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

This commit is contained in:
xinian
2026-02-12 00:31:41 +08:00
committed by cnb
parent 0f914eb9b8
commit 64c3b50860
2 changed files with 12 additions and 10 deletions

View File

@@ -16,6 +16,10 @@ import (
func (h Controller) EnterMap(data *space.InInfo, c *player.Player) (result *info.SimpleInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
if c.Info.MapID != data.MapId {
atomic.StoreUint32(&c.Canmon, 2)
c.MapNPC.Reset(7 * time.Second)
}
c.Info.MapID = data.MapId //登录地图
c.Info.Pos = data.Point
@@ -25,7 +29,7 @@ func (h Controller) EnterMap(data *space.InInfo, c *player.Player) (result *info
// copier.CopyWithOption(result, c.Info, copier.Option{DeepCopy: true})
defer c.GetSpace().EnterMap(c)
c.GetSpace().EnterMap(c)
return nil, -1
}
@@ -45,16 +49,15 @@ func (h Controller) LeaveMap(data *space.LeaveMapInboundInfo, c *player.Player)
result = &info.LeaveMapOutboundInfo{
UserID: c.Info.UserID,
}
defer c.GetSpace().LeaveMap(c) //玩家离开地图
c.GetSpace().LeaveMap(c) //玩家离开地图
// 如果有正在运行的刷怪协程,发送停止信号
//c.Info.MapID = 0 // 重置当前地图
return
return nil, -1
}
func (h Controller) GetMapPlayerList(data *space.ListMapPlayerInboundInfo, c *player.Player) (result *info.ListMapPlayerOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
atomic.StoreUint32(&c.Canmon, 2)
c.MapNPC.Reset(5 * time.Second)
result = &info.ListMapPlayerOutboundInfo{
Player: c.GetSpace().GetInfo(c),
}