MCPcopy Create free account
hub / github.com/PlayFab/gsdk / EnforceTimeout

Method EnforceTimeout

csharp/WinTestRunnerGame/Program.cs:266–285  ·  view source on GitHub ↗
(SessionCookie sessionCookie)

Source from the content-addressed store, hash-verified

264 }
265
266 private static void EnforceTimeout(SessionCookie sessionCookie)
267 {
268 if (sessionCookie.TimeoutSecs != 0)
269 {
270 _sessionTimeoutTimestamp = DateTimeOffset.Now.AddSeconds(sessionCookie.TimeoutSecs);
271 }
272
273 if (_sessionTimeoutTimestamp != DateTimeOffset.MaxValue)
274 {
275 while (!_isShutdown && _sessionTimeoutTimestamp > DateTimeOffset.Now)
276 Thread.Sleep(1000);
277
278 // If we didn't shutdown yet, that means we timed out
279 if (!_isShutdown)
280 {
281 LogMessage($"Session Timeout exceeded at {DateTimeOffset.Now.ToString()}...");
282 OnShutdown();
283 }
284 }
285 }
286
287 /// <summary>
288 /// Listens for any requests and responds with the game host's config values

Callers

nothing calls this directly

Calls 2

LogMessageFunction · 0.85
ToStringMethod · 0.80

Tested by

no test coverage detected