From 69f4341affe8d18759ab202b566074ff7052a783 Mon Sep 17 00:00:00 2001 From: UnKownOwO <80520429@qq.com> Date: Tue, 3 Oct 2023 00:19:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B0=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gs/game/game_plugin_pubg.go | 2 +- gs/game/player_world.go | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gs/game/game_plugin_pubg.go b/gs/game/game_plugin_pubg.go index 79bf3f99..c5b4626b 100644 --- a/gs/game/game_plugin_pubg.go +++ b/gs/game/game_plugin_pubg.go @@ -132,7 +132,7 @@ func (p *PluginPubg) GlobalTickPubg() { } alivePlayerList := p.GetAlivePlayerList() if len(alivePlayerList) <= 1 { - if len(alivePlayerList) <= 1 { + if len(alivePlayerList) == 1 { info := fmt.Sprintf("『%v』大吉大利,今晚吃鸡。", alivePlayerList[0].NickName) GAME.PlayerChatReq(world.GetOwner(), &proto.PlayerChatReq{ChatInfo: &proto.ChatInfo{Content: &proto.ChatInfo_Text{Text: info}}}) } diff --git a/gs/game/player_world.go b/gs/game/player_world.go index 660ec06f..72450ee5 100644 --- a/gs/game/player_world.go +++ b/gs/game/player_world.go @@ -117,7 +117,17 @@ func (g *Game) GetScenePointReq(player *model.Player, payloadMsg pb.Message) { return } dbWorld := owner.GetDbWorld() + if dbWorld == nil { + logger.Error("db world is nil, uid: %v", player.PlayerId) + g.SendError(cmd.GetScenePointRsp, player, &proto.GetScenePointRsp{}) + return + } dbScene := dbWorld.GetSceneById(req.SceneId) + if dbScene == nil { + logger.Error("db scene is nil, sceneId: %v, uid: %v", req.SceneId, player.PlayerId) + g.SendError(cmd.GetScenePointRsp, player, &proto.GetScenePointRsp{}) + return + } // 区域 暂时解锁全部区域 areaIdMap := make(map[uint32]bool) for _, worldAreaData := range gdconf.GetWorldAreaDataMap() {