Files
GaCy-GO/internal/gameserver/currency_wars_shop.go
T

37 lines
1.3 KiB
Go

package gameserver
import (
"fmt"
"gac-hkrpg-go/internal/common"
goproto "gac-hkrpg-go/protocol/proto"
)
// Exact runtime method pointers and their baseline native consumers were
// resolved for the catalog's source assembly (see CW investigation notes).
// Factory RVA 0xdbf2340 takes the slot index separately and selects the role
// constructor for oneof tag 1403. Cost RVA 0xdbf2860 reads HDE +0x28 (tag 13).
// Source is deliberately supplied by the action processor; its obfuscated enum
// values are not assigned normal/special meanings by this converter.
func currencyWarsRoleOfferProto(catalog *common.CurrencyWarsCatalog, offer common.CurrencyWarsShopOffer,
source goproto.FKGIEPHGACD,
) (*goproto.HDEIAANGMDB, error) {
if catalog == nil {
return nil, fmt.Errorf("CW offer catalog is missing")
}
if _, valid := goproto.FKGIEPHGACD_name[int32(source)]; !valid {
return nil, fmt.Errorf("CW shop source enum is outside the protocol schema")
}
if _, err := catalog.CapturedRoleVariant(offer.RoleID, offer.Star); err != nil {
return nil, err
}
return &goproto.HDEIAANGMDB{
Source: source,
LHGIFDNPIDE: offer.Sold,
KDKPDJNMMCM: offer.Cost,
AELHFLGJMJN: &goproto.HDEIAANGMDB_BDPIMPJOJBK{
BDPIMPJOJBK: &goproto.NJBGFHDPFNO{RoleId: offer.RoleID, RoleStar: offer.Star},
},
}, nil
}