Пример #1
0
 private void Add(CharacterName character, ServerDateStamped wurmDateTime)
 {
     lock (locker)
     {
         data.Add(new LiveLogsDataForCharacter(character, wurmDateTime, null));
     }
 }
Пример #2
0
        /// <summary>
        /// Null if entry is not applicable.
        /// </summary>
        public ServerDateStamped TryParseWurmDateTime(LogEntry wurmLogEntry)
        {
            //[16:24:19] It is 09:00:48 on day of the Wurm in week 4 of the Bear's starfall in the year of 1035.
            if (wurmLogEntry.Content.Contains("It is", StringComparison.InvariantCulture))
            {
                if (Regex.IsMatch(
                    wurmLogEntry.Content,
                    @"It is \d\d:\d\d:\d\d on .+ in week .+ in the year of \d+\.",
                    RegexOptions.Compiled))
                {

                    var wurmDateTime = TryCreateWurmDateTimeFromLogLine(wurmLogEntry.Content);
                    if (wurmDateTime == null)
                    {
                        return null;
                    }
                    var result = new ServerDateStamped()
                    {
                        WurmDateTime = wurmDateTime.Value,
                        Stamp = wurmLogEntry.Timestamp
                    };
                    return result;
                }
            }
            return null;
        }
Пример #3
0
 public void UpdateHistoric(ServerName serverName, ServerDateStamped date)
 {
     ServerData data = GetServerData(serverName);
     if (data.LogHistory.ServerDate.Stamp < date.Stamp)
     {
         data.LogHistory.ServerDate = date;
         persistenceManager.FlagAsChanged();
     }
 }
Пример #4
0
 private WurmDateTime AdjustedWurmDateTime(ServerDateStamped date)
 {
     return date.WurmDateTime + (Time.Get.LocalNowOffset - date.Stamp);
 }