A class for handling commands send by the players
Exemple #1
0
        /// <summary>
        /// This function is used internally.
        /// It executes all needed handlers when a specific command occures.
        /// </summary>
        /// <param name="str">
        /// A <see cref="System.String"/>
        /// </param>
        /// <param name="cmd">
        /// A <see cref="Command"/>
        /// </param>
        internal static void Execute(Player player, Command cmd)
        {
            foreach (KeyValuePair<string, ClientCommandDelegate> keyval in events) {
                if (cmd.ToString().StartsWith(keyval.Key)) {
                    if (keyval.Value != null) {
                        keyval.Value(player, cmd);
                    }
                }
            }

            cmd.Execute(player);
        }
Exemple #2
0
 /// <summary>
 /// Emulates a player calling a command.
 /// </summary>
 /// <param name="p">
 /// Instance of the player <see cref="Player"/>
 /// </param>
 public void FakeCall(Player p)
 {
     overrideArguments = true;
     instance = this;
     MetaModEngine.dllapiFunctions.ClientCommand(p.Pointer);
     instance = null;
     overrideArguments = false;
 }
Exemple #3
0
 public void SwearCheck(Player player, Command cmd)
 {
 }
Exemple #4
0
 public CommandEventArgs(Player player, Command command)
     : base(player)
 {
     Command = command;
 }
Exemple #5
0
 void HandleSayExec(Player player, Command command)
 {
     // Ommit /exec and execute the following text
       string exec_string = command.Arguments[1].Split(' ').Shift().Join(' ') + ";";
       EvaluateGoldSrc(player, exec_string);
 }