diff options
author | madmaxoft <github@xoft.cz> | 2013-08-12 08:35:13 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-08-12 08:35:13 +0200 |
commit | c628ab03e9aae0b8e56f260ad02cfc7d51285a71 (patch) | |
tree | 402ee387cbf33bd6ca39f718f7addb4fdcc82dd2 /source/Server.cpp | |
parent | Removed unused cServer::IsConnected() function. (diff) | |
download | cuberite-c628ab03e9aae0b8e56f260ad02cfc7d51285a71.tar cuberite-c628ab03e9aae0b8e56f260ad02cfc7d51285a71.tar.gz cuberite-c628ab03e9aae0b8e56f260ad02cfc7d51285a71.tar.bz2 cuberite-c628ab03e9aae0b8e56f260ad02cfc7d51285a71.tar.lz cuberite-c628ab03e9aae0b8e56f260ad02cfc7d51285a71.tar.xz cuberite-c628ab03e9aae0b8e56f260ad02cfc7d51285a71.tar.zst cuberite-c628ab03e9aae0b8e56f260ad02cfc7d51285a71.zip |
Diffstat (limited to 'source/Server.cpp')
-rw-r--r-- | source/Server.cpp | 46 |
1 files changed, 10 insertions, 36 deletions
diff --git a/source/Server.cpp b/source/Server.cpp index 0045d4808..82a4cb9f5 100644 --- a/source/Server.cpp +++ b/source/Server.cpp @@ -162,6 +162,16 @@ void cServer::RemoveClient(const cClientHandle * a_Client) +void cServer::ClientMovedToWorld(const cClientHandle * a_Client) +{ + cCSLock Lock(m_CSClients); + m_Clients.remove(const_cast<cClientHandle *>(a_Client)); +} + + + + + bool cServer::InitServer(cIniFile & a_SettingsIni) { m_Description = a_SettingsIni.GetValue ("Server", "Description", "MCServer! - In C++!").c_str(); @@ -298,23 +308,6 @@ void cServer::OnConnectionAccepted(cSocket & a_Socket) -void cServer::BroadcastChat(const AString & a_Message, const cClientHandle * a_Exclude) -{ - cCSLock Lock(m_CSClients); - for (ClientList::iterator itr = m_Clients.begin(); itr != m_Clients.end(); ++itr) - { - if ((*itr == a_Exclude) || !(*itr)->IsLoggedIn()) - { - continue; - } - (*itr)->SendChat(a_Message); - } -} - - - - - bool cServer::Tick(float a_Dt) { cRoot::Get()->TickCommands(); @@ -452,25 +445,6 @@ void cServer::BindBuiltInConsoleCommands(void) -void cServer::SendMessage(const AString & a_Message, cPlayer * a_Player /* = NULL */, bool a_bExclude /* = false */ ) -{ - if ((a_Player != NULL) && !a_bExclude) - { - cClientHandle * Client = a_Player->GetClientHandle(); - if (Client != NULL) - { - Client->SendChat(a_Message); - } - return; - } - - BroadcastChat(a_Message, (a_Player != NULL) ? a_Player->GetClientHandle() : NULL); -} - - - - - void cServer::Shutdown(void) { m_ListenThreadIPv4.Stop(); |