add game to client

This commit is contained in:
RaidMax
2022-04-22 16:03:34 -05:00
parent 7b3ddd58c6
commit 0a8e415af8
13 changed files with 5061 additions and 4 deletions

View File

@ -626,6 +626,8 @@ namespace SharedLibraryCore.Database.Models
Utilities.DefaultLogger.LogInformation("Client {client} is joining the game from {source}", ToString(),
ipAddress.HasValue ? "Status" : "Log");
GameName = (Reference.Game)CurrentServer.GameName;
if (ipAddress != null)
{
IPAddress = ipAddress;

View File

@ -103,7 +103,8 @@ namespace SharedLibraryCore.Services
Level = Permission.User,
FirstConnection = DateTime.UtcNow,
LastConnection = DateTime.UtcNow,
NetworkId = entity.NetworkId
NetworkId = entity.NetworkId,
GameName = (Reference.Game)entity.CurrentServer.GameName
};
_logger.LogDebug("[create] adding {entity} to context", entity.ToString());
@ -283,6 +284,8 @@ namespace SharedLibraryCore.Services
entity.PasswordSalt = temporalClient.PasswordSalt;
}
entity.GameName ??= temporalClient.GameName;
// update in database
await context.SaveChangesAsync();
return entity.ToPartialClient();
@ -357,7 +360,8 @@ namespace SharedLibraryCore.Services
Level = Permission.User,
FirstConnection = DateTime.UtcNow,
LastConnection = DateTime.UtcNow,
NetworkId = entity.NetworkId
NetworkId = entity.NetworkId,
GameName = (Reference.Game)entity.CurrentServer.GameName
};
if (existingAlias == null)