public UsageTrackerSync(ISettings userSettings, IUsageLoader usageLoader, string unityVersion, string instanceId) { this.userSettings = userSettings; this.usageLoader = usageLoader; this.appVersion = ApplicationInfo.Version; this.unityVersion = unityVersion; this.instanceId = instanceId; if (userSettings.Exists(Constants.GuidKey)) { userId = userSettings.Get(Constants.GuidKey); } if (String.IsNullOrEmpty(userId)) { userId = Guid.NewGuid().ToString(); userSettings.Set(Constants.GuidKey, userId); } Logger.Trace("userId:{0} instanceId:{1}", userId, instanceId); if (Enabled) { RunTimer(MetrisReportTimeout); } }
public UsageTracker(IMetricsService metricsService, ISettings userSettings, IUsageLoader usageLoader, string userId, string unityVersion, string instanceId) { this.userSettings = userSettings; this.usageLoader = usageLoader; this.metricsService = metricsService; this.userId = userId; this.appVersion = ApplicationInfo.Version; this.unityVersion = unityVersion; this.instanceId = instanceId; Logger.Trace("userId:{0} instanceId:{1}", userId, instanceId); if (Enabled) { RunTimer(3 * 60); } }