Exemplo n.º 1
0
        public override bool ProcessCommand(string commandLine)
        {
            // If an input state machine is running, send commandLine to machine
            if (CurrentStateMachine != null && !CurrentStateMachine.IsFinalStateReached)
            {
                CurrentStateMachine.ProcessInput(this, commandLine);
                return(true);
            }
            else
            {
                CurrentStateMachine = null; // reset current state machine if not currently running one
                // ! means repeat last command (only when last command was not delete)
                if (commandLine != null && commandLine.Length >= 1 && commandLine[0] == '!')
                {
                    if (LastCommand?.ToLowerInvariant() == "delete")
                    {
                        Send("Cannot use '!' to repeat 'delete' command");
                        _deletionConfirmationNeeded = false; // reset delete confirmation
                        return(false);
                    }
                    commandLine          = LastCommand;
                    LastCommandTimestamp = DateTime.Now;
                }
                else
                {
                    LastCommand          = commandLine;
                    LastCommandTimestamp = DateTime.Now;
                }

                // Extract command and parameters
                bool extractedSuccessfully = CommandHelpers.ExtractCommandAndParameters(Aliases, commandLine, out string command, out string rawParameters, out CommandParameter[] parameters, out bool forceOutOfGame);
Exemplo n.º 2
0
        protected Player()
        {
            PlayerState = PlayerStates.Loading;

            _delayedTells = new List <string>();
            _avatarList   = new List <CharacterData>();

            Aliases                     = new Dictionary <string, string>();
            CurrentStateMachine         = null;
            _deletionConfirmationNeeded = false;
        }