mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 16:02:26 +08:00
优化
This commit is contained in:
@@ -505,6 +505,8 @@ func (w *World) InitPlayerWorldAvatar(player *model.Player) {
|
||||
if !player.SceneJump && (worldAvatar.avatarEntityId != 0 || worldAvatar.weaponEntityId != 0) {
|
||||
continue
|
||||
}
|
||||
scene.DestroyEntity(worldAvatar.avatarEntityId)
|
||||
scene.DestroyEntity(worldAvatar.weaponEntityId)
|
||||
worldAvatar.avatarEntityId = scene.CreateEntityAvatar(player, worldAvatar.avatarId)
|
||||
worldAvatar.weaponEntityId = scene.CreateEntityWeapon()
|
||||
}
|
||||
|
||||
@@ -437,14 +437,12 @@ func (g *Game) GetOnlinePlayerInfoReq(player *model.Player, payloadMsg pb.Messag
|
||||
|
||||
func (g *Game) PacketOnlinePlayerInfo(player *model.Player) *proto.OnlinePlayerInfo {
|
||||
world := WORLD_MANAGER.GetWorldByID(player.WorldId)
|
||||
if world == nil {
|
||||
logger.Error("get world is nil, worldId: %v, uid: %v", player.WorldId, player.PlayerID)
|
||||
return new(proto.OnlinePlayerInfo)
|
||||
}
|
||||
worldPlayerNum := uint32(1)
|
||||
// TODO 远程玩家的世界内人数
|
||||
if world != nil {
|
||||
worldPlayerNum = uint32(world.GetWorldPlayerNum())
|
||||
} else {
|
||||
// TODO 远程玩家的世界内人数
|
||||
worldPlayerNum = 1
|
||||
}
|
||||
onlinePlayerInfo := &proto.OnlinePlayerInfo{
|
||||
Uid: player.PlayerID,
|
||||
|
||||
@@ -191,7 +191,7 @@ func (g *Game) ChangeMpTeamAvatarReq(player *model.Player, payloadMsg pb.Message
|
||||
logger.Error("get world is nil, worldId: %v, uid: %v", player.WorldId, player.PlayerID)
|
||||
return
|
||||
}
|
||||
if !world.GetMultiplayer() || len(avatarGuidList) == 0 || len(avatarGuidList) > 4 {
|
||||
if WORLD_MANAGER.IsBigWorld(world) || !world.GetMultiplayer() || len(avatarGuidList) == 0 || len(avatarGuidList) > 4 {
|
||||
g.SendError(cmd.ChangeMpTeamAvatarRsp, player, &proto.ChangeMpTeamAvatarRsp{})
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user