Update - 1.12.0.120

EN: 1.12.0.120
CN: 1.12.0.120
JP: 1.12.0.124
KR: 1.12.0.124
This commit is contained in:
SL1900
2026-06-30 14:30:00 +09:00
parent 061d344bf2
commit 80af235e05
826 changed files with 625145 additions and 81163 deletions
+2 -1
View File
@@ -1299,7 +1299,8 @@ AllEnum.OptionType = {
AllEnum.RewardType = {
First = 1,
Three = 2,
Extra = 3
Extra = 3,
Double = 4
}
AllEnum.FormationEnterType = {
MainLine = 0,
@@ -685,7 +685,8 @@ function ActivityAvgData:RefreshAvgRedDot()
end
local actGroupData = PlayerData.Activity:GetActivityGroupDataById(nActGroupId)
local bActGroupUnlock = actGroupData:IsUnlock()
local bNew = isUnlock and isNew and not isClicked and isOpen and bActGroupUnlock
local bActGroupOpen = actGroupData:CheckActivityGroupOpen()
local bNew = isUnlock and isNew and not isClicked and isOpen and bActGroupUnlock and bActGroupOpen
if bNew == true then
tbActGroupRedDot[nActGroupId] = true
end
@@ -973,6 +974,7 @@ function ActivityAvgData:SendMsg_STORY_DONE(callBack, tbBattleEvents)
end
self.mapTempCL = {}
self.mapTempLatestCnt = {}
local sOldPid = PlayerData.Avg:GetPersonalityId()
func_overwrite(self.mapTempPersonality, self.mapPersonality)
self.mapTempPersonality = {}
self.mapTempPersonalityCnt = {}
@@ -981,6 +983,7 @@ function ActivityAvgData:SendMsg_STORY_DONE(callBack, tbBattleEvents)
local actChapterConfig = ConfigTable.GetData("ActivityStoryChapter", self.CURRENT_ACTIVITY_ID)
local tbActPersonality, tbActPersonalityFactor = self:_FilterPersonalityByChapter(actChapterConfig.ChapterId)
PlayerData.Avg:RefreshActPersonalityData(actChapterConfig.ChapterId, tbActPersonality, tbActPersonalityFactor)
PlayerData.Avg:PersonalityChangedUpload(sOldPid)
if callBack ~= nil then
callBack(mapChangeInfo)
end
@@ -0,0 +1,169 @@
local ActivityDataBase = require("GameCore.Data.DataClass.Activity.ActivityDataBase")
local DoubleDropsActData = class("DoubleDropsActData", ActivityDataBase)
local mapInsType = {
[GameEnum.instanceType.DailyInstance] = GameEnum.OpenFuncType.DailyInstance,
[GameEnum.instanceType.RegionBoss] = GameEnum.OpenFuncType.RegionBoss,
[GameEnum.instanceType.SkillInstance] = GameEnum.OpenFuncType.SkillInstance,
[GameEnum.instanceType.CharGemInstance] = GameEnum.OpenFuncType.CharGemInstance
}
function DoubleDropsActData:Init()
self.nDailyUseTimes = 0
self.nDailyMaxTimes = 0
self.tbInstanceType = {}
self.tbOpenFuncType = {}
self.nRewardType = 0
self.tbQuests = {}
self:InitConfig()
end
function DoubleDropsActData:InitConfig()
if CacheTable.Get("_ActivityDoubleQuest") == nil or next(CacheTable.Get("_ActivityDoubleQuest")) == nil then
local funcForeach = function(mapData)
CacheTable.InsertData("_ActivityDoubleQuest", mapData.ActivityId, mapData)
end
ForEachTableLine(ConfigTable.Get("ActivityDoubleQuest"), funcForeach)
end
local mapDoubleCfg = ConfigTable.GetData("ActivityDouble", self.nActId)
if mapDoubleCfg == nil then
return
end
self.nDailyMaxTimes = mapDoubleCfg.DailyTimes
self.tbInstanceType = mapDoubleCfg.InstanceType
self.tbOpenFuncType = {}
for _, v in ipairs(mapDoubleCfg.InstanceType) do
table.insert(self.tbOpenFuncType, mapInsType[v])
end
self.nRewardType = mapDoubleCfg.RewardType
end
function DoubleDropsActData:RefreshDoubleDropsActData(nActId, msgData)
self.nDailyUseTimes = msgData.DailyUseTimes
if msgData.Quests == nil or #msgData.Quests == 0 then
self.tbQuests = {}
local tbQuest = CacheTable.GetData("_ActivityDoubleQuest", nActId)
if tbQuest ~= nil then
for _, v in ipairs(tbQuest) do
local tbJson = decodeJson(v.QuestParams)
local questData = {
nId = v.Id,
nStatus = AllEnum.ActQuestStatus.UnComplete,
progress = {
Cur = 0,
Max = tbJson[#tbJson]
}
}
table.insert(self.tbQuests, questData)
end
end
else
self:CacheAllQuestData(msgData.Quests)
end
end
function DoubleDropsActData:UpdateDoubleCount(nCount)
self.nDailyUseTimes = nCount
end
function DoubleDropsActData:QuestServer2Client(nStatus)
if nStatus == 0 then
return AllEnum.ActQuestStatus.UnComplete
elseif nStatus == 1 then
return AllEnum.ActQuestStatus.Complete
else
return AllEnum.ActQuestStatus.Received
end
end
function DoubleDropsActData:CacheAllQuestData(questListData)
self.tbQuests = {}
for _, v in pairs(questListData) do
local questData = {
nId = v.Id,
nStatus = self:QuestServer2Client(v.Status),
progress = v.Progress[1]
}
table.insert(self.tbQuests, questData)
end
self:RefreshRedDot()
end
function DoubleDropsActData:RefreshQuestData(msgData)
local questData = {
nId = msgData.Id,
nStatus = self:QuestServer2Client(msgData.Status),
progress = msgData.Progress[1]
}
for k, v in ipairs(self.tbQuests) do
if v.nId == msgData.Id then
self.tbQuests[k] = questData
break
end
end
self:RefreshRedDot()
end
function DoubleDropsActData:RefreshRedDot()
local bRedDot = false
for _, questData in ipairs(self.tbQuests) do
bRedDot = bRedDot or questData.nStatus == AllEnum.ActQuestStatus.Complete
if bRedDot then
break
end
end
RedDotManager.SetValid(RedDotDefine.Activity_Tab, self.nActId, bRedDot)
RedDotManager.SetValid(RedDotDefine.Activity_DoubleDrop_Quest, self.nActId, bRedDot)
end
function DoubleDropsActData:GetAllQuests()
return self.tbQuests
end
function DoubleDropsActData:GetDoubleDropsTimes()
return self.nDailyUseTimes, self.nDailyMaxTimes
end
function DoubleDropsActData:GetDoubleFuncType()
return self.tbOpenFuncType
end
function DoubleDropsActData:GetInstanceType()
return self.tbInstanceType
end
function DoubleDropsActData:CheckInstanceType(nType)
return table.indexof(self.tbInstanceType, nType) > 0
end
function DoubleDropsActData:GetRewardType()
return self.nRewardType
end
function DoubleDropsActData:GetDropString()
local str1, str2 = "", ""
if self.nRewardType == GameEnum.activityDoubleRewardType.Double then
str1 = orderedFormat(ConfigTable.GetUIText("Double_Drops_Double_Count_1"), self.nDailyMaxTimes - self.nDailyUseTimes, self.nDailyMaxTimes)
str2 = ConfigTable.GetUIText("Double_Drops_Double_Count_2")
elseif self.nRewardType == GameEnum.activityDoubleRewardType.Triple then
str1 = orderedFormat(ConfigTable.GetUIText("Double_Drops_Triple_Count_1"), self.nDailyMaxTimes - self.nDailyUseTimes, self.nDailyMaxTimes)
str2 = ConfigTable.GetUIText("Double_Drops_Triple_Count_2")
end
return str1, str2
end
function DoubleDropsActData:GetDropActString()
local str = ""
if self.nRewardType == GameEnum.activityDoubleRewardType.Double then
str = orderedFormat(ConfigTable.GetUIText("Double_Drops_Act_Double_Count"), self.nDailyMaxTimes - self.nDailyUseTimes, self.nDailyMaxTimes)
elseif self.nRewardType == GameEnum.activityDoubleRewardType.Triple then
str = orderedFormat(ConfigTable.GetUIText("Double_Drops_Triple_Count_1"), self.nDailyMaxTimes - self.nDailyUseTimes, self.nDailyMaxTimes)
end
return str
end
function DoubleDropsActData:SendReceiveQuestReward(nQuestId, callback)
local netCallback = function(_, netMsg)
for k, v in ipairs(self.tbQuests) do
if v.nStatus == AllEnum.ActQuestStatus.Complete then
v.nStatus = AllEnum.ActQuestStatus.Received
end
end
self:RefreshRedDot()
local receiveCallback = function()
if type(callback) == "function" then
callback()
end
EventManager.Hit("ReceiveDoubleDropQuest")
end
UTILS.OpenReceiveByChangeInfo(netMsg, receiveCallback)
end
local mapSendMsg = {
ActivityId = self.nActId,
QuestId = nQuestId or 0
}
HttpNetHandler.SendMsg(NetMsgId.Id.activity_double_quest_reward_receive_req, mapSendMsg, nil, netCallback)
end
return DoubleDropsActData
@@ -12,6 +12,8 @@ function GoldenSpyData:Init()
self.tbLevelData = {}
self.cacheEnterFloorList = {}
self:AddListeners()
self.nGroupId = 0
self.nLevelId = 0
end
function GoldenSpyData:AddListeners()
EventManager.Add(EventId.IsNewDay, self, self.OnEvent_NewDay)
@@ -174,7 +176,13 @@ function GoldenSpyData:RefreshRedDot()
end
local actGroupId = ConfigTable.GetData("Activity", self.nActId).MidGroupId
for _, groupData in pairs(self.tbLevelGroupData) do
if CS.ClientManager.Instance.serverTimeStamp < groupData.nStartTime and groupData.nStartTime ~= 0 then
local isOpen = self:CheckActivityOpen()
if not isOpen then
RedDotManager.SetValid(RedDotDefine.Activity_GoldenSpy_Group, {
actGroupId,
groupData.nId
}, false)
elseif CS.ClientManager.Instance.serverTimeStamp < groupData.nStartTime and groupData.nStartTime ~= 0 then
RedDotManager.SetValid(RedDotDefine.Activity_GoldenSpy_Group, {
actGroupId,
groupData.nId
@@ -194,9 +202,17 @@ function GoldenSpyData:RefreshRedDot()
end
function GoldenSpyData:StartLevel(groupId, levelId)
self.nGroupId = groupId
self.nLevelId = levelId
self.GoldenSpyLevelData:InitData()
self.GoldenSpyLevelData:StartLevel(levelId)
EventManager.Hit(EventId.OpenPanel, PanelId.GoldenSpyPanel, self.nActId, self.nGroupId, levelId)
local config = ConfigTable.GetData("GoldenSpyControl", self.nActId)
if config == nil then
return
end
EventManager.Hit(EventId.OpenPanel, config.LevelPanelId, self.nActId, self.nGroupId, levelId)
end
function GoldenSpyData:GetLastLevelData()
return self.nGroupId, self.nLevelId
end
function GoldenSpyData:FinishLevel(levelId, data, callback)
local items = {}
@@ -221,7 +237,7 @@ function GoldenSpyData:FinishLevel(levelId, data, callback)
Items = items,
Skills = skills
}
local callback = function(_, msgData)
local msgCallback = function(_, msgData)
local oldLevelData = self:GetLevelDataById(levelId)
local levelCfg = ConfigTable.GetData("GoldenSpyLevel", levelId)
local levelData = {
@@ -231,10 +247,10 @@ function GoldenSpyData:FinishLevel(levelId, data, callback)
}
self:UpdateLevelData(levelData)
if callback ~= nil then
callback()
callback(msgData)
end
end
HttpNetHandler.SendMsg(NetMsgId.Id.activity_gds_settle_req, mapMsg, nil, callback)
HttpNetHandler.SendMsg(NetMsgId.Id.activity_gds_settle_req, mapMsg, nil, msgCallback)
end
function GoldenSpyData:EnterFloor(floorId)
if table.indexof(self.cacheEnterFloorList, floorId) == 0 then
@@ -248,4 +264,53 @@ function GoldenSpyData:GetFloorIsNew(floorId)
end
return false
end
function GoldenSpyData:GetNextLevel(nGroupId, nCurLevelId)
local groupCfg = ConfigTable.GetData("GoldenSpyLevelGroup", nGroupId)
if groupCfg == nil then
return nil, nil
end
local levelList = groupCfg.LevelList
local nIndex = table.indexof(levelList, nCurLevelId)
if nIndex == 0 then
return nil, nil
end
if nIndex < #levelList then
return nGroupId, levelList[nIndex + 1]
end
local nNextGroupId = self:GetNextGroup(nGroupId)
if nNextGroupId == nil then
return nil, nil
end
local nextGroupData = self:GetLevelGroupDataById(nNextGroupId)
if nextGroupData == nil then
return nil, nil
end
local nextGroupConfig = ConfigTable.GetData("GoldenSpyLevelGroup", nNextGroupId)
if nextGroupConfig == nil then
return nil, nil
end
if CS.ClientManager.Instance.serverTimeStamp < nextGroupData.nStartTime and nextGroupData.nStartTime ~= 0 then
return nil, nil
elseif not self:CheckPreGroupPassByGroupId(nNextGroupId) then
return nil, nil
else
return nNextGroupId, nextGroupConfig.LevelList[1]
end
end
function GoldenSpyData:GetNextGroup(nCurGroupId)
local tbGroupList = ConfigTable.GetData("GoldenSpyControl", self.nActId).LevelGroupList
local nIndex = table.indexof(tbGroupList, nCurGroupId)
if nIndex == #tbGroupList then
return nil
end
return tbGroupList[nIndex + 1]
end
function GoldenSpyData:GetPreGroup(nCurGroupId)
local tbGroupList = ConfigTable.GetData("GoldenSpyControl", self.nActId).LevelGroupList
local nIndex = table.indexof(tbGroupList, nCurGroupId)
if nIndex == 1 then
return nil
end
return tbGroupList[nIndex - 1]
end
return GoldenSpyData
@@ -0,0 +1,70 @@
local ActivityGroupDataBase = require("GameCore.Data.DataClass.Activity.ActivityGroupDataBase")
local GunStorm_10109Data = class("GunStorm_10109Data", ActivityGroupDataBase)
function GunStorm_10109Data:Init()
self.tbAllActivity = {}
self.nCGActivityId = 0
self.sCGPath = ""
self.bPlayedCG = false
self:ParseActivity()
end
function GunStorm_10109Data:ParseActivity()
if self.actGroupConfig == nil then
self.actGroupConfig = ConfigTable.GetData("ActivityGroup", self.nActGroupId)
end
if self.actGroupConfig == nil then
printError("ActivityGroup config not found for id: " .. tostring(self.nActGroupId))
return
end
local sJson = self.actGroupConfig.Enter
local tbJson = decodeJson(sJson)
if tbJson == nil then
printError("ActivityGroup Enter json is nil for id: " .. tostring(self.nActGroupId))
end
for _, activity in pairs(tbJson) do
local data = {
ActivityId = activity[1],
Index = activity[2],
PanelId = activity[3]
}
table.insert(self.tbAllActivity, data)
end
local sCgJson = self.actGroupConfig.CG
if sCgJson ~= nil then
local tbCGJson = decodeJson(sCgJson)
if tbCGJson and 2 <= #tbCGJson then
self.nCGActivityId = tonumber(tbCGJson[1])
self.sCGPath = tbCGJson[2]
end
end
end
function GunStorm_10109Data:GetActivityDataByIndex(nIndex)
for _, activity in pairs(self.tbAllActivity) do
if activity.Index == nIndex then
return activity
end
end
end
function GunStorm_10109Data:PlayCG()
self:SendMsg_CG_READ(self.nCGActivityId)
end
function GunStorm_10109Data:GetActivityGroupCGPlayed()
if self.bPlayedCG then
return true
end
return PlayerData.Activity:IsCGPlayed(self.nCGActivityId)
end
function GunStorm_10109Data:IsActivityInActivityGroup(nActivityId)
for _, activity in pairs(self.tbAllActivity) do
if activity.ActivityId == nActivityId then
return true, self.nActGroupId
end
end
return false
end
function GunStorm_10109Data:SendMsg_CG_READ(nActivityId)
local Callback = function()
self.bPlayedCG = true
end
HttpNetHandler.SendMsg(NetMsgId.Id.activity_cg_read_req, {nActivityId}, nil, Callback)
end
return GunStorm_10109Data
@@ -120,7 +120,7 @@ function PeriodicQuestActData:GetCanReceiveRewardGroup()
local nGroupId = 0
local nCurDay = self:GetCurOpenDay()
for _, v in pairs(self.tbAllQuestList) do
if nCurDay >= v.nDay and v.nStatus == AllEnum.ActQuestStatus.Complete and nGroupId < v.nGroupId then
if nCurDay >= v.nDay and v.nStatus == AllEnum.ActQuestStatus.Complete and (0 == nGroupId or nGroupId > v.nGroupId) then
nGroupId = v.nGroupId
end
end
@@ -27,10 +27,12 @@ local WinterNight_10105Data = require("GameCore.Data.DataClass.Activity.WinterNi
local Postal_10106Data = require("GameCore.Data.DataClass.Activity.Postal_10106Data")
local Viewfinder_10107Data = require("GameCore.Data.DataClass.Activity.Viewfinder_10107Data")
local Tech_10108Data = require("GameCore.Data.DataClass.Activity.Tech_10108Data")
local GunStorm_10109Data = require("GameCore.Data.DataClass.Activity.GunStorm_10109Data")
local PenguinCardActData = require("GameCore.Data.DataClass.Activity.PenguinCardActData")
local GoldenSpyData = require("GameCore.Data.DataClass.Activity.GoldenSpyData")
local Solodance_20102Data = require("GameCore.Data.DataClass.Activity.Solodance_20102Data")
local SwimTheme_11100Data = require("GameCore.Data.DataClass.Activity.SwimTheme_11100Data")
local DoubleDropsActData = require("GameCore.Data.DataClass.Activity.DoubleDropsActData")
function PlayerActivityData:Init()
self.bCacheActData = false
self.tbAllActivity = {}
@@ -142,6 +144,8 @@ function PlayerActivityData:CacheAllActivityData(mapNetMsg)
self:RefreshPenguinCardActData(nActId, v.PenguinCard)
elseif actCfg.ActivityType == GameEnum.activityType.GoldenSpy then
self:RefreshGoldenSpyActData(nActId, v.GDS)
elseif actCfg.ActivityType == GameEnum.activityType.Double then
self:RefreshDoubleDropsActData(nActId, v.Double)
end
end
end
@@ -239,6 +243,8 @@ function PlayerActivityData:CreateActivityIns(actData)
actIns = PenguinCardActData.new(actData)
elseif actCfg.ActivityType == GameEnum.activityType.GoldenSpy then
actIns = GoldenSpyData.new(actData)
elseif actCfg.ActivityType == GameEnum.activityType.Double then
actIns = DoubleDropsActData.new(actData)
end
if actIns ~= nil then
self.tbAllActivity[actData.Id] = actIns
@@ -302,6 +308,13 @@ end
function PlayerActivityData:GetActivityDataById(nActId)
return self.tbAllActivity[nActId] or nil
end
function PlayerActivityData:GetActivityDataByType(nActType)
for _, v in pairs(self.tbAllActivity) do
if v:GetActType() == nActType then
return v
end
end
end
function PlayerActivityData:CacheActivityGroupData()
local foreachActGroup = function(mapData)
self:CreateActivityGroupIns(mapData)
@@ -346,6 +359,8 @@ function PlayerActivityData:CreateActivityGroupIns(actData)
actIns = SwimTheme_11100Data.new(actData)
elseif actCfg.ActivityThemeType == GameEnum.activityThemeType.Tech_10108 then
actIns = Tech_10108Data.new(actData)
elseif actCfg.ActivityThemeType == GameEnum.activityThemeType.GunStorm_10109 then
actIns = GunStorm_10109Data.new(actData)
end
self.tbAllActivityGroup[actData.Id] = actIns
PlayerData.ActivityAvg:RefreshAvgRedDot()
@@ -474,7 +489,11 @@ function PlayerActivityData:RefreshSingleQuest(questData)
if nil ~= self.tbAllActivity[questData.ActivityId] then
self.tbAllActivity[questData.ActivityId]:RefreshQuestData(questData)
end
elseif actCfg.ActivityType == GameEnum.activityType.PenguinCard and nil ~= self.tbAllActivity[questData.ActivityId] then
elseif actCfg.ActivityType == GameEnum.activityType.PenguinCard then
if nil ~= self.tbAllActivity[questData.ActivityId] then
self.tbAllActivity[questData.ActivityId]:RefreshQuestData(questData)
end
elseif actCfg.ActivityType == GameEnum.activityType.Double and nil ~= self.tbAllActivity[questData.ActivityId] then
self.tbAllActivity[questData.ActivityId]:RefreshQuestData(questData)
end
end
@@ -617,6 +636,11 @@ end
function PlayerActivityData:IsCGPlayed(nActId)
return table.indexof(self.tbReadedCG, nActId) > 0
end
function PlayerActivityData:RefreshDoubleDropsActData(nActId, msgData)
if nil ~= self.tbAllActivity[nActId] then
self.tbAllActivity[nActId]:RefreshDoubleDropsActData(nActId, msgData)
end
end
function PlayerActivityData:GetActivityBannerList()
local tbList = {}
for _, v in pairs(self.tbAllActivity) do
+28
View File
@@ -532,6 +532,30 @@ function AvgData:MarkChoosedPersonality(sAvgId, nGroupId, nIndex, nFactor)
nCurCnt = nCurCnt + 1
self.mapTempPersonalityCnt[sAvgId][nGroupId][nIndex] = nCurCnt
end
function AvgData:GetPersonalityId()
local _, _, sFace = self:CalcPersonality(1)
return sFace and tostring(sFace) or ""
end
function AvgData:PersonalityChangedUpload(sOldPersonalityId)
local sNewPersonalityId = self:GetPersonalityId()
if sOldPersonalityId == sNewPersonalityId then
return
end
local tabEvt = {}
table.insert(tabEvt, {
"before_personality",
sOldPersonalityId
})
table.insert(tabEvt, {
"after_personality",
sNewPersonalityId
})
table.insert(tabEvt, {
"role_id",
tostring(PlayerData.Base._nPlayerId)
})
NovaAPI.UserEventUpload("personality_change", tabEvt)
end
function AvgData:CalcPersonality(nId)
local cfgData_SRP = ConfigTable.GetData("StoryRolePersonality", nId)
local tbPersonalityBaseNum = cfgData_SRP.BaseValue
@@ -940,11 +964,15 @@ function AvgData:SendMsg_STORY_DONE(callBack, tbBattleEvents)
end
self.mapTempCL = {}
self.mapTempLatestCnt = {}
local sOldPid = next(self.mapTempPersonality) ~= nil and self:GetPersonalityId()
func_overwrite(self.mapTempPersonality, self.mapPersonality)
self.mapTempPersonality = {}
self.mapTempPersonalityCnt = {}
func_overwrite(self.mapTempPersonalityFactor, self.mapPersonalityFactor)
self.mapTempPersonalityFactor = {}
if sOldPid then
self:PersonalityChangedUpload(sOldPid)
end
if callBack ~= nil then
callBack(mapChangeInfo)
end
@@ -1241,6 +1241,10 @@ function PlayerBaseData:Event_CreateRole()
"role_id",
tostring(self._nPlayerId)
})
table.insert(tab_1, {
"personality_id",
PlayerData.Avg:GetPersonalityId()
})
NovaAPI.UserEventUpload("role_login", tab_1)
end
function PlayerBaseData:PrologueEventUpload(index)
@@ -241,7 +241,7 @@ function PlayerDailyInstanceData:MsgSettleDailyInstance(nLevelId, nBuildId, nSta
}
end
if callback ~= nil then
callback(mapMsgData.Select, mapMsgData.First, mapMsgData.Exp, mapMsgData.Change)
callback(mapMsgData.Select, mapMsgData.First, mapMsgData.DoubleItems, mapMsgData.Exp, mapMsgData.Change)
end
self:EventUpload(1, nLevelId, nBuildId)
end
@@ -146,6 +146,7 @@ function PlayerDiscData:GetDiscSkillByNote(tbDisc, tbHasNote, nNeedNote)
end
end
table.insert(tbSkill, {
nCurLevel = nCurLayer,
nId = nSubSkillId,
tbNote = tbNote,
nMaxLayerNoteNeed = nMaxLayerNoteNeed
@@ -205,6 +206,7 @@ function PlayerDiscData:GetDiscSkillByNoteCurrentLevel(tbDisc, tbHasNote, nNeedN
end
end
table.insert(tbSkill, {
nCurLevel = nCurLayer,
nId = nSubSkillId,
tbNote = tbNote,
nMaxLayerNoteNeed = nMaxLayerNoteNeed
@@ -219,7 +219,7 @@ function PlayerEquipmentInstanceData:MsgSettleEquipmentInstance(nLevelId, nBuild
}
end
if callback ~= nil then
callback(mapMsgData.AwardItems, mapMsgData.FirstItems, mapMsgData.SurpriseItems, mapMsgData.Exp, mapMsgData.Change)
callback(mapMsgData.AwardItems, mapMsgData.FirstItems, mapMsgData.SurpriseItems, mapMsgData.DoubleItems, mapMsgData.Exp, mapMsgData.Change)
end
self._EndTime = CS.ClientManager.Instance.serverTimeStampWithTimeZone
local tabUpLevel = {}
@@ -687,6 +687,20 @@ function PlayerMallData:CollectEnqueue(nOrderId, nType)
if not self._tbOrderCollect then
self._tbOrderCollect = {}
end
if self._bProcessingOrder and #self._tbOrderCollect == 0 then
local bHasWait = false
for _, v in pairs(self._tbWaitingOrderCollect) do
if v.nOrderId == nOrderId then
bHasWait = true
printError("订单:" .. nOrderId .. " 重复进入等待列表")
break
end
end
if not bHasWait then
table.insert(self._tbWaitingOrderCollect, {nOrderId = nOrderId, nType = nType})
end
return
end
table.insert(self._tbOrderCollect, {nOrderId = nOrderId, nType = nType})
end
function PlayerMallData:SendBattlePassOrderReq(nMode, nVersion, callback)
+162 -32
View File
@@ -6,6 +6,8 @@ function PlayerPhoneData:Init()
self.tbChatMsgCache = {}
self.tbPhoneMsgChoiceTarget = {}
self.tbPhoneMsgGroupData = {}
self.tbPhoneMsgGroupMeta = {}
self.tbPhoneMsgMetaParsed = {}
self.tbHistoryMsg = {}
self.tbHistorySelection = {}
self.tbNewChatList = {}
@@ -35,6 +37,8 @@ end
function PlayerPhoneData:GetChatState(chatData)
if chatData.nProcess == 0 then
return AllEnum.PhoneChatState.New
elseif chatData.nAllProcess == nil then
return AllEnum.PhoneChatState.UnComplete
elseif chatData.nProcess < chatData.nAllProcess then
return AllEnum.PhoneChatState.UnComplete
elseif chatData.nProcess >= chatData.nAllProcess then
@@ -44,17 +48,19 @@ end
function PlayerPhoneData:CreateNewChat(mapMsgData)
local chatData = {}
chatData.nChatId = mapMsgData.Id
chatData.nProcess = mapMsgData.Process
chatData.tbSelection = mapMsgData.Options
local chatAvgMsg = self:GetAVGPhoneMsg(chatData.nChatId)
if nil == chatAvgMsg then
return
chatData.nProcess = mapMsgData.Process or 0
chatData.tbSelection = mapMsgData.Options or {}
chatData.bHistoryParsed = false
local chatCfg = ConfigTable.GetData("Chat", chatData.nChatId)
if chatCfg == nil then
return nil
end
chatData.avgMsg = chatAvgMsg
chatData.nAllProcess = #chatAvgMsg
chatData.nStatus = self:GetChatState(chatData)
if chatData.nProcess > 0 then
self:ParseAvgHistoryPhoneMsgData(chatData.nChatId, chatData.avgMsg, chatData.nProcess, chatData.tbSelection)
if not self:EnsureChatAvgMetaLoaded(chatData) then
return nil
end
else
chatData.nStatus = self:GetChatState(chatData)
end
return chatData
end
@@ -117,7 +123,8 @@ function PlayerPhoneData:RefreshChatProcess(nAddressId, nChatId, nProcess, tbSel
chatData.nProcess = nProcess
if nil ~= tbSelection then
chatData.tbSelection = tbSelection
local data = chatData.avgMsg[lastProcess]
self:EnsureChatAvgLoaded(chatData)
local data = chatData.avgMsg and chatData.avgMsg[lastProcess]
if data ~= nil and data.cmd == "SetPhoneMsgChoiceBegin" then
local nGroupId = tonumber(data.param[1]) or 0
if nGroupId == #tbSelection then
@@ -140,7 +147,8 @@ function PlayerPhoneData:RefreshChatProcess(nAddressId, nChatId, nProcess, tbSel
end
end
chatData.nStatus = self:GetChatState(chatData)
self:UpdateHistoryPhoneMsgData(nChatId, chatData.avgMsg[nProcess], nProcess)
chatData.bHistoryParsed = false
self:ClearHistoryPhoneMsgData(nChatId)
end
self:RefreshAddressStatus(nAddressId)
end
@@ -375,6 +383,9 @@ function PlayerPhoneData:CheckNewChat(nAddressId, callback)
end
function PlayerPhoneData:GetNextProcess(nAddressId, nChatId, nProcess)
local chatData = self:GetChatData(nAddressId, nChatId)
if not self:EnsureChatAvgLoaded(chatData) then
return nProcess
end
local nNextProcess = nProcess
local tbMsg = chatData.avgMsg[nNextProcess]
if nil ~= tbMsg and tbMsg.cmd == "SetPhoneMsgChoiceJumpTo" then
@@ -396,7 +407,9 @@ function PlayerPhoneData:CheckChatComplete(nChatId)
local dataAddress = self.tbAddressBook[nAddressId]
if nil ~= dataAddress and nil ~= dataAddress.tbChatList then
local chatData = dataAddress.tbChatList[nChatId]
return chatData.nProcess >= chatData.nAllProcess
if self:EnsureChatAvgMetaLoaded(chatData) then
return chatData.nProcess >= chatData.nAllProcess
end
end
end
printError(string.format("聊天未解锁,请检查配置!!chatId = [%s])", nChatId))
@@ -430,17 +443,10 @@ end
function PlayerPhoneData:GetAVGPhoneMsg(nChatId, sLanguage)
local chatCfg = ConfigTable.GetData("Chat", nChatId)
if nil ~= chatCfg then
if sLanguage == nil then
sLanguage = Settings.sCurrentTxtLanguage
end
local nCurLanguageIdx = GetLanguageIndex(sLanguage)
local sAvgCfgPath = GetAvgLuaRequireRoot(nCurLanguageIdx) .. "Config/" .. chatCfg.AVGId
local sAvgCfgPath = self:GetAVGPhoneCfgPath(chatCfg, sLanguage)
if nil == self.tbChatMsgCache[sAvgCfgPath] then
local ok, tbAllAvgCfg = pcall(require, sAvgCfgPath)
if not ok then
printError("AvgId对应的配置文件没有找到,path:" .. sAvgCfgPath .. ". error: " .. tbAllAvgCfg)
return
else
local tbAllAvgCfg = self:LoadAVGPhoneCfg(chatCfg, sLanguage)
if tbAllAvgCfg ~= nil then
self.tbChatMsgCache[sAvgCfgPath] = {}
local sMsgGroup
for i, v in ipairs(tbAllAvgCfg) do
@@ -449,8 +455,13 @@ function PlayerPhoneData:GetAVGPhoneMsg(nChatId, sLanguage)
self.tbChatMsgCache[sAvgCfgPath][sMsgGroup] = {}
self.tbPhoneMsgGroupData[chatCfg.AVGId .. sMsgGroup] = {}
self.tbPhoneMsgGroupData[chatCfg.AVGId .. sMsgGroup].nStartCmdId = i
self.tbPhoneMsgGroupMeta[chatCfg.AVGId .. sMsgGroup] = {nStartCmdId = i, nAllProcess = 0}
elseif v.cmd ~= "End" then
table.insert(self.tbChatMsgCache[sAvgCfgPath][sMsgGroup], v)
local tbMeta = self.tbPhoneMsgGroupMeta[chatCfg.AVGId .. sMsgGroup]
if tbMeta ~= nil then
tbMeta.nAllProcess = tbMeta.nAllProcess + 1
end
if v.cmd == "SetPhoneMsgChoiceBegin" then
if self.tbPhoneMsgChoiceTarget[chatCfg.AVGId .. sMsgGroup] == nil then
self.tbPhoneMsgChoiceTarget[chatCfg.AVGId .. sMsgGroup] = {}
@@ -494,6 +505,7 @@ function PlayerPhoneData:GetAVGPhoneMsg(nChatId, sLanguage)
end
end
end
self.tbPhoneMsgMetaParsed[sAvgCfgPath] = true
end
end
if nil ~= self.tbChatMsgCache[sAvgCfgPath] then
@@ -501,6 +513,93 @@ function PlayerPhoneData:GetAVGPhoneMsg(nChatId, sLanguage)
end
end
end
function PlayerPhoneData:GetAVGPhoneCfgPath(chatCfg, sLanguage)
if chatCfg == nil then
return nil
end
if sLanguage == nil then
sLanguage = Settings.sCurrentTxtLanguage
end
local nCurLanguageIdx = GetLanguageIndex(sLanguage)
return GetAvgLuaRequireRoot(nCurLanguageIdx) .. "Config/" .. chatCfg.AVGId
end
function PlayerPhoneData:LoadAVGPhoneCfg(chatCfg, sLanguage)
local sAvgCfgPath = self:GetAVGPhoneCfgPath(chatCfg, sLanguage)
if sAvgCfgPath == nil then
return nil
end
local ok, tbAllAvgCfg = pcall(require, sAvgCfgPath)
if not ok then
printError("AvgId对应的配置文件没有找到,path:" .. sAvgCfgPath .. ". error: " .. tbAllAvgCfg)
return nil
end
return tbAllAvgCfg, sAvgCfgPath
end
function PlayerPhoneData:ParseAVGPhoneMeta(chatCfg, sLanguage)
local tbAllAvgCfg, sAvgCfgPath = self:LoadAVGPhoneCfg(chatCfg, sLanguage)
if tbAllAvgCfg == nil then
return nil
end
if self.tbPhoneMsgMetaParsed[sAvgCfgPath] then
return sAvgCfgPath
end
local sMsgGroup
for i, v in ipairs(tbAllAvgCfg) do
if v.cmd == "SetGroupId" then
sMsgGroup = v.param[1]
local sKey = chatCfg.AVGId .. sMsgGroup
self.tbPhoneMsgGroupMeta[sKey] = {nStartCmdId = i, nAllProcess = 0}
elseif v.cmd ~= "End" and sMsgGroup ~= nil then
local sKey = chatCfg.AVGId .. sMsgGroup
local tbMeta = self.tbPhoneMsgGroupMeta[sKey]
if tbMeta ~= nil then
tbMeta.nAllProcess = tbMeta.nAllProcess + 1
end
end
end
self.tbPhoneMsgMetaParsed[sAvgCfgPath] = true
return sAvgCfgPath
end
function PlayerPhoneData:GetAVGPhoneMsgMeta(nChatId, sLanguage)
local chatCfg = ConfigTable.GetData("Chat", nChatId)
if chatCfg ~= nil then
local sKey = chatCfg.AVGId .. chatCfg.AVGGroupId
if self.tbPhoneMsgGroupMeta[sKey] == nil then
self:ParseAVGPhoneMeta(chatCfg, sLanguage)
end
return self.tbPhoneMsgGroupMeta[sKey]
end
end
function PlayerPhoneData:EnsureChatAvgMetaLoaded(chatData)
if chatData == nil then
return false
end
if chatData.nAllProcess ~= nil then
return true
end
local tbMeta = self:GetAVGPhoneMsgMeta(chatData.nChatId)
if tbMeta == nil then
return false
end
chatData.nAllProcess = tbMeta.nAllProcess
chatData.nStatus = self:GetChatState(chatData)
return true
end
function PlayerPhoneData:EnsureChatAvgLoaded(chatData)
if chatData == nil then
return false
end
if chatData.avgMsg ~= nil then
return true
end
chatData.avgMsg = self:GetAVGPhoneMsg(chatData.nChatId)
if chatData.avgMsg == nil then
return false
end
chatData.nAllProcess = #chatData.avgMsg
chatData.nStatus = self:GetChatState(chatData)
return true
end
function PlayerPhoneData:ParseAvgHistoryPhoneMsgData(nChatId, tbMsgData, nProcess, tbSelection)
self:ClearHistoryPhoneMsgData(nChatId)
if nil ~= tbMsgData then
@@ -565,10 +664,31 @@ function PlayerPhoneData:ParseAvgHistoryPhoneMsgData(nChatId, tbMsgData, nProces
end
end
end
function PlayerPhoneData:EnsureChatHistoryParsed(chatData)
if chatData == nil then
return
end
if chatData.bHistoryParsed == true then
return
end
if not self:EnsureChatAvgLoaded(chatData) then
return
end
if chatData.nProcess ~= nil and chatData.nProcess > 0 then
self:ParseAvgHistoryPhoneMsgData(chatData.nChatId, chatData.avgMsg, chatData.nProcess, chatData.tbSelection)
else
self:ClearHistoryPhoneMsgData(chatData.nChatId)
end
chatData.bHistoryParsed = true
end
function PlayerPhoneData:GetAvgStartCmdId(nChatId)
local chatCfg = ConfigTable.GetData("Chat", nChatId)
if chatCfg ~= nil then
local tbData = self.tbPhoneMsgGroupData[chatCfg.AVGId .. chatCfg.AVGGroupId]
local sKey = chatCfg.AVGId .. chatCfg.AVGGroupId
local tbData = self.tbPhoneMsgGroupData[sKey]
if tbData == nil then
tbData = self:GetAVGPhoneMsgMeta(nChatId)
end
if tbData ~= nil then
return tbData.nStartCmdId
end
@@ -606,39 +726,53 @@ function PlayerPhoneData:UpdateHistoryPhoneMsgData(nChatId, tbMsgData, nProcess)
}
table.insert(self.tbHistoryMsg[nChatId], data)
end
function PlayerPhoneData:GetHistoryPhoneMsgData(nChatId)
function PlayerPhoneData:GetHistoryPhoneMsgData(nChatId, chatData)
if chatData ~= nil then
self:EnsureChatHistoryParsed(chatData)
end
if self.tbHistoryMsg[nChatId] == nil then
self.tbHistoryMsg[nChatId] = {}
end
return self.tbHistoryMsg[nChatId]
end
function PlayerPhoneData:GetHistoryPhoneSelectionData(nChatId)
function PlayerPhoneData:GetHistoryPhoneSelectionData(nChatId, chatData)
if chatData ~= nil then
self:EnsureChatHistoryParsed(chatData)
end
if self.tbHistorySelection[nChatId] == nil then
self.tbHistorySelection[nChatId] = {}
end
return self.tbHistorySelection[nChatId]
end
function PlayerPhoneData:GetChatMsg(chatData, nIndex)
self:EnsureChatAvgLoaded(chatData)
local avgGroupMsg = chatData.avgMsg
if nil ~= avgGroupMsg then
if nIndex == 1 then
return avgGroupMsg[nIndex]
else
self:EnsureChatHistoryParsed(chatData)
local tbChatList = self.tbHistoryMsg[chatData.nChatId]
return tbChatList[#tbChatList]
if tbChatList ~= nil then
return tbChatList[#tbChatList]
end
end
end
end
function PlayerPhoneData:GetChatContent(chatData, nIndex)
self:EnsureChatAvgLoaded(chatData)
local avgGroupMsg = chatData.avgMsg
if nil ~= avgGroupMsg then
local tbAvgMsg = avgGroupMsg[nIndex]
if nIndex == 1 then
return ProcAvgTextContent(tbAvgMsg.param[3], GetLanguageIndex(Settings.sCurrentTxtLanguage))
else
self:EnsureChatHistoryParsed(chatData)
local tbChatList = self.tbHistoryMsg[chatData.nChatId]
local chatData = tbChatList[#tbChatList]
return ProcAvgTextContent(chatData.param[3], GetLanguageIndex(Settings.sCurrentTxtLanguage))
local historyChatData = tbChatList and tbChatList[#tbChatList]
if historyChatData ~= nil then
return ProcAvgTextContent(historyChatData.param[3], GetLanguageIndex(Settings.sCurrentTxtLanguage))
end
end
end
end
@@ -684,10 +818,6 @@ function PlayerPhoneData:SendAddressListReq(callback)
end
function PlayerPhoneData:SendChatProcess(nAddressId, nChatId, nProcess, tbSelection, bEnd, callback)
local httpCall = function(mapMsgData)
if nil == self.tbHistoryMsg[nChatId] or nil == next(self.tbHistoryMsg[nChatId]) then
local chatData = self:GetChatData(nAddressId, nChatId)
self:ParseAvgHistoryPhoneMsgData(nChatId, chatData.avgMsg, nProcess, tbSelection)
end
self:RefreshChatProcess(nAddressId, nChatId, nProcess, tbSelection)
if nil ~= callback then
callback()
+52 -18
View File
@@ -557,10 +557,13 @@ function PlayerQuestData:ReceiveTourReward(nTid, callback)
end
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
local bWasInBatch = self._bInBatchReceive
if callback ~= nil then
callback(mapMsgData)
end
EventManager.Hit(EventId.TourQuestReceived, mapMsgData.Rewards, mapMsgData.Change)
if not bWasInBatch then
EventManager.Hit(EventId.TourQuestReceived, mapMsgData.Rewards, mapMsgData.Change)
end
self:UpdateQuestRedDot("TourGuide")
end
PlayerData.State:SetMailOverflow(false)
@@ -571,10 +574,13 @@ function PlayerQuestData:ReceiveTourGroupReward(callback)
self.nCurTourGroupOrderIndex = self.nCurTourGroupOrderIndex + 1
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
local bWasInBatch = self._bInBatchReceive
if callback ~= nil then
callback(mapMsgData)
end
EventManager.Hit(EventId.TourGroupReceived, mapMsgData.Rewards, mapMsgData.Change)
if not bWasInBatch then
EventManager.Hit(EventId.TourGroupReceived, mapMsgData.Rewards, mapMsgData.Change)
end
self:UpdateQuestRedDot("TourGuide")
end
PlayerData.State:SetMailOverflow(false)
@@ -654,10 +660,12 @@ function PlayerQuestData:ReceiveTeamFormationReward(nTid, nGroupId, callback)
local cb = function()
EventManager.Hit("UpdateTeamFormationGroup")
end
UTILS.OpenReceiveByDisplayItem(tbItem, mapMsgData, cb)
if not self._bInBatchReceive then
UTILS.OpenReceiveByDisplayItem(tbItem, mapMsgData, cb)
end
self:UpdateQuestRedDot("Assist")
if callback ~= nil then
callback(mapMsgData)
callback(mapMsgData, tbItem, mapMsgData)
end
end
PlayerData.State:SetMailOverflow(false)
@@ -729,15 +737,29 @@ function PlayerQuestData:ReceiveTeamFormationGroupReward(nGroupId, nAttributeIdx
local cb = function()
EventManager.Hit("UpdateTeamFormationGroup", bAttributeComplete, nNextGroupId)
end
UTILS.OpenReceiveByDisplayItem(tbItem, mapMsgData.Change, cb)
if not self._bInBatchReceive then
UTILS.OpenReceiveByDisplayItem(tbItem, mapMsgData.Change, cb)
end
self:UpdateQuestRedDot("Assist")
if callback ~= nil then
callback(mapMsgData)
callback(mapMsgData, tbItem, mapMsgData.Change, bAttributeComplete, nNextGroupId)
end
end
PlayerData.State:SetMailOverflow(false)
HttpNetHandler.SendMsg(NetMsgId.Id.quest_assist_group_reward_receive_req, msg, nil, Callback)
end
function PlayerQuestData:SetBatchReceiveFlag(bOn)
self._nBatchReceiveCount = self._nBatchReceiveCount or 0
if bOn then
self._nBatchReceiveCount = self._nBatchReceiveCount + 1
else
self._nBatchReceiveCount = self._nBatchReceiveCount - 1
if self._nBatchReceiveCount < 0 then
self._nBatchReceiveCount = 0
end
end
self._bInBatchReceive = self._nBatchReceiveCount > 0
end
function PlayerQuestData:ReceiveDailyReward(nTid, callback)
local msg = {Value = nTid}
local tbReceivedId = {}
@@ -764,10 +786,13 @@ function PlayerQuestData:ReceiveDailyReward(nTid, callback)
end
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
local bWasInBatch = self._bInBatchReceive
if callback ~= nil then
callback()
callback(mapDecodedChangeInfo, mapMsgData)
end
if not bWasInBatch then
EventManager.Hit(EventId.DailyQuestReceived, mapMsgData)
end
EventManager.Hit(EventId.DailyQuestReceived, mapMsgData)
self:UpdateQuestRedDot("Daily")
end
PlayerData.State:SetMailOverflow(false)
@@ -793,14 +818,17 @@ function PlayerQuestData:ReceiveDailyActiveReward(callBack)
self:UpdateDailyQuestRedDot()
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
if callBack ~= nil then
callBack()
end
local tbShowReward = {}
for id, count in pairs(tbReward) do
table.insert(tbShowReward, {id = id, count = count})
end
EventManager.Hit(EventId.DailyQuestActiveReceived, tbShowReward)
local bWasInBatch = self._bInBatchReceive
if callBack ~= nil then
callBack(tbShowReward, mapDecodedChangeInfo)
end
if not bWasInBatch then
EventManager.Hit(EventId.DailyQuestActiveReceived, tbShowReward)
end
end
HttpNetHandler.SendMsg(NetMsgId.Id.quest_daily_active_reward_receive_req, {}, nil, callback)
end
@@ -830,10 +858,13 @@ function PlayerQuestData:ReceiveWeeklyReward(nTid, callback)
end
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
local bWasInBatch = self._bInBatchReceive
if callback ~= nil then
callback()
callback(mapDecodedChangeInfo, mapMsgData)
end
if not bWasInBatch then
EventManager.Hit(EventId.WeeklyQuestReceived, mapMsgData)
end
EventManager.Hit(EventId.WeeklyQuestReceived, mapMsgData)
self:UpdateQuestRedDot("Weekly")
end
PlayerData.State:SetMailOverflow(false)
@@ -859,14 +890,17 @@ function PlayerQuestData:ReceiveWeeklyActiveReward(callBack)
self:UpdateWeeklyQuestRedDot()
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
if callBack ~= nil then
callBack()
end
local tbShowReward = {}
for id, count in pairs(tbReward) do
table.insert(tbShowReward, {id = id, count = count})
end
EventManager.Hit(EventId.WeeklyQuestActiveReceived, tbShowReward)
local bWasInBatch = self._bInBatchReceive
if callBack ~= nil then
callBack(tbShowReward, mapDecodedChangeInfo)
end
if not bWasInBatch then
EventManager.Hit(EventId.WeeklyQuestActiveReceived, tbShowReward)
end
end
HttpNetHandler.SendMsg(NetMsgId.Id.quest_weekly_active_reward_receive_req, {}, nil, callback)
end
@@ -221,7 +221,7 @@ function PlayerSkillInstanceData:MsgSettleSkillInstance(nLevelId, nBuildId, nSta
}
end
if callback ~= nil then
callback(mapMsgData.AwardItems, mapMsgData.FirstItems, mapMsgData.ThreeStarItems, mapMsgData.SurpriseItems, mapMsgData.Exp, mapMsgData.Change)
callback(mapMsgData.AwardItems, mapMsgData.FirstItems, mapMsgData.ThreeStarItems, mapMsgData.SurpriseItems, mapMsgData.DoubleItems, mapMsgData.Exp, mapMsgData.Change)
end
self._EndTime = CS.ClientManager.Instance.serverTimeStampWithTimeZone
local tabUpLevel = {}
@@ -96,8 +96,14 @@ function PlayerTutorialData:GetNextLevelId(levelId)
end
return nNextlevelId
end
function PlayerTutorialData:GetLevelReward(levelId)
function PlayerTutorialData:GetLevelReward(levelId, callback)
local mapSendMsg = {Value = levelId}
if self:GetLevelData(levelId).LevelStatus == AllEnum.ActQuestStatus.Received then
if callback ~= nil then
callback()
end
return
end
local succ_cb = function(_, mapData)
self:UpdateLevel({
nlevelId = levelId,
@@ -105,6 +111,12 @@ function PlayerTutorialData:GetLevelReward(levelId)
})
local bIsNew = LocalData.GetPlayerLocalData("Tutorial_IsNew")
self:RefreshRedDot(bIsNew)
local closeCallback = function()
if callback ~= nil then
callback()
end
end
UTILS.OpenReceiveByChangeInfo(mapData, closeCallback)
EventManager.Hit(EventId.TutorialQuestReceived, mapData)
end
HttpNetHandler.SendMsg(NetMsgId.Id.tutorial_level_reward_receive_req, mapSendMsg, nil, succ_cb)
+4 -1
View File
@@ -1273,7 +1273,10 @@ local BindProcessFunction = function()
[NetMsgId.Id.activity_penguin_card_quest_reward_receive_failed_ack] = NOTHING_NEED_TO_BE_DONE,
[NetMsgId.Id.activity_gds_settle_succeed_ack] = HttpNetHandlerPlus.activity_gds_settle_succeed_ack,
[NetMsgId.Id.activity_gds_settle_failed_ack] = NOTHING_NEED_TO_BE_DONE,
[NetMsgId.Id.clear_all_activity_golden_spy_levels_notify] = HttpNetHandlerPlus.clear_all_activity_golden_spy_levels_notify
[NetMsgId.Id.clear_all_activity_golden_spy_levels_notify] = HttpNetHandlerPlus.clear_all_activity_golden_spy_levels_notify,
[NetMsgId.Id.activity_double_quest_reward_receive_succeed_ack] = HttpNetHandlerPlus.activity_double_quest_reward_receive_succeed_ack,
[NetMsgId.Id.activity_double_quest_reward_receive_failed_ack] = NOTHING_NEED_TO_BE_DONE,
[NetMsgId.Id.activity_double_reward_times_notify] = HttpNetHandlerPlus.activity_double_reward_times_notify
}
end
function HttpNetHandler.Init()
+15 -5
View File
@@ -78,10 +78,6 @@ function HttpNetHandlerPlus.activity_story_reward_receive_succeed_ack(mapMsgData
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
function HttpNetHandlerPlus.activity_history_story_settle_succeed_ack(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
function HttpNetHandlerPlus.activity_task_reward_receive_succeed_ack(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
@@ -240,6 +236,10 @@ function HttpNetHandlerPlus.activity_story_settle_succeed_ack(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
function HttpNetHandlerPlus.activity_history_story_settle_succeed_ack(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
function HttpNetHandlerPlus.milkout_settle_succeed_ack(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
@@ -271,9 +271,19 @@ end
function HttpNetHandlerPlus.activity_gds_settle_succeed_ack(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
UTILS.OpenReceiveByChangeInfo(mapMsgData)
end
function HttpNetHandlerPlus.clear_all_activity_golden_spy_levels_notify(mapMsgData)
EventManager.Hit("ClearAllGoldenSpyLevels", mapMsgData)
end
function HttpNetHandlerPlus.activity_double_quest_reward_receive_succeed_ack(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
function HttpNetHandlerPlus.activity_double_reward_times_notify(mapMsgData)
local actData = PlayerData.Activity:GetActivityDataById(mapMsgData.ActivityId)
if actData ~= nil then
actData:UpdateDoubleCount(mapMsgData.UseTimes)
EventManager.Hit("UpdateInstanceDoubleCount")
end
end
return HttpNetHandlerPlus
+8
View File
@@ -697,6 +697,9 @@ NetMsgId.Id = {
activity_penguin_card_quest_reward_receive_req = 8404,
activity_penguin_card_quest_reward_receive_succeed_ack = 8405,
activity_penguin_card_quest_reward_receive_failed_ack = 8406,
activity_double_quest_reward_receive_req = 8407,
activity_double_quest_reward_receive_succeed_ack = 8408,
activity_double_quest_reward_receive_failed_ack = 8409,
mail_list_req = 9001,
mail_list_succeed_ack = 9002,
mail_list_failed_ack = 9003,
@@ -879,6 +882,7 @@ NetMsgId.Id = {
activity_end_item_change_notify = 10053,
item_expired_change_notify = 10054,
milkout_character_unlock_notify = 10055,
activity_double_reward_times_notify = 10056,
activity_mining_apply_req = 11001,
activity_mining_apply_succeed_ack = 11002,
activity_mining_apply_failed_ack = 11003,
@@ -1614,6 +1618,9 @@ NetMsgId.MsgName = {
[8404] = "proto.ActivityPenguinCardQuestReceiveReq",
[8405] = "proto.ChangeInfo",
[8406] = "proto.Error",
[8407] = "proto.ActivityDoubleQuestRewardReq",
[8408] = "proto.ChangeInfo",
[8409] = "proto.Error",
[9001] = "proto.Nil",
[9002] = "proto.Mails",
[9003] = "proto.Error",
@@ -1796,6 +1803,7 @@ NetMsgId.MsgName = {
[10053] = "proto.ChangeInfo",
[10054] = "proto.ItemTpl",
[10055] = "proto.MilkoutCharacterUnlockNotify",
[10056] = "proto.ActivityDoubleRewardTimesNotify",
[11001] = "proto.ActivityMiningApplyReq",
[11002] = "proto.ActivityMiningApplyResp",
[11003] = "proto.Error",
+1
View File
@@ -99,6 +99,7 @@ local RedDotDefine = {
Activity_PenguinCard_Level = "Activity.PenguinCard.Level.<param>",
Activity_Group_PenguinCard_Level = "Activity_Group_New.<param>.PenguinCard",
Activity_Group_TrekkerVersus = "Activity.Group.<param>.TrekkerVersus",
Activity_DoubleDrop_Quest = "Activity.DoubleDrop.<param>",
ActivityLevel = "Activity_Group_New.<param>.ActivityLevel",
ActivityLevel_Explore = "Activity_Group_New.<param>.ActivityLevel.Explore",
ActivityLevel_Explore_Level = "Activity_Group_New.<param>.ActivityLevel.Explore.<param>",
+36 -19
View File
@@ -207,27 +207,44 @@ function RedDotManager.PrintRedDot(sKey, param, bLeaf)
return
end
local node = RedDotManager.GetNode(sNodeKey)
if nil ~= node then
node:PrintRedDot(bLeaf, tbNode)
if nil == node then
return
end
if tbNode ~= nil and #tbNode ~= 0 then
for k, v in ipairs(tbNode) do
local tbKey = {}
table.insert(tbKey, v.sNodeKey)
if bLeaf then
v:GetParentKey(tbKey)
end
local sCurKey = ""
for i = #tbKey, 1, -1 do
if i == #tbKey then
sCurKey = tbKey[i]
else
sCurKey = sCurKey .. "->" .. tbKey[i]
end
end
local bindObjCount = v:GetBindObjCount()
printError(string.format("[RedDot] key = %s, redDotCount = %s, bindObjCount = %s", sCurKey, v.nRedDotCount, bindObjCount))
node:PrintRedDot(bLeaf, tbNode, 0)
if tbNode == nil or #tbNode == 0 then
return
end
local COLOR_NODE = "#4FC3F7"
local COLOR_LEAF = "#B5E853"
local COLOR_ACTIVE = "#FF5252"
local escape = function(v)
local s = tostring(v)
s = s:gsub("<", "")
s = s:gsub(">", "")
return s
end
local wrap = function(sColor, sText)
return string.format("<color=%s>%s</color>", sColor, sText)
end
local tbLines = {}
table.insert(tbLines, string.format("[RedDot] ===== Tree of [%s] =====", escape(sNodeKey)))
for _, item in ipairs(tbNode) do
local curNode = item.node
local nDepth = item.depth or 0
local sIndent = string.rep("", nDepth)
local sBranch = 0 < nDepth and "├─ " or ""
local bIsLeaf = nil == curNode.tbChildNodeList or #curNode.tbChildNodeList == 0
local sTagRaw = bIsLeaf and "[Leaf]" or "[Node]"
local sTag = wrap(bIsLeaf and COLOR_LEAF or COLOR_NODE, sTagRaw)
local bindObjCount = curNode:GetBindObjCount()
local sValid = escape(curNode:GetValid())
local sInfo = string.format("%s count=%s bind=%s valid=%s", escape(curNode.sNodeKey), tostring(curNode.nRedDotCount), tostring(bindObjCount), sValid)
if curNode.nRedDotCount and 0 < curNode.nRedDotCount then
sInfo = wrap(COLOR_ACTIVE, sInfo)
end
table.insert(tbLines, string.format("%s%s%s %s", sIndent, sBranch, sTag, sInfo))
end
table.insert(tbLines, "[RedDot] ===== End =====")
printError(table.concat(tbLines, "\n"))
end
return RedDotManager
+11 -3
View File
@@ -143,14 +143,22 @@ end
function RedDotNode:CheckLeafNode()
return nil == self.tbChildNodeList or #self.tbChildNodeList == 0
end
function RedDotNode:PrintRedDot(bLeaf, tbNode)
function RedDotNode:PrintRedDot(bLeaf, tbNode, nDepth)
if self.sNodeKey == "Root" then
if bLeaf and nil ~= self.tbChildNodeList then
for _, v in ipairs(self.tbChildNodeList) do
v:PrintRedDot(true, tbNode, 0)
end
end
return
end
table.insert(tbNode, self)
table.insert(tbNode, {
node = self,
depth = nDepth or 0
})
if bLeaf and nil ~= self.tbChildNodeList then
for _, v in ipairs(self.tbChildNodeList) do
v:PrintRedDot(true, tbNode)
v:PrintRedDot(true, tbNode, (nDepth or 0) + 1)
end
end
end
+1 -1
View File
@@ -605,7 +605,7 @@ function BaseCtrl:SetPngSprite(imgObj, sPath, sSurfix)
sPath = sPath .. sSurfix
end
end
if string.find(sPath, "Icon/") == nil and string.find(sPath, "Image/") == nil and string.find(sPath, "ImageAvg/") == nil and string.find(sPath, "big_sprites/") == nil and string.find(sPath, "Disc/") == nil and string.find(sPath, "Play_") == nil and string.find(sPath, "UI_Activity") == nil then
if sPath == nil or string.find(sPath, "Icon/") == nil and string.find(sPath, "Image/") == nil and string.find(sPath, "ImageAvg/") == nil and string.find(sPath, "big_sprites/") == nil and string.find(sPath, "Disc/") == nil and string.find(sPath, "Play_") == nil and string.find(sPath, "UI_Activity") == nil then
traceback("配置表中 Icon 资源字段内容填写错误,应填路径,如:Icon/Item/item_1panel id:" .. self._panel._nPanelId .. "ctrl name:" .. self.__cname)
NovaAPI.SetImageSpriteAsset(imgObj, nil)
return false
+17 -16
View File
@@ -170,9 +170,6 @@ local PanelDefine = {
[PanelId.VampireSurvivorSettle] = "Game.UI.VampireSurvivor.VampireSurvivorSettlelPanel",
[PanelId.WeeklyCopiesPanel] = "Game.UI.WeeklyCopies.WeeklyCopiesPanel",
[PanelId.CharPlot] = "Game.UI.CharacterRecord.CharPlotPanel",
[PanelId.MiningGame] = "Game.UI.Play_Mining.MiningGamePanel",
[PanelId.MiningGameStory] = "Game.UI.Play_Mining.MiningGameStoryPanel",
[PanelId.MiningGameQuest] = "Game.UI.Play_Mining.MiningGameQuestPanel",
[PanelId.LoginSetting] = "Game.UI.Settings.LoginSettingsPanel",
[PanelId.ScoreBossBattlePanel] = "Game.UI.Battle.ScoreBossBattlePanel",
[PanelId.ScoreBossSelectPanel] = "Game.UI.ScoreBoss.ScoreBossSelectPanel",
@@ -228,7 +225,6 @@ local PanelDefine = {
[PanelId.ActivityLevelsSelectPanel] = "Game.UI.ActivityTheme.Swim.ActivityLevels.ActivityLevelsSelectPanel",
[PanelId.ActivityLevelsInstanceResultPanel] = "Game.UI.ActivityTheme.LevelCommon.ActivityLevelsInstanceResultPanel",
[PanelId.SwimTheme] = "Game.UI.ActivityTheme.Swim.SwimThemePanel",
[PanelId.MiningGameGuidePanel] = "Game.UI.Play_Mining.MiningGameGuidePanel",
[PanelId.SwimThemeStory] = "Game.UI.ActivityTheme.Swim.Story.SwimThemeStoryPanel",
[PanelId.CharInfoTrial] = "Game.UI.CharacterInfoTrial.CharacterInfoTrialPanel",
[PanelId.CharSkillTrial] = "Game.UI.CharacterInfoTrial.CharSkillTrialPanel",
@@ -254,8 +250,6 @@ local PanelDefine = {
[PanelId.BdConvertResultPanel] = "Game.UI.Activity.BdConvert._500001.BdConvertResultPanel",
[PanelId.BdConvertBuildDetail] = "Game.UI.Activity.BdConvert._500001.BdConvertBuildDetailPanel",
[PanelId.Task_10101] = "Game.UI.ActivityTheme.10101.Task.OurRegimentTaskPanel",
[PanelId.MiningGame_400002] = "Game.UI.Play_Mining_400002.MiningGamePanel",
[PanelId.MiningGameGuidePanel_400002] = "Game.UI.Play_Mining_400002.MiningGameGuidePanel",
[PanelId.TowerDefenseGiveupPanel] = "Game.UI.TowerDefense.TowerDefenseGiveUpPanel",
[PanelId.BreakOutThemePanel] = "Game.UI.ActivityTheme.30101.BreakOutThemePanel",
[PanelId.Shop_30101] = "Game.UI.ActivityTheme.30101.Shop.ActivityShopPanel",
@@ -264,8 +258,6 @@ local PanelDefine = {
[PanelId.QuestNewbie] = "Game.UI.QuestNewbie.QuestNewbiePanel",
[PanelId.TowerDefenseTestPanel] = "Game.Editor.TowerDefense.TowerDefenseTestPanel",
[PanelId.TowerDefenseTestResultPanel] = "Game.Editor.TowerDefense.TowerDefenseTestResultPanel",
[PanelId.MiningGame_400003] = "Game.UI.Play_Mining.400003.MiningGamePanel",
[PanelId.MiningGameGuidePanel_400003] = "Game.UI.Play_Mining.400003.MiningGameGuidePanel",
[PanelId.TrekkerVersus] = "Game.UI.TrekkerVersus_600002.TrekkerVersusPanel",
[PanelId.ActivityLevelsSelectPanel_20101] = "Game.UI.ActivityTheme.20101.ActivityLevels.ActivityLevelsSelectPanel",
[PanelId.ChristmasThemePanel] = "Game.UI.ActivityTheme.20101.ChristmasThemePanel",
@@ -310,8 +302,6 @@ local PanelDefine = {
[PanelId.Task_10104] = "Game.UI.ActivityTheme.10104.Task.SpringTaskPanel",
[PanelId.SpringFestivalThemePanel] = "Game.UI.ActivityTheme.10104.SpringFestivalThemePanel",
[PanelId.SpringFestivalStory] = "Game.UI.ActivityTheme.10104.Story.SpringFestivalStoryPanel",
[PanelId.MiningGame_400007] = "Game.UI.Play_Mining.400007.MiningGamePanel",
[PanelId.MiningGameGuidePanel_400007] = "Game.UI.Play_Mining.400007.MiningGameGuidePanel",
[PanelId.WinterNightThemePanel] = "Game.UI.ActivityTheme.10105.WinterNightThemePanel",
[PanelId.WinterNightStory] = "Game.UI.ActivityTheme.10105.Story.WinterNightStoryPanel",
[PanelId.Task_10105] = "Game.UI.ActivityTheme.10105.Task.WinterNightTaskPanel",
@@ -323,15 +313,15 @@ local PanelDefine = {
[PanelId.PostalThemePanel] = "Game.UI.ActivityTheme.10106.PostalThemePanel",
[PanelId.PostalStory] = "Game.UI.ActivityTheme.10106.Story.PostalStoryPanel",
[PanelId.RankBuildDetail] = "Game.UI.StarTower.Build.RankBuildDetailPanel",
[PanelId.GoldenSpyPanel] = "Game.UI.Activity.GoldenSpy.GoldenSpyLevelPanel",
[PanelId.GoldenSpyLevelSelectPanel] = "Game.UI.Activity.GoldenSpy.GoldenSpyLevelSelectPanel",
[PanelId.GoldenSpyBuffSelectPanel] = "Game.UI.Activity.GoldenSpy.GoldenSpyBuffSelectPanel",
[PanelId.GoldenSpyResultPanel] = "Game.UI.Activity.GoldenSpy.GoldenSpyResultPanel",
[PanelId.GoldenSpyPanel_400008] = "Game.UI.Activity.GoldenSpy.400008.GoldenSpyLevelPanel",
[PanelId.GoldenSpyLevelSelectPanel_400008] = "Game.UI.Activity.GoldenSpy.400008.GoldenSpyLevelSelectPanel",
[PanelId.GoldenSpyBuffSelectPanel_400008] = "Game.UI.Activity.GoldenSpy.400008.GoldenSpyBuffSelectPanel",
[PanelId.GoldenSpyResultPanel_400008] = "Game.UI.Activity.GoldenSpy.400008.GoldenSpyResultPanel",
[PanelId.PotentialPreselectionList] = "Game.UI.PotentialPreselection.PotentialPreselectionPanel",
[PanelId.PotentialPreselectionEdit] = "Game.UI.PotentialPreselection.PotentialPreselectionEditPanel",
[PanelId.ImportPreselection] = "Game.UI.PotentialPreselection.ImportPreselectionPanel",
[PanelId.PreselectionRename] = "Game.UI.PotentialPreselection.PreselectionRenamePanel",
[PanelId.GoldenSpyBuffTipsPanel] = "Game.UI.Activity.GoldenSpy.GoldenSpyBuffTipsPanel",
[PanelId.GoldenSpyBuffTipsPanel_400008] = "Game.UI.Activity.GoldenSpy.400008.GoldenSpyBuffTipsPanel",
[PanelId.ActivityLevelsSelectPanel_20102] = "Game.UI.ActivityTheme.20102.ActivityLevels.ActivityLevelsSelectPanel",
[PanelId.Task_20102] = "Game.UI.ActivityTheme.20102.Task.SoloDanceTaskPanel",
[PanelId.Shop_20102] = "Game.UI.ActivityTheme.20102.Shop.ActivityShopPanel",
@@ -359,7 +349,18 @@ local PanelDefine = {
[PanelId.Task_10108] = "Game.UI.ActivityTheme.10108.Task.TechTaskPanel",
[PanelId.Shop_10108] = "Game.UI.ActivityTheme.10108.Shop.ActivityShopPanel",
[PanelId.Main_10108] = "Game.UI.ActivityTheme.10108.TechThemePanel",
[PanelId.TechStory] = "Game.UI.ActivityTheme.10108.Story.TechStoryPanel"
[PanelId.TechStory] = "Game.UI.ActivityTheme.10108.Story.TechStoryPanel",
[PanelId.DoubleDropActQuestPanel_103001] = "Game.UI.Activity.DoubleDrop.DoubleDropActQuestPanel_103001",
[PanelId.ActivityLevelsSelectPanel_10109] = "Game.UI.ActivityTheme.10109.ActivityLevels.ActivityLevelsSelectPanel",
[PanelId.GunStormPanel] = "Game.UI.ActivityTheme.10109.GunStormPanel",
[PanelId.Task_10109] = "Game.UI.ActivityTheme.10109.Task.GunStormTaskPanel",
[PanelId.Shop_10109] = "Game.UI.ActivityTheme.10109.Shop.ActivityShopPanel",
[PanelId.GunStormStory_10109] = "Game.UI.ActivityTheme.10109.Story.GunStormStoryPanel",
[PanelId.GoldenSpyPanel_400012] = "Game.UI.Activity.GoldenSpy.400012.GoldenSpyLevelPanel",
[PanelId.GoldenSpyLevelSelectPanel_400012] = "Game.UI.Activity.GoldenSpy.400012.GoldenSpyLevelSelectPanel",
[PanelId.GoldenSpyBuffSelectPanel_400012] = "Game.UI.Activity.GoldenSpy.400012.GoldenSpyBuffSelectPanel",
[PanelId.GoldenSpyResultPanel_400012] = "Game.UI.Activity.GoldenSpy.400012.GoldenSpyResultPanel",
[PanelId.GoldenSpyBuffTipsPanel_400012] = "Game.UI.Activity.GoldenSpy.400012.GoldenSpyBuffTipsPanel"
}
if NovaAPI.GetClientChannel() == AllEnum.ChannelName.BanShu then
end
+16 -5
View File
@@ -327,15 +327,15 @@ local PanelId = {
PostalThemePanel = 413,
PostalStory = 414,
RankBuildDetail = 415,
GoldenSpyPanel = 416,
GoldenSpyLevelSelectPanel = 417,
GoldenSpyBuffSelectPanel = 418,
GoldenSpyPanel_400008 = 416,
GoldenSpyLevelSelectPanel_400008 = 417,
GoldenSpyBuffSelectPanel_400008 = 418,
PotentialPreselectionList = 419,
PotentialPreselectionEdit = 420,
ImportPreselection = 421,
PreselectionRename = 422,
GoldenSpyResultPanel = 423,
GoldenSpyBuffTipsPanel = 424,
GoldenSpyResultPanel_400008 = 423,
GoldenSpyBuffTipsPanel_400008 = 424,
ActivityLevelsSelectPanel_20102 = 425,
Task_20102 = 426,
Shop_20102 = 427,
@@ -376,6 +376,17 @@ local PanelId = {
JointDrillRanking_510005 = 464,
JointDrillRankDetail_510005 = 465,
JointDrillRaid_510005 = 466,
DoubleDropActQuestPanel_103001 = 467,
ActivityLevelsSelectPanel_10109 = 468,
GunStormPanel = 469,
GunStormStory_10109 = 470,
Task_10109 = 471,
Shop_10109 = 472,
GoldenSpyPanel_400012 = 473,
GoldenSpyLevelSelectPanel_400012 = 474,
GoldenSpyBuffSelectPanel_400012 = 475,
GoldenSpyResultPanel_400012 = 476,
GoldenSpyBuffTipsPanel_400012 = 477,
GmTools = 99999
}
return PanelId