This commit is contained in:
@@ -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))),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -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:]...)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user