일단 클라이언트 코드 채움

This commit is contained in:
2025-05-10 00:08:59 +09:00
parent 20f8c7b29d
commit be6ea6e92f
4 changed files with 73 additions and 6 deletions

View File

@@ -418,10 +418,14 @@ void ServerManager::processContinuePacket(ContinuePacket continuePacket, IOCPPAS
}
}
void ServerManager::registerUser(std::string userName, std::shared_ptr<TCPSocket> sock) {
bool ServerManager::registerUser(std::string userName, std::shared_ptr<TCPSocket> sock) {
std::lock_guard<std::mutex> lock(resourceMutex_);
if (userName2ID_.find(userName) != userName2ID_.end()) {
return false;
}
Snowflake UID = GenerateID();
userNames_[UID] = userName;
userName2ID_[userName] = UID;
UID2userSocket_[UID] = sock;
userSocket2UID_[sock] = UID;
}