mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-03-01 00:35:36 +08:00
修复场景小组配置id读取顺序问题
This commit is contained in:
@@ -59,6 +59,7 @@ type GameDataConfig struct {
|
|||||||
ReliquaryMainDataMap map[int32]map[int32]*ReliquaryMainData // 圣遗物主属性
|
ReliquaryMainDataMap map[int32]map[int32]*ReliquaryMainData // 圣遗物主属性
|
||||||
ReliquaryAffixDataMap map[int32]map[int32]*ReliquaryAffixData // 圣遗物追加属性
|
ReliquaryAffixDataMap map[int32]map[int32]*ReliquaryAffixData // 圣遗物追加属性
|
||||||
QuestDataMap map[int32]*QuestData // 任务
|
QuestDataMap map[int32]*QuestData // 任务
|
||||||
|
ParentQuestMap map[int32]map[int32]*QuestData // 父任务索引
|
||||||
DropDataMap map[int32]*DropData // 掉落
|
DropDataMap map[int32]*DropData // 掉落
|
||||||
MonsterDropDataMap map[string]map[int32]*MonsterDropData // 怪物掉落
|
MonsterDropDataMap map[string]map[int32]*MonsterDropData // 怪物掉落
|
||||||
ChestDropDataMap map[string]map[int32]*ChestDropData // 宝箱掉落
|
ChestDropDataMap map[string]map[int32]*ChestDropData // 宝箱掉落
|
||||||
|
|||||||
@@ -373,6 +373,15 @@ func (g *GameDataConfig) loadQuestData() {
|
|||||||
g.QuestDataMap[questData.QuestId] = questData
|
g.QuestDataMap[questData.QuestId] = questData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
g.ParentQuestMap = make(map[int32]map[int32]*QuestData)
|
||||||
|
for _, questData := range g.QuestDataMap {
|
||||||
|
questMap, exist := g.ParentQuestMap[questData.ParentQuestId]
|
||||||
|
if !exist {
|
||||||
|
questMap = make(map[int32]*QuestData)
|
||||||
|
g.ParentQuestMap[questData.ParentQuestId] = questMap
|
||||||
|
}
|
||||||
|
questMap[questData.QuestId] = questData
|
||||||
|
}
|
||||||
logger.Info("QuestData count: %v", len(g.QuestDataMap))
|
logger.Info("QuestData count: %v", len(g.QuestDataMap))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -383,3 +392,7 @@ func GetQuestDataById(questId int32) *QuestData {
|
|||||||
func GetQuestDataMap() map[int32]*QuestData {
|
func GetQuestDataMap() map[int32]*QuestData {
|
||||||
return CONF.QuestDataMap
|
return CONF.QuestDataMap
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetQuestDataMapByParentQuestId(parentQuestId int32) map[int32]*QuestData {
|
||||||
|
return CONF.ParentQuestMap[parentQuestId]
|
||||||
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ type Group struct {
|
|||||||
RegionMap map[int32]*Region `json:"-"` // 区域
|
RegionMap map[int32]*Region `json:"-"` // 区域
|
||||||
TriggerMap map[string]*Trigger `json:"-"` // 触发器
|
TriggerMap map[string]*Trigger `json:"-"` // 触发器
|
||||||
GroupInitConfig *GroupInitConfig `json:"-"` // 初始化配置
|
GroupInitConfig *GroupInitConfig `json:"-"` // 初始化配置
|
||||||
SuiteList []*Suite `json:"-"` // 小组配置
|
SuiteMap map[int32]*Suite `json:"-"` // 小组配置
|
||||||
LuaStr string `json:"-"` // LUA原始字符串缓存
|
LuaStr string `json:"-"` // LUA原始字符串缓存
|
||||||
LuaState *lua.LState `json:"-"` // LUA虚拟机实例
|
LuaState *lua.LState `json:"-"` // LUA虚拟机实例
|
||||||
}
|
}
|
||||||
@@ -241,8 +241,8 @@ func (g *GameDataConfig) loadGroup(group *Group, block *Block, sceneId int32, bl
|
|||||||
if len(suiteLuaTableList) == 0 {
|
if len(suiteLuaTableList) == 0 {
|
||||||
// logger.Debug("get suites object is nil, sceneId: %v, blockId: %v, groupId: %v", sceneId, blockId, groupId)
|
// logger.Debug("get suites object is nil, sceneId: %v, blockId: %v, groupId: %v", sceneId, blockId, groupId)
|
||||||
}
|
}
|
||||||
group.SuiteList = make([]*Suite, 0)
|
group.SuiteMap = make(map[int32]*Suite)
|
||||||
for _, suiteLuaTable := range suiteLuaTableList {
|
for index, suiteLuaTable := range suiteLuaTableList {
|
||||||
suite := &Suite{
|
suite := &Suite{
|
||||||
MonsterConfigIdList: make([]int32, 0),
|
MonsterConfigIdList: make([]int32, 0),
|
||||||
GadgetConfigIdList: make([]int32, 0),
|
GadgetConfigIdList: make([]int32, 0),
|
||||||
@@ -274,7 +274,7 @@ func (g *GameDataConfig) loadGroup(group *Group, block *Block, sceneId int32, bl
|
|||||||
suite.TriggerNameList = append(suite.TriggerNameList, nameAny.(string))
|
suite.TriggerNameList = append(suite.TriggerNameList, nameAny.(string))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
group.SuiteList = append(group.SuiteList, suite)
|
group.SuiteMap[int32(len(suiteLuaTableList)-index)] = suite
|
||||||
}
|
}
|
||||||
luaState.Close()
|
luaState.Close()
|
||||||
block.groupMapLoadLock.Lock()
|
block.groupMapLoadLock.Lock()
|
||||||
|
|||||||
@@ -337,12 +337,11 @@ func (s *Scene) AddGroupSuite(groupId uint32, suiteId uint8) {
|
|||||||
logger.Error("get scene group config is nil, groupId: %v", groupId)
|
logger.Error("get scene group config is nil, groupId: %v", groupId)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
suiteIndex := suiteId - 1
|
suiteConfig, exist := groupConfig.SuiteMap[int32(suiteId)]
|
||||||
if int(suiteIndex) >= len(groupConfig.SuiteList) {
|
if !exist {
|
||||||
logger.Error("invalid suiteId: %v", suiteId)
|
logger.Error("invalid suiteId: %v", suiteId)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
suiteConfig := groupConfig.SuiteList[suiteIndex]
|
|
||||||
suite := &Suite{
|
suite := &Suite{
|
||||||
entityMap: make(map[uint32]*Entity),
|
entityMap: make(map[uint32]*Entity),
|
||||||
}
|
}
|
||||||
@@ -459,9 +458,9 @@ func getTempFightPropMap() map[uint32]float32 {
|
|||||||
constant.FIGHT_PROP_CUR_ATTACK: float32(50.0),
|
constant.FIGHT_PROP_CUR_ATTACK: float32(50.0),
|
||||||
constant.FIGHT_PROP_BASE_DEFENSE: float32(500.0),
|
constant.FIGHT_PROP_BASE_DEFENSE: float32(500.0),
|
||||||
constant.FIGHT_PROP_CUR_DEFENSE: float32(500.0),
|
constant.FIGHT_PROP_CUR_DEFENSE: float32(500.0),
|
||||||
constant.FIGHT_PROP_BASE_HP: float32(10000.0),
|
constant.FIGHT_PROP_BASE_HP: float32(5000.0),
|
||||||
constant.FIGHT_PROP_CUR_HP: float32(10000.0),
|
constant.FIGHT_PROP_CUR_HP: float32(5000.0),
|
||||||
constant.FIGHT_PROP_MAX_HP: float32(10000.0),
|
constant.FIGHT_PROP_MAX_HP: float32(5000.0),
|
||||||
constant.FIGHT_PROP_PHYSICAL_SUB_HURT: float32(0.1),
|
constant.FIGHT_PROP_PHYSICAL_SUB_HURT: float32(0.1),
|
||||||
constant.FIGHT_PROP_ICE_SUB_HURT: float32(0.1),
|
constant.FIGHT_PROP_ICE_SUB_HURT: float32(0.1),
|
||||||
constant.FIGHT_PROP_FIRE_SUB_HURT: float32(0.1),
|
constant.FIGHT_PROP_FIRE_SUB_HURT: float32(0.1),
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ func (g *Game) SceneRegionTriggerCheck(player *model.Player, scene *Scene, oldPo
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
for suiteId := range group.GetAllSuite() {
|
for suiteId := range group.GetAllSuite() {
|
||||||
suiteConfig := groupConfig.SuiteList[suiteId-1]
|
suiteConfig := groupConfig.SuiteMap[int32(suiteId)]
|
||||||
for _, regionConfigId := range suiteConfig.RegionConfigIdList {
|
for _, regionConfigId := range suiteConfig.RegionConfigIdList {
|
||||||
regionConfig := groupConfig.RegionMap[regionConfigId]
|
regionConfig := groupConfig.RegionMap[regionConfigId]
|
||||||
if regionConfig == nil {
|
if regionConfig == nil {
|
||||||
@@ -115,7 +115,7 @@ func (g *Game) MonsterDieTriggerCheck(player *model.Player, groupId uint32, grou
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
for suiteId := range group.GetAllSuite() {
|
for suiteId := range group.GetAllSuite() {
|
||||||
suiteConfig := groupConfig.SuiteList[suiteId-1]
|
suiteConfig := groupConfig.SuiteMap[int32(suiteId)]
|
||||||
for _, triggerName := range suiteConfig.TriggerNameList {
|
for _, triggerName := range suiteConfig.TriggerNameList {
|
||||||
triggerConfig := groupConfig.TriggerMap[triggerName]
|
triggerConfig := groupConfig.TriggerMap[triggerName]
|
||||||
if triggerConfig.Event != constant.LUA_EVENT_ANY_MONSTER_DIE {
|
if triggerConfig.Event != constant.LUA_EVENT_ANY_MONSTER_DIE {
|
||||||
@@ -157,7 +157,7 @@ func (g *Game) QuestStartTriggerCheck(player *model.Player, questId uint32) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
for suiteId := range group.GetAllSuite() {
|
for suiteId := range group.GetAllSuite() {
|
||||||
suiteConfig := groupConfig.SuiteList[suiteId-1]
|
suiteConfig := groupConfig.SuiteMap[int32(suiteId)]
|
||||||
for _, triggerName := range suiteConfig.TriggerNameList {
|
for _, triggerName := range suiteConfig.TriggerNameList {
|
||||||
triggerConfig := groupConfig.TriggerMap[triggerName]
|
triggerConfig := groupConfig.TriggerMap[triggerName]
|
||||||
if triggerConfig.Event != constant.LUA_EVENT_QUEST_START {
|
if triggerConfig.Event != constant.LUA_EVENT_QUEST_START {
|
||||||
|
|||||||
@@ -316,6 +316,13 @@ func (g *Game) AbilityInvocationsNotify(player *model.Player, payloadMsg pb.Mess
|
|||||||
// logger.Debug("AbilityInvocationsNotify: %v", entry, player.PlayerID)
|
// logger.Debug("AbilityInvocationsNotify: %v", entry, player.PlayerID)
|
||||||
switch entry.ArgumentType {
|
switch entry.ArgumentType {
|
||||||
case proto.AbilityInvokeArgument_ABILITY_META_MODIFIER_CHANGE:
|
case proto.AbilityInvokeArgument_ABILITY_META_MODIFIER_CHANGE:
|
||||||
|
modifierChange := new(proto.AbilityMetaModifierChange)
|
||||||
|
err := pb.Unmarshal(entry.AbilityData, modifierChange)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("parse AbilityMetaModifierChange error: %v", err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
// logger.Error("MC: %v", modifierChange)
|
||||||
worldAvatar := world.GetWorldAvatarByEntityId(entry.EntityId)
|
worldAvatar := world.GetWorldAvatarByEntityId(entry.EntityId)
|
||||||
if worldAvatar != nil {
|
if worldAvatar != nil {
|
||||||
for _, ability := range worldAvatar.abilityList {
|
for _, ability := range worldAvatar.abilityList {
|
||||||
|
|||||||
@@ -116,8 +116,6 @@ func (g *Game) OnLoginOk(userId uint32, clientSeq uint32, gateAppId string, isRe
|
|||||||
TICK_MANAGER.CreateUserGlobalTick(userId)
|
TICK_MANAGER.CreateUserGlobalTick(userId)
|
||||||
TICK_MANAGER.CreateUserTimer(userId, UserTimerActionTest, 100, player.NickName)
|
TICK_MANAGER.CreateUserTimer(userId, UserTimerActionTest, 100, player.NickName)
|
||||||
|
|
||||||
g.AcceptQuest(player, true)
|
|
||||||
|
|
||||||
atomic.AddInt32(&ONLINE_PLAYER_NUM, 1)
|
atomic.AddInt32(&ONLINE_PLAYER_NUM, 1)
|
||||||
|
|
||||||
SELF = nil
|
SELF = nil
|
||||||
@@ -240,6 +238,7 @@ func (g *Game) LoginNotify(userId uint32, player *model.Player, clientSeq uint32
|
|||||||
g.SendMsg(cmd.AvatarDataNotify, userId, clientSeq, g.PacketAvatarDataNotify(player))
|
g.SendMsg(cmd.AvatarDataNotify, userId, clientSeq, g.PacketAvatarDataNotify(player))
|
||||||
g.SendMsg(cmd.OpenStateUpdateNotify, userId, clientSeq, g.PacketOpenStateUpdateNotify())
|
g.SendMsg(cmd.OpenStateUpdateNotify, userId, clientSeq, g.PacketOpenStateUpdateNotify())
|
||||||
g.SendMsg(cmd.QuestListNotify, userId, clientSeq, g.PacketQuestListNotify(player))
|
g.SendMsg(cmd.QuestListNotify, userId, clientSeq, g.PacketQuestListNotify(player))
|
||||||
|
g.SendMsg(cmd.FinishedParentQuestNotify, userId, clientSeq, g.PacketFinishedParentQuestNotify(player))
|
||||||
// g.GCGLogin(player) // 发送GCG登录相关的通知包
|
// g.GCGLogin(player) // 发送GCG登录相关的通知包
|
||||||
playerLoginRsp := &proto.PlayerLoginRsp{
|
playerLoginRsp := &proto.PlayerLoginRsp{
|
||||||
IsUseAbilityHash: true,
|
IsUseAbilityHash: true,
|
||||||
|
|||||||
@@ -19,7 +19,9 @@ func (g *Game) AddQuestContentProgressReq(player *model.Player, payloadMsg pb.Me
|
|||||||
req := payloadMsg.(*proto.AddQuestContentProgressReq)
|
req := payloadMsg.(*proto.AddQuestContentProgressReq)
|
||||||
logger.Debug("AddQuestContentProgressReq: %v", req)
|
logger.Debug("AddQuestContentProgressReq: %v", req)
|
||||||
|
|
||||||
g.AddQuestProgress(player, req)
|
g.TriggerQuest(player, int32(req.ContentType), "", int32(req.Param))
|
||||||
|
|
||||||
|
// g.AddQuestProgress(player, req)
|
||||||
|
|
||||||
rsp := &proto.AddQuestContentProgressRsp{
|
rsp := &proto.AddQuestContentProgressRsp{
|
||||||
ContentType: req.ContentType,
|
ContentType: req.ContentType,
|
||||||
@@ -225,11 +227,23 @@ func (g *Game) TriggerQuest(player *model.Player, cond int32, complexParam strin
|
|||||||
if questDataConfig == nil {
|
if questDataConfig == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
// TODO 实在不知道客户端要在怎样的情况下 才会发长按10006这个技能 这里先临时改表解决了
|
||||||
|
// 是走ability体系计算出来的 操了
|
||||||
|
if questDataConfig.QuestId == 35303 {
|
||||||
|
questDataConfig.FinishCondList[0].Param[0] = 10067
|
||||||
|
}
|
||||||
for _, questCond := range questDataConfig.FinishCondList {
|
for _, questCond := range questDataConfig.FinishCondList {
|
||||||
if questCond.Type != cond {
|
if questCond.Type != cond {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
switch cond {
|
switch cond {
|
||||||
|
case constant.QUEST_FINISH_COND_TYPE_FINISH_PLOT:
|
||||||
|
ok := matchParamEqual(questCond.Param, param, 1)
|
||||||
|
if !ok {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
dbQuest.ForceFinishQuest(quest.QuestId)
|
||||||
|
updateQuestIdList = append(updateQuestIdList, quest.QuestId)
|
||||||
case constant.QUEST_FINISH_COND_TYPE_TRIGGER_FIRE:
|
case constant.QUEST_FINISH_COND_TYPE_TRIGGER_FIRE:
|
||||||
// 场景触发器跳了 参数1:触发器id
|
// 场景触发器跳了 参数1:触发器id
|
||||||
ok := matchParamEqual(questCond.Param, param, 1)
|
ok := matchParamEqual(questCond.Param, param, 1)
|
||||||
@@ -273,17 +287,63 @@ func (g *Game) TriggerQuest(player *model.Player, cond int32, complexParam strin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(updateQuestIdList) > 0 {
|
if len(updateQuestIdList) > 0 {
|
||||||
ntf := &proto.QuestListUpdateNotify{
|
questList := make([]*proto.Quest, 0)
|
||||||
QuestList: make([]*proto.Quest, 0),
|
|
||||||
}
|
|
||||||
for _, questId := range updateQuestIdList {
|
for _, questId := range updateQuestIdList {
|
||||||
pbQuest := g.PacketQuest(player, questId)
|
pbQuest := g.PacketQuest(player, questId)
|
||||||
if pbQuest == nil {
|
if pbQuest == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
ntf.QuestList = append(ntf.QuestList, pbQuest)
|
questList = append(questList, pbQuest)
|
||||||
|
}
|
||||||
|
g.SendMsg(cmd.QuestListUpdateNotify, player.PlayerID, player.ClientSeq, &proto.QuestListUpdateNotify{
|
||||||
|
QuestList: questList,
|
||||||
|
})
|
||||||
|
parentQuestList := make([]*proto.ParentQuest, 0)
|
||||||
|
parentQuestMap := make(map[int32]bool)
|
||||||
|
for _, questId := range updateQuestIdList {
|
||||||
|
questDataConfig := gdconf.GetQuestDataById(int32(questId))
|
||||||
|
if questDataConfig == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
_, exist := parentQuestMap[questDataConfig.ParentQuestId]
|
||||||
|
if exist {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
parentQuestMap[questDataConfig.ParentQuestId] = true
|
||||||
|
finishedParentQuest := true
|
||||||
|
subQuestDataMap := gdconf.GetQuestDataMapByParentQuestId(questDataConfig.ParentQuestId)
|
||||||
|
for _, subQuestData := range subQuestDataMap {
|
||||||
|
quest := dbQuest.GetQuestById(uint32(subQuestData.QuestId))
|
||||||
|
if quest == nil {
|
||||||
|
finishedParentQuest = false
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if quest.State != constant.QUEST_STATE_FINISHED {
|
||||||
|
finishedParentQuest = false
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if finishedParentQuest {
|
||||||
|
childQuestList := make([]*proto.ChildQuest, 0)
|
||||||
|
for _, subQuestData := range subQuestDataMap {
|
||||||
|
childQuestList = append(childQuestList, &proto.ChildQuest{
|
||||||
|
State: constant.QUEST_STATE_FINISHED,
|
||||||
|
QuestId: uint32(subQuestData.QuestId),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
parentQuestList = append(parentQuestList, &proto.ParentQuest{
|
||||||
|
ParentQuestId: uint32(questDataConfig.ParentQuestId),
|
||||||
|
ParentQuestState: 1,
|
||||||
|
IsFinished: true,
|
||||||
|
ChildQuestList: childQuestList,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(parentQuestList) > 0 {
|
||||||
|
g.SendMsg(cmd.FinishedParentQuestUpdateNotify, player.PlayerID, player.ClientSeq, &proto.FinishedParentQuestUpdateNotify{
|
||||||
|
ParentQuestList: parentQuestList,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
g.SendMsg(cmd.QuestListUpdateNotify, player.PlayerID, player.ClientSeq, ntf)
|
|
||||||
g.AcceptQuest(player, true)
|
g.AcceptQuest(player, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -315,7 +375,7 @@ func (g *Game) PacketQuest(player *model.Player, questId uint32) *proto.Quest {
|
|||||||
|
|
||||||
// PacketQuestListNotify 打包任务列表通知
|
// PacketQuestListNotify 打包任务列表通知
|
||||||
func (g *Game) PacketQuestListNotify(player *model.Player) *proto.QuestListNotify {
|
func (g *Game) PacketQuestListNotify(player *model.Player) *proto.QuestListNotify {
|
||||||
questListNotify := &proto.QuestListNotify{
|
ntf := &proto.QuestListNotify{
|
||||||
QuestList: make([]*proto.Quest, 0),
|
QuestList: make([]*proto.Quest, 0),
|
||||||
}
|
}
|
||||||
dbQuest := player.GetDbQuest()
|
dbQuest := player.GetDbQuest()
|
||||||
@@ -324,7 +384,56 @@ func (g *Game) PacketQuestListNotify(player *model.Player) *proto.QuestListNotif
|
|||||||
if pbQuest == nil {
|
if pbQuest == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
questListNotify.QuestList = append(questListNotify.QuestList, pbQuest)
|
ntf.QuestList = append(ntf.QuestList, pbQuest)
|
||||||
}
|
}
|
||||||
return questListNotify
|
return ntf
|
||||||
|
}
|
||||||
|
|
||||||
|
// PacketFinishedParentQuestNotify 打包已完成父任务列表通知
|
||||||
|
func (g *Game) PacketFinishedParentQuestNotify(player *model.Player) *proto.FinishedParentQuestNotify {
|
||||||
|
ntf := &proto.FinishedParentQuestNotify{
|
||||||
|
ParentQuestList: make([]*proto.ParentQuest, 0),
|
||||||
|
}
|
||||||
|
dbQuest := player.GetDbQuest()
|
||||||
|
parentQuestMap := make(map[int32]bool)
|
||||||
|
for questId := range dbQuest.GetQuestMap() {
|
||||||
|
questDataConfig := gdconf.GetQuestDataById(int32(questId))
|
||||||
|
if questDataConfig == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
_, exist := parentQuestMap[questDataConfig.ParentQuestId]
|
||||||
|
if exist {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
parentQuestMap[questDataConfig.ParentQuestId] = true
|
||||||
|
finishedParentQuest := true
|
||||||
|
subQuestDataMap := gdconf.GetQuestDataMapByParentQuestId(questDataConfig.ParentQuestId)
|
||||||
|
for _, subQuestData := range subQuestDataMap {
|
||||||
|
quest := dbQuest.GetQuestById(uint32(subQuestData.QuestId))
|
||||||
|
if quest == nil {
|
||||||
|
finishedParentQuest = false
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if quest.State != constant.QUEST_STATE_FINISHED {
|
||||||
|
finishedParentQuest = false
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if finishedParentQuest {
|
||||||
|
childQuestList := make([]*proto.ChildQuest, 0)
|
||||||
|
for _, subQuestData := range subQuestDataMap {
|
||||||
|
childQuestList = append(childQuestList, &proto.ChildQuest{
|
||||||
|
State: constant.QUEST_STATE_FINISHED,
|
||||||
|
QuestId: uint32(subQuestData.QuestId),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
ntf.ParentQuestList = append(ntf.ParentQuestList, &proto.ParentQuest{
|
||||||
|
ParentQuestId: uint32(questDataConfig.ParentQuestId),
|
||||||
|
ParentQuestState: 1,
|
||||||
|
IsFinished: true,
|
||||||
|
ChildQuestList: childQuestList,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ntf
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -651,8 +651,9 @@ func (g *Game) GetNeighborGroup(sceneId uint32, pos *model.Vector) map[uint32]*g
|
|||||||
|
|
||||||
// AddSceneGroup 加载场景组
|
// AddSceneGroup 加载场景组
|
||||||
func (g *Game) AddSceneGroup(player *model.Player, scene *Scene, groupConfig *gdconf.Group) {
|
func (g *Game) AddSceneGroup(player *model.Player, scene *Scene, groupConfig *gdconf.Group) {
|
||||||
initSuiteId := int(groupConfig.GroupInitConfig.Suite)
|
initSuiteId := groupConfig.GroupInitConfig.Suite
|
||||||
if initSuiteId < 1 || initSuiteId > len(groupConfig.SuiteList) {
|
_, exist := groupConfig.SuiteMap[initSuiteId]
|
||||||
|
if !exist {
|
||||||
logger.Error("invalid init suite id: %v, uid: %v", initSuiteId, player.PlayerID)
|
logger.Error("invalid init suite id: %v, uid: %v", initSuiteId, player.PlayerID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -689,7 +690,8 @@ func (g *Game) AddSceneGroupSuite(player *model.Player, groupId uint32, suiteId
|
|||||||
logger.Error("get group config is nil, groupId: %v, uid: %v", groupId, player.PlayerID)
|
logger.Error("get group config is nil, groupId: %v, uid: %v", groupId, player.PlayerID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if suiteId < 1 || suiteId > uint8(len(groupConfig.SuiteList)) {
|
_, exist := groupConfig.SuiteMap[int32(suiteId)]
|
||||||
|
if !exist {
|
||||||
logger.Error("invalid suite id: %v, uid: %v", suiteId, player.PlayerID)
|
logger.Error("invalid suite id: %v, uid: %v", suiteId, player.PlayerID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -719,8 +721,9 @@ func (g *Game) AddSceneGroupMonster(player *model.Player, groupId uint32, monste
|
|||||||
logger.Error("get group config is nil, groupId: %v, uid: %v", groupId, player.PlayerID)
|
logger.Error("get group config is nil, groupId: %v, uid: %v", groupId, player.PlayerID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
initSuiteId := int(groupConfig.GroupInitConfig.Suite)
|
initSuiteId := groupConfig.GroupInitConfig.Suite
|
||||||
if initSuiteId < 1 || initSuiteId > len(groupConfig.SuiteList) {
|
_, exist := groupConfig.SuiteMap[initSuiteId]
|
||||||
|
if !exist {
|
||||||
logger.Error("invalid init suite id: %v, uid: %v", initSuiteId, player.PlayerID)
|
logger.Error("invalid init suite id: %v, uid: %v", initSuiteId, player.PlayerID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ func (g *Game) HandleAbilityStamina(player *model.Player, entry *proto.AbilityIn
|
|||||||
hashCode := endec.Hk4eAbilityHashCode(avatarSkillData.AbilityName)
|
hashCode := endec.Hk4eAbilityHashCode(avatarSkillData.AbilityName)
|
||||||
if uint32(hashCode) == abilityNameHashCode {
|
if uint32(hashCode) == abilityNameHashCode {
|
||||||
avatarAbility = avatarSkillData
|
avatarAbility = avatarSkillData
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if avatarAbility == nil {
|
if avatarAbility == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user