private List <TrackingEventData> PrepareWithSession() { List <TrackingEventData> list = new List <TrackingEventData>(); if (this.m_dropCounter > 0) { double num = !this.m_lastFail.HasValue ? 0.0 : (DateTime.Now - this.m_lastFail.Value).TotalMinutes; TrackingEvent event2 = new TrackingEvent("data_discarded"); event2.Payload["events_dropped"] = this.m_dropCounter; event2.Payload["time_played_offline"] = (int)(this.m_offlineMinutes + num); TrackingEventData item = event2.GetData(); item.sid = Service.Binder.SessionData.SessionId; item.appversion = Service.Binder.SessionData.ClientVersion; list.Add(item); } foreach (TrackingEventData data2 in this.m_batch) { if (data2.sid == null) { data2.sid = Service.Binder.SessionData.SessionId; data2.appversion = Service.Binder.SessionData.ClientVersion; } list.Add(data2); } return(list); }
public void AddEvent(TrackingEvent _trackingEvent) { if (!ConfigApp.CHEAT_MARKETING_MODE_ENABLED) { Service.Binder.EventBus.TrackingEvent(_trackingEvent); _trackingEvent.Payload["$utc-stamp"] = Convert.ToUInt64(DateTime.UtcNow.Subtract(FirstOfJanuary1970).TotalMilliseconds); this.m_batch.Enqueue(_trackingEvent.GetData()); if (this.m_batch.Count > ConfigService.TRACKING_QUEUE_SIZE) { this.m_batch.Dequeue(); this.m_dropCounter++; } this.m_queueChanged = true; } }