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

Last change on this file since 310 was 267, checked in by alloc, 9 years ago

Update Chat stuff to 14.6 b26

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