mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-12-27 14:00:35 +00:00
added saving character when a connection with shard is killed
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "PlayerManager.hpp"
|
||||
#include "CNShared.hpp"
|
||||
#include "settings.hpp"
|
||||
#include "Database.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
@@ -52,6 +53,9 @@ void CNShardServer::killConnection(CNSocket* cns) {
|
||||
if (PlayerManager::players.find(cns) == PlayerManager::players.end())
|
||||
return;
|
||||
|
||||
//save player to DB
|
||||
Database::updatePlayer(*PlayerManager::players[cns].plr);
|
||||
|
||||
// remove from CNSharedData
|
||||
int64_t key = PlayerManager::getPlayer(cns)->SerialKey;
|
||||
PlayerManager::removePlayer(cns);
|
||||
|
||||
Reference in New Issue
Block a user