diff --git a/gs/game/player_login.go b/gs/game/player_login.go index c46f6885..e93b0616 100644 --- a/gs/game/player_login.go +++ b/gs/game/player_login.go @@ -116,6 +116,8 @@ func (g *Game) OnLoginOk(userId uint32, clientSeq uint32, gateAppId string, isRe TICK_MANAGER.CreateUserGlobalTick(userId) TICK_MANAGER.CreateUserTimer(userId, UserTimerActionTest, 100, player.NickName) + g.AcceptQuest(player, true) + atomic.AddInt32(&ONLINE_PLAYER_NUM, 1) SELF = nil diff --git a/gs/game/player_quest.go b/gs/game/player_quest.go index 8eee4447..1df43033 100644 --- a/gs/game/player_quest.go +++ b/gs/game/player_quest.go @@ -145,28 +145,32 @@ func (g *Game) AcceptQuest(player *model.Player, notifyClient bool) { ntf.QuestList = append(ntf.QuestList, pbQuest) } g.SendMsg(cmd.QuestListUpdateNotify, player.PlayerID, player.ClientSeq, ntf) - // TODO 判断任务是否能开始 - for _, questId := range addQuestIdList { - g.StartQuest(player, questId) - } + } + // TODO 判断任务是否能开始 + for _, questId := range addQuestIdList { + g.StartQuest(player, questId, notifyClient) } } // StartQuest 开始一个任务 -func (g *Game) StartQuest(player *model.Player, questId uint32) { +func (g *Game) StartQuest(player *model.Player, questId uint32, notifyClient bool) { dbQuest := player.GetDbQuest() dbQuest.StartQuest(questId) - ntf := &proto.QuestListUpdateNotify{ - QuestList: make([]*proto.Quest, 0), - } - pbQuest := g.PacketQuest(player, questId) - if pbQuest == nil { - return - } - ntf.QuestList = append(ntf.QuestList, pbQuest) - g.SendMsg(cmd.QuestListUpdateNotify, player.PlayerID, player.ClientSeq, ntf) + g.QuestExec(player, questId) g.QuestStartTriggerCheck(player, questId) + + if notifyClient { + ntf := &proto.QuestListUpdateNotify{ + QuestList: make([]*proto.Quest, 0), + } + pbQuest := g.PacketQuest(player, questId) + if pbQuest == nil { + return + } + ntf.QuestList = append(ntf.QuestList, pbQuest) + g.SendMsg(cmd.QuestListUpdateNotify, player.PlayerID, player.ClientSeq, ntf) + } } // QuestExec 任务开始执行触发操作 diff --git a/gs/game/player_scene.go b/gs/game/player_scene.go index 4d650801..3c78b25e 100644 --- a/gs/game/player_scene.go +++ b/gs/game/player_scene.go @@ -681,6 +681,8 @@ func (g *Game) RemoveSceneGroup(player *model.Player, scene *Scene, groupConfig g.SendMsg(cmd.GroupUnloadNotify, player.PlayerID, player.ClientSeq, ntf) } +// TODO Group和Suite的初始化和加载卸载逻辑还没完全理清 所以现在这里写得略答辩 + func (g *Game) AddSceneGroupSuite(player *model.Player, groupId uint32, suiteId uint8) { groupConfig := gdconf.GetSceneGroup(int32(groupId)) if groupConfig == nil {