일단 클라이언트 코드 채움
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user