Example #1
0
        private static async Task SetUserAsync(UserSession session, GameSessionService service, BrowserSessionStorage data, bool saveBrowserStorage)
        {
            if (session.User == null)
            {
                session.User = await service.GameEngineService.Users.GetUserAsync(service, data.UserId);
            }

            if (string.IsNullOrWhiteSpace(data.UserId))
            {
                data.UserId        = session.User.Id;
                saveBrowserStorage = true;
            }

            if (saveBrowserStorage)
            {
                await service.SetBrowserSessionStorageAsync(data);
            }
        }