If a recipient can't be found for a private message sent by a client, the server sends the "player not found" error message to the client
This commit is contained in:
@@ -1452,7 +1452,24 @@ namespace Barotrauma.Networking
|
|||||||
|
|
||||||
if (targetClient == null)
|
if (targetClient == null)
|
||||||
{
|
{
|
||||||
AddChatMessage("Player \"" + command + "\" not found!", ChatMessageType.Error);
|
if (senderClient != null)
|
||||||
|
{
|
||||||
|
var chatMsg = ChatMessage.Create(
|
||||||
|
"", "Player \"" + command + "\" not found!",
|
||||||
|
ChatMessageType.Error, null);
|
||||||
|
|
||||||
|
chatMsg.NetStateID = senderClient.chatMsgQueue.Count > 0 ?
|
||||||
|
(ushort)(senderClient.chatMsgQueue.Last().NetStateID + 1) :
|
||||||
|
(ushort)(senderClient.lastRecvChatMsgID + 1);
|
||||||
|
|
||||||
|
senderClient.chatMsgQueue.Add(chatMsg);
|
||||||
|
senderClient.lastChatMsgQueueID = chatMsg.NetStateID;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddChatMessage("Player \"" + command + "\" not found!", ChatMessageType.Error);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user