Пример #1
0
        private void ctlChat_InputReceived(object sender, Lionsguard.InputReceivedEventArgs e)
        {
            RdlCommandParserErrorType errType = RdlCommandParserErrorType.None;
            RdlCommand cmd;

            if (RdlCommand.TryParse(e.Input, out cmd, out errType))
            {
                // Only echo say, shout, tell and emotes.
                this.EchoInput(cmd);

                if (this.ServerCommandType == CommandType.Player)
                {
                    ServerManager.Instance.SendCommand(cmd);
                }
                else
                {
                    ServerManager.Instance.SendUserCommand(cmd);
                }
            }
            else
            {
                switch (errType)
                {
                case RdlCommandParserErrorType.NoTargetForTell:
                    this.Write(MessageType.Error, "TELL requires the name of the person you wish to send a message.");
                    break;

                case RdlCommandParserErrorType.NoArgumentsSpecified:
                    this.Write(MessageType.Error, String.Format("No arguments were specified for the {0} command.", cmd.TypeName));
                    break;

                case RdlCommandParserErrorType.InvalidNumberOfArguments:
                    this.Write(MessageType.Error, String.Format("An invalid number of arguments were specified for the {0} command.", cmd.TypeName));
                    break;
                }
            }
        }
Пример #2
0
 protected virtual void OnInputReceived(InputReceivedEventArgs e)
 {
     this.InputReceived(this, e);
 }