fCraft.Commands.ParseCommand C# (CSharp) Method

ParseCommand() private method

private ParseCommand ( Player player, string message, bool fromConsole ) : void
player Player
message string
fromConsole bool
return void
        internal void ParseCommand( Player player, string message, bool fromConsole ) {
            Command cmd = new Command( message );
            if( consoleSafeHandlers.ContainsKey( cmd.name ) ) {
                consoleSafeHandlers[cmd.name]( player, cmd );
            } else if( handlers.ContainsKey( cmd.name ) ) {
                if( fromConsole ) {
                    player.Message( "You cannot use this command from console." );
                } else {
                    handlers[cmd.name]( player, cmd );
                }
            } else {
                player.Message( "Unrecognized command: " + cmd.name );
            }
        }