fix(server): complete native shop purchases, quantities and diamond payments

This commit is contained in:
2026-10-05 17:21:27 +08:00
parent ce638a6649
commit 0e6a8ef97b
6 changed files with 525 additions and 13 deletions
+9
View File
@@ -823,6 +823,15 @@ func serve(args []string) (serveErr error) {
return fmt.Errorf("load cash bonus claims: %w", err)
}
cashService.AttachLegacyCounts(gachaService)
cashSpecialProducts := []gamedata.CashProductKey{{GroupID: infiniteGacha.ProductGroupID, ProductID: infiniteGacha.ProductID, SaleGroup: infiniteGacha.SaleGroup}}
for _, group := range regularGacha.Groups() {
if group.CashProductGroupID != 0 && group.CashProductID != 0 {
cashSpecialProducts = append(cashSpecialProducts, gamedata.CashProductKey{GroupID: group.CashProductGroupID, ProductID: group.CashProductID, SaleGroup: group.CashSalesGroup})
}
}
if err := cashService.AttachSpecialProducts(cashSpecialProducts); err != nil {
return fmt.Errorf("attach special cash products: %w", err)
}
cashService.AttachDelegate(func(key gamedata.CashProductKey, request []byte) ([]byte, bool, error) {
known := key.GroupID == infiniteGacha.ProductGroupID && key.ProductID == infiniteGacha.ProductID && key.SaleGroup == infiniteGacha.SaleGroup
for _, group := range regularGacha.Groups() {