This commit is contained in:
aozhiwei 2024-07-10 15:50:39 +08:00
parent da106673c8
commit 872fba5414
3 changed files with 8 additions and 3 deletions

View File

@ -29,4 +29,9 @@ const (
)
const (
USER_ADD_GOLD_REASON_RETURN = 1
USER_ADD_GOLD_REASON_USE = 2
)
const BASE_SCORE = 2800

View File

@ -68,7 +68,7 @@ func OpenGoldBullion(accountId string, accountAddress string, netId int32, token
}
}
{
if !UserAddGold(accountId, goldNum) {
if !UserAddGold(accountId, goldNum, netId, tokenId, constant.USER_ADD_GOLD_REASON_USE) {
return false
}
}
@ -212,7 +212,7 @@ func ReturnGoldBullion(accountId string, netId int32, tokenId string) bool {
}
{
if !UserAddGold(accountId, goldNum) {
if !UserAddGold(accountId, goldNum, netId, tokenId, constant.USER_ADD_GOLD_REASON_RETURN) {
return false
}
}

View File

@ -44,7 +44,7 @@ func AccountIdExistsAndIgnoreError(accountId string) bool {
return isExists
}
func UserAddGold(accountId string, goldNum int32) bool {
func UserAddGold(accountId string, goldNum int32, netId int32, tokenId string, reason int32) bool {
result := false
f5.GetGoStyleDb().Update(
constant.GAME_DB,