``feat(item): 新增物品出售价格属性(SellPrice)并实现物品出售功能,优化宠物面板计算和时区判断逻辑``

This commit is contained in:
1
2025-12-12 19:10:09 +00:00
parent 3242207f95
commit cedb02faf7
35 changed files with 172 additions and 152 deletions

View File

@@ -0,0 +1,21 @@
package controller
import (
"blazing/common/data/xmlres"
"blazing/common/socket/errorcode"
"blazing/logic/service/fight"
"blazing/logic/service/item"
"blazing/logic/service/player"
)
func (h Controller) ITEM_SALE(data *item.C2S_ITEM_SALE, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
if c.Service.Item.CheakItem(data.ItemId) < data.Amount {
return nil, errorcode.ErrorCodes.ErrSystemError
}
if xmlres.ItemsMAP[int(data.ItemId)].SellPrice != 0 {
c.Info.Coins += uint32(int64(data.Amount) * int64(xmlres.ItemsMAP[int(data.ItemId)].SellPrice))
}
return result, 0
}