1
0

Added cRoot:BroadcastChat() to the Lua API.

This allows plugins to broadcast a chat message to all connected players. It is a replacement for previously removed cServer:BroadcastChat().
This commit is contained in:
madmaxoft
2013-08-17 23:58:37 +02:00
parent fcfbdee76d
commit d287183137
4 changed files with 52 additions and 2 deletions

View File

@@ -478,6 +478,18 @@ void cRoot::SaveAllChunks(void)
void cRoot::BroadcastChat(const AString & a_Message)
{
for (WorldMap::iterator itr = m_WorldsByName.begin(), end = m_WorldsByName.end(); itr != end; ++itr)
{
itr->second->BroadcastChat(a_Message);
} // for itr - m_WorldsByName[]
}
bool cRoot::ForEachPlayer(cPlayerListCallback & a_Callback)
{
for (WorldMap::iterator itr = m_WorldsByName.begin(), itr2 = itr; itr != m_WorldsByName.end(); itr = itr2)