``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

@@ -6,15 +6,15 @@ import (
"blazing/logic/service/fight"
"blazing/logic/service/maphot"
"blazing/logic/service/maps"
"blazing/logic/service/maps/info"
"blazing/logic/service/space/info"
"blazing/logic/service/player"
"blazing/logic/service/space"
"github.com/jinzhu/copier"
)
func (h *Controller) MapEnter(data *maps.InInfo, c *player.Player) (result *info.OutInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
func (h *Controller) MapEnter(data *space.InInfo, c *player.Player) (result *info.OutInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
c.Info.MapID = data.MapId //登录地图
c.GetSpace().User.Store(c.Info.UserID, c) //添加玩家
@@ -36,7 +36,7 @@ func (h Controller) MapHot(data *maphot.InInfo, c *player.Player) (result *mapho
return
}
func (h *Controller) MapLeave(data *maps.LeaveMapInboundInfo, c *player.Player) (result *info.LeaveMapOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
func (h *Controller) MapLeave(data *space.LeaveMapInboundInfo, c *player.Player) (result *info.LeaveMapOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
//data.Broadcast(c.Info.MapID, info.LeaveMapOutboundInfo{UserID: c.Info.UserID}) //同步广播
result = &info.LeaveMapOutboundInfo{
@@ -49,7 +49,7 @@ func (h *Controller) MapLeave(data *maps.LeaveMapInboundInfo, c *player.Player)
//c.Info.MapID = 0 // 重置当前地图
return
}
func (h *Controller) MapList(data *maps.ListMapPlayerInboundInfo, c *player.Player) (result *info.ListMapPlayerOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
func (h *Controller) MapList(data *space.ListMapPlayerInboundInfo, c *player.Player) (result *info.ListMapPlayerOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
atomic.StoreUint32(&c.Canmon, 2)
result = &info.ListMapPlayerOutboundInfo{
@@ -58,7 +58,7 @@ func (h *Controller) MapList(data *maps.ListMapPlayerInboundInfo, c *player.Play
return
}
func (h *Controller) Attack_Boss(data *maps.AttackBossInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
func (h *Controller) Attack_Boss(data *space.AttackBossInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
if atomic.LoadInt32(&c.GetSpace().MapBossInfo.Hp) > 0 {
atomic.AddInt32(&c.GetSpace().MapBossInfo.Hp, -1)