fix error of forget to prepare user info

This commit is contained in:
2024-05-24 15:42:31 +00:00
parent f3dd078e65
commit 109afd5bcf
2 changed files with 7 additions and 1 deletions

View File

@ -346,6 +346,11 @@ std::string TicketSystemEngine::RefundTicket(const std::string &command) {
}
}
}
response_stream << "[" << command_id << "] RefundTicket";
hash_t user_ID_hash = SplitMix64Hash(user_name);
if (online_users.find(user_ID_hash) == online_users.end()) {
response_stream << "[" << command_id << "] -1";
return response_stream.str();
}
response_stream << "[" << command_id << "] 0";
return response_stream.str();
}

View File

@ -89,6 +89,7 @@ std::string TicketSystemEngine::AddUser(const std::string &command) {
strcpy(dat.name, name.c_str());
strcpy(dat.mailAddr, mailAddr.c_str());
user_data.Put(new_user_username_hash, dat);
transaction_manager.PrepareUserInfo(SplitMix64Hash(username));
LOG->debug("stored user_name hash: {}", new_user_username_hash);
LOG->debug("stored user_name: {}", dat.username);
LOG->debug("stored password hash: {}", dat.password_hash);