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)
|
public async Task<User> CreateUser(string steamId)
|
||||||
{
|
{
|
||||||
User user = new User()
|
User user = new User
|
||||||
{
|
{
|
||||||
SteamId = steamId,
|
SteamId = steamId,
|
||||||
Vip = true,
|
Vip = true,
|
||||||
EndTime = DateTime.MaxValue,
|
EndTime = DateTime.MaxValue,
|
||||||
PetLevel = 1,
|
PetLevel = 1,
|
||||||
|
PetModel = "h000",
|
||||||
|
PetEffect = "e000",
|
||||||
EncodedCardGroups = new List<EncodedCardGroup>
|
EncodedCardGroups = new List<EncodedCardGroup>
|
||||||
{
|
{
|
||||||
new()
|
new()
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ namespace TOOHUCardAPI.Data.Services
|
|||||||
user.KeyTotal += AppSettings.DailyKeyBonus;
|
user.KeyTotal += AppSettings.DailyKeyBonus;
|
||||||
user.LastDailyLoginBonus = DateTime.Now;;
|
user.LastDailyLoginBonus = DateTime.Now;;
|
||||||
await _userRepository.UpdateUser(user);
|
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;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,6 +58,7 @@ namespace TOOHUCardAPI.Data.Services
|
|||||||
User user = await _userRepository.GetUser(steamId);
|
User user = await _userRepository.GetUser(steamId);
|
||||||
user.PetModel = petModel;
|
user.PetModel = petModel;
|
||||||
user.PetEffect = petEffect;
|
user.PetEffect = petEffect;
|
||||||
|
await _userRepository.UpdateUser(user);
|
||||||
_logger.LogInformation($"User {user.SteamId} saved new pet data with model: {petModel} and effect {petEffect}");
|
_logger.LogInformation($"User {user.SteamId} saved new pet data with model: {petModel} and effect {petEffect}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user