Fixed missing update on saving custom pet
This commit is contained in:
@@ -42,12 +42,14 @@ namespace TOOHUCardAPI.Data.Repositories
|
||||
|
||||
public async Task<User> CreateUser(string steamId)
|
||||
{
|
||||
User user = new User()
|
||||
User user = new User
|
||||
{
|
||||
SteamId = steamId,
|
||||
Vip = true,
|
||||
EndTime = DateTime.MaxValue,
|
||||
PetLevel = 1,
|
||||
PetModel = "h000",
|
||||
PetEffect = "e000",
|
||||
EncodedCardGroups = new List<EncodedCardGroup>
|
||||
{
|
||||
new()
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace TOOHUCardAPI.Data.Services
|
||||
user.KeyTotal += AppSettings.DailyKeyBonus;
|
||||
user.LastDailyLoginBonus = DateTime.Now;;
|
||||
await _userRepository.UpdateUser(user);
|
||||
_logger.LogInformation($"User {user.SteamId} received a daily login bonus. Keys earned: {AppSettings.DailyKeyBonus}. New Key total: {user.KeyTotal}");
|
||||
return user;
|
||||
}
|
||||
|
||||
@@ -57,6 +58,7 @@ namespace TOOHUCardAPI.Data.Services
|
||||
User user = await _userRepository.GetUser(steamId);
|
||||
user.PetModel = petModel;
|
||||
user.PetEffect = petEffect;
|
||||
await _userRepository.UpdateUser(user);
|
||||
_logger.LogInformation($"User {user.SteamId} saved new pet data with model: {petModel} and effect {petEffect}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user