Added Unloading and Deletion of user accounts

This commit is contained in:
Kayne Ruse
2014-05-06 18:57:49 +10:00
parent 9b5b48a8ab
commit 0ff787abda
2 changed files with 34 additions and 2 deletions
+9
View File
@@ -122,6 +122,15 @@ void ServerApplication::HandleDisconnect(SerialPacket packet) {
network.Send(&clientMap[packet.clientInfo.clientIndex].address, buffer, PACKET_BUFFER_SIZE);
clientMap.erase(packet.clientInfo.clientIndex);
//unload the client's account
//TODO: change clientIndex to accountIndex for player ID
for (auto it : accountMap) {
if (it.second.clientIndex == packet.clientInfo.clientIndex) {
UnloadUserAccount(it.first);
break;
}
}
//prep the delete packet
SerialPacket delPacket;
delPacket.meta.type = SerialPacket::Type::CHARACTER_DELETE;