1
0

Removed cServer::BroadcastChat() and cServer::SendMessage().

These two functions make it difficult to move to the new ticking system, and they aren't used anyway. If so required, they can be emulated by ForEachWorld / ForEachPlayer calls.
This commit is contained in:
madmaxoft
2013-08-12 08:35:13 +02:00
parent 6914bf4c65
commit c628ab03e9
7 changed files with 42 additions and 133 deletions

View File

@@ -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();