예제 #1
0
 public void GetChat() //消息接收并判断是否响应
 {
     try
     {
         //获取第二个字符开始到空格为止的PCR命令
         PCRGuildCommand = PCRGuildEventArgs.Message.Text.Substring(1).Split(' ')[0];
         //获取指令类型
         Resource.Commands.PCRGuildCmd.PCRGuildCommands.TryGetValue(PCRGuildCommand, out PCRGuildCmdType commandType);
         this.CommandType = commandType;
         //未知指令
         if (CommandType == 0)
         {
             GetUnknowCommand(PCRGuildEventArgs);
             ConsoleLog.Info("PCR公会管理", CommandType == 0 ? "解析到未知指令" : $"解析指令{CommandType}");
             return;
         }
         //公会管理指令
         if (CommandType > 0 && (int)CommandType < 100)
         {
             PCRHandler.GuildMgrResponse(Sender, PCRGuildEventArgs, CommandType);
         }
         //出刀管理指令
         else if ((int)CommandType > 100 && (int)CommandType < 200)
         {
             GuildBattleManager.GuildBattleResponse(Sender, PCRGuildEventArgs, CommandType);
         }
         //Boss数据相关指令
         else if ((int)CommandType > 200 && (int)CommandType < 300)
         {
             BossManager.BossResponse(Sender, PCRGuildEventArgs, CommandType);
         }
     }
     catch (Exception e)
     {
         //命令无法被正确解析
         ConsoleLog.Error("PCR公会管理", $"指令解析发生错误\n{e}");
         return;
     }
 }