Esempio n. 1
0
 private void Add(CharacterName character, ServerUptimeStamped uptime)
 {
     lock (locker)
     {
         data.Add(new LiveLogsDataForCharacter(character, null, uptime));
     }
 }
Esempio n. 2
0
 public void UpdateHistoric(ServerName serverName, ServerUptimeStamped uptime)
 {
     ServerData data = GetServerData(serverName);
     if (data.LogHistory.ServerUptime.Stamp < uptime.Stamp)
     {
         data.LogHistory.ServerUptime = uptime;
         persistenceManager.FlagAsChanged();
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Null if entry is not applicable.
 /// </summary>
 public ServerUptimeStamped TryParseUptime(LogEntry wurmLogEntry)
 {
     if (wurmLogEntry.Content.Contains("The server has been up"))
     {
         var uptime = TryGetTimeSpanServerUpSince(wurmLogEntry.Content);
         if (uptime == null)
         {
             return null;
         }
         var result = new ServerUptimeStamped()
         {
             Uptime = uptime.Value,
             Stamp = wurmLogEntry.Timestamp
         };
         return result;
     }
     return null;
 }
Esempio n. 4
0
 private TimeSpan AdjustedUptime(ServerUptimeStamped uptime)
 {
     return uptime.Uptime + (Time.Get.LocalNowOffset - uptime.Stamp);
 }