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

Last change on this file since 250 was 238, checked in by alloc, 9 years ago

Server fixes for A12

File size: 684 bytes
Line 
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) {
10 PrivateMassageConnections.SetLastPMSender (_sender, _receiver);
11 senderName = _sender.playerName;
12 } else {
13 senderName = "Server";
14 }
15 _receiver.SendPackage (new NetPackageGameMessage (_message, senderName + " (PM)"));
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.