summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-08-14 19:11:54 +0200
committermadmaxoft <github@xoft.cz>2013-08-14 19:11:54 +0200
commit17b2353d71c405bc626de22e5467d13be792c317 (patch)
tree6684622247b5c921439bffec3671582cc67fd499 /source
parentFixed crashes in world's clientlist manipulators (diff)
downloadcuberite-17b2353d71c405bc626de22e5467d13be792c317.tar
cuberite-17b2353d71c405bc626de22e5467d13be792c317.tar.gz
cuberite-17b2353d71c405bc626de22e5467d13be792c317.tar.bz2
cuberite-17b2353d71c405bc626de22e5467d13be792c317.tar.lz
cuberite-17b2353d71c405bc626de22e5467d13be792c317.tar.xz
cuberite-17b2353d71c405bc626de22e5467d13be792c317.tar.zst
cuberite-17b2353d71c405bc626de22e5467d13be792c317.zip
Diffstat (limited to 'source')
-rw-r--r--source/Player.cpp3
-rw-r--r--source/Server.cpp2
-rw-r--r--source/Server.h4
3 files changed, 6 insertions, 3 deletions
diff --git a/source/Player.cpp b/source/Player.cpp
index 34980d2f6..a1ea631aa 100644
--- a/source/Player.cpp
+++ b/source/Player.cpp
@@ -112,6 +112,9 @@ cPlayer::~cPlayer(void)
{
LOGD("Deleting cPlayer \"%s\" at %p, ID %d", m_PlayerName.c_str(), this, GetUniqueID());
+ // Notify the server that the player is being destroyed
+ cRoot::Get()->GetServer()->PlayerDestroying(this);
+
SaveToDisk();
m_World->RemovePlayer( this );
diff --git a/source/Server.cpp b/source/Server.cpp
index c01222e5a..fad562973 100644
--- a/source/Server.cpp
+++ b/source/Server.cpp
@@ -183,7 +183,7 @@ void cServer::PlayerCreated(const cPlayer * a_Player)
-void cServer::PlayerDestroyed(const cPlayer * a_Player)
+void cServer::PlayerDestroying(const cPlayer * a_Player)
{
// To avoid deadlocks, the player count is not handled directly, but rather posted onto the tick thread
cCSLock Lock(m_CSPlayerCountDiff);
diff --git a/source/Server.h b/source/Server.h
index 87e472465..b4fe81d8f 100644
--- a/source/Server.h
+++ b/source/Server.h
@@ -81,8 +81,8 @@ public: // tolua_export
/// Notifies the server that a player was created; the server uses this to adjust the number of players
void PlayerCreated(const cPlayer * a_Player);
- /// Notifies the server that a player was destroyed; the server uses this to adjust the number of players
- void PlayerDestroyed(const cPlayer * a_Player);
+ /// Notifies the server that a player is being destroyed; the server uses this to adjust the number of players
+ void PlayerDestroying(const cPlayer * a_Player);
CryptoPP::RSA::PrivateKey & GetPrivateKey(void) { return m_PrivateKey; }
CryptoPP::RSA::PublicKey & GetPublicKey (void) { return m_PublicKey; }