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