Beispiel #1
0
        public void HandleNewLiveData()
        {
            var newData = liveLogsDataQueue.Consume();
            foreach (var data in newData)
            {
                if (data.Uptime != null)
                {
                    var serverName = wurmServerHistory.GetServer(data.Character, data.Uptime.Stamp.DateTime);
                    if (serverName != null)
                    {
                        TimeDetails details;
                        if (!latestData.TryGetValue(serverName, out details))
                        {
                            details = new TimeDetails();
                            latestData.Add(serverName, details);
                        }

                        if (details.ServerUptime.Stamp < data.Uptime.Stamp)
                        {
                            details.ServerUptime = new ServerUptimeStamped()
                            {
                                Uptime = data.Uptime.Uptime,
                                Stamp = data.Uptime.Stamp
                            };
                        }
                    }
                }
                if (data.WurmDateTime != null)
                {
                    var serverName = wurmServerHistory.GetServer(data.Character, data.WurmDateTime.Stamp.DateTime);
                    if (serverName != null)
                    {
                        TimeDetails details;
                        if (!latestData.TryGetValue(serverName, out details))
                        {
                            details = new TimeDetails();
                            latestData.Add(serverName, details);
                        }

                        if (details.ServerDate.Stamp < data.WurmDateTime.Stamp)
                        {
                            details.ServerDate = new ServerDateStamped()
                            {
                                WurmDateTime = data.WurmDateTime.WurmDateTime,
                                Stamp = data.WurmDateTime.Stamp
                            };
                        }
                    }
                }
            }
        }
Beispiel #2
0
 public ServerData()
 {
     LogHistory = new TimeDetails();
 }
Beispiel #3
0
 public ServerData()
 {
     LogHistory = new TimeDetails();
 }