Example #1
0
 private static string RecordHeartbeatStatusToString(HeartbeatGameStatus status)
 {
     using (var stream = new StringWriter())
     {
         TimeSpan span = DateTime.Now - System.Diagnostics.Process.GetCurrentProcess().StartTime;
         stream.WriteLine("FileVersion:{0}", HeartbeatGameStatus.MASTER_FILE_VERSION);
         stream.WriteLine("UptimeSeconds:{0}", (int)span.TotalSeconds);
         stream.WriteLine("ServerName:{0}", status.ServerName);
         stream.WriteLine("AccountName:{0}", status.AccountName);
         stream.WriteLine("CharacterName:{0}", status.CharacterName);
         stream.WriteLine("LogFilepath:{0}", log.GetLogFilepath());
         stream.WriteLine("ProcessId:{0}", System.Diagnostics.Process.GetCurrentProcess().Id);
         stream.WriteLine("TeamList:{0}", status.TeamList);
         var assembly = System.Reflection.Assembly.GetExecutingAssembly();
         stream.WriteLine("MagFilterVersion:{0}", assembly.GetName().Version);
         stream.WriteLine("MagFilterFilePath:{0}", assembly.Location);
         var text = stream.ToString();
         return(text);
     }
 }
Example #2
0
        internal static void RecordHeartbeatStatus(string filepath, HeartbeatGameStatus status)
        {
            string contents = RecordHeartbeatStatusToString(status);

            WriteTextToFile(contents, filepath);
        }