This commit is contained in:
aozhiwei 2024-08-07 19:26:44 +08:00
parent 92e328f417
commit ca1bf9d3f0
2 changed files with 15 additions and 4 deletions

View File

@ -19,10 +19,6 @@ func (this *Recharge) Init1() {
panic("Recharge diamond <= 0")
return
}
if this.GetDiamond() > constant.RECHARGE_CURRENCY_MAX_EXCHANGE_RAET {
panic("Recharge diamond < upimit")
return
}
if this.GetPrice() <= 0 {
panic("Recharge price <= 0")
return

View File

@ -96,3 +96,18 @@ func (this *RechargeCurrencyTable) Load() {
}
}
}
func (this *RechargeCurrencyTable) PostInit1() {
this.netIdHash.Range(
func (key int32, val *RechargeCurrency) bool {
netId := key
currencyMeta := val
Table.Recharge.Traverse(func(ele *Recharge) bool {
if int64(ele.GetPrice()) * currencyMeta.GetExchangeRate() != int64(ele.GetDiamond()) {
panic(fmt.Sprintf("load metafile json decode error %s %s", "currency.json", netId))
}
return true
})
return true
})
}