Esempio n. 1
0
        public void HandlePlayerCommand(Player player, string msg)
        {
            PlayerCommandPreprocessEventArgs playerCommandPreprocessEvent = new PlayerCommandPreprocessEventArgs(player, msg);

            PlayerEvents.OnPlayerCommandPreprocess(playerCommandPreprocessEvent);
            if (playerCommandPreprocessEvent.IsCancel)
            {
                return;
            }
            string[] args = playerCommandPreprocessEvent.Message.Split(' ');
            string   cmd  = args[0];

            if (args.Length != 1)
            {
                List <string> tmp = new List <string>(args);
                tmp.RemoveAt(0);
                args = tmp.ToArray();
            }
            else
            {
                args = new string[0];
            }

            this.CommandHandler.CommandHandle(player, cmd, args);
        }
 public static void OnPlayerCommandPreprocess(PlayerCommandPreprocessEventArgs args)
 {
     PlayerCommandPreprocess?.Invoke(args);
 }