유저 연결이 끊어졌을 시에 방에서도 나가도록 수정
This commit is contained in:
@@ -6,8 +6,14 @@ namespace Chattr {
|
||||
|
||||
void ServerManager::_IOCPClient(Chattr::ThreadPool* thread, Chattr::IOCPPASSINDATA* data) {
|
||||
if (data->event == IOCPEVENT::QUIT) {
|
||||
if (userSocket2UID_.find(data->socket) != userSocket2UID_.end())
|
||||
if (userSocket2UID_.find(data->socket) != userSocket2UID_.end()) {
|
||||
for (auto room : rooms_) {
|
||||
if (room.second.find(userSocket2UID_[data->socket]) != room.second.end()) {
|
||||
exitRoom(userSocket2UID_[data->socket], room.first);
|
||||
}
|
||||
}
|
||||
deleteUser(userSocket2UID_[data->socket]);
|
||||
}
|
||||
delete data;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user