don't use server nick when echoing command

This commit is contained in:
in0finite 2021-03-01 00:50:53 +01:00
parent 26b51b99c9
commit 1a9fe1754d
2 changed files with 4 additions and 4 deletions

View file

@ -41,11 +41,11 @@ namespace SanAndreasUnity.Chat
}
// send command back to player
ChatManager.SendChatMessageToPlayer(player, chatMessage);
ChatManager.SendChatMessageToPlayer(player, chatMessage, false);
// send response back to player
if (!string.IsNullOrWhiteSpace(response))
ChatManager.SendChatMessageToPlayer(player, response);
ChatManager.SendChatMessageToPlayer(player, response, true);
// discard chat message
return new ChatPreprocessorResult {shouldBeDiscarded = true};

View file

@ -177,7 +177,7 @@ namespace SanAndreasUnity.Chat
}
/// <summary> Use only on server. </summary>
public static void SendChatMessageToPlayer( Player player, string msg ) {
public static void SendChatMessageToPlayer( Player player, string msg, bool useServerNick ) {
NetStatus.ThrowIfNotOnServer();
@ -185,7 +185,7 @@ namespace SanAndreasUnity.Chat
if (string.IsNullOrEmpty(msg))
return;
SendChatMessageToPlayer (player, msg, singleton.serverChatNick);
SendChatMessageToPlayer (player, msg, useServerNick ? singleton.serverChatNick : "");
}