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

Last change on this file since 387 was 354, checked in by alloc, 5 years ago

A18 preps

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