整理代码,私有变量接口化访问

This commit is contained in:
flswld
2023-02-09 01:01:05 +08:00
parent 98c35380b1
commit 9d6e95a6b4
21 changed files with 661 additions and 375 deletions

View File

@@ -31,7 +31,7 @@ func (g *GameManager) PullRecentChatReq(player *model.Player, payloadMsg pb.Mess
}
world := WORLD_MANAGER.GetWorldByID(player.WorldId)
if world.multiplayer {
if world.GetMultiplayer() {
chatList := world.GetChatList()
count := len(chatList)
if count > 10 {
@@ -239,7 +239,7 @@ func (g *GameManager) PlayerChatReq(player *model.Player, payloadMsg pb.Message)
ChannelId: channelId,
ChatInfo: sendChatInfo,
}
for _, worldPlayer := range world.playerMap {
for _, worldPlayer := range world.GetAllPlayer() {
g.SendMsg(cmd.PlayerChatNotify, worldPlayer.PlayerID, player.ClientSeq, playerChatNotify)
}