mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2026-02-11 14:50:03 +00:00
Revamp CNShared logic
* Use a specialized connection object * Copy the Player object less frequently * Use a randomly generated serial key for shard auth * Refuse invalid shard connection attempts * Clean up connection metadata when a Player joins the shard * Prune abandoned connections when they time out
This commit is contained in:
@@ -99,14 +99,7 @@ void CNShardServer::_killConnection(CNSocket* cns) {
|
||||
if (PlayerManager::players.find(cns) == PlayerManager::players.end())
|
||||
return;
|
||||
|
||||
Player* plr = PlayerManager::getPlayer(cns);
|
||||
|
||||
int64_t key = plr->SerialKey;
|
||||
|
||||
PlayerManager::removePlayer(cns); // removes the player from the list and saves it to DB
|
||||
|
||||
// remove from CNShared
|
||||
CNShared::erasePlayer(key);
|
||||
}
|
||||
|
||||
void CNShardServer::killConnection(CNSocket *cns) {
|
||||
|
||||
Reference in New Issue
Block a user