Kick players out of instances when they leave

This commit is contained in:
Gent
2020-10-14 00:26:30 -04:00
parent 85530ef57f
commit efd729710f
7 changed files with 47 additions and 20 deletions

View File

@@ -82,9 +82,7 @@ void CNShardServer::_killConnection(CNSocket* cns) {
int64_t key = plr->SerialKey;
// save player to DB
Database::updatePlayer(PlayerManager::players[cns].plr);
PlayerManager::removePlayer(cns);
PlayerManager::removePlayer(cns); // removes the player from the list and saves it to DB
// remove from CNSharedData
CNSharedData::erasePlayer(key);