private void startBoot() { updHostname(); SessionStart?.Invoke(); _osEntity = _plexgate.New <OSEntity>(); _plexgate.GetLayer(LayerType.Main).AddEntity(_osEntity); }
// Update camera position, rotation and projection void LateUpdate() { UpdateCamera(WebXRViewEyes.Left); UpdateCamera(WebXRViewEyes.Right); UpdateInput(LeftInput); UpdateInput(RightInput); LeftInput.Available = _byteArray[44] != 0; RightInput.Available = _byteArray[45] != 0; // Input source change event if (_byteArray[3] != 0) { InputSourcesChange.Invoke(); _byteArray[3] = 0; } // Session state changed invoked when all gamepads and cameras are updated if (InternalInSession && !InSession) //New session detected { InSession = true; SessionStart.Invoke(); } else if (InSession && !InternalInSession) // End of session detected { InSession = false; SessionEnd.Invoke(); } }
void ApplyStart(SessionStart start) { StartTime = start.Timestamp; FinishCriteria = new FinishCriteria(start.Duration, start.TotalLaps, start.LapsAfterDuration, start.SkipStartingCheckpoint, start.ForceFinishOnly); TrackOfCheckpoints = ReloadTrack(StartTime, FinishCriteria); }
/// <summary>取得舊有或建立新的 CJF.Net.Http.Session 執行個體。</summary> /// <param name="context">傳入包裝著 System.Net.HttpListenerContext 殼的執行個體。</param> /// <param name="session">傳回已存在的 CJF.Net.Http.Session 執行個體。</param> /// <returns>true: 找到對應的 CJF.Net.Http.Session 執行個體; false: 未找到,但已建立新的 CJF.Net.Http.Session 執行個體。</returns> public bool GetOrCreate(HttpServiceContext context, out HttpListenerSession session) { var cookie = context.Request.Cookies[_cookieName]; session = null; if (cookie != null && !cookie.Expired) { _sessions.TryGetValue(cookie.Value, out session); if (session != null) { session.LastRequest = DateTime.Now; } } if (session == null) { HttpListenerSession sess = new HttpListenerSession(); _sessions.AddOrUpdate(sess.ID, sess, (k, v) => v = sess); cookie = new Cookie(_cookieName, sess.ID, "/"); context.Response.SetCookie(cookie); context.Session = sess; session = sess; SessionStart?.BeginInvoke(this, context, null, null); return(false); } else { context.Session = session; return(true); } }
protected virtual void OnSessionStart(Vector3 focusPoint) { notifyListeners("Session_Start", focusPoint); if (null != SessionStart) { SessionStart.Invoke(this, new SessionStartEventArgs(focusPoint)); } }
public async void RunSession() { if (_SessionLoop.CurrentIteration > 1) { _Status = StatusType.SessionRest; await SessionRest.RunAsync(CancelToken); } SessionStart?.Invoke(this, _SessionLoop.CurrentIteration); RunTrialSet(); }
public override int GetHashCode() { int hash = 1; if (messageCase_ == MessageOneofCase.SessionStart) { hash ^= SessionStart.GetHashCode(); } hash ^= (int)messageCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
protected async virtual Task OnStartAsync(IAnalyticsClient client, DateTime now) { _lastHeartBeatMsgSent = now + TimeSpan.Zero.WithRandomDeviation(3); if (_options.SessionStartMessage) { var msg = new SessionStart { GamerTag = GamerTag, GameSession = GameSession }; await client.SendMessageAsync(msg, now); } }
private void btnStart_Click(object sender, RoutedEventArgs e) { SessionType type = listSessionType.SelectedItem as SessionType; if (type == null) { return; } SavedState.Data.CurrentSession = new Session() { TypeId = type.Id }; SavedState.Save(); SessionStart?.Invoke(this, type.Id); }
public void RecordNaturallyPassiveMetric() { var sessionStart = new SessionStart(); _telemetryLogger.Object.RecordSessionStart(sessionStart); Assert.NotNull(_recordedMetrics); _telemetryLogger.Verify( mock => mock.Record(_recordedMetrics), Times.Once ); var datum = Assert.Single(_recordedMetrics.Data); Assert.NotNull(datum); Assert.Equal("session_start", datum.MetricName); Assert.True(datum.Passive); }
public void MergeFrom(SessionMessage other) { if (other == null) { return; } switch (other.MessageCase) { case MessageOneofCase.SessionStart: if (SessionStart == null) { SessionStart = new global::RdpBridge.Protocol.SessionStartMessage(); } SessionStart.MergeFrom(other.SessionStart); break; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); }
internal static void BeginSession() { if (!Initialized) { Initialized = Init(); } if (!Initialized) { Service.Logger.Warn("Could not begin analytics session: init failed."); return; } _sessionStopwatch = Stopwatch.StartNew(); SessionId = Guid.NewGuid().ToString("D"); var startEvent = new SessionStart(); startEvent.Enqueue(); }
/// <summary> /// Writes a new entry to the log, which always goes to the system console and then /// to the log file depending upon log registration policy. /// The lines is composed of: DateTime, Type of entry, Origin, Text. /// </summary> /// <param name="EntryType">Type of log entry</param> /// <param name="Text">Text to log</param> /// <param name="Origin">Originator of the entry (e.g. a type.method)</param> private static void LogWrite(string EntryType, string Text, string Origin) { string LogLine; if (FirstWritingOfTheSession) { FirstWritingOfTheSession = false; LogLine = String.Format("{0}\t{1}\t{2}\t{3}", SessionStart.AsCommonDateTime(true), "LOG", "SYSTEM", "*".Replicate(10) + "LOG START. Product Version:" + AppExec.ApplicationVersion + ", OS: " + Environment.OSVersion.ToString() + " " + "*".Replicate(10)); //T Console.WriteLine(LogLine); LogFileWrite(EntryType, LogLine); } LogLine = String.Format("{0}\t{1}\t{2}\t{3}", DateTime.Now.AsCommonDateTime(true), EntryType, Origin, Text); //T Console.WriteLine(LogLine); LogFileWrite(EntryType, LogLine); }
public async Task <ApiResponse <OpenedSession> > SessionOpen(string appSecret = null) { if (string.IsNullOrWhiteSpace(appSecret) && string.IsNullOrWhiteSpace(this.FreeboxApi.AppInfo.AppToken)) { throw new ArgumentNullException(nameof(appSecret), LocalizedStrings.AppTokenNotProvided); } if (!string.IsNullOrWhiteSpace(appSecret) && string.IsNullOrWhiteSpace(this.FreeboxApi.AppInfo.AppToken)) { this.FreeboxApi.AppInfo.AppToken = appSecret; } var appToken = appSecret ?? this.FreeboxApi.AppInfo.AppToken; var uri = new Uri($"{FreeboxApi.ApiInfo.ApiUri}{BaseModuleUri}"); var challengeResponse = await GetAsync <LoginStart>(uri, bypassAutoLogin : true); using (var hmac = new HMACSHA1(Encoding.UTF8.GetBytes(appToken))) { var challengeToReturn = hmac .ComputeHash(Encoding.UTF8.GetBytes(challengeResponse.Result.Challenge)) .Aggregate("", (s, e) => s + string.Format(CultureInfo.InvariantCulture, "{0:x2}", e), s => s); var sessionStart = new SessionStart() { AppId = this.FreeboxApi.AppInfo.AppId, Password = challengeToReturn }; var response = await PostAsync <SessionStart, OpenedSession>(sessionStart, new Uri($"{uri}session/"), bypassAutoLogin : true); this.LoggedIn = response.Success; this.SessionToken = response.Result.SessionToken; this.Permissions = response.Result.Permissions; return(response); } }
/// <summary> /// Constructs a new instance of this class /// </summary> /// <param name="caller">The object that is doing the logging</param> /// <param name="messageBus">A message bus to send log messages over</param> /// <param name="logEntryRepository">An IRepository implememntation for persisting logged messages</param> /// <param name="errorRepository">An IRepository implementation for persisting errors</param> public Logger(object caller, MessageBus messageBus, IRepository <LogEntry> logEntryRepository, IRepository <AuditableError> errorRepository) { Contract.Requires(logEntryRepository != null); Contract.Requires(caller != null); this.SessionStart = DateTime.Now; this.GUID = Guid.NewGuid().ToString(); this.Caller = caller.GetType().ToString(); this.Entries = new List <LogEntry>(); this.MessageBus = messageBus; this.LogEntryRepository = logEntryRepository; this.ErrorRepository = errorRepository; this.FileName = $"Logs\\{Caller}.{SessionStart.ToString("yyyy.MM.dd.HH.mm.ss", CultureInfo.CurrentCulture)}.log"; if (!Directory.Exists("Logs")) { Directory.CreateDirectory("Logs"); } WriteContext = logEntryRepository.WriteContext(); }
public static void CallSessionStart() { SessionStart?.Invoke(); }
public void Start(SessionStart start) { LogEntries.Add(start); ApplyStart(start); }
public string ToSessionString() { return($"{Guid}_{SessionStart.ToString()}"); }
private void OnTestStart(ITestResultCollection statistics) { SessionStart?.Invoke(statistics); }