refactor: 修复代码格式并调整地图玩家信息获取逻辑
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
This commit is contained in:
@@ -19,7 +19,7 @@ func (h Controller) EnterMap(data *space.InInfo, c *player.Player) (result *info
|
||||
if c.Info.MapID != data.MapId {
|
||||
atomic.StoreUint32(&c.Canmon, 2)
|
||||
c.MapNPC.Reset(7 * time.Second)
|
||||
}else{
|
||||
} else {
|
||||
atomic.StoreUint32(&c.Canmon, 1)
|
||||
}
|
||||
c.Info.MapID = data.MapId //登录地图
|
||||
@@ -47,10 +47,6 @@ func (h Controller) GetMapHot(data *maphot.InInfo, c *player.Player) (result *ma
|
||||
func (h Controller) LeaveMap(data *space.LeaveMapInboundInfo, c *player.Player) (result *info.LeaveMapOutboundInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
|
||||
atomic.StoreUint32(&c.Canmon, 0)
|
||||
|
||||
//data.Broadcast(c.Info.MapID, info.LeaveMapOutboundInfo{UserID: c.Info.UserID}) //同步广播
|
||||
result = &info.LeaveMapOutboundInfo{
|
||||
UserID: c.Info.UserID,
|
||||
}
|
||||
c.GetSpace().LeaveMap(c) //玩家离开地图
|
||||
|
||||
// 如果有正在运行的刷怪协程,发送停止信号
|
||||
|
||||
Reference in New Issue
Block a user