source: binary-improvements/AllocsCommands/Chat.cs@ 342

Last change on this file since 342 was 335, checked in by alloc, 6 years ago

*Fixed PMs for A17

File size: 757 bytes
Line 
1namespace AllocsFixes.CustomCommands {
2 public class Chat {
3 public static void SendMessage (ClientInfo _receiver, ClientInfo _sender, string _message) {
4 string senderName;
5 if (_sender != null) {
6 PrivateMessageConnections.SetLastPMSender (_sender, _receiver);
7 senderName = _sender.playerName;
8 } else {
9 senderName = "Server";
10 }
11
12 _receiver.SendPackage (new NetPackageChat(EChatType.Whisper, -1, _message, senderName + " (PM)", false, null));
13 string receiverName = _receiver.playerName;
14 SdtdConsole.Instance.Output ("Message to player " +
15 (receiverName != null ? "\"" + receiverName + "\"" : "unknownName") +
16 " sent with sender \"" + senderName + "\"");
17 }
18 }
19}
Note: See TracBrowser for help on using the repository browser.