1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-02-10 22:09:15 +08:00
committed by cnb
parent ab1445510a
commit a5485de510
12 changed files with 41 additions and 50 deletions

View File

@@ -117,7 +117,7 @@ func (h Controller) BuyGoldItem(data *item.C2S_GOLD_BUY_PRODUCT, player *player.
return nil, errorcode.ErrorCodes.ErrSystemError
}
if !player.UseGold(uint32(data.Count) * uint32(pro.JindouPrice) * 100) {
if !player.UseGold(int64(data.Count) * int64(pro.JindouPrice) * 100) {
return nil, errorcode.ErrorCodes.ErrSystemError
}
usegold = uint64(data.Count) * uint64(pro.JindouPrice*100)
@@ -138,7 +138,7 @@ func (h Controller) BuyGoldItem(data *item.C2S_GOLD_BUY_PRODUCT, player *player.
player.SendPackCmd(1105, item.GoldOnlineRemainOutboundInfo{
Coin: player.Info.Coins,
GoldNumber: player.User.GetGold(uint(player.Info.UserID)),
GoldNumber: uint32(player.User.GetGold(uint(player.Info.UserID))),
})
}

View File

@@ -123,7 +123,10 @@ func (h Controller) TogglePetBagWarehouse(
index, pet, ok := player.FindPet(data.CatchTime)
if ok {
// ========== 新增index合法性校验 ==========
if index < 0 || index >= len(player.Info.PetList) {
return result, errorcode.ErrorCodes.ErrSystemError
}
player.Service.Pet.UPdate(*pet)
player.Info.PetList = append(player.Info.PetList[:index], player.Info.PetList[index+1:]...)

View File

@@ -41,7 +41,7 @@ func (h Controller) GetPlayerGoldCount(data *item.GoldOnlineRemainInboundInfo, p
return &item.GoldOnlineRemainOutboundInfo{
GoldNumber: player.User.GetGold(uint(player.Info.UserID)),
GoldNumber: uint32(player.User.GetGold(uint(player.Info.UserID))),
Coin: player.Info.Coins,
}, 0
}

View File

@@ -120,7 +120,8 @@ func (h Controller) DeleteTask(data *task.DeleteTaskInboundInfo, c *player.Playe
if c.Info.GetTask(int(data.TaskId)) != model.Accepted {
return nil, errorcode.ErrorCodes.ErrSystemError
}
result = &task.DeleteTaskOutboundInfo{TaskId: data.TaskId}
result = &task.DeleteTaskOutboundInfo{}
result.TaskId = data.TaskId
c.Info.SetTask(int(data.TaskId), model.Unaccepted)
return &task.DeleteTaskOutboundInfo{}, 0
return result, 0
}