mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-12 00:38:48 -07:00
purchase: simplify wallet update
This commit is contained in:
parent
b9b17b9f27
commit
d4294130d9
@ -2271,19 +2271,12 @@ public class ContentController : Controller {
|
||||
}
|
||||
|
||||
// deduct the cost of the purchase
|
||||
achievementService.AddAchievementPoints(viking, AchievementPointTypes.GameCurrency, -totalCoinCost);
|
||||
achievementService.AddAchievementPoints(viking, AchievementPointTypes.CashCurrency, -totalGemCost);
|
||||
|
||||
achievementService.AddAchievementPoints(viking, AchievementPointTypes.GameCurrency, -totalCoinCost + gemsToAdd);
|
||||
achievementService.AddAchievementPoints(viking, AchievementPointTypes.CashCurrency, -totalGemCost + coinsToAdd);
|
||||
|
||||
// add items to the inventory (database)
|
||||
var addedItems = inventoryService.AddItemsToInventoryBulk(viking, inventoryItemsToAdd);
|
||||
|
||||
// add gems and coins that were purchased
|
||||
if (gemsToAdd != 0)
|
||||
achievementService.AddAchievementPoints(viking, AchievementPointTypes.CashCurrency, gemsToAdd);
|
||||
if (coinsToAdd != 0)
|
||||
achievementService.AddAchievementPoints(viking, AchievementPointTypes.GameCurrency, coinsToAdd);
|
||||
|
||||
// build response
|
||||
List<CommonInventoryResponseItem> items = new List<CommonInventoryResponseItem>();
|
||||
foreach (var i in itemsToSendBack) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user