示例#1
0
        private void RunInternal(ClientInfo _sender, List <string> _params)
        {
            if (_params.Count < 1)
            {
                SdtdConsole.Instance.Output("Usage: reply <message>");
                return;
            }

            string message = _params [0];

            ClientInfo receiver = PrivateMassageConnections.GetLastPMSenderForPlayer(_sender);

            if (receiver != null)
            {
                Chat.SendMessage(receiver, _sender, message);
            }
            else
            {
                if (receiver != null)
                {
                    SdtdConsole.Instance.Output("The sender of the PM you last received is currently not online.");
                }
                else
                {
                    SdtdConsole.Instance.Output("You have not received a PM so far.");
                }
            }
        }
示例#2
0
        public static void SendMessage(ClientInfo _receiver, ClientInfo _sender, string _message)
        {
            string senderName;

            if (_sender != null)
            {
                PrivateMassageConnections.SetLastPMSender(_sender, _receiver);
                senderName = _sender.playerName;
            }
            else
            {
                senderName = "Server";
            }
            _receiver.SendPackage(new NetPackageGameMessage(_message, senderName + " (PM)"));
            string receiverName = _receiver.playerName;

            string[] strArrays = new string[] { "Message to player ", null, null, null, null };
            strArrays[1] = (receiverName == null ? "unknownName" : string.Concat("\"", receiverName, "\""));
            strArrays[2] = " sent with sender \"";
            strArrays[3] = senderName;
            strArrays[4] = "\"";
            SdtdConsole.Instance.Output(string.Concat(strArrays));
        }