/// <summary> /// Initializes the command system provider /// </summary> private void Initialize() { rustCommands = typeof(ConsoleSystem.Index).GetField("dictionary", BindingFlags.NonPublic | BindingFlags.Static)?.GetValue(null) as IDictionary <string, ConsoleSystem.Command>; registeredChatCommands = new Dictionary <string, CommandCallback>(); chatCommandHandler = new ChatCommandHandler(ChatCommandCallback, registeredChatCommands.ContainsKey); consolePlayer = new RustConsolePlayer(); }
/// <summary> /// Initializes the command system provider /// </summary> private void Initialize() { rustCommands = typeof(ConsoleSystem.Index).GetField("dictionary", BindingFlags.NonPublic | BindingFlags.Static)?.GetValue(null) as IDictionary<string, ConsoleSystem.Command>; registeredChatCommands = new Dictionary<string, CommandCallback>(); chatCommandHandler = new ChatCommandHandler(ChatCommandCallback, registeredChatCommands.ContainsKey); consolePlayer = new RustConsolePlayer(); }
public RustCommandSystem() { this.registeredCommands = new Dictionary <string, RustCommandSystem.RegisteredCommand>(); CommandCallback commandCallback = new CommandCallback(this.CommandCallback); IDictionary <string, RustCommandSystem.RegisteredCommand> strs = this.registeredCommands; this.commandHandler = new CommandHandler(commandCallback, new Func <string, bool>(strs.ContainsKey)); this.consolePlayer = new RustConsolePlayer(); }
/// <summary> /// Initializes the command system /// </summary> public RustCommandSystem() { registeredCommands = new Dictionary <string, RegisteredCommand>(); commandHandler = new CommandHandler(CommandCallback, registeredCommands.ContainsKey); consolePlayer = new RustConsolePlayer(); }