コード例 #1
0
 private void LoadCustomCombatClass()
 {
     AmeisenLogger.Instance.Log("AmeisenBot", $"Loading custom CombatClass: {Config.CustomCombatClassFile}", LogLevel.Verbose);
     if (Config.CustomCombatClassFile.Length == 0 ||
         !File.Exists(Config.CustomCombatClassFile))
     {
         AmeisenLogger.Instance.Log("AmeisenBot", "Loading default CombatClass", LogLevel.Warning);
         LoadDefaultCombatClass();
     }
     else
     {
         try
         {
             WowInterface.CombatClass = CompileCustomCombatClass();
             OnCombatClassCompilationStatusChanged?.Invoke(true, string.Empty, string.Empty);
             AmeisenLogger.Instance.Log("AmeisenBot", $"Compiling custom CombatClass successful", LogLevel.Warning);
         }
         catch (Exception e)
         {
             AmeisenLogger.Instance.Log("AmeisenBot", $"Compiling custom CombatClass failed:\n{e}", LogLevel.Warning);
             OnCombatClassCompilationStatusChanged?.Invoke(false, e.GetType().Name, e.ToString());
             LoadDefaultCombatClass();
         }
     }
 }
コード例 #2
0
 private void LoadCustomCombatClass()
 {
     AmeisenLogger.Instance.Log($"Loading custom CombatClass: {Config.CustomCombatClassFile}", LogLevel.Verbose);
     if (Config.CustomCombatClassFile.Length == 0 ||
         !File.Exists(Config.CustomCombatClassFile))
     {
         LoadDefaultCombatClass();
     }
     else
     {
         try
         {
             CombatClass = CompileCustomCombatClass();
             OnCombatClassCompilationStatusChanged?.Invoke(true, string.Empty, string.Empty);
         }
         catch (Exception e)
         {
             OnCombatClassCompilationStatusChanged?.Invoke(false, e.GetType().Name, e.ToString());
             LoadDefaultCombatClass();
         }
     }
 }