Example #1
0
 /// <summary>
 /// The combat has started, so we begin registering the console messages
 /// </summary>
 public void StartCombat()
 {
     // We are now logging the combat information
     InCombat = true;
     CombatLogStringBuilder = new StringBuilder();
     skirmishInformation    = new SkirmishInformation();
 }
Example #2
0
 /// <summary>
 /// The combat has started, so we begin registering the console messages
 /// </summary>
 public void StartCombat()
 {
     try
     {
         if (Main.enabled && !InCombat)
         {
             // We are now logging the combat information
             InCombat = true;
             CombatLogStringBuilder = new StringBuilder();
             skirmishInformation    = new SkirmishInformation();
         }
     }
     catch (Exception ex)
     {
         Main.LogError(ex);
     }
 }
Example #3
0
        /// <summary>
        /// Write the logs
        /// </summary>
        /// <param name="stringsToWrite">The string that is to be written</param>
        /// <param name="configuration">The configuration for the combat log exporter</param>
        public void WriteLogs(StringBuilder stringsToWrite, CombatConfiguration configuration, SkirmishInformation skirmish)
        {
            // Write the combat log to a file
            string dateTimeName = $"{configuration.CombatLogWriteLocation}{skirmish.MapName} - {skirmish.StartOfCombatTime}.log";

            try
            {
                File.WriteAllText(dateTimeName, stringsToWrite.ToString());
            }
            catch (Exception e)
            {
                Game.Console.AddMessage($"Exception in Combat Log Exporter: {e}");
            }
        }
Example #4
0
        /// <summary>
        /// Write the logs
        /// </summary>
        /// <param name="stringsToWrite">The string that is to be written</param>
        /// <param name="configuration">The configuration for the combat log exporter</param>
        public void WriteLogs(StringBuilder stringsToWrite, CombatConfiguration configuration, SkirmishInformation skirmish)
        {
            // Write the combat log to a file
            string dateTimeName = $"{configuration.CombatLogWriteLocation}{skirmish.MapName} - {skirmish.StartOfCombatTime}.log";

            try
            {
                File.WriteAllText(dateTimeName, stringsToWrite.ToString());
            }
            catch (Exception e)
            {
                Main.LogError(e);
            }
        }