Allow the server to send a global notice to all players (for example if a server reboot is going to happen). Does not work with current client version 0.6.3.
This commit is contained in:
@@ -691,9 +691,19 @@ AbstractClientStateReceiving::Process(ClientThread &client)
|
||||
NetPacketChatText::Data chatData;
|
||||
tmpPacket->ToNetPacketChatText()->GetData(chatData);
|
||||
|
||||
boost::shared_ptr<PlayerData> tmpPlayer = client.GetPlayerDataByUniqueId(chatData.playerId);
|
||||
if (tmpPlayer.get())
|
||||
client.GetCallback().SignalNetClientChatMsg(tmpPlayer->GetName(), chatData.text);
|
||||
string playerName;
|
||||
if (chatData.playerId == 0)
|
||||
{
|
||||
playerName = "(global notice)";
|
||||
}
|
||||
else
|
||||
{
|
||||
boost::shared_ptr<PlayerData> tmpPlayer = client.GetPlayerDataByUniqueId(chatData.playerId);
|
||||
if (tmpPlayer.get())
|
||||
playerName = tmpPlayer->GetName();
|
||||
}
|
||||
if (!playerName.empty())
|
||||
client.GetCallback().SignalNetClientChatMsg(playerName, chatData.text);
|
||||
}
|
||||
else if (tmpPacket->ToNetPacketPlayerLeft())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user