diff options
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(); |