添加任务

This commit is contained in:
flswld
2023-02-19 19:40:48 +08:00
parent 795b3e79f5
commit 418655dea9
6 changed files with 419 additions and 20 deletions
+40 -1
View File
@@ -148,7 +148,7 @@ func (g *GameManager) LoginNotify(userId uint32, player *model.Player, clientSeq
g.SendMsg(cmd.PlayerStoreNotify, userId, clientSeq, g.PacketPlayerStoreNotify(player))
g.SendMsg(cmd.AvatarDataNotify, userId, clientSeq, g.PacketAvatarDataNotify(player))
g.SendMsg(cmd.OpenStateUpdateNotify, userId, clientSeq, g.PacketOpenStateUpdateNotify())
g.GCGLogin(player) // 发送GCG登录相关的通知包
// g.GCGLogin(player) // 发送GCG登录相关的通知包
playerLoginRsp := &proto.PlayerLoginRsp{
IsUseAbilityHash: true,
AbilityHashCode: 0,
@@ -160,6 +160,45 @@ func (g *GameManager) LoginNotify(userId uint32, player *model.Player, clientSeq
TotalTickTime: 0.0,
}
g.SendMsg(cmd.PlayerLoginRsp, userId, clientSeq, playerLoginRsp)
questListNotify := &proto.QuestListNotify{
QuestList: make([]*proto.Quest, 0),
}
for _, questDataConfig := range gdconf.GetQuestDataMap() {
if questDataConfig.QuestId == 35104 {
questListNotify.QuestList = append(questListNotify.QuestList, &proto.Quest{
QuestId: 35104,
State: 2,
StartTime: uint32(time.Now().Unix()),
ParentQuestId: 351,
StartGameTime: 438,
AcceptTime: uint32(time.Now().Unix()),
FinishProgressList: []uint32{0},
})
continue
}
finishProgressList := make([]uint32, 0)
if questDataConfig.FinishCondType1 != 0 {
finishProgressList = append(finishProgressList, 0)
}
if questDataConfig.FinishCondType2 != 0 {
finishProgressList = append(finishProgressList, 0)
}
if questDataConfig.FinishCondType3 != 0 {
finishProgressList = append(finishProgressList, 0)
}
questListNotify.QuestList = append(questListNotify.QuestList, &proto.Quest{
QuestId: uint32(questDataConfig.QuestId),
State: 1,
StartTime: uint32(time.Now().Unix()),
ParentQuestId: uint32(questDataConfig.ParentQuestId),
StartGameTime: 0,
AcceptTime: uint32(time.Now().Unix()),
FinishProgressList: finishProgressList,
})
}
g.SendMsg(cmd.QuestListNotify, userId, clientSeq, questListNotify)
}
func (g *GameManager) PacketPlayerDataNotify(player *model.Player) *proto.PlayerDataNotify {