Update - 1.9.0.103

EN: 1.9.0.103
CN: 1.9.0.104
JP: 1.9.0.106
KR: 1.9.0.108
This commit is contained in:
SL1900
2026-04-18 00:15:00 +09:00
parent 35fe1f046d
commit e0549005e1
1150 changed files with 941124 additions and 19847 deletions
+20 -2
View File
@@ -474,7 +474,9 @@ AllEnum.WorldMapNodeType = {
ScoreBoss = 12,
SkillInstance = 13,
Trial = 14,
JointDrill = 15
JointDrill = 15,
ActivityLevels = 16,
ActivityStory = 17
}
AllEnum.FrameColor_New = {
[0] = "0",
@@ -1529,7 +1531,8 @@ AllEnum.ActivityThemeFuncIndex = {
Story = 3,
Shop = 4,
Level = 5,
Other = 6
FateCard = 6,
TrekkerVersus = 7
}
AllEnum.CgSurfix = {Main = "_M", Image = ""}
AllEnum.Cg2DType = {Base = 1, L2D = 2}
@@ -1571,4 +1574,19 @@ AllEnum.PenguinCardSuitSprite = {
[GameEnum.PenguinBaseCardSuit.Red] = "icon_PengCard_Fire",
[GameEnum.PenguinBaseCardSuit.Green] = "icon_PengCard_Wind"
}
AllEnum.GoldenSpyHitAreaType = {Circle = 1, Rectangle = 2}
AllEnum.TrekkerVersusDuelSelfInfo = {
NameKey = "TD_SelfName",
Icon = "UI_Activity/_600002/head_172_duel"
}
AllEnum.PreselectionPanelType = {
Create = 1,
Preview = 2,
Edit = 3
}
AllEnum.GoldenSpyBuffType = {
ActiveBuff = 1,
DelayBuff = 2,
UnactiveBuff = 3
}
return AllEnum
@@ -37,33 +37,30 @@ function BreakOutData:RefreshBreakOutData(actId, msgData)
end
function BreakOutData:CacheAllCharacterData(UnLockedCharacterData)
self.tbUnLockedCharacterDataList = {}
self.tbUnLockedCharacterDataMap = {}
for _, v in pairs(UnLockedCharacterData) do
local CharacterData = {
nId = v.Id,
nBattleTimes = v.BattleTimes
}
table.insert(self.tbUnLockedCharacterDataList, CharacterData)
self.tbUnLockedCharacterDataMap[v.Id] = CharacterData
end
end
function BreakOutData:CacheIsUnlocked(CharacterNid)
for _, v in pairs(self.tbUnLockedCharacterDataList) do
if v.nId == CharacterNid then
return true
end
if self.tbUnLockedCharacterDataMap[CharacterNid] then
return true
end
return false
end
function BreakOutData:GetDataFromBreakOutCharacter(CharacterNid)
for _, v in pairs(self.tbUnLockedCharacterDataList) do
if v.nId == CharacterNid then
return ConfigTable.GetData("BreakOutCharacter", CharacterNid)
end
if self.tbUnLockedCharacterDataMap[CharacterNid] then
return ConfigTable.GetData("BreakOutCharacter", CharacterNid)
end
return nil
end
function BreakOutData:GetSkillData(CharacterNid)
local tbCharacterData
self:GetDataFromBreakOutCharacter(CharacterNid)
local tbCharacterData = self:GetDataFromBreakOutCharacter(CharacterNid)
if tbCharacterData == nil then
return nil
else
@@ -71,23 +68,25 @@ function BreakOutData:GetSkillData(CharacterNid)
end
end
function BreakOutData:GetBattleCount(CharacterNid)
for _, v in pairs(self.tbUnLockedCharacterDataList) do
if v.nId == CharacterNid then
return v.nBattleTimes
end
if self.tbUnLockedCharacterDataMap[CharacterNid] ~= nil then
return self.tbUnLockedCharacterDataMap[CharacterNid].nBattleTimes
else
return 0
end
return 0
end
function BreakOutData:CacheAllLevelData(levelListData)
self.tbLevelDataList = {}
self.tbLevelDataMap = {}
for _, v in pairs(levelListData) do
local config = ConfigTable.GetData("BreakOutLevel", v.Id)
local levelData = {
nId = v.Id,
bFirstComplete = v.FirstComplete,
nDifficultyType = ConfigTable.GetData("BreakOutLevel", v.Id).Type,
nPreLevelId = ConfigTable.GetData("BreakOutLevel", v.Id).PreLevelId
nDifficultyType = config.Type,
nPreLevelId = config.PreLevelId
}
table.insert(self.tbLevelDataList, levelData)
self.tbLevelDataMap[v.Id] = levelData
end
end
function BreakOutData:IsAllLevelComplete()
@@ -102,14 +101,12 @@ function BreakOutData:GetLevelData()
return self.tbLevelDataList
end
function BreakOutData:GetLevelDataById(nId)
local levelData
for _, v in pairs(self.tbLevelDataList) do
if v.nId == nId then
levelData = v
break
end
if self.tbLevelDataMap[nId] ~= nil then
return self.tbLevelDataMap[nId]
else
printLog(nId .. ":Id不存在对应关卡数据")
return nil
end
return levelData
end
function BreakOutData:UpdateLevelData(levelData)
for _, v in pairs(self.tbLevelDataList) do
@@ -126,34 +123,23 @@ function BreakOutData:UpdateLevelData(levelData)
end
end
function BreakOutData:UpdateCharacterData(CharacterData)
for _, v in pairs(self.tbUnLockedCharacterDataList) do
if v.nId == CharacterData.CharacterNid then
v.nBattleTimes = v.nBattleTimes + 1
EventManager.Hit("RefreshCharacterBattleTimes")
break
end
if self.tbUnLockedCharacterDataMap[CharacterData.CharacterNid] ~= nil then
self.tbUnLockedCharacterDataMap[CharacterData.CharacterNid].nBattleTimes = self.tbUnLockedCharacterDataMap[CharacterData.CharacterNid].nBattleTimes + 1
EventManager.Hit("RefreshCharacterBattleTimes")
end
end
function BreakOutData:GetDetailLevelDataById(nId)
local levelData
for _, v in pairs(self.tbLevelDataList) do
if v.nId == nId then
levelData = ConfigTable.GetData("BreakOutLevel", nId)
break
end
if self.tbLevelDataMap[nId] then
return ConfigTable.GetData("BreakOutLevel", nId)
end
return levelData
return nil
end
function BreakOutData:GetDetailFloorDataById(nId)
local FloorData
for _, v in pairs(self.tbLevelDataList) do
if v.nId == nId then
nFloorId = ConfigTable.GetData("BreakOutLevel", nId).FloorId
FloorData = ConfigTable.GetData("BreakOutFloor", nFloorId)
break
end
if self.tbLevelDataMap[nId] then
local nFloorId = ConfigTable.GetData("BreakOutLevel", nId).FloorId
return ConfigTable.GetData("BreakOutFloor", nFloorId)
end
return FloorData
return nil
end
function BreakOutData:GetLevelsByTab(nTabIndex)
local levelData = {}
@@ -162,12 +148,9 @@ function BreakOutData:GetLevelsByTab(nTabIndex)
table.insert(levelData, ConfigTable.GetData("BreakOutLevel", v.nId))
end
end
local sortFunc = function(a, b)
local aConfig = ConfigTable.GetData("BreakOutLevel", a.Id)
local bConfig = ConfigTable.GetData("BreakOutLevel", b.Id)
return aConfig.Difficulty < bConfig.Difficulty
end
table.sort(levelData, sortFunc)
table.sort(levelData, function(a, b)
return a.Difficulty < b.Difficulty
end)
return levelData
end
function BreakOutData:GetBreakoutLevelTypeNum()
@@ -291,7 +274,12 @@ function BreakOutData:GetLevelStartTime(nLevelId)
return remainTime
end
function BreakOutData:IsPreLevelComplete(nLevelId)
local nPreLevelId = ConfigTable.GetData("BreakOutLevel", nLevelId).PreLevelId
local tbLevelData = ConfigTable.GetData("BreakOutLevel", nLevelId)
if tbLevelData == nil then
printLog(nLevelId .. ":Id不存在对应关卡数据")
return false
end
local nPreLevelId = tbLevelData.PreLevelId
if nPreLevelId == 0 then
return true
end
@@ -302,6 +290,9 @@ function BreakOutData:IsLevelComplete(nLevelId)
return true
end
local nLevelData = self:GetLevelDataById(nLevelId)
if nLevelData == nil then
return false
end
return nLevelData.bFirstComplete
end
function BreakOutData:GetUnFinishEasyLevel()
@@ -361,7 +352,7 @@ end
function BreakOutData:RefreshCharacterData(charId)
local bIsLock = true
for _, v in pairs(self.tbUnLockedCharacterDataList) do
if v.Id == charId then
if v.nId == charId then
bIsLock = false
break
end
@@ -369,6 +360,7 @@ function BreakOutData:RefreshCharacterData(charId)
if bIsLock then
local CharacterData = {nId = charId, nBattleTimes = 0}
table.insert(self.tbUnLockedCharacterDataList, CharacterData)
self.tbUnLockedCharacterDataMap[charId] = CharacterData
end
end
function BreakOutData:OnEvent_GMClearAllLevels(mapMsgData)
@@ -2,7 +2,6 @@ local BreakOutData_00 = class("BreakOutData_00")
function BreakOutData_00:AddListeners()
end
function BreakOutData_00:RefreshBreakOutData(tableData)
self.nActId = actId
self.ActEnd = true
if tableData ~= nil then
self:CacheAllLevelData(tableData)
@@ -11,6 +11,7 @@ local mapEventConfig = {
SetPlayFinishState = "SetPlayFinishState"
}
function BreakOutLevelData:InitData(nLevelId, nCharacterNid, nActId)
self:UnBindEvent()
self.nLevelId = nLevelId
self.tbSkillData = {}
self.cacheHasDicList = {}
@@ -18,9 +19,8 @@ function BreakOutLevelData:InitData(nLevelId, nCharacterNid, nActId)
self.nCharacterNid = nCharacterNid
self.bRestart = false
self:BindEvent()
self.tbDropCollect = {}
self.FloorId = ConfigTable.GetData("BreakOutLevel", nLevelId).FloorId
self.bIsEnd = true
self.bShouldExit = true
self.bIsFinishGame = false
local sJson = LocalData.GetPlayerLocalData("BreakOutFloorDicId")
local tb = decodeJson(sJson)
@@ -35,6 +35,7 @@ function BreakOutLevelData:RefreshCharSkillCd(nCharacterId, nCD)
self.tbCharacterData[nCharacterId].nCD = nCD
end
function BreakOutLevelData:GetCurrentFloorDrops(FloorData)
self.tbDropCollect = {}
if FloorData == nil then
return
end
@@ -77,7 +78,7 @@ function BreakOutLevelData:UnBindEvent()
end
end
function BreakOutLevelData:OnEvent_UnloadComplete()
if not self.bIsEnd then
if not self.bShouldExit then
local tempData = {
curChar = self.nCharacterNid,
nLevelId = self.nLevelId,
@@ -86,17 +87,17 @@ function BreakOutLevelData:OnEvent_UnloadComplete()
}
EventManager.Hit("BreakOutRestart")
EventManager.Hit("Event_ReStartBreakOut", tempData)
self.bIsEnd = true
self.bShouldExit = true
else
NovaAPI.EnterModule("MainMenuModuleScene", true)
self:UnBindEvent()
end
end
function BreakOutLevelData:SetBreakOut_Complete(bIsEnd)
self.bIsEnd = bIsEnd
self.bShouldExit = bIsEnd
end
function BreakOutLevelData:GetIsBreakOut_Complete()
return self.bIsEnd
return self.bShouldExit
end
function BreakOutLevelData:SetPlayFinishState(bIsFinishGame)
self.bIsFinishGame = bIsFinishGame
@@ -0,0 +1,251 @@
local ActivityDataBase = require("GameCore.Data.DataClass.Activity.ActivityDataBase")
local LocalData = require("GameCore.Data.LocalData")
local GoldenSpyData = class("GoldenSpyData", ActivityDataBase)
local GoldenSpyLevelData = require("Game.UI.Activity.GoldenSpy.GoldenSpyLevelData")
local ClientManager = CS.ClientManager.Instance
local RapidJson = require("rapidjson")
local RedDotManager = require("GameCore.RedDot.RedDotManager")
function GoldenSpyData:Init()
self.GoldenSpyLevelData = GoldenSpyLevelData.new()
self.cacheEnterGroupList = {}
self.tbLevelGroupData = {}
self.tbLevelData = {}
self.cacheEnterFloorList = {}
self:AddListeners()
end
function GoldenSpyData:AddListeners()
EventManager.Add(EventId.IsNewDay, self, self.OnEvent_NewDay)
end
function GoldenSpyData:OnEvent_NewDay()
end
function GoldenSpyData:RefreshGoldenSpyActData(actId, msgData)
self:Init()
self.nActId = actId
self.tbLevelGroupData = {}
self.tbLevelData = {}
local sJson = LocalData.GetPlayerLocalData("GoldenSpyGroupData")
local tb = decodeJson(sJson)
if type(tb) == "table" then
self.cacheEnterGroupList = tb
end
local sfloorJson = LocalData.GetPlayerLocalData("GoldenSpyFloorData")
local tbFloor = decodeJson(sfloorJson)
if type(tbFloor) == "table" then
self.cacheEnterFloorList = tbFloor
end
self:CacheAllLevelData(msgData.Levels)
end
function GoldenSpyData:CacheAllLevelData(msgData)
local controllCfg = ConfigTable.GetData("GoldenSpyControl", self.nActId)
if controllCfg == nil then
return
end
for _, v in ipairs(controllCfg.LevelGroupList) do
local levelGroupCfg = ConfigTable.GetData("GoldenSpyLevelGroup", v)
if levelGroupCfg ~= nil then
local levelGroupData = {
nId = levelGroupCfg.Id,
nStartTime = self:GetGroupStartTime(levelGroupCfg.Id)
}
self.tbLevelGroupData[levelGroupCfg.Id] = levelGroupData
for _, v in ipairs(levelGroupCfg.LevelList) do
local levelCfg = ConfigTable.GetData("GoldenSpyLevel", v)
if levelCfg ~= nil then
local levelData = {
nId = levelCfg.Id,
nMaxScore = 0,
bFirstComplete = false
}
self:UpdateLevelData(levelData)
end
end
end
end
if msgData ~= nil then
for _, v in ipairs(msgData) do
local levelData = {
nId = v.LevelId,
nMaxScore = v.MaxScore or 0,
bFirstComplete = v.FirstComplete
}
self:UpdateLevelData(levelData)
end
end
self:RefreshRedDot()
end
function GoldenSpyData:UpdateLevelData(levelData)
self.tbLevelData[levelData.nId] = levelData
end
function GoldenSpyData:GetLevelDataById(levelId)
return self.tbLevelData[levelId]
end
function GoldenSpyData:CheckPreLevelPassById(levelId)
local levelCfg = ConfigTable.GetData("GoldenSpyLevel", levelId)
if levelCfg == nil then
return false
end
local preLevelId = levelCfg.PreLevelId
if preLevelId == 0 then
return true
end
local preLevelData = self:GetLevelDataById(preLevelId)
if preLevelData == nil then
return true
end
return preLevelData.bFirstComplete
end
function GoldenSpyData:GetGroupIsNew(groupId)
if table.indexof(self.cacheEnterGroupList, groupId) == 0 then
return true
end
return false
end
function GoldenSpyData:EnterGroupSelect(groupId)
local actGroupId = ConfigTable.GetData("Activity", self.nActId).MidGroupId
if table.indexof(self.cacheEnterGroupList, groupId) == 0 then
table.insert(self.cacheEnterGroupList, groupId)
LocalData.SetPlayerLocalData("GoldenSpyGroupData", RapidJson.encode(self.cacheEnterGroupList))
RedDotManager.SetValid(RedDotDefine.Activity_GoldenSpy_Group, {actGroupId, groupId}, false)
self:RefreshRedDot()
end
end
function GoldenSpyData:GetLevelGroupDataById(groupId)
return self.tbLevelGroupData[groupId]
end
function GoldenSpyData:GetAllLevelGroupData()
return self.tbLevelGroupData
end
function GoldenSpyData:CheckPreGroupPassByGroupId(groupId)
local tbGroupList = ConfigTable.GetData("GoldenSpyControl", self.nActId).LevelGroupList
local nIndex = table.indexof(tbGroupList, groupId)
if nIndex == 1 then
return true
end
local preGroupId = tbGroupList[nIndex - 1]
local preGroupData = self:GetLevelGroupDataById(preGroupId)
if preGroupData == nil then
return false
end
local groupCfg = ConfigTable.GetData("GoldenSpyLevelGroup", preGroupId)
if groupCfg == nil then
return false
end
local bAllLevelPass = true
for _, levelId in ipairs(groupCfg.LevelList) do
local levelData = self:GetLevelDataById(levelId)
local levelCfg = ConfigTable.GetData("GoldenSpyLevel", levelId)
if levelData == nil then
bAllLevelPass = false
break
end
if not levelData.bFirstComplete then
bAllLevelPass = false
break
end
end
return bAllLevelPass
end
function GoldenSpyData:GetGroupStartTime(groupId)
local groupConfig = ConfigTable.GetData("GoldenSpyLevelGroup", groupId)
if groupConfig == nil then
return 0
end
local openActDayNextTime = ClientManager:GetNextRefreshTime(self.nOpenTime)
local nTempDay = 0
if openActDayNextTime > self.nOpenTime then
nTempDay = 1
end
local nDay = (ClientManager.serverTimeStamp - openActDayNextTime) // 86400 + nTempDay
if nDay >= groupConfig.DayOpen then
return 0
end
local openDayNextTime = ClientManager:GetNextRefreshTime(ClientManager.serverTimeStamp)
return openDayNextTime + (groupConfig.DayOpen - nDay - 1) * 86400
end
function GoldenSpyData:GetGoldenSpyLevelData()
return self.GoldenSpyLevelData
end
function GoldenSpyData:GetGoldenSpyFloorData()
return self.GoldenSpyLevelData:GetFloorData()
end
function GoldenSpyData:RefreshRedDot()
if not self:GetPlayState() then
return
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
RedDotManager.SetValid(RedDotDefine.Activity_GoldenSpy_Group, {
actGroupId,
groupData.nId
}, false)
elseif not self:CheckPreGroupPassByGroupId(groupData.nId) then
RedDotManager.SetValid(RedDotDefine.Activity_GoldenSpy_Group, {
actGroupId,
groupData.nId
}, false)
else
RedDotManager.SetValid(RedDotDefine.Activity_GoldenSpy_Group, {
actGroupId,
groupData.nId
}, self:GetGroupIsNew(groupData.nId))
end
end
end
function GoldenSpyData:StartLevel(groupId, levelId)
self.nGroupId = groupId
self.GoldenSpyLevelData:InitData()
self.GoldenSpyLevelData:StartLevel(levelId)
EventManager.Hit(EventId.OpenPanel, PanelId.GoldenSpyPanel, self.nActId, self.nGroupId, levelId)
end
function GoldenSpyData:FinishLevel(levelId, data, callback)
local items = {}
for _, v in pairs(data.tbItems) do
local data = {
ItemId = v.itemId,
PickCount = v.itemCount
}
table.insert(items, data)
end
local skills = {}
for k, v in pairs(data.tbSkills) do
local data = {SkillId = k, UseCount = v}
table.insert(skills, data)
end
local mapMsg = {
ActivityId = self.nActId,
LevelId = levelId,
Floor = data.nFloor,
Score = data.nScore,
CompletedTaskCount = data.nTaskCompleteCount,
Items = items,
Skills = skills
}
local callback = function(_, msgData)
local oldLevelData = self:GetLevelDataById(levelId)
local levelCfg = ConfigTable.GetData("GoldenSpyLevel", levelId)
local levelData = {
nId = levelId,
nMaxScore = math.max(oldLevelData.nMaxScore, data.nScore),
bFirstComplete = oldLevelData.bFirstComplete or data.nScore >= levelCfg.Score
}
self:UpdateLevelData(levelData)
if callback ~= nil then
callback()
end
end
HttpNetHandler.SendMsg(NetMsgId.Id.activity_gds_settle_req, mapMsg, nil, callback)
end
function GoldenSpyData:EnterFloor(floorId)
if table.indexof(self.cacheEnterFloorList, floorId) == 0 then
table.insert(self.cacheEnterFloorList, floorId)
LocalData.SetPlayerLocalData("GoldenSpyFloorData", RapidJson.encode(self.cacheEnterFloorList))
end
end
function GoldenSpyData:GetFloorIsNew(floorId)
if table.indexof(self.cacheEnterFloorList, floorId) == 0 then
return true
end
return false
end
return GoldenSpyData
@@ -224,6 +224,10 @@ function PenguinCardActData:RefreshLevelRedDot()
local bSkip = table.indexof(self.tbSkipNewLevel, nId) > 0
if bSkip then
RedDotManager.SetValid(RedDotDefine.Activity_PenguinCard_Level, {nId}, false)
local bInActGroup, nActGroupId = PlayerData.Activity:IsActivityInActivityGroup(self.nActId)
if bInActGroup then
RedDotManager.SetValid(RedDotDefine.Activity_Group_PenguinCard_Level, {nActGroupId, nId}, false)
end
else
local bLock = self:CheckLevelLock(nId)
local bHasScore = self.mapLevelData[nId] and 0 < self.mapLevelData[nId].nScore
@@ -234,10 +238,18 @@ function PenguinCardActData:RefreshLevelRedDot()
RedDotManager.SetValid(RedDotDefine.Activity_PenguinCard_Level, {nId}, bNew)
end
end
local bInActGroup, nActGroupId = PlayerData.Activity:IsActivityInActivityGroup(self.nActId)
if bInActGroup then
RedDotManager.SetValid(RedDotDefine.Activity_Group_PenguinCard_Level, {nActGroupId}, #self.tbNewLevel > 0)
end
end
function PenguinCardActData:SkipLevelRedDot()
for _, nId in ipairs(self.tbNewLevel) do
RedDotManager.SetValid(RedDotDefine.Activity_PenguinCard_Level, {nId}, false)
local bInActGroup, nActGroupId = PlayerData.Activity:IsActivityInActivityGroup(self.nActId)
if bInActGroup then
RedDotManager.SetValid(RedDotDefine.Activity_Group_PenguinCard_Level, {nActGroupId}, false)
end
if table.indexof(self.tbSkipNewLevel, nId) == 0 then
table.insert(self.tbSkipNewLevel, nId)
end
@@ -26,6 +26,8 @@ local SpringFestival_10104Data = require("GameCore.Data.DataClass.Activity.Sprin
local WinterNight_10105Data = require("GameCore.Data.DataClass.Activity.WinterNight_10105Data")
local Postal_10106Data = require("GameCore.Data.DataClass.Activity.Postal_10106Data")
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")
function PlayerActivityData:Init()
self.bCacheActData = false
self.tbAllActivity = {}
@@ -134,6 +136,8 @@ function PlayerActivityData:CacheAllActivityData(mapNetMsg)
self:RefreshThrowGiftData(nActId, v.ThrowGift)
elseif actCfg.ActivityType == GameEnum.activityType.PenguinCard then
self:RefreshPenguinCardActData(nActId, v.PenguinCard)
elseif actCfg.ActivityType == GameEnum.activityType.GoldenSpy then
self:RefreshGoldenSpyActData(nActId, v.GDS)
end
end
end
@@ -228,6 +232,8 @@ function PlayerActivityData:CreateActivityIns(actData)
actIns = ThrowGiftData.new(actData)
elseif actCfg.ActivityType == GameEnum.activityType.PenguinCard then
actIns = PenguinCardActData.new(actData)
elseif actCfg.ActivityType == GameEnum.activityType.GoldenSpy then
actIns = GoldenSpyData.new(actData)
end
if actIns ~= nil then
self.tbAllActivity[actData.Id] = actIns
@@ -327,6 +333,8 @@ function PlayerActivityData:CreateActivityGroupIns(actData)
actIns = WinterNight_10105Data.new(actData)
elseif actCfg.ActivityThemeType == GameEnum.activityThemeType.Postal_10106 then
actIns = Postal_10106Data.new(actData)
elseif actCfg.ActivityThemeType == GameEnum.activityThemeType.SoloDance_20102 then
actIns = Solodance_20102Data.new(actData)
end
self.tbAllActivityGroup[actData.Id] = actIns
PlayerData.ActivityAvg:RefreshAvgRedDot()
@@ -560,6 +568,11 @@ function PlayerActivityData:RefreshPenguinCardActData(nActId, msgData)
self.tbAllActivity[nActId]:RefreshPenguinCardActData(msgData)
end
end
function PlayerActivityData:RefreshGoldenSpyActData(nActId, msgData)
if nil ~= self.tbAllActivity[nActId] then
self.tbAllActivity[nActId]:RefreshGoldenSpyActData(nActId, msgData)
end
end
function PlayerActivityData:RefreshActivityLevelGameActData(nActId, msgData)
if nil ~= self.tbAllActivity[nActId] then
self.tbAllActivity[nActId]:RefreshActivityLevelGameActData(nActId, msgData)
@@ -0,0 +1,61 @@
local ActivityGroupDataBase = require("GameCore.Data.DataClass.Activity.ActivityGroupDataBase")
local Solodance_20102Data = class("Solodance_20102Data", ActivityGroupDataBase)
function Solodance_20102Data:Init()
self.tbAllActivity = {}
self.nCGActivityId = 0
self.sCGPath = ""
self.bPlayedCG = false
self:ParseActivity()
end
function Solodance_20102Data:ParseActivity()
if self.actGroupConfig == nil then
self.actGroupConfig = ConfigTable.GetData("ActivityGroup", self.nActGroupId)
end
local sJson = self.actGroupConfig.Enter
local tbJson = decodeJson(sJson)
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)
self.nCGActivityId = tonumber(tbCGJson[1])
self.sCGPath = tbCGJson[2]
end
end
function Solodance_20102Data:GetActivityDataByIndex(nIndex)
for _, activity in pairs(self.tbAllActivity) do
if activity.Index == nIndex then
return activity
end
end
end
function Solodance_20102Data:PlayCG()
self:SendMsg_CG_READ(self.nCGActivityId)
end
function Solodance_20102Data:GetActivityGroupCGPlayed()
if self.bPlayedCG then
return true
end
return PlayerData.Activity:IsCGPlayed(self.nCGActivityId)
end
function Solodance_20102Data:IsActivityInActivityGroup(nActivityId)
for _, activity in pairs(self.tbAllActivity) do
if activity.ActivityId == nActivityId then
return true, self.nActGroupId
end
end
return false
end
function Solodance_20102Data:SendMsg_CG_READ(nActivityId)
local Callback = function()
self.bPlayedCG = true
end
HttpNetHandler.SendMsg(NetMsgId.Id.activity_cg_read_req, {nActivityId}, nil, Callback)
end
return Solodance_20102Data
@@ -13,6 +13,10 @@ function TrekkerVersusData:Init()
self.bFirstIn = true
self.nSuccessBattle = 0
self.nLastBattleHard = 0
self.nTimerIdleRefresh = 0
self.bFirstBattlePlayed = false
EventManager.Add("TrekkerVersusReceiveHeatQuest", self, self.RequestReceiveScheduleReward)
EventManager.Add("TrekkerVersusFanGiftDataRefresh", self, self.OnEvent_TrekkerVersusFanGiftDataRefresh)
end
function TrekkerVersusData:GetActivityData()
return {
@@ -31,19 +35,28 @@ function TrekkerVersusData:RefreshTrekkerVersusData(nActId, msgData)
self.nFanLevel = msgData.Level
self.nFanExp = msgData.Exp
self.nIdleRewardStartTime = msgData.Show.IdleTime
self.tbIdleReward = msgData.Show.IdleValues
self.tbIdleReward = msgData.Show.IdleValues or {}
self.nSelfHotValue = msgData.Show.SelfHotValue
self.nRivalHotValue = msgData.Show.RivalHotValue
self.tbHotValueRewardIds = msgData.HotValueRewardIds
self.tbHotValueRewardIds = msgData.HotValueRewardIds or {}
self.tbDuelRewardIds = msgData.DuelRewardIds
self.tbDuelHistory = msgData.HistoryResult
self.tbDuelHistory = msgData.Results
self.bFirstBattlePlayed = self.nIdleRewardStartTime ~= nil and self.nIdleRewardStartTime > 0
self.nLastBuildId = msgData.BuildId
self.nCachedBuildId = msgData.BuildId
self.nRecord = msgData.Show.Difficulty
self.nRecord = msgData.Show.Difficult or 0
self.nRivalCount = 0
local foreachRival = function(mapData)
if mapData.GroupId == self.nActId then
self.nRivalCount = self.nRivalCount + 1
end
end
ForEachTableLine(DataTable.TravelerDuelTarget, foreachRival)
for _, mapQuest in ipairs(msgData.Quests) do
self.mapQuests[mapQuest.Id] = mapQuest
end
self:RefreshQusetRedDot()
PlayerData.State:RefreshTrekkerVersusIdleRewardRedDot()
end
function TrekkerVersusData:EnterTrekkerVersus(nLevelId, nBuildId, tbAffix)
local callback = function()
@@ -65,11 +78,7 @@ function TrekkerVersusData:GetTravelerDuelAffixUnlock(nAffixId)
if mapAffixCfgData.UnlockDurationTime > 0 and curTimeStamp < _fixedTimeStamp then
local sCond = ""
local sumTime = _fixedTimeStamp - curTimeStamp
if 86400 < sumTime then
sCond = orderedFormat(ConfigTable.GetUIText("TDQuest_Day"), math.floor(sumTime / 86400))
else
sCond = ConfigTable.GetUIText("TDQuest_LessThenDay")
end
sCond = orderedFormat(ConfigTable.GetUIText("TDQuest_Day"), math.ceil(sumTime / 86400))
return false, 4, sCond
end
if 0 < mapAffixCfgData.UnlockDifficulty and self.nRecord < mapAffixCfgData.UnlockDifficulty then
@@ -99,18 +108,38 @@ function TrekkerVersusData:GetAllQuestData()
table.sort(ret, sort)
return ret
end
function TrekkerVersusData:CheckBattlePlayed()
return self.bFirstBattlePlayed
end
function TrekkerVersusData:GetCurStreamerDuelData()
local mapStreamerDuelCfgData = self:GetTrekkerVersusCfgData()
local mapDuelData
local nMaxDay = 1
local mapLastData
local foreachDuel = function(mapData)
if mapData.DayNum >= nMaxDay then
nMaxDay = mapData.DayNum
mapLastData = mapData
end
if mapData.GroupId == mapStreamerDuelCfgData.TargetGroupId and mapData.DayNum == self.nDayNum then
mapDuelData = mapData
end
end
ForEachTableLine(DataTable.TravelerDuelTarget, foreachDuel)
if mapDuelData == nil then
mapDuelData = mapLastData
end
return mapDuelData
end
function TrekkerVersusData:GetCurHeatValue()
local nLastDuelResultHeatValue = 0
if self.tbDuelHistory ~= nil and 0 < #self.tbDuelHistory then
nLastDuelResultHeatValue = self.tbDuelHistory[#self.tbDuelHistory].SelfHotValue or 0
end
if nLastDuelResultHeatValue > self.nSelfHotValue then
self.nSelfHotValue = nLastDuelResultHeatValue
self.nRivalHotValue = self.tbDuelHistory[#self.tbDuelHistory].RivalHotValue or 0
end
local mapHeatData = {
nSelfHotValue = self.nSelfHotValue or 0,
nRivalHotValue = self.nRivalHotValue or 0
@@ -128,10 +157,52 @@ function TrekkerVersusData:GetCurFanData()
return mapFanData
end
function TrekkerVersusData:GetDuelHistory()
table.sort(self.tbDuelHistory, function(a, b)
return a.SelfHotValue > b.SelfHotValue
end)
return self.tbDuelHistory
end
function TrekkerVersusData:GetIdleReward()
return self.tbIdleReward
local tbIdleReward = {}
local bAllZero = true
local foreachIdleReward = function(mapData)
for k, v in pairs(self.tbIdleReward) do
if v.TypeId == mapData.HotValueItemType then
local nCount = math.floor(v.Value / mapData.CumulativeValue)
if 1 <= nCount then
bAllZero = false
end
table.insert(tbIdleReward, {
Tid = mapData.Id,
Qty = nCount
})
break
end
end
end
ForEachTableLine(DataTable.TravelerDuelHotValueItem, foreachIdleReward)
if bAllZero then
tbIdleReward = {}
end
return tbIdleReward
end
function TrekkerVersusData:GetIdleValue()
return self.tbIdleReward or 0
end
function TrekkerVersusData:GetRecordLevel()
return self.nRecord or 0
end
function TrekkerVersusData:GetIdleRewardStartTime()
return self.nIdleRewardStartTime
end
function TrekkerVersusData:GetRivalCount()
return self.nRivalCount or 0
end
function TrekkerVersusData:GetHotValueRewardTable()
return self.tbHotValueRewardIds
end
function TrekkerVersusData:GetDuelRewardTable()
return self.tbDuelRewardIds
end
function TrekkerVersusData:SetCachedBuildId(nBuildId)
self.nCachedBuildId = nBuildId
@@ -163,7 +234,7 @@ function TrekkerVersusData:EnterGame(nLevel, nBuildId, tbAffixes)
end
end
function TrekkerVersusData:SettleBattle(bSuccess, nLevelId, nTime, tbAffix, nBuildId, msgCallback)
local callback = function()
local callback = function(_, msgData)
local bNewRecord = false
if bSuccess then
local nRecordLevel = 0
@@ -188,6 +259,7 @@ function TrekkerVersusData:SettleBattle(bSuccess, nLevelId, nTime, tbAffix, nBui
end
self.nSuccessBattle = 1
self.nLastBattleHard = nRecordLevel
self.bFirstBattlePlayed = true
else
self.nSuccessBattle = -1
local nRecordLevel = 0
@@ -199,6 +271,10 @@ function TrekkerVersusData:SettleBattle(bSuccess, nLevelId, nTime, tbAffix, nBui
end
self.nLastBattleHard = nRecordLevel
end
if msgData ~= nil and msgData.Show ~= nil then
self.nIdleRewardStartTime = msgData.Show.IdleTime
self.tbIdleReward = msgData.Show.IdleValues
end
if msgCallback ~= nil then
msgCallback(bNewRecord)
end
@@ -213,20 +289,47 @@ function TrekkerVersusData:SettleBattle(bSuccess, nLevelId, nTime, tbAffix, nBui
}
HttpNetHandler.SendMsg(NetMsgId.Id.activity_trekker_versus_settle_req, msg, nil, callback)
end
function TrekkerVersusData:RequestIdleRefresh()
local msg = {
Value = self.nActId
}
local callback = function(_, msgData)
function TrekkerVersusData:RequestIdleRefresh(callback)
local nElapsedTime = CS.ClientManager.Instance.serverTimeStamp - self.nTimerIdleRefresh
if nElapsedTime < 60 then
if callback ~= nil then
callback()
end
return
end
self.nTimerIdleRefresh = CS.ClientManager.Instance.serverTimeStamp
local cb = function(_, msgData)
if msgData ~= nil then
self.nIdleRewardStartTime = msgData.IdleTime
self.nDifficult = msgData.Difficulty
self.tbIdleReward = msgData.IdleValues
self.nSelfHotValue = msgData.SelfHotValue
self.nRivalHotValue = msgData.RivalHotValue
local bRedDotOn = false
if self.tbIdleReward ~= nil and #self.tbIdleReward > 0 then
local nPassedTime = CS.ClientManager.Instance.serverTimeStamp - self.nIdleRewardStartTime
if nPassedTime >= 3600 * ConfigTable.GetConfigNumber("TrekkerVersusIdleRewardRedDotTime") then
bRedDotOn = true
end
end
local bInActGroup, nActGroupId = PlayerData.Activity:IsActivityInActivityGroup(self.nActId)
if bInActGroup then
RedDotManager.SetValid(RedDotDefine.TrekkerVersusIdleReward, {
nActGroupId,
self.nActId
}, bRedDotOn)
end
PlayerData.State:RefreshTrekkerVersusIdleRewardRedDot(self.nIdleRewardStartTime)
self:RefreshQusetRedDot()
local mapHeatData = self:GetCurHeatValue()
EventManager.Hit("UpdateTrekkerVersusHotValue", mapHeatData.nSelfHotValue, mapHeatData.nRivalHotValue)
if callback ~= nil then
callback(msgData)
end
end
end
HttpNetHandler.SendMsg(NetMsgId.Id.activity_trekker_versus_idle_refresh_req, msg, nil, callback)
HttpNetHandler.SendMsg(NetMsgId.Id.activity_trekker_versus_idle_refresh_req, {
Value = self.nActId
}, nil, cb)
end
function TrekkerVersusData:RequestIdleRewardReceive(callback)
local msg = {
@@ -235,10 +338,16 @@ function TrekkerVersusData:RequestIdleRewardReceive(callback)
local cb = function(_, msgData)
if msgData ~= nil then
if msgData.Change ~= nil then
HttpNetHandler.ProcChangeInfo(msgData.Change)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(msgData.Change)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
UTILS.OpenReceiveByDisplayItem(msgData.AwardItems, msgData.ChangeInfo)
end
self.nIdleRewardStartTime = msgData.IdleTime
for k, v in pairs(self.tbIdleReward) do
v.Value = 0
end
PlayerData.State:RefreshTrekkerVersusIdleRewardRedDot(self.nIdleRewardStartTime)
self:RefreshQusetRedDot()
if callback ~= nil then
callback(msgData)
end
@@ -246,7 +355,7 @@ function TrekkerVersusData:RequestIdleRewardReceive(callback)
end
HttpNetHandler.SendMsg(NetMsgId.Id.activity_trekker_versus_idle_reward_receive_req, msg, nil, cb)
end
function TrekkerVersusData:RequestSendStreamerGift(tbGift, callback)
function TrekkerVersusData:RequestSendStreamerGift(tbGift, nAddHotValue, callback)
local msg = {
ActivityId = self.nActId,
Items = tbGift
@@ -257,12 +366,20 @@ function TrekkerVersusData:RequestSendStreamerGift(tbGift, callback)
local nPrevFanExp = self.nFanExp
self.nFanLevel = msgData.Level
self.nFanExp = msgData.Exp
self.nSelfHotValue = msgData.Show.SelfHotValue
self.nRivalHotValue = msgData.Show.RivalHotValue
if msgData.Change ~= nil then
HttpNetHandler.ProcChangeInfo(msgData.Change)
UTILS.OpenReceiveByDisplayItem(msgData.AwardItems, msgData.ChangeInfo)
local nNowTime = CS.ClientManager.Instance.serverTimeStamp
if msgData.SelfHotValue > self.nSelfHotValue then
self.nSelfHotValue = msgData.SelfHotValue
elseif nNowTime < self:GetChallengeEndTime() then
self.nSelfHotValue = self.nSelfHotValue + nAddHotValue
end
self.nRivalHotValue = msgData.RivalHotValue
local mapHeatData = self:GetCurHeatValue()
EventManager.Hit("UpdateTrekkerVersusHotValue", mapHeatData.nSelfHotValue, mapHeatData.nRivalHotValue)
if msgData.Change ~= nil then
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(msgData.Change)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
self:RefreshQusetRedDot()
if callback ~= nil then
callback(msgData, nPrevFanLevel, nPrevFanExp)
end
@@ -276,9 +393,30 @@ function TrekkerVersusData:RequestReceiveScheduleReward(nScheduleType)
ScheduleType = nScheduleType
}
local callback = function(_, msgData)
if msgData ~= nil and msgData.Change ~= nil then
HttpNetHandler.ProcChangeInfo(msgData.Change)
UTILS.OpenReceiveByDisplayItem(msgData.AwardItems, msgData.ChangeInfo)
if msgData ~= nil then
if msgData.Change ~= nil then
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(msgData.Change)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
UTILS.OpenReceiveByDisplayItem(msgData.AwardItems, msgData.ChangeInfo)
end
if nScheduleType == 1 then
local foreachHeatQuest = function(mapQuestData)
if mapQuestData.TargetValue <= self.nSelfHotValue and table.indexof(self.tbHotValueRewardIds, mapQuestData.Id) <= 0 then
table.insert(self.tbHotValueRewardIds, mapQuestData.Id)
end
end
ForEachTableLine(DataTable.TravelerDuelHotValueRewards, foreachHeatQuest)
self:RefreshQusetRedDot()
EventManager.Hit("TrekkerVersusHeatQuestRefresh")
elseif nScheduleType == 2 then
for _, v in pairs(self.tbDuelHistory) do
if table.indexof(self.tbDuelRewardIds, v.TargetId) <= 0 then
table.insert(self.tbDuelRewardIds, v.TargetId)
end
end
self:RefreshQusetRedDot()
EventManager.Hit("TrekkerVersusDuelQuestRefresh")
end
end
end
HttpNetHandler.SendMsg(NetMsgId.Id.activity_trekker_versus_schedule_reward_receive_req, msg, nil, callback)
@@ -309,8 +447,10 @@ function TrekkerVersusData:ReceiveQuestReward(callback)
end
end
local msgCallback = function(_, msgData)
if callback ~= nil then
callback(msgData)
if msgData.Change ~= nil then
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(msgData.Change)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
UTILS.OpenReceiveByDisplayItem(msgData.AwardItems, msgData.ChangeInfo)
end
for _, mapQuest in pairs(self.mapQuests) do
if mapQuest.Status == 1 then
@@ -318,6 +458,10 @@ function TrekkerVersusData:ReceiveQuestReward(callback)
end
end
self:RefreshQusetRedDot()
EventManager.Hit("TrekkerVersusQuestRefresh")
if callback ~= nil then
callback(msgData)
end
end
if bReceive then
local msg = {
@@ -347,16 +491,60 @@ function TrekkerVersusData:GetChallengeEndTime()
end
return self.nEndTime
end
function TrekkerVersusData:IsOpenStreamerDuel(nStartTime)
local nowTime = CS.ClientManager.Instance.serverTimeStamp
local nEndTime = CS.ClientManager.Instance:GetNextRefreshTime(nStartTime) + 86400 * (self.nRivalCount - 1)
return nStartTime < nowTime and nowTime < nEndTime
end
function TrekkerVersusData:RefreshQusetRedDot()
local bVisible = false
local bGiftQuestVisible = false
local bBattleQuestVisible = false
for _, mapQuest in pairs(self.mapQuests) do
if mapQuest.Status == 1 then
bVisible = true
break
local mapQuestData = ConfigTable.GetData("TravelerDuelChallengeQuest", mapQuest.Id)
if mapQuestData.CompleteCond == GameEnum.questCompleteCond.TrekkerVersusFansWithSpecificLevel then
bGiftQuestVisible = true
else
bBattleQuestVisible = true
end
end
end
RedDotManager.SetValid(RedDotDefine.TrekkerVersusQuest, nil, bVisible)
RedDotManager.SetValid(RedDotDefine.TrekkerVersusQuest_1, nil, bVisible)
local bInActGroup, nActGroupId = PlayerData.Activity:IsActivityInActivityGroup(self.nActId)
if bInActGroup then
RedDotManager.SetValid(RedDotDefine.TrekkerVersusGiftQuest, {
nActGroupId,
self.nActId
}, bGiftQuestVisible)
RedDotManager.SetValid(RedDotDefine.TrekkerVersusBattleQuest, {
nActGroupId,
self.nActId
}, bBattleQuestVisible)
end
local bStreamerDuelOpen = self:IsOpenStreamerDuel(self:GetChallengeStartTime())
local nPassedDuelCount = bStreamerDuelOpen and self.nDayNum - 1 or self.nRivalCount
if self.nDayNum == 0 then
nPassedDuelCount = self.nRivalCount
end
local nReceivedDuelReward = #self.tbDuelRewardIds
if bInActGroup then
RedDotManager.SetValid(RedDotDefine.TrekkerVersusDuelQuest, {
nActGroupId,
self.nActId
}, nPassedDuelCount > nReceivedDuelReward)
end
local bHeatQuestVisible = false
local foreachHeatReward = function(mapData)
if mapData.TargetValue <= self.nSelfHotValue and table.indexof(self.tbHotValueRewardIds, mapData.Id) <= 0 then
bHeatQuestVisible = true
end
end
ForEachTableLine(DataTable.TravelerDuelHotValueRewards, foreachHeatReward)
if bInActGroup then
RedDotManager.SetValid(RedDotDefine.TrekkerVersusHeatQuest, {
nActGroupId,
self.nActId
}, bHeatQuestVisible)
end
end
function TrekkerVersusData:GetFirstIn()
local bFirst = self.bFirstIn
@@ -365,4 +553,12 @@ function TrekkerVersusData:GetFirstIn()
end
return bFirst
end
function TrekkerVersusData:OnEvent_TrekkerVersusFanGiftDataRefresh(nActId, nFanLevel, nExp)
if nActId ~= self.nActId then
return
end
self.nFanLevel = nFanLevel
self.nFanExp = nExp
EventManager.Hit("TrekkerVersusFanGiftShowRefresh")
end
return TrekkerVersusData
@@ -1,4 +1,6 @@
local dailycheckinctrl = require("Game.UI.CheckIn.DailyCheckInCtrl")
local NotificationManager = require("GameCore.Module.NotificationManager")
local LocalSettingData = require("GameCore.Data.LocalSettingData")
local DispatchData = class("DispatchData")
local tbAllDispatchData = {}
local tbWeeklyDispatchDataIds = {}
@@ -9,6 +11,8 @@ local OnEvent_NewDay = function()
tbCompletedDailyDispatchIds = {}
EventManager.Hit("UpdateDispatchData")
end
local OnEvent_SettingsNotificationClose = function()
end
local Init = function()
EventManager.Add(EventId.IsNewDay, DispatchData, OnEvent_NewDay)
end
@@ -23,6 +27,7 @@ local CacheDispatchData = function(data)
local state = AllEnum.DispatchState.Accepting
if v.ProcessTime * 60 + v.StartTime <= CS.ClientManager.Instance.serverTimeStamp then
state = AllEnum.DispatchState.Complete
else
end
tbAllDispatchData[v.Id] = {Data = v, State = state}
end
+82 -24
View File
@@ -16,7 +16,9 @@ function EquipmentData:Clear()
self.nRefreshId = nil
self.bLock = nil
self.tbAffix = nil
self.tbUpgradeCount = nil
self.tbAlterAffix = nil
self.tbAlterUpgradeCount = nil
self.tbPotentialAffix = nil
self.tbSkillAffix = nil
self.tbRandomAttr = nil
@@ -44,51 +46,72 @@ function EquipmentData:ParseConfigData(equipmentCfg)
end
function EquipmentData:ParseServerData(mapEquipment)
self.bLock = mapEquipment.Lock
self:UpdateAffix(mapEquipment.Attributes)
self:UpdateAlterAffix(mapEquipment.AlterAttributes)
self:UpdateAffix(mapEquipment.Attributes, mapEquipment.OverlockCount)
self:UpdateAlterAffix(mapEquipment.AlterAttributes, mapEquipment.AlterOverlockCount)
end
function EquipmentData:UpdateAffix(tbAttributes)
function EquipmentData:UpdateAffix(tbAttributes, tbCount)
self.tbAffix = tbAttributes
self:UpdateRandomAttr(self.tbAffix)
self.tbUpgradeCount = tbCount
self:UpdateRandomAttr(self.tbAffix, self.tbUpgradeCount)
end
function EquipmentData:UpdateAlterAffix(tbAttributes)
function EquipmentData:UpdateAlterAffix(tbAttributes, tbCount)
self.tbAlterAffix = tbAttributes
self.tbAlterUpgradeCount = tbCount
end
function EquipmentData:ReplaceRandomAttr()
if not self.tbAlterAffix or next(self.tbAlterAffix) == nil then
return
end
if not self.tbAlterUpgradeCount or next(self.tbAlterUpgradeCount) == nil then
return
end
self.tbAffix = clone(self.tbAlterAffix)
for k, _ in ipairs(self.tbAlterAffix) do
self.tbAlterAffix[k] = 0
end
self:UpdateRandomAttr(self.tbAffix)
self.tbUpgradeCount = clone(self.tbAlterUpgradeCount)
for k, _ in ipairs(self.tbAlterUpgradeCount) do
self.tbAlterUpgradeCount[k] = 0
end
self:UpdateRandomAttr(self.tbAffix, self.tbUpgradeCount)
end
function EquipmentData:UpdateRandomAttr(mapAttrs)
function EquipmentData:UpdateRandomAttr(mapAttrs, tbCount)
self.tbPotentialAffix = {}
self.tbSkillAffix = {}
self.tbRandomAttr = {}
self.tbEffect = {}
for _, v in ipairs(mapAttrs) do
local add = function(mapCfg, nAttrId)
if not mapCfg then
return
end
if mapCfg.AttrType == GameEnum.CharGemEffectType.Potential then
table.insert(self.tbPotentialAffix, mapCfg)
elseif mapCfg.AttrType == GameEnum.CharGemEffectType.SkillLevel then
table.insert(self.tbSkillAffix, mapCfg)
elseif mapCfg.AttrType == GameEnum.effectType.ATTR_FIX or mapCfg.AttrType == GameEnum.effectType.PLAYER_ATTR_FIX then
if mapCfg.AttrTypeSecondSubtype == GameEnum.parameterType.BASE_VALUE then
local value = tonumber(mapCfg.Value) or 0
local mapData = {
AttrId = nAttrId,
Value = value,
CfgValue = value / ConfigData.IntFloatPrecision
}
table.insert(self.tbRandomAttr, mapData)
else
table.insert(self.tbEffect, mapCfg.EffectId)
end
end
end
for k, v in ipairs(mapAttrs) do
if 0 < v then
local mapCfg = ConfigTable.GetData("CharGemAttrValue", v)
if mapCfg then
if mapCfg.AttrType == GameEnum.CharGemEffectType.Potential then
table.insert(self.tbPotentialAffix, mapCfg)
elseif mapCfg.AttrType == GameEnum.CharGemEffectType.SkillLevel then
table.insert(self.tbSkillAffix, mapCfg)
elseif mapCfg.AttrType == GameEnum.effectType.ATTR_FIX or mapCfg.AttrType == GameEnum.effectType.PLAYER_ATTR_FIX then
if mapCfg.AttrTypeSecondSubtype == GameEnum.parameterType.BASE_VALUE then
local value = tonumber(mapCfg.Value) or 0
local mapData = {
AttrId = v,
Value = value,
CfgValue = value / ConfigData.IntFloatPrecision
}
table.insert(self.tbRandomAttr, mapData)
else
table.insert(self.tbEffect, mapCfg.EffectId)
end
if tbCount and 0 < tbCount[k] then
local nId = mapCfg.TypeId * 100 + tbCount[k] + mapCfg.Level
local mapAfterCfg = ConfigTable.GetData("CharGemAttrValue", nId)
add(mapAfterCfg, nId)
else
add(mapCfg, v)
end
end
end
@@ -137,6 +160,41 @@ function EquipmentData:CheckAlterEmpty()
end
return false
end
function EquipmentData:GetUpgradeCount()
local nAll = 0
if self.tbUpgradeCount then
for _, v in ipairs(self.tbUpgradeCount) do
nAll = nAll + v
end
end
return nAll
end
function EquipmentData:ChangeUpgradeCount(nAttrIndex, nChange)
if self.tbAlterUpgradeCount[nAttrIndex] == self.tbUpgradeCount[nAttrIndex] and self.tbAlterAffix[nAttrIndex] == self.tbAffix[nAttrIndex] then
self.tbAlterUpgradeCount[nAttrIndex] = self.tbAlterUpgradeCount[nAttrIndex] + nChange
end
self.tbUpgradeCount[nAttrIndex] = self.tbUpgradeCount[nAttrIndex] + nChange
end
function EquipmentData:CheckUpgradeAble()
local nAll = self:GetUpgradeCount()
local nLimit = ConfigTable.GetConfigNumber("CharGemOverlockCount")
return nAll < nLimit
end
function EquipmentData:CheckUpgradeAlterSame(nAttrIndex)
if not self.tbAlterAffix or next(self.tbAlterAffix) == nil then
return true
end
if not self.tbAlterUpgradeCount or next(self.tbAlterUpgradeCount) == nil then
return true
end
if self.tbAlterAffix[nAttrIndex] == 0 then
return true
end
if self.tbAlterUpgradeCount[nAttrIndex] == self.tbUpgradeCount[nAttrIndex] and self.tbAlterAffix[nAttrIndex] == self.tbAffix[nAttrIndex] then
return true
end
return false
end
function EquipmentData:GetTypeDesc()
local sLanguage = AllEnum.EquipmentType[self.nType].Language
return ConfigTable.GetUIText(sLanguage)
@@ -229,6 +229,11 @@ function FilterData:GetCacheFilterByKey(fKey, sKey)
end
return self:GetFilterByKey(fKey, sKey), false
end
function FilterData:GetCacheFilter(fKey)
if nil ~= self.tbCacheFilter[fKey] then
return self.tbCacheFilter[fKey]
end
end
function FilterData:CacheCharSort(nType, bOrder)
self.nFormationCharSrotType = nType
self.bFormationCharOrder = bOrder
+42 -1
View File
@@ -1,6 +1,8 @@
local PlayerBaseData = class("PlayerBaseData")
local TimerManager = require("GameCore.Timer.TimerManager")
local AvgManager = require("GameCore.Module.AvgManager")
local NotificationManager = require("GameCore.Module.NotificationManager")
local LocalSettingData = require("GameCore.Data.LocalSettingData")
local TimerScaleType = require("GameCore.Timer.TimerScaleType")
local ModuleManager = require("GameCore.Module.ModuleManager")
local localdata = require("GameCore.Data.LocalData")
@@ -127,6 +129,14 @@ function PlayerBaseData:ProcessTableData()
end
ForEachTableLine(ConfigTable.Get("DemonAdvance"), foreachTable)
CacheTable.Set("_DemonAdvance", _tbDemonAdvance)
self.tbHonorLevelTitle = {}
local foreachHonorLevel = function(mapData)
if self.tbHonorLevelTitle[mapData.GroupId] == nil then
self.tbHonorLevelTitle[mapData.GroupId] = {}
end
table.insert(self.tbHonorLevelTitle[mapData.GroupId], mapData)
end
ForEachTableLine(ConfigTable.Get("HonorLevel"), foreachHonorLevel)
end
function PlayerBaseData:CacheAccInfo(mapData)
if mapData ~= nil then
@@ -196,6 +206,19 @@ function PlayerBaseData:CacheHonorTitleInfo(mapData)
end
end
function PlayerBaseData:CacheHonorTitleList(mapData)
if not mapData then
return
end
if not self._tbHonorTitleList then
self._tbHonorTitleList = {}
end
for _, v in pairs(mapData) do
local data = {Id = v}
table.insert(self._tbHonorTitleList, data)
end
self:RefreshHonorTitleRedDot()
end
function PlayerBaseData:CacheHonorTitleListActivity(mapData)
if not mapData then
return
end
@@ -417,7 +440,11 @@ function PlayerBaseData:ChangeHonorTitle(mapData)
local newData = {}
local delData = {}
for _, v in pairs(mapData) do
table.insert(self._tbHonorTitleList, v.NewId)
local data = {
Lv = v.Level,
Id = v.NewId
}
table.insert(self._tbHonorTitleList, data)
local honorData = ConfigTable.GetData("Honor", v.NewId)
if honorData.TabType == GameEnum.honorTabType.Achieve then
local foreachHonor = function(mapData)
@@ -1175,6 +1202,18 @@ function PlayerBaseData:CheckNewFuncUnlockFixedRoguelike(nFRId)
end
ForEachTableLine(DataTable.OpenFunc, ForEachOpenFunc)
end
function PlayerBaseData:GetLevelHonorTitleData(nGroupId)
local tbHonorTitle = {}
local maxLevel = 0
if self.tbHonorLevelTitle[nGroupId] == nil then
return nil, maxLevel
end
for _, v in pairs(self.tbHonorLevelTitle[nGroupId]) do
tbHonorTitle[v.Level] = v
maxLevel = math.max(maxLevel, v.Level)
end
return tbHonorTitle, maxLevel
end
function PlayerBaseData:OnEvent_TransAnimInClear()
self.bInLoading = true
end
@@ -1263,4 +1302,6 @@ function PlayerBaseData:OnCS2LuaEvent_AppFocus(bFocus)
printLog("Lua PlayerBaseData OnCS2LuaEvent_AppFocus, Lose APP Focus, nCachedTime: " .. tostring(self.nCachedTime) .. ", nRequestEnergyLimitTime: " .. tostring(self.nRequestEnergyLimitTime) .. ", nLastEnergy: " .. tostring(self.nLastEnergy) .. ", nLastEnergyBattery: " .. tostring(self.nLastEnergyBattery))
end
end
function PlayerBaseData:OnEvent_SettingsNotificationClose()
end
return PlayerBaseData
+24 -2
View File
@@ -254,7 +254,8 @@ function PlayerCharData:CreateNewChar(msgData)
nAffinityExp = msgData.AffinityExp,
nAffinityLevel = msgData.AffinityLevel,
tbAffinityQuests = msgData.AffinityQuests,
tbArchiveRewardIds = msgData.ArchiveRewardIds or {}
tbArchiveRewardIds = msgData.ArchiveRewardIds or {},
bIsFavorite = msgData.IsFavorite
}
if msgData.DatingEventIds ~= nil and msgData.DatingEventRewardIds ~= nil then
PlayerData.Dating:RefreshLimitedEventList(nCharId, msgData.DatingEventIds, msgData.DatingEventRewardIds)
@@ -1251,6 +1252,7 @@ function PlayerCharData:GetDataForCharList()
mapChar[nCharId].CreateTime = data.nCreateTime
mapChar[nCharId].Advance = self:GetCharAdvance(nCharId)
mapChar[nCharId].Favorability = self:GetCharAffinityData(nCharId).Level
mapChar[nCharId].IsFavorite = self:GetCharFavoriteState(nCharId)
else
printError(nCharId .. "角色数据不存在")
end
@@ -1270,6 +1272,7 @@ function PlayerCharData:GetCharDataById(nCharId)
tbCharData.CreateTime = self._mapChar[nCharId].nCreateTime
tbCharData.Advance = self:GetCharAdvance(nCharId)
tbCharData.Favorability = self:GetCharAffinityData(nCharId).Level
tbCharData.IsFavorite = self:GetCharFavoriteState(nCharId)
end
return tbCharData
end
@@ -1362,6 +1365,21 @@ function PlayerCharData:SetCharSkinId(nCharId, nSkinId)
end
EventManager.Hit(EventId.CharacterSkinChange, nCharId, nSkinId)
end
function PlayerCharData:SetCharFavoriteState(nCharId, bOnFavorite)
local mapChar = self._mapChar[nCharId]
if mapChar == nil then
printError("没有该角色数据" .. nCharId)
end
self._mapChar[nCharId].bIsFavorite = bOnFavorite
end
function PlayerCharData:GetCharFavoriteState(nCharId)
local mapChar = self._mapChar[nCharId]
if mapChar == nil then
printError("没有该角色数据" .. nCharId)
return false
end
return mapChar.bIsFavorite
end
function PlayerCharData:CalcAffinityEffect(nCharId)
local tbEfts = PlayerData.Char:GetCharAffinityEffects(nCharId)
if tbEfts == nil then
@@ -2047,7 +2065,11 @@ function PlayerCharData:UpdateCharPlotReddot(nCharId)
end
end
function PlayerCharData:UpdateCharArchiveRewardRedDot(nCharId)
local nCurFavorLevel = self:GetCharAffinityData(nCharId).Level
local affinityData = self:GetCharAffinityData(nCharId)
if affinityData == nil then
return
end
local nCurFavorLevel = affinityData.Level
local foreachCharacterArchive = function(mapData)
if mapData.CharacterId == nCharId then
local bReward = false
+20 -1
View File
@@ -841,8 +841,9 @@ function PlayerDiscData:GetTrialDiscById(nId)
if not nId then
return
end
if self._mapTrialDisc[nId] == nil then
if self._mapTrialDisc == nil or self._mapTrialDisc[nId] == nil then
printLog(string.format("该星盘不存在或新获得, 唯一Id: %d", nId))
return
end
return self._mapTrialDisc[nId]
end
@@ -906,6 +907,24 @@ function PlayerDiscData:CalcTrialInfoInBuild(nTrialId, tbSecondarySkill)
discInfo.discLevel = discData.nLevel
return discInfo
end
function PlayerDiscData:GetRankDetailDisc(nId)
if not nId then
return
end
if not nId then
printError("GenerateLocalDiscData Failed!")
return
end
local mapDisc = {}
mapDisc.Id = nId
mapDisc.Exp = 0
mapDisc.Level = 1
mapDisc.Phase = 0
mapDisc.Star = 0
mapDisc.Read = false
local discData = DiscData.new(mapDisc)
return discData
end
local tbSortNameTextCfg = {
"CharList_Sort_Toggle_Level",
"CharList_Sort_Toggle_Rare",
@@ -6,6 +6,7 @@ function PlayerEquipmentData:Init()
self.tbCharSelectPreset = {}
self.tbCharEquipment = {}
self.bRollWarning = true
self.bRollUpgradeWarning = true
self:ProcessTableData()
self.isTestPresetTeam = false
end
@@ -234,6 +235,12 @@ end
function PlayerEquipmentData:SetRollWarning(bAble)
self.bRollWarning = bAble
end
function PlayerEquipmentData:GetRollUpgradeWarning()
return self.bRollUpgradeWarning
end
function PlayerEquipmentData:SetRollUpgradeWarning(bAble)
self.bRollUpgradeWarning = bAble
end
function PlayerEquipmentData:CacheEquipmentSelect(nSlotId, nGemIndex, nCharId)
self.mapSelect = {
nSlotId = nSlotId,
@@ -249,6 +256,22 @@ function PlayerEquipmentData:GetEquipmentSelect()
self.mapSelect = nil
return mapSelect
end
function PlayerEquipmentData:CacheEquipmentUpgrade(nSlotId, nGemIndex, nCharId, nSelectUpgradeIndex)
self.mapUpgrade = {
nSlotId = nSlotId,
nGemIndex = nGemIndex,
nCharId = nCharId,
nSelectUpgradeIndex = nSelectUpgradeIndex
}
end
function PlayerEquipmentData:GetEquipmentUpgrade()
if self.mapUpgrade == nil then
return false
end
local mapUpgrade = clone(self.mapUpgrade)
self.mapUpgrade = nil
return mapUpgrade
end
function PlayerEquipmentData:CheckAlterHighQualityAffix(tbAlterAffix, tbLockId)
for _, v in ipairs(tbAlterAffix) do
if v ~= 0 and table.indexof(tbLockId, v) == 0 then
@@ -341,7 +364,7 @@ function PlayerEquipmentData:SendCharGemRefreshReq(nCharId, nSlotId, nGemIndex,
LockAttrs = tbLockAttrs
}
local successCallback = function(_, mapMainData)
self.tbCharEquipment[nCharId][nSlotId][nGemIndex]:UpdateAlterAffix(mapMainData.Attributes)
self.tbCharEquipment[nCharId][nSlotId][nGemIndex]:UpdateAlterAffix(mapMainData.Attributes, mapMainData.OverlockCount)
if callback then
callback()
end
@@ -361,6 +384,42 @@ function PlayerEquipmentData:SendCharGemGenerateReq(nCharId, nSlotId, callback)
end
HttpNetHandler.SendMsg(NetMsgId.Id.char_gem_generate_req, msgData, nil, successCallback)
end
function PlayerEquipmentData:SendCharGemOverlockReq(nCharId, nSlotId, nGemIndex, nAttrIndex, callback)
local msgData = {
CharId = nCharId,
SlotId = nSlotId,
GemIndex = nGemIndex - 1,
AttrIndex = nAttrIndex - 1
}
local successCallback = function(_, mapMainData)
local mapEquip = self.tbCharEquipment[nCharId][nSlotId][nGemIndex]
mapEquip:ChangeUpgradeCount(nAttrIndex, 1)
mapEquip:UpdateRandomAttr(mapEquip.tbAffix, mapEquip.tbUpgradeCount)
EventManager.Hit("EquipmentSlotChanged")
if callback then
callback()
end
end
HttpNetHandler.SendMsg(NetMsgId.Id.char_gem_overlock_req, msgData, nil, successCallback)
end
function PlayerEquipmentData:SendCharGemOverlockRevertReq(nCharId, nSlotId, nGemIndex, nAttrIndex, callback)
local msgData = {
CharId = nCharId,
SlotId = nSlotId,
GemIndex = nGemIndex - 1,
AttrIndex = nAttrIndex - 1
}
local successCallback = function(_, mapMainData)
local mapEquip = self.tbCharEquipment[nCharId][nSlotId][nGemIndex]
mapEquip:ChangeUpgradeCount(nAttrIndex, -1)
mapEquip:UpdateRandomAttr(mapEquip.tbAffix, mapEquip.tbUpgradeCount)
EventManager.Hit("EquipmentSlotChanged")
if callback then
callback()
end
end
HttpNetHandler.SendMsg(NetMsgId.Id.char_gem_overlock_revert_req, msgData, nil, successCallback)
end
function PlayerEquipmentData:CacheEquipmentDataForChar(mapMsgData)
if self.tbCharPreset == nil then
self.tbCharPreset = {}
@@ -294,7 +294,13 @@ function PlayerItemData:GetItemCountByID(Tid)
end
if itemCfgData.Type == GameEnum.itemType.Honor then
local tbHonor = PlayerData.Base:GetPlayerHonorTitleList()
local bHas = 0 < table.indexof(tbHonor, Tid)
local bHas = false
for k, v in pairs(tbHonor) do
if v.Id == Tid then
bHas = true
break
end
end
return bHas and 1 or 0
end
if self._mapItem[Tid] ~= nil then
@@ -46,10 +46,10 @@ function PlayerJointDrillData_1:InitConfig()
CacheTable.SetField("_JointDrillLevel", line.DrillLevelGroupId, line.Difficulty, line)
end
ForEachTableLine(ConfigTable.Get("JointDrillLevel"), funcForeachJointDrillLevel)
local funcForeachJointDrillLevel = function(line)
local funcForeachJointDrillFloor = function(line)
CacheTable.SetField("_JointDrillFloor", line.FloorId, line.BattleLvs, line)
end
ForEachTableLine(ConfigTable.Get("JointDrillFloor"), funcForeachJointDrillLevel)
ForEachTableLine(ConfigTable.Get("JointDrillFloor"), funcForeachJointDrillFloor)
local funcForeachJointDrillQuest = function(line)
if nil == CacheTable.GetData("_JointDrillQuest", line.GroupId) then
CacheTable.SetData("_JointDrillQuest", line.GroupId, {})
@@ -240,33 +240,7 @@ function PlayerJointDrillData_1:IsJointDrillUnlock(nLevelId)
return self.actDataIns:CheckPassedId(nPreLevelId)
end
function PlayerJointDrillData_1:GetMonsterMaxHp(nMonsterId, nDifficulty)
local nMaxHp = 0
local mapMonsterCfg = ConfigTable.GetData("Monster", nMonsterId)
if mapMonsterCfg == nil then
return 0
end
local mapAdjustCfg = ConfigTable.GetData("MonsterValueTempleteAdjust", mapMonsterCfg.Templete)
if mapAdjustCfg == nil then
return 0
end
if next(CacheTable.Get("_MonsterValueTemplete")) == nil then
local funcForeachMonsterValueTemplete = function(line)
CacheTable.SetField("_MonsterValueTemplete", line.TemplateId, line.Lv, line.Hp)
end
ForEachTableLine(ConfigTable.Get("MonsterValueTemplete"), funcForeachMonsterValueTemplete)
end
local mapCfgList = CacheTable.GetData("_MonsterValueTemplete", mapAdjustCfg.TemplateId)
if mapCfgList == nil then
return 0
end
local nValue = mapCfgList[nDifficulty]
if nValue == nil then
return 0
end
local nRatio = mapAdjustCfg.HpRatio
local nFix = mapAdjustCfg.HpFix
nMaxHp = math.floor(nValue * (1 + nRatio * ConfigData.IntFloatPrecision) + nFix)
return nMaxHp
return NovaAPI.GetJointDrillBossMaxHp(nMonsterId, nDifficulty)
end
function PlayerJointDrillData_1:GetMonsterName(nMonsterId)
local mapMonsterCfg = ConfigTable.GetData("Monster", nMonsterId)
@@ -394,146 +368,208 @@ end
function PlayerJointDrillData_1:RestartBattle()
self:EnterJointDrill(self.nCurLevelId, self.nSelectBuildId, self.bSimulate, AllEnum.JointDrillLevelStartType.Restart, self.nCurLevel)
end
function PlayerJointDrillData_1:ContinueJointDrill(nBuildId, callback)
local NetCallback = function(_, netMsg)
local sKey = LocalData.GetPlayerLocalData("JointDrillRecordKey") or ""
if sKey == "" or sKey ~= tostring(self.nStartTime) then
if sKey ~= "" then
NovaAPI.DeleteRecFile(sKey)
function PlayerJointDrillData_1:ContinueJointDrill(nBuildId, callback, bEditor)
if not bEditor then
local NetCallback = function(_, netMsg)
local sKey = LocalData.GetPlayerLocalData("JointDrillRecordKey") or ""
if sKey == "" or sKey ~= tostring(self.nStartTime) then
if sKey ~= "" then
NovaAPI.DeleteRecFile(sKey)
end
LocalData.SetPlayerLocalData("JointDrillRecordKey", self.nStartTime)
LocalData.SetPlayerLocalData("JointDrillRecordFloorId", 0)
LocalData.SetPlayerLocalData("JointDrillRecordExcludeId", 0)
end
if callback ~= nil then
callback()
end
LocalData.SetPlayerLocalData("JointDrillRecordKey", self.nStartTime)
LocalData.SetPlayerLocalData("JointDrillRecordFloorId", 0)
LocalData.SetPlayerLocalData("JointDrillRecordExcludeId", 0)
end
if callback ~= nil then
callback()
end
local msg = {BuildId = nBuildId}
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_continue_req, msg, nil, NetCallback)
elseif callback ~= nil then
callback()
end
local msg = {BuildId = nBuildId}
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_continue_req, msg, nil, NetCallback)
end
function PlayerJointDrillData_1:JointDrillGameOver(callback, bSettle)
self:SetRecorderExcludeIds()
self:StopRecord()
self._EndTime = ClientManager.serverTimeStamp
local NetCallback = function(_, netMsg)
local nScoreOld = 0
if self.mapSelfRankData ~= nil then
nScoreOld = self.mapSelfRankData.Score
function PlayerJointDrillData_1:JointDrillGameOver(callback, bSettle, bEditor)
if not bEditor then
self:SetRecorderExcludeIds()
self:StopRecord()
self._EndTime = ClientManager.serverTimeStamp
local NetCallback = function(_, netMsg)
local nScoreOld = 0
if self.mapSelfRankData ~= nil then
nScoreOld = self.mapSelfRankData.Score
end
if netMsg.Old ~= netMsg.New then
self:SendJointDrillRankMsg()
end
self:UploadRecordFile(netMsg.Token)
if not self.bSimulate then
self.nTotalScore = self.nTotalScore + netMsg.FightScore + netMsg.HpScore + netMsg.DifficultyScore
end
EventManager.Hit(EventId.ClosePanel, PanelId.JointDrillBuildList_1)
self.bResetLevelSelect = true
if callback ~= nil then
callback(netMsg)
end
if bSettle then
local nResultType = AllEnum.JointDrillResultType.ChallengeEnd
local mapScore = {}
local nTotalScore = self:GetTotalRankScore()
local mapChange, mapItems = {}, {}
local nOld, nNew = 0, 0
if netMsg ~= nil then
mapChange = netMsg.Change or {}
mapItems = netMsg.Items or {}
local nScore = netMsg.FightScore + netMsg.HpScore + netMsg.DifficultyScore
mapScore = {
FightScore = netMsg.FightScore,
HpScore = netMsg.HpScore,
DifficultyScore = netMsg.DifficultyScore,
nTotalScore = nTotalScore,
nScore = nScore,
nScoreOld = nScoreOld
}
nOld = netMsg.Old
nNew = netMsg.New
end
EventManager.Hit(EventId.OpenPanel, PanelId.JointDrillResult_1, nResultType, self.nCurLevel, 0, self.nCurLevelId, self.mapBossInfo, mapScore, mapItems, mapChange, nOld, nNew, self.bSimulate, #self.tbTeams)
end
self:EventUpload(4, 0)
self:ChallengeEnd()
end
if netMsg.Old ~= netMsg.New then
self:SendJointDrillRankMsg()
end
self:UploadRecordFile(netMsg.Token)
if not self.bSimulate then
self.nTotalScore = self.nTotalScore + netMsg.FightScore + netMsg.HpScore + netMsg.DifficultyScore
end
EventManager.Hit(EventId.ClosePanel, PanelId.JointDrillBuildList_1)
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_game_over_req, {}, nil, NetCallback)
else
self.bResetLevelSelect = true
if callback ~= nil then
callback(netMsg)
callback()
end
if bSettle then
local nResultType = AllEnum.JointDrillResultType.ChallengeEnd
local mapScore = {}
local nTotalScore = self:GetTotalRankScore()
local mapChange, mapItems = {}, {}
local nOld, nNew = 0, 0
if netMsg ~= nil then
mapChange = netMsg.Change or {}
mapItems = netMsg.Items or {}
local nScore = netMsg.FightScore + netMsg.HpScore + netMsg.DifficultyScore
mapScore = {
FightScore = netMsg.FightScore,
HpScore = netMsg.HpScore,
DifficultyScore = netMsg.DifficultyScore,
nTotalScore = nTotalScore,
nScore = nScore,
nScoreOld = nScoreOld
}
nOld = netMsg.Old
nNew = netMsg.New
end
EventManager.Hit(EventId.OpenPanel, PanelId.JointDrillResult_1, nResultType, self.nCurLevel, 0, self.nCurLevelId, self.mapBossInfo, mapScore, mapItems, mapChange, nOld, nNew, self.bSimulate, #self.tbTeams)
end
self:EventUpload(4, 0)
self:ChallengeEnd()
end
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_game_over_req, {}, nil, NetCallback)
end
function PlayerJointDrillData_1:JointDrillGiveUp(nFloor, nTime, nDamage, nBossHp, sRecord, mapBuild, callback)
self:SetRecorderExcludeIds()
self:StopRecord()
local NetCallback = function(_, netMsg)
function PlayerJointDrillData_1:JointDrillGiveUp(nFloor, nTime, nDamage, nBossHp, sRecord, mapBuild, callback, bEditor)
if not bEditor then
self:SetRecorderExcludeIds()
self:StopRecord()
local NetCallback = function(_, netMsg)
self.record = sRecord
self.nCurLevel = nFloor
self.mapBossInfo.nHp = nBossHp
if callback ~= nil then
callback(netMsg)
end
if netMsg.Old ~= netMsg.New then
self:SendJointDrillRankMsg()
end
end
local msg = {
Floor = nFloor,
Time = nTime,
Damage = nDamage,
BossHp = nBossHp,
Record = sRecord
}
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_give_up_req, msg, nil, NetCallback)
else
self.record = sRecord
self.nCurLevel = nFloor
self.mapBossInfo.nHp = nBossHp
if callback ~= nil then
callback(netMsg)
end
if netMsg.Old ~= netMsg.New then
self:SendJointDrillRankMsg()
callback()
end
end
local msg = {
Floor = nFloor,
Time = nTime,
Damage = nDamage,
BossHp = nBossHp,
Record = sRecord
}
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_give_up_req, msg, nil, NetCallback)
end
function PlayerJointDrillData_1:JointDrillRetreat(mapBuild, nBossHp, callback)
self:SetRecorderExcludeIds(true)
self:StopRecord()
local NetCallback = function(_, netMsg)
function PlayerJointDrillData_1:JointDrillRetreat(mapBuild, nBossHp, callback, bEditor)
if not bEditor then
self:SetRecorderExcludeIds(true)
self:StopRecord()
local NetCallback = function(_, netMsg)
self:RemoveJointDrillTeam(mapBuild)
self.mapBossInfo.nHp = nBossHp
if callback ~= nil then
callback()
end
end
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_retreat_req, {}, nil, NetCallback)
else
self:RemoveJointDrillTeam(mapBuild)
self.mapBossInfo.nHp = nBossHp
if callback ~= nil then
callback()
end
end
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_retreat_req, {}, nil, NetCallback)
end
function PlayerJointDrillData_1:JointDrillSettle(mapBuild, nTime, nDamage, callback)
self:SetRecorderExcludeIds()
self:StopRecord()
self:AddJointDrillTeam(mapBuild, nTime, nDamage)
self._EndTime = ClientManager.serverTimeStamp
local NetCallback = function(_, netMsg)
self:UploadRecordFile(netMsg.Token)
if not self.bSimulate then
local nScore = netMsg.FightScore + netMsg.HpScore + netMsg.DifficultyScore
self.nTotalScore = self.nTotalScore + nScore
self.actDataIns:PassedLevel(self.nCurLevelId, nScore)
function PlayerJointDrillData_1:JointDrillSettle(mapBuild, nTime, nDamage, callback, bEditor)
if not bEditor then
self:SetRecorderExcludeIds()
self:StopRecord()
self:AddJointDrillTeam(mapBuild, nTime, nDamage)
self._EndTime = ClientManager.serverTimeStamp
local NetCallback = function(_, netMsg)
self:UploadRecordFile(netMsg.Token)
if not self.bSimulate then
local nScore = netMsg.FightScore + netMsg.HpScore + netMsg.DifficultyScore
self.nTotalScore = self.nTotalScore + nScore
self.actDataIns:PassedLevel(self.nCurLevelId, nScore)
end
EventManager.Hit(EventId.ClosePanel, PanelId.JointDrillBuildList_1)
self.bResetLevelSelect = true
if callback ~= nil then
callback(netMsg)
end
if netMsg.Old ~= netMsg.New then
self:SendJointDrillRankMsg()
end
self:EventUpload(4, 1)
end
EventManager.Hit(EventId.ClosePanel, PanelId.JointDrillBuildList_1)
local sKey = LocalData.GetPlayerLocalData("JointDrillRecordKey") or ""
local tbSamples = UTILS.GetBattleSamples(sKey)
local bSuccess, nCheckSum = NovaAPI.GetRecorderKey(sKey)
local tbSendSample = {Sample = tbSamples, Checksum = nCheckSum}
local msg = {
Time = nTime,
Damage = nDamage,
Sample = tbSendSample,
Events = {
List = PlayerData.Achievement:GetBattleAchievement(GameEnum.levelType.JointDrill, true)
}
}
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_settle_req, msg, nil, NetCallback)
else
self:AddJointDrillTeam(mapBuild, nTime, nDamage)
self.bResetLevelSelect = true
if callback ~= nil then
callback(netMsg)
callback()
end
if netMsg.Old ~= netMsg.New then
self:SendJointDrillRankMsg()
end
self:EventUpload(4, 1)
end
local sKey = LocalData.GetPlayerLocalData("JointDrillRecordKey") or ""
local tbSamples = UTILS.GetBattleSamples(sKey)
local bSuccess, nCheckSum = NovaAPI.GetRecorderKey(sKey)
local tbSendSample = {Sample = tbSamples, Checksum = nCheckSum}
local msg = {
Time = nTime,
Damage = nDamage,
Sample = tbSendSample,
Events = {
List = PlayerData.Achievement:GetBattleAchievement(GameEnum.levelType.JointDrill, true)
}
}
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_settle_req, msg, nil, NetCallback)
end
function PlayerJointDrillData_1:JointDrillSync(nFloor, nTime, nDamage, nBossHp, nBossHpMax, sRecord, callback)
local NetCallback = function(_, netMsg)
function PlayerJointDrillData_1:JointDrillSync(nFloor, nTime, nDamage, nBossHp, nBossHpMax, sRecord, callback, bEditor)
if not bEditor then
local NetCallback = function(_, netMsg)
self.record = sRecord
self.mapBossInfo.nHp = nBossHp
self.mapBossInfo.nHpMax = nBossHpMax
if callback ~= nil then
callback()
end
end
local msg = {
Floor = nFloor,
Time = nTime,
Damage = nDamage,
BossHp = nBossHp,
BossHpMax = nBossHpMax,
Record = sRecord
}
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_sync_req, msg, nil, NetCallback)
else
self.record = sRecord
self.mapBossInfo.nHp = nBossHp
self.mapBossInfo.nHpMax = nBossHpMax
@@ -541,15 +577,6 @@ function PlayerJointDrillData_1:JointDrillSync(nFloor, nTime, nDamage, nBossHp,
callback()
end
end
local msg = {
Floor = nFloor,
Time = nTime,
Damage = nDamage,
BossHp = nBossHp,
BossHpMax = nBossHpMax,
Record = sRecord
}
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_sync_req, msg, nil, NetCallback)
end
function PlayerJointDrillData_1:LevelEnd(nType)
if self.curLevel ~= nil and type(self.curLevel.UnBindEvent) == "function" then
@@ -636,7 +663,7 @@ function PlayerJointDrillData_1:GetCachedBuild()
return self.nSelectBuildId
end
function PlayerJointDrillData_1:GetBossHpBarNum()
if self.nCurLevelId ~= nil then
if self.nCurLevelId ~= 0 then
local mapCfg = ConfigTable.GetData("JointDrillLevel", self.nCurLevelId)
if mapCfg ~= nil then
return mapCfg.HpBarNum
@@ -718,7 +745,6 @@ function PlayerJointDrillData_1:SetRecorderExcludeIds(bRemove)
table.insert(tbTemp, 1, nExcludeValue % 2)
nExcludeValue = math.floor(nExcludeValue / 2)
end
printTable(tbTemp)
for k, v in ipairs(tbTemp) do
if v == 1 then
tbFloorId:Add(#tbTemp - k + 1)
@@ -792,14 +818,14 @@ function PlayerJointDrillData_1:GetTotalRankScore()
end
function PlayerJointDrillData_1:SendJointDrillSweepMsg(nLevelId, nCount, callback)
local NetCallback = function(_, netMsg)
local mapSelfRank = PlayerData.JointDrill_1:GetSelfRankData()
local mapSelfRank = self:GetSelfRankData()
local nRank = 0
local nScoreOld = 0
if mapSelfRank ~= nil then
nRank = mapSelfRank.Rank
nScoreOld = mapSelfRank.Score
end
local nTotalScoreOld = PlayerData.JointDrill_1:GetTotalRankScore()
local nTotalScoreOld = self:GetTotalRankScore()
local nScore = math.max(netMsg.Score - nTotalScoreOld, 0)
local mapScore = {
nScore = nScore,
@@ -47,10 +47,10 @@ function PlayerJointDrillData_2:InitConfig()
CacheTable.SetField("_JointDrill_2_Level", line.DrillLevelGroupId, line.Difficulty, line)
end
ForEachTableLine(ConfigTable.Get("JointDrill_2_Level"), funcForeachJointDrillLevel2)
local funcForeachJointDrillLevel2 = function(line)
local funcForeachJointDrillFloor2 = function(line)
CacheTable.SetField("_JointDrill_2_Floor", line.FloorId, line.BattleLvs, line)
end
ForEachTableLine(ConfigTable.Get("JointDrill_2_Floor"), funcForeachJointDrillLevel2)
ForEachTableLine(ConfigTable.Get("JointDrill_2_Floor"), funcForeachJointDrillFloor2)
self.nRankCount = 0
local funcForeachJointDrillRank = function(line)
self.nRankCount = self.nRankCount + 1
@@ -116,33 +116,7 @@ function PlayerJointDrillData_2:GetMonsterCfg(nMonsterId)
end
end
function PlayerJointDrillData_2:GetMonsterMaxHp(nMonsterId, nDifficulty)
local nMaxHp = 0
local mapMonsterCfg = ConfigTable.GetData("Monster", nMonsterId)
if mapMonsterCfg == nil then
return 0
end
local mapAdjustCfg = ConfigTable.GetData("MonsterValueTempleteAdjust", mapMonsterCfg.Templete)
if mapAdjustCfg == nil then
return 0
end
if next(CacheTable.Get("_MonsterValueTemplete")) == nil then
local funcForeachMonsterValueTemplete = function(line)
CacheTable.SetField("_MonsterValueTemplete", line.TemplateId, line.Lv, line.Hp)
end
ForEachTableLine(ConfigTable.Get("MonsterValueTemplete"), funcForeachMonsterValueTemplete)
end
local mapCfgList = CacheTable.GetData("_MonsterValueTemplete", mapAdjustCfg.TemplateId)
if mapCfgList == nil then
return 0
end
local nValue = mapCfgList[nDifficulty]
if nValue == nil then
return 0
end
local nRatio = mapAdjustCfg.HpRatio
local nFix = mapAdjustCfg.HpFix
nMaxHp = math.floor(nValue * (1 + nRatio * ConfigData.IntFloatPrecision) + nFix)
return nMaxHp
return NovaAPI.GetJointDrillBossMaxHp(nMonsterId, nDifficulty)
end
function PlayerJointDrillData_2:InitBossInfo(nGroupId, nDifficulty)
self.mapBossInfo = {}
@@ -316,187 +290,237 @@ end
function PlayerJointDrillData_2:RestartBattle()
self:EnterJointDrill(self.nCurLevelId, self.nSelectBuildId, self.bSimulate, AllEnum.JointDrillLevelStartType.Restart, self.nCurLevel)
end
function PlayerJointDrillData_2:ContinueJointDrill(nBuildId, callback)
local NetCallback = function(_, netMsg)
local sKey = LocalData.GetPlayerLocalData("JointDrillRecordKey") or ""
if sKey == "" or sKey ~= tostring(self.nStartTime) then
if sKey ~= "" then
NovaAPI.DeleteRecFile(sKey)
function PlayerJointDrillData_2:ContinueJointDrill(nBuildId, callback, bEditor)
if not bEditor then
local NetCallback = function(_, netMsg)
local sKey = LocalData.GetPlayerLocalData("JointDrillRecordKey") or ""
if sKey == "" or sKey ~= tostring(self.nStartTime) then
if sKey ~= "" then
NovaAPI.DeleteRecFile(sKey)
end
LocalData.SetPlayerLocalData("JointDrillRecordKey", self.nStartTime)
LocalData.SetPlayerLocalData("JointDrillRecordFloorId", 0)
LocalData.SetPlayerLocalData("JointDrillRecordExcludeId", 0)
end
if callback ~= nil then
callback()
end
LocalData.SetPlayerLocalData("JointDrillRecordKey", self.nStartTime)
LocalData.SetPlayerLocalData("JointDrillRecordFloorId", 0)
LocalData.SetPlayerLocalData("JointDrillRecordExcludeId", 0)
end
if callback ~= nil then
callback()
end
local msg = {BuildId = nBuildId}
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_2_continue_req, msg, nil, NetCallback)
elseif callback ~= nil then
callback()
end
local msg = {BuildId = nBuildId}
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_2_continue_req, msg, nil, NetCallback)
end
function PlayerJointDrillData_2:JointDrillGameOver(callback, bSettle)
self:SetRecorderExcludeIds()
self:StopRecord()
self._EndTime = ClientManager.serverTimeStamp
local NetCallback = function(_, netMsg)
local nScoreOld = 0
if self.mapSelfRankData ~= nil then
nScoreOld = self.mapSelfRankData.Score
function PlayerJointDrillData_2:JointDrillGameOver(callback, bSettle, bEditor)
if not bEditor then
self:SetRecorderExcludeIds()
self:StopRecord()
self._EndTime = ClientManager.serverTimeStamp
local NetCallback = function(_, netMsg)
local nScoreOld = 0
if self.mapSelfRankData ~= nil then
nScoreOld = self.mapSelfRankData.Score
end
if netMsg.Old ~= netMsg.New then
self:SendJointDrillRankMsg()
end
self:UploadRecordFile(netMsg.Token)
if not self.bSimulate then
self.nTotalScore = self.nTotalScore + netMsg.FightScore + netMsg.HpScore + netMsg.DifficultyScore
end
EventManager.Hit(EventId.ClosePanel, PanelId.JointDrillBuildList_2)
self.bResetLevelSelect = true
if callback ~= nil then
callback(netMsg)
end
if bSettle then
local nResultType = AllEnum.JointDrillResultType.ChallengeEnd
local mapScore = {}
local nTotalScore = self.nTotalScore
local mapChange, mapItems = {}, {}
local nOld, nNew = 0, 0
if netMsg ~= nil then
mapChange = netMsg.Change or {}
mapItems = netMsg.Items or {}
local nScore = netMsg.FightScore + netMsg.HpScore + netMsg.DifficultyScore
mapScore = {
FightScore = netMsg.FightScore,
HpScore = netMsg.HpScore,
DifficultyScore = netMsg.DifficultyScore,
nTotalScore = nTotalScore,
nScore = nScore,
nScoreOld = nScoreOld
}
nOld = netMsg.Old
nNew = netMsg.New
end
local mapBossInfo = self.mapBossInfo[self.nCurLevel]
EventManager.Hit(EventId.OpenPanel, PanelId.JointDrillResult_2, nResultType, self.nCurLevel, 0, self.nCurLevelId, mapBossInfo, mapScore, mapItems, mapChange, nOld, nNew, self.bSimulate, #self.tbTeams)
end
self:EventUpload(4, 0)
self:ChallengeEnd()
end
if netMsg.Old ~= netMsg.New then
self:SendJointDrillRankMsg()
end
self:UploadRecordFile(netMsg.Token)
if not self.bSimulate then
self.nTotalScore = self.nTotalScore + netMsg.FightScore + netMsg.HpScore + netMsg.DifficultyScore
end
EventManager.Hit(EventId.ClosePanel, PanelId.JointDrillBuildList_2)
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_2_game_over_req, {}, nil, NetCallback)
else
self.bResetLevelSelect = true
if callback ~= nil then
callback(netMsg)
callback()
end
if bSettle then
local nResultType = AllEnum.JointDrillResultType.ChallengeEnd
local mapScore = {}
local nTotalScore = self.nTotalScore
local mapChange, mapItems = {}, {}
local nOld, nNew = 0, 0
if netMsg ~= nil then
mapChange = netMsg.Change or {}
mapItems = netMsg.Items or {}
local nScore = netMsg.FightScore + netMsg.HpScore + netMsg.DifficultyScore
mapScore = {
FightScore = netMsg.FightScore,
HpScore = netMsg.HpScore,
DifficultyScore = netMsg.DifficultyScore,
nTotalScore = nTotalScore,
nScore = nScore,
nScoreOld = nScoreOld
}
nOld = netMsg.Old
nNew = netMsg.New
end
local mapBossInfo = self.mapBossInfo[self.nCurLevel]
EventManager.Hit(EventId.OpenPanel, PanelId.JointDrillResult_2, nResultType, self.nCurLevel, 0, self.nCurLevelId, mapBossInfo, mapScore, mapItems, mapChange, nOld, nNew, self.bSimulate, #self.tbTeams)
end
self:EventUpload(4, 0)
self:ChallengeEnd()
end
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_2_game_over_req, {}, nil, NetCallback)
end
function PlayerJointDrillData_2:JointDrillGiveUp(nLevel, nTime, nDamage, sRecord, callback)
self:SetRecorderExcludeIds()
self:StopRecord()
local NetCallback = function(_, netMsg)
function PlayerJointDrillData_2:JointDrillGiveUp(nLevel, nTime, nDamage, sRecord, callback, bEditor)
if not bEditor then
self:SetRecorderExcludeIds()
self:StopRecord()
local NetCallback = function(_, netMsg)
self.record = sRecord
self.nCurLevel = nLevel
if callback ~= nil then
callback(netMsg)
end
if netMsg.Old ~= netMsg.New then
self:SendJointDrillRankMsg()
end
end
local tbBossHps = {}
local mapBoss = self.mapBossInfo[nLevel]
if mapBoss ~= nil then
for nIndex, v in ipairs(mapBoss) do
if v.nBossCfgId ~= 0 then
table.insert(tbBossHps, {
Id = v.nBossCfgId,
Hp = v.nHp
})
end
end
end
local msg = {
Floor = nLevel,
Time = nTime,
Damage = nDamage,
BossHps = tbBossHps,
Record = sRecord
}
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_2_give_up_req, msg, nil, NetCallback)
else
self.record = sRecord
self.nCurLevel = nLevel
if callback ~= nil then
callback(netMsg)
end
if netMsg.Old ~= netMsg.New then
self:SendJointDrillRankMsg()
callback()
end
end
local tbBossHps = {}
local mapBoss = self.mapBossInfo[nLevel]
if mapBoss ~= nil then
for nIndex, v in ipairs(mapBoss) do
if v.nBossCfgId ~= 0 then
table.insert(tbBossHps, {
Id = v.nBossCfgId,
Hp = v.nHp
})
end
function PlayerJointDrillData_2:JointDrillRetreat(mapBuild, callback, bEditor)
if not bEditor then
self:SetRecorderExcludeIds(true)
self:StopRecord()
local NetCallback = function(_, netMsg)
self:RemoveJointDrillTeam(mapBuild)
if callback ~= nil then
callback()
end
end
end
local msg = {
Floor = nLevel,
Time = nTime,
Damage = nDamage,
BossHps = tbBossHps,
Record = sRecord
}
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_2_give_up_req, msg, nil, NetCallback)
end
function PlayerJointDrillData_2:JointDrillRetreat(mapBuild, callback)
self:SetRecorderExcludeIds(true)
self:StopRecord()
local NetCallback = function(_, netMsg)
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_2_retreat_req, {}, nil, NetCallback)
else
self:RemoveJointDrillTeam(mapBuild)
if callback ~= nil then
callback()
end
end
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_2_retreat_req, {}, nil, NetCallback)
end
function PlayerJointDrillData_2:JointDrillSettle(mapBuild, nTime, nDamage, callback)
self:SetRecorderExcludeIds()
self:StopRecord()
self:AddJointDrillTeam(mapBuild, nTime, nDamage)
self._EndTime = ClientManager.serverTimeStamp
local NetCallback = function(_, netMsg)
self:UploadRecordFile(netMsg.Token)
if not self.bSimulate then
local nScore = netMsg.FightScore + netMsg.HpScore + netMsg.DifficultyScore
self.nTotalScore = self.nTotalScore + nScore
self.actDataIns:PassedLevel(self.nCurLevelId, nScore)
function PlayerJointDrillData_2:JointDrillSettle(mapBuild, nTime, nDamage, callback, bEditor)
if not bEditor then
self:SetRecorderExcludeIds()
self:StopRecord()
self:AddJointDrillTeam(mapBuild, nTime, nDamage)
self._EndTime = ClientManager.serverTimeStamp
local NetCallback = function(_, netMsg)
self:UploadRecordFile(netMsg.Token)
if not self.bSimulate then
local nScore = netMsg.FightScore + netMsg.HpScore + netMsg.DifficultyScore
self.nTotalScore = self.nTotalScore + nScore
self.actDataIns:PassedLevel(self.nCurLevelId, nScore)
end
EventManager.Hit(EventId.ClosePanel, PanelId.JointDrillBuildList_2)
self.bResetLevelSelect = true
if callback ~= nil then
callback(netMsg)
end
if netMsg.Old ~= netMsg.New then
self:SendJointDrillRankMsg()
end
self:EventUpload(4, 1)
end
EventManager.Hit(EventId.ClosePanel, PanelId.JointDrillBuildList_2)
local sKey = LocalData.GetPlayerLocalData("JointDrillRecordKey") or ""
local tbSamples = UTILS.GetBattleSamples(sKey)
local bSuccess, nCheckSum = NovaAPI.GetRecorderKey(sKey)
local tbSendSample = {Sample = tbSamples, Checksum = nCheckSum}
local msg = {
Time = nTime,
Damage = nDamage,
Sample = tbSendSample,
Events = {
List = PlayerData.Achievement:GetBattleAchievement(GameEnum.levelType.JointDrill, true)
}
}
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_2_settle_req, msg, nil, NetCallback)
else
self:AddJointDrillTeam(mapBuild, nTime, nDamage)
self.bResetLevelSelect = true
if callback ~= nil then
callback(netMsg)
callback()
end
if netMsg.Old ~= netMsg.New then
self:SendJointDrillRankMsg()
end
self:EventUpload(4, 1)
end
local sKey = LocalData.GetPlayerLocalData("JointDrillRecordKey") or ""
local tbSamples = UTILS.GetBattleSamples(sKey)
local bSuccess, nCheckSum = NovaAPI.GetRecorderKey(sKey)
local tbSendSample = {Sample = tbSamples, Checksum = nCheckSum}
local msg = {
Time = nTime,
Damage = nDamage,
Sample = tbSendSample,
Events = {
List = PlayerData.Achievement:GetBattleAchievement(GameEnum.levelType.JointDrill, true)
}
}
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_2_settle_req, msg, nil, NetCallback)
end
function PlayerJointDrillData_2:JointDrillSync(nLevel, nTime, nDamage, sRecord, callback)
local NetCallback = function(_, netMsg)
function PlayerJointDrillData_2:JointDrillSync(nLevel, nTime, nDamage, sRecord, callback, bEditor)
if not bEditor then
local NetCallback = function(_, netMsg)
self.record = sRecord
if callback ~= nil then
callback()
end
end
local tbBossHp = {}
local tbBossHpMax = {}
if self.mapBossInfo[nLevel] ~= nil then
for nIndex, v in ipairs(self.mapBossInfo[nLevel]) do
if v.nBossCfgId ~= 0 then
table.insert(tbBossHp, {
Id = v.nBossCfgId,
Hp = v.nHp
})
table.insert(tbBossHpMax, {
Id = v.nBossCfgId,
Hp = v.nHpMax
})
end
end
end
local msg = {
Floor = nLevel,
Time = nTime,
Damage = nDamage,
BossHps = tbBossHp,
BossHpMaxes = tbBossHpMax,
Record = sRecord
}
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_2_sync_req, msg, nil, NetCallback)
else
self.record = sRecord
if callback ~= nil then
callback()
end
end
local tbBossHp = {}
local tbBossHpMax = {}
if self.mapBossInfo[nLevel] ~= nil then
for nIndex, v in ipairs(self.mapBossInfo[nLevel]) do
if v.nBossCfgId ~= 0 then
table.insert(tbBossHp, {
Id = v.nBossCfgId,
Hp = v.nHp
})
table.insert(tbBossHpMax, {
Id = v.nBossCfgId,
Hp = v.nHpMax
})
end
end
end
local msg = {
Floor = nLevel,
Time = nTime,
Damage = nDamage,
BossHps = tbBossHp,
BossHpMaxes = tbBossHpMax,
Record = sRecord
}
HttpNetHandler.SendMsg(NetMsgId.Id.joint_drill_2_sync_req, msg, nil, NetCallback)
end
function PlayerJointDrillData_2:LevelEnd(nType)
if self.curLevel ~= nil and type(self.curLevel.UnBindEvent) == "function" then
@@ -583,7 +607,7 @@ function PlayerJointDrillData_2:GetCachedBuild()
return self.nSelectBuildId
end
function PlayerJointDrillData_2:GetBossHpBarNum()
if self.nCurLevelId ~= nil then
if self.nCurLevelId ~= 0 then
local mapCfg = ConfigTable.GetData("JointDrill_2_Level", self.nCurLevelId)
if mapCfg ~= nil then
return mapCfg.HpBarNum
@@ -665,7 +689,6 @@ function PlayerJointDrillData_2:SetRecorderExcludeIds(bRemove)
table.insert(tbTemp, 1, nExcludeValue % 2)
nExcludeValue = math.floor(nExcludeValue / 2)
end
printTable(tbTemp)
for k, v in ipairs(tbTemp) do
if v == 1 then
tbFloorId:Add(#tbTemp - k + 1)
@@ -0,0 +1,351 @@
local PlayerPotentialPreselectionData = class("PlayerPotentialPreselectionData")
local TimerManager = require("GameCore.Timer.TimerManager")
local saveCD = 5
function PlayerPotentialPreselectionData:Init()
self.bGetData = false
self.tbPreselectionList = {}
self.mapCurUsePreselection = {}
self.rankSaveTimer = nil
end
function PlayerPotentialPreselectionData:CreateNewPreselection(mapNetData)
local mapPotential = {}
local tbCharPotential = {}
for _, v in ipairs(mapNetData.CharPotentials) do
local nCharId = v.CharId
local tbPotential = {}
for _, data in ipairs(v.Potentials) do
table.insert(tbPotential, {
nId = data.Id,
nLevel = data.Level
})
end
table.insert(tbCharPotential, {nCharId = nCharId, tbPotential = tbPotential})
end
mapPotential = {
nId = mapNetData.Id,
sName = mapNetData.Name,
bPreference = mapNetData.Preference,
tbCharPotential = tbCharPotential,
nTimestamp = mapNetData.Timestamp
}
return mapPotential
end
function PlayerPotentialPreselectionData:GetPreselectionById(nId)
for _, v in ipairs(self.tbPreselectionList) do
if v.nId == nId then
return v
end
end
end
function PlayerPotentialPreselectionData:SavePreselection(sName, bPreference, tbCharPotential, callback)
self:SendImportPotential(sName, bPreference, tbCharPotential, callback)
end
function PlayerPotentialPreselectionData:PackPotentialData(tbCharPotential)
local bit_buffer = {}
local bit_pos = 0
local to_uint32 = function(num)
num = math.floor(num or 0)
if num < 0 then
num = 0
elseif 4294967295 < num then
num = 4294967295
end
return num
end
local add_bit = function(bit)
bit_buffer[bit_pos] = bit
bit_pos = bit_pos + 1
end
local write_bits = function(value, num_bits)
for i = num_bits - 1, 0, -1 do
add_bit(value >> i & 1)
end
end
local pack_potential = function(tbAll, tbPotential, bSpecial)
for k, nId in ipairs(tbAll) do
local nLevel = 0
for _, data in ipairs(tbPotential) do
if data.nId == nId then
nLevel = data.nLevel
break
end
end
if bSpecial then
local flag = 0 < nLevel and 1 or 0
write_bits(flag, 1)
else
write_bits(nLevel, 3)
end
end
end
for k, v in ipairs(tbCharPotential) do
if v.nCharId == 0 then
return
end
write_bits(to_uint32(v.nCharId), 32)
end
for k, v in ipairs(tbCharPotential) do
local potentialCfg = ConfigTable.GetData("CharPotential", v.nCharId)
if potentialCfg ~= nil then
if k == 1 then
pack_potential(potentialCfg.MasterSpecificPotentialIds, v.tbPotential, true)
pack_potential(potentialCfg.MasterNormalPotentialIds, v.tbPotential, false)
pack_potential(potentialCfg.CommonPotentialIds, v.tbPotential, false)
else
pack_potential(potentialCfg.AssistSpecificPotentialIds, v.tbPotential, true)
pack_potential(potentialCfg.AssistNormalPotentialIds, v.tbPotential, false)
pack_potential(potentialCfg.CommonPotentialIds, v.tbPotential, false)
end
end
end
local bytes = {}
for i = 0, bit_pos - 1, 8 do
local byte = 0
for j = 0, 7 do
if bit_pos > i + j then
byte = byte * 2 + (bit_buffer[i + j] or 0)
else
byte = byte * 2
end
end
table.insert(bytes, string.char(byte))
end
return CS.System.Convert.ToBase64String(table.concat(bytes))
end
function PlayerPotentialPreselectionData:UnPackPotentialData(b64Str)
if not b64Str or type(b64Str) ~= "string" or b64Str == "" then
return
end
if string.match(b64Str, "[^A-Za-z0-9+/=]") then
printError("包含非base64字符")
return
end
b64Str = b64Str:gsub("-", "+")
b64Str = b64Str:gsub("_", "/")
local len = #b64Str
if len % 4 ~= 0 then
b64Str = b64Str .. string.rep("=", 4 - len % 4)
end
if #b64Str % 4 ~= 0 then
printError("Base64长度错误")
return
end
local ok, packed_data = xpcall(function()
return CS.System.Convert.FromBase64String(b64Str)
end, function(e)
return e
end)
if not ok then
printError("Base64解码失败: " .. tostring(packed_data))
return
end
local bit_buffer = {}
local bit_count = 0
for i = 1, #packed_data do
local byte = string.byte(packed_data, i)
for j = 7, 0, -1 do
local bit = byte >> j & 1
bit_buffer[bit_count] = bit
bit_count = bit_count + 1
end
end
local bit_index = 0
local read_bits = function(num_bits)
local value = 0
for i = num_bits - 1, 0, -1 do
if bit_index >= bit_count then
break
end
value = value + (bit_buffer[bit_index] or 0) * (1 << i)
bit_index = bit_index + 1
end
return value
end
local tbCharPotential = {}
for i = 1, 3 do
local nCharId = read_bits(32)
local mapCharCfg = ConfigTable.GetData_Character(nCharId)
if mapCharCfg == nil or mapCharCfg.Visible == false or mapCharCfg.Available == false then
printError("角色id解析错误")
return
end
table.insert(tbCharPotential, {
CharId = nCharId,
Potentials = {}
})
end
local nMaxLevel = ConfigTable.GetConfigNumber("PotentialPreselectionMaxLevel")
local unpack_potential = function(tbPotential, tbAll, bSpecial)
for _, nId in ipairs(tbAll) do
if bSpecial then
local flag = read_bits(1)
if flag == 1 then
table.insert(tbPotential, {Id = nId, Level = 1})
end
else
local nLevel = read_bits(3)
if nLevel > nMaxLevel then
printError("潜能等级异常")
return false
end
if 0 < nLevel then
table.insert(tbPotential, {Id = nId, Level = nLevel})
end
end
end
return true
end
for k, v in ipairs(tbCharPotential) do
if v.CharId > 0 then
local potentialCfg = ConfigTable.GetData("CharPotential", v.CharId)
if potentialCfg then
local bAvailable = true
if k == 1 then
bAvailable = bAvailable and unpack_potential(v.Potentials, potentialCfg.MasterSpecificPotentialIds, true)
bAvailable = bAvailable and unpack_potential(v.Potentials, potentialCfg.MasterNormalPotentialIds, false)
else
bAvailable = bAvailable and unpack_potential(v.Potentials, potentialCfg.AssistSpecificPotentialIds, true)
bAvailable = bAvailable and unpack_potential(v.Potentials, potentialCfg.AssistNormalPotentialIds, false)
end
bAvailable = bAvailable and unpack_potential(v.Potentials, potentialCfg.CommonPotentialIds, false)
if not bAvailable then
return
end
end
end
end
return tbCharPotential
end
function PlayerPotentialPreselectionData:SavePreselectionFromRank(sName, bPreference, tbCharPotential, callback)
if self.rankSaveTimer ~= nil then
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("Potential_Preselection_Save_CD"))
return
end
self.rankSaveTimer = TimerManager.Add(1, saveCD, nil, function()
self.rankSaveTimer:Cancel()
self.rankSaveTimer = nil
end, true, true, true, nil)
self:SendImportPotential(sName, bPreference, tbCharPotential, callback)
end
function PlayerPotentialPreselectionData:GetPreselectionList()
return self.tbPreselectionList
end
function PlayerPotentialPreselectionData:SendGetPreselectionList(callback)
if not self.bGetData then
local netCallback = function(_, mapNetData)
self.bGetData = true
self.tbPreselectionList = {}
for _, v in ipairs(mapNetData.List) do
local mapData = self:CreateNewPreselection(v)
table.insert(self.tbPreselectionList, mapData)
end
if callback ~= nil then
callback()
end
end
HttpNetHandler.SendMsg(NetMsgId.Id.potential_preselection_list_req, {}, nil, netCallback)
elseif callback ~= nil then
callback()
end
end
function PlayerPotentialPreselectionData:SendDeletePreselection(tbIds, callback)
local netCallback = function(_, mapNetData)
local tbTemp = {}
for k, v in ipairs(self.tbPreselectionList) do
if table.indexof(tbIds, v.nId) == 0 then
table.insert(tbTemp, v)
end
end
self.tbPreselectionList = tbTemp
local tbAllTeam = PlayerData.Team:GetAllTeamData()
if tbAllTeam ~= nil then
for nIdx, v in ipairs(tbAllTeam) do
if 0 < table.indexof(tbIds, v.nPreselectionId) then
local tmpDisc = v.tbTeamDiscId
local tbTeamMemberId = v.tbTeamMemberId
PlayerData.Team:UpdateFormationInfo(nIdx, tbTeamMemberId, tmpDisc, 0)
end
end
end
if callback ~= nil then
callback()
end
EventManager.Hit("DeletePotentialPreselection")
end
local msgData = {Ids = tbIds}
HttpNetHandler.SendMsg(NetMsgId.Id.potential_preselection_delete_req, msgData, nil, netCallback)
end
function PlayerPotentialPreselectionData:SendChangePreselectionName(nId, sName, callback)
local netCallback = function()
for _, v in ipairs(self.tbPreselectionList) do
if v.nId == nId then
v.sName = sName
break
end
end
if callback ~= nil then
callback()
end
end
local msgData = {Id = nId, Name = sName}
HttpNetHandler.SendMsg(NetMsgId.Id.potential_preselection_name_set_req, msgData, nil, netCallback)
end
function PlayerPotentialPreselectionData:SendPreselectionPreference(tbCheckIns, tbCheckOutIds, callback)
local netCallback = function(_, mapNetData)
for _, v in ipairs(self.tbPreselectionList) do
if tbCheckIns ~= nil and table.indexof(tbCheckIns, v.nId) > 0 then
v.bPreference = true
end
if tbCheckOutIds ~= nil and table.indexof(tbCheckOutIds, v.nId) > 0 then
v.bPreference = false
end
end
if callback ~= nil then
callback()
end
end
local msgData = {CheckInIds = tbCheckIns, CheckOutIds = tbCheckOutIds}
HttpNetHandler.SendMsg(NetMsgId.Id.potential_preselection_preference_set_req, msgData, nil, netCallback)
end
function PlayerPotentialPreselectionData:SendUpdatePotential(nId, tbCharPotential, callback)
local netCallback = function(_, mapNetData)
local mapData = self:CreateNewPreselection(mapNetData)
for k, v in ipairs(self.tbPreselectionList) do
if v.nId == nId then
self.tbPreselectionList[k] = mapData
break
end
end
if callback ~= nil then
callback(mapData)
end
end
local msgData = {Id = nId, CharPotentials = tbCharPotential}
HttpNetHandler.SendMsg(NetMsgId.Id.potential_preselection_update_req, msgData, nil, netCallback)
end
function PlayerPotentialPreselectionData:SendImportPotential(sName, bPreference, tbCharPotential, callback)
local netCallback = function(_, mapNetData)
local bInList = false
local mapData = self:CreateNewPreselection(mapNetData)
for k, v in ipairs(self.tbPreselectionList) do
if v.nId == mapData.nId then
bInList = true
self.tbPreselectionList[k] = mapData
break
end
end
if not bInList then
table.insert(self.tbPreselectionList, mapData)
end
if callback ~= nil then
callback(mapData)
end
end
local msgData = {
Name = sName,
Preference = bPreference,
CharPotentials = tbCharPotential
}
HttpNetHandler.SendMsg(NetMsgId.Id.potential_preselection_import_req, msgData, nil, netCallback)
end
return PlayerPotentialPreselectionData
+75 -13
View File
@@ -39,6 +39,7 @@ function PlayerQuestData:Init()
self.nCurTourGroupOrderIndex = 0
self.nMaxTourGroupOrderIndex = 0
self.nMaxTeamFormationGroupIdx = 0
self.nMaxTeamFormationGroupIdxInAttr = {}
self.tbTourGuideGroup = {}
self.tbTourGuide = {}
self.tbTeamFormation = {}
@@ -92,6 +93,10 @@ function PlayerQuestData:InitConfig()
end
ForEachTableLine(DataTable.WeeklyQuestActive, foreachWeeklyActive)
local foreachTeamFormationGroup = function(mapData)
if self.nMaxTeamFormationGroupIdxInAttr[mapData.AttributeId] == nil then
self.nMaxTeamFormationGroupIdxInAttr[mapData.AttributeId] = 0
end
self.nMaxTeamFormationGroupIdxInAttr[mapData.AttributeId] = self.nMaxTeamFormationGroupIdxInAttr[mapData.AttributeId] + 1
table.insert(self.tbTeamFormationGroup, mapData)
end
ForEachTableLine(DataTable.AssistQuestGroup, foreachTeamFormationGroup)
@@ -240,6 +245,17 @@ function PlayerQuestData:GetStarTowerBookQuestData()
end
return self._mapQuest[12]
end
function PlayerQuestData:GetOngoingAttributeId()
local nLastestAttributeId = 0
for k, v in pairs(self.tbTeamFormationAttr) do
local bComplete = self:CheckTeamFormationAttributeCompleted(v.Id)
if not bComplete then
nLastestAttributeId = v.Id
break
end
end
return nLastestAttributeId
end
function PlayerQuestData:GetAttributeIdByGroupId(nGroupId)
for nGroupIdx, mapGroup in pairs(self.tbTeamFormationGroup) do
if mapGroup.Id == nGroupId then
@@ -278,9 +294,16 @@ function PlayerQuestData:GetCurTeamFormationQuestGroup(nAttributeId)
end
return mapFirstGroup.Id
end
local nCurIndex = math.min(self.tbCurTeamFormationGroupIndex[nAttributeId] + 1, self.nMaxTeamFormationGroupIdx)
local mapCurGroup = self.tbTeamFormationGroup[nCurIndex]
return mapCurGroup.Id
local nCurIndex = math.min(self.tbCurTeamFormationGroupIndex[nAttributeId] + 1, self.nMaxTeamFormationGroupIdxInAttr[nAttributeId])
local nCurAttriCount = 0
for i = 1, #self.tbTeamFormationGroup do
if self.tbTeamFormationGroup[i].AttributeId == nAttributeId then
nCurAttriCount = nCurAttriCount + 1
if nCurAttriCount == nCurIndex then
return self.tbTeamFormationGroup[i].Id
end
end
end
end
function PlayerQuestData:GetTeamFormationQuestData()
if self._mapQuest[QuestType.Assist] == nil then
@@ -301,12 +324,36 @@ function PlayerQuestData:GetTeamFormationGroupById(nGroupId)
end
return tbGroupData
end
function PlayerQuestData:CheckTeamFormationAttributeCompleted(nAttrId)
local tbGroups = {}
local bCompleted = true
function PlayerQuestData:GetTeamFormationGroupStartIndex(nAttrId)
local nStartIndex = 0
for nGroupIndex, mapGroup in pairs(self.tbTeamFormationGroup) do
if mapGroup.AttributeId == nAttrId then
local bGroupCompleted = self:CheckTeamFormationGroupReward(nAttrId, nGroupIndex)
nStartIndex = nGroupIndex
break
end
end
return nStartIndex
end
function PlayerQuestData:GetTeamFormationGroupEndIndex(nAttrId)
local nEndIndex = 0
local nLastestGroupId = self:GetCurTeamFormationQuestGroup(nAttrId)
for nGroupIndex, mapGroup in pairs(self.tbTeamFormationGroup) do
if mapGroup.AttributeId == nAttrId and mapGroup.Id == nLastestGroupId then
nEndIndex = nGroupIndex
end
end
return nEndIndex
end
function PlayerQuestData:CheckTeamFormationAttributeCompleted(nAttrId)
local bCompleted = true
local tbIndexInAttr = {}
for nGroupIndex, mapGroup in pairs(self.tbTeamFormationGroup) do
if mapGroup.AttributeId == nAttrId then
if tbIndexInAttr[nAttrId] == nil then
tbIndexInAttr[nAttrId] = 0
end
tbIndexInAttr[nAttrId] = tbIndexInAttr[nAttrId] + 1
local bGroupCompleted = self:CheckTeamFormationGroupReward(nAttrId, tbIndexInAttr[nAttrId])
bCompleted = bCompleted and bGroupCompleted
if bCompleted == false then
return false
@@ -336,9 +383,11 @@ function PlayerQuestData:CheckTeamFormationAttributeUnlocked(nAttrId)
return true
end
local bCompleted = true
local nGroupIdxInAttr = 0
for nGroupIndex, mapGroup in pairs(self.tbTeamFormationGroup) do
if mapGroup.AttributeId == mapAttr.Pre then
local bGroupCompleted = self:CheckTeamFormationGroupReward(nAttrId, nGroupIndex)
nGroupIdxInAttr = nGroupIdxInAttr + 1
local bGroupCompleted = self:CheckTeamFormationGroupReward(mapAttr.Pre, nGroupIdxInAttr)
bCompleted = bCompleted and bGroupCompleted
if bCompleted == false then
return false
@@ -350,10 +399,15 @@ end
function PlayerQuestData:GetTeamFormationAttributeProgress(nAttrId)
local nTotalCount = 0
local nReceivedCount = 0
local tbIndexInAttr = {}
for nGroupIndex, mapGroup in pairs(self.tbTeamFormationGroup) do
if mapGroup.AttributeId == nAttrId then
if tbIndexInAttr[nAttrId] == nil then
tbIndexInAttr[nAttrId] = 0
end
tbIndexInAttr[nAttrId] = tbIndexInAttr[nAttrId] + 1
nTotalCount = nTotalCount + 1
local bGroupCompleted = self:CheckTeamFormationGroupReward(nAttrId, nGroupIndex)
local bGroupCompleted = self:CheckTeamFormationGroupReward(nAttrId, tbIndexInAttr[nAttrId])
if bGroupCompleted then
nReceivedCount = nReceivedCount + 1
end
@@ -1222,13 +1276,21 @@ end
function PlayerQuestData:UpdateTeamFormationRedDot()
local bCanReceive = false
local bAllReceive = true
local nAttr = 0
for k, v in pairs(table) do
nAttr = nAttr + 1
local bComp = self:CheckTeamFormationAttributeCompleted(nAttr)
local nAttr = 1
local nFinish = 0
local foreachAttri = function(mapData)
nFinish = nFinish + 1
end
ForEachTableLine(DataTable.AssistAttribute, foreachAttri)
for i = 1, nFinish do
local bComp = self:CheckTeamFormationAttributeCompleted(i)
if not bComp then
nAttr = i
break
end
if i == nFinish then
nAttr = i
end
end
local nCurGroupId = self:GetCurTeamFormationQuestGroup(nAttr)
local questList = self._mapQuest[QuestType.Assist]
@@ -547,6 +547,17 @@ function PlayerStarTowerData:GetMaxDifficult(nGroupId)
end
return ret
end
function PlayerStarTowerData:GetGlobalMaxDifficult()
local ret = 1
local foreachStarTower = function(mapData)
local nTempRet = self:GetMaxDifficult(mapData.Id)
if nTempRet > ret then
ret = nTempRet
end
end
ForEachTableLine(DataTable.StarTowerGroup, foreachStarTower)
return ret
end
function PlayerStarTowerData:GetMaxPassedDifficult(nGroupId)
local ret = 0
local mapGroup = CacheTable.GetData("_StarTower", nGroupId)
@@ -25,6 +25,7 @@ function PlayerStateData:CacheStateData(mapMsgData)
RedDotManager.SetValid(RedDotDefine.StarTowerBook_Affinity_Reward, "server", mapMsgData.NpcAffinityReward)
PlayerData.Quest:UpdateServerQuestRedDot(mapMsgData.TravelerDuelQuest)
PlayerData.Quest:UpdateServerQuestRedDot(mapMsgData.TravelerDuelChallengeQuest)
self.nLastReceiveIdleRewardTime = mapMsgData.TravelerDuelIdleReward or CS.ClientManager.Instance.serverTimeStamp
PlayerData.InfinityTower:UpdateBountyRewardState(mapMsgData.InfinityTower)
PlayerData.StarTowerBook:UpdateServerRedDot(mapMsgData.StarTowerBook)
PlayerData.ScoreBoss:UpdateRedDot(mapMsgData.ScoreBoss)
@@ -335,4 +336,31 @@ function PlayerStateData:RefreshCharAdvanceRewardRedDot()
end
end
end
function PlayerStateData:RefreshTrekkerVersusIdleRewardRedDot(nNewTime)
local nActId = 0
local foreachActData = function(mapData)
if mapData.ActivityType == GameEnum.activityType.TrekkerVersus then
nActId = mapData.Id > nActId and mapData.Id or nActId
end
end
ForEachTableLine(DataTable.Activity, foreachActData)
local actData = PlayerData.Activity:GetActivityDataById(nActId)
local bRedDotOn = false
if actData ~= nil then
local tbIdleReward = actData:GetIdleReward()
if tbIdleReward ~= nil and 0 < #tbIdleReward then
if nNewTime ~= nil then
self.nLastReceiveIdleRewardTime = nNewTime
end
local nElapsedTime = CS.ClientManager.Instance.serverTimeStamp - self.nLastReceiveIdleRewardTime
if nElapsedTime >= 3600 * ConfigTable.GetConfigNumber("TrekkerVersusIdleRewardRedDotTime") then
bRedDotOn = true
end
end
end
local bInActGroup, nActGroupId = PlayerData.Activity:IsActivityInActivityGroup(nActId)
if bInActGroup then
RedDotManager.SetValid(RedDotDefine.TrekkerVersusIdleReward, {nActGroupId, nActId}, bRedDotOn)
end
end
return PlayerStateData
+22 -3
View File
@@ -20,7 +20,8 @@ function PlayerTeamData:CacheFormationInfo(mapData)
0,
0,
0
}
},
nPreselectionId = 0
}
end
end
@@ -42,7 +43,8 @@ function PlayerTeamData:CacheFormationInfo(mapData)
0,
0,
0
}
},
nPreselectionId = 0
}
end
for nIndex, nCharId in ipairs(v.CharIds) do
@@ -51,19 +53,21 @@ function PlayerTeamData:CacheFormationInfo(mapData)
for nIndex, nDiscId in ipairs(v.DiscIds) do
mapTeamData.tbTeamDiscId[nIndex] = nDiscId
end
mapTeamData.nPreselectionId = v.PreselectionId
end
end
if mapData.Record ~= nil then
PlayerData.StarTower:CacheFormationInfo(mapData.Record)
end
end
function PlayerTeamData:UpdateFormationInfo(nTeamId, tbCharIds, tbDiscIds, callback)
function PlayerTeamData:UpdateFormationInfo(nTeamId, tbCharIds, tbDiscIds, nPreselectionId, callback)
local PlayerFormationReq = {}
PlayerFormationReq.Formation = {}
PlayerFormationReq.Formation.Number = nTeamId
PlayerFormationReq.Formation.Captain = 1
PlayerFormationReq.Formation.CharIds = tbCharIds
PlayerFormationReq.Formation.DiscIds = tbDiscIds
PlayerFormationReq.Formation.PreselectionId = nPreselectionId
local Callback = function()
if self._tbTeam == nil then
self._tbTeam = {}
@@ -78,12 +82,16 @@ function PlayerTeamData:UpdateFormationInfo(nTeamId, tbCharIds, tbDiscIds, callb
mapTeamData.tbTeamDiscId[nIndex] = nDiscId
end
end
mapTeamData.nPreselectionId = nPreselectionId
if callback ~= nil and type(callback) == "function" then
callback()
end
end
HttpNetHandler.SendMsg(NetMsgId.Id.player_formation_req, PlayerFormationReq, nil, Callback)
end
function PlayerTeamData:GetAllTeamData()
return self._tbTeam
end
function PlayerTeamData:GetTeamData(nTeamId)
if self._tbTeam == nil then
return nil, nil
@@ -134,6 +142,17 @@ function PlayerTeamData:GetTeamCharId(nTeamId)
end
return tbCharId
end
function PlayerTeamData:GetTeamPreselectionId(nTeamId)
if self._tbTeam == nil then
return 0
end
local mapTeamData = self._tbTeam[nTeamId]
if mapTeamData ~= nil then
return mapTeamData.nPreselectionId
else
return 0
end
end
function PlayerTeamData:CheckTeamValid(nTeamId)
if self._tbTeam == nil then
return false
@@ -1,5 +1,6 @@
local PlayerTrialData = class("PlayerTrialData")
local AdventureModuleHelper = CS.AdventureModuleHelper
local Actor2DManager = require("Game.Actor2D.Actor2DManager")
function PlayerTrialData:Init()
self.curLevel = nil
self.bInSettlement = false
@@ -65,6 +66,7 @@ function PlayerTrialData:EnterTrialEditor(nFloor)
self.curLevel:BindEvent()
end
if type(self.curLevel.Init) == "function" then
Actor2DManager.ForceUseL2D(true)
self.curLevel:Init(self, nFloor)
end
end
@@ -82,10 +84,12 @@ function PlayerTrialData:EnterTrial(nLevelId)
self.curLevel:BindEvent()
end
if type(self.curLevel.Init) == "function" then
Actor2DManager.ForceUseL2D(true)
self.curLevel:Init(self, nLevelId)
end
end
function PlayerTrialData:LevelEnd()
Actor2DManager.ForceUseL2D(false)
PlayerData.Build:DeleteTrialBuild()
if nil ~= self.curLevel and type(self.curLevel.UnBindEvent) == "function" then
self.curLevel:UnBindEvent()
@@ -245,10 +245,10 @@ function PlayerVoiceData:PlayBoardSelectVoice(nCharId, nSkinId)
end
function PlayerVoiceData:PlayMainViewOpenVoice()
local curBoardCharId, curSkinId = self:GetCurBoardCharIdAndSkinId()
self:CheckHoliday()
local bPlayFirst = false
local tbVoiceKey = {}
if nil ~= curBoardCharId then
if curBoardCharId ~= nil and curBoardCharId ~= 0 then
self:CheckHoliday()
local nServerTimeStamp = ClientManager.serverTimeStamp
local nHour = tonumber(os.date("%H", nServerTimeStamp))
local getIndex = function(nHour)
@@ -267,7 +267,7 @@ function PlayerVoiceData:PlayMainViewOpenVoice()
else
tbVoiceKey = {sKey, "greet"}
end
if #self.tbHolidayVoiceKey > 0 then
if 0 < #self.tbHolidayVoiceKey then
for _, v in ipairs(self.tbHolidayVoiceKey) do
table.insert(tbVoiceKey, v)
end
@@ -302,7 +302,7 @@ function PlayerVoiceData:PlayBoardClickVoice()
end
self.nContinuousClickCount = self.nContinuousClickCount + 1
local curBoardCharId, curSkinId = self:GetCurBoardCharIdAndSkinId()
if nil ~= curBoardCharId then
if curBoardCharId ~= nil and curBoardCharId ~= 0 then
local tbVoiceKey = {}
if self.nContinuousClickCount > getBoardClickMaxCount(self.bNpc) then
table.insert(tbVoiceKey, "hfc")
@@ -369,7 +369,7 @@ function PlayerVoiceData:PlayBoardFreeVoice()
curSkinId = self.nNPCSkinId
sVoiceKey = "hang_npc"
end
if nil ~= curBoardCharId then
if curBoardCharId ~= nil and curBoardCharId ~= 0 then
self:PlayCharVoice(sVoiceKey, curBoardCharId, curSkinId, self.bNpc)
end
end
@@ -383,7 +383,7 @@ function PlayerVoiceData:PlayBoardFreeLongTimeVoice()
curSkinId = self.nNPCSkinId
sVoiceKey = "exhang_npc"
end
if nil ~= curBoardCharId then
if curBoardCharId ~= nil and curBoardCharId ~= 0 then
self:PlayCharVoice(sVoiceKey, curBoardCharId, curSkinId, self.bNpc)
end
end
+5
View File
@@ -50,12 +50,17 @@ local LoadBattleData = function()
LocalSettingData.mapData.BattleHUD = LoadLocalData("BattleHUD", AllEnum.BattleHudType.Sector)
end
end
local LoadNotificationData = function()
LocalSettingData.mapData.Energy = LoadLocalData("Energy", true)
LocalSettingData.mapData.Dispatch = LoadLocalData("Dispatch", true)
end
function LocalSettingData.Init()
LocalSettingData.mapData = {}
LocalSettingData.mapData.UseLive2D = LoadLocalData("UseLive2D", true)
LoadSoundData()
LoadBattleData()
InitCurSignInData()
LoadNotificationData()
end
function LocalSettingData.GetLocalSettingData(subKey)
return LocalSettingData.mapData[subKey]
+3
View File
@@ -161,6 +161,9 @@ function PlayerData.Init()
local StoryData = require("GameCore.Data.DataClass.PlayerStoryData")
PlayerData.Story = StoryData.new()
PlayerData.Story:Init()
local PotentialPreselection = require("GameCore.Data.DataClass.PlayerPotentialPreselectionData")
PlayerData.PotentialPreselection = PotentialPreselection.new()
PlayerData.PotentialPreselection:Init()
local foreachEnumDesc = function(mapData)
CacheTable.SetField("_EnumDesc", mapData.EnumName, mapData.Value, mapData.Key)
end
+1
View File
@@ -174,6 +174,7 @@ local EventId = {
DispatchRefreshPanel = 506,
SettingsBattleClose = 510,
CharTalentUIVisible = 511,
SettingsNotificationClose = 512,
GMToolShow = 998,
GMToolClose = 998.1,
GMToolClosePanel = 998.2,
+11 -3
View File
@@ -160,9 +160,15 @@ function EventManager.Remove(nEventId, listener, callback)
end
end
function EventManager.RemoveAll(nEventId)
mapEvent[nEventId] = nil
mapTempAdd[nEventId] = nil
mapTempRemove[nEventId] = nil
if type(mapEvent) == "table" then
mapEvent[nEventId] = nil
end
if type(mapTempAdd) == "table" then
mapTempAdd[nEventId] = nil
end
if type(mapTempRemove) == "table" then
mapTempRemove[nEventId] = nil
end
end
function EventManager.Hit(nEventId, ...)
if mapEvent == nil or mapOnHitEventId == nil then
@@ -190,6 +196,8 @@ function EventManager.Hit(nEventId, ...)
mapOnHitEventId[nEventId] = nil
ProcAdd(nEventId)
ProcRemove(nEventId)
elseif mapOnHitEventId[nEventId] ~= nil then
printWarn("在同一帧里,不应重复触发同一事件,EvendId:" .. tostring(nEventId))
end
end
local mapEntityEvent, mapTempEntityEventAdd, mapTempEntityEventRemove, mapOnHitEntityEventId
+2
View File
@@ -10,6 +10,7 @@ local AvgManager = require("GameCore.Module.AvgManager")
local MessageBoxManager = require("GameCore.Module.MessageBoxManager")
local GamepadUIManager = require("GameCore.Module.GamepadUIManager")
local LampNoticeManager = require("GameCore.Module.LampNoticeManager")
local NotificationManager = require("GameCore.Module.NotificationManager")
RedDotManager = require("GameCore.RedDot.RedDotManager")
EventManager.Init()
TimerManager.Init()
@@ -25,6 +26,7 @@ AvgManager.Init()
MessageBoxManager.Init()
GamepadUIManager.Init()
LampNoticeManager.Init()
NotificationManager.Init()
RedDotManager.Init()
PopUpManager.Init()
function OnCSLuaManagerUpdate()
-5
View File
@@ -95,11 +95,6 @@ local OnEvent_AvgSTEnd = function(_)
objAvgPanel = nil
NovaAPI.SetScreenSleepTimeout(false)
end
if AVG_EDITOR ~= true then
GameResourceLoader.Unload("UI", "ui_avg")
end
GameResourceLoader.Unload("ImageAvg")
GameResourceLoader.Unload("Actor2DAvg")
bInAvg = false
end
local func_OnEvent_TransAnimInClear = function()
@@ -0,0 +1,70 @@
local NotificationManager = {}
local TimerManager = require("GameCore.Timer.TimerManager")
local Event = require("GameCore.Event.Event")
local SDKManager = CS.SDKManager.Instance
local tbNotification = {}
local bAppSuspended = false
local OnApplicationFocus = function(_, bFocus)
bAppSuspended = not bFocus
end
function NotificationManager.RegisterNotification(nId, nSubkey, nTime)
if not SDKManager:IsSDKInit() then
return
end
if not NovaAPI.IsMobilePlatform() then
return
end
local configData = ConfigTable.GetData("NotificationConfig", nId)
if configData == nil then
printLog("NotificationManager 注册推送失败,配置表数据不存在")
return
end
local setTime = nTime - 5000
if setTime <= CS.ClientManager.Instance.serverTimeStamp then
return
end
local data = {
id = nId,
key = nId + nSubkey,
time = nTime,
timer = TimerManager.Add(1, setTime - CS.ClientManager.Instance.serverTimeStamp, nil, function()
if not bAppSuspended then
printLog("NotificationManager 由计时器触发的取消推送成功,id:", tostring(nId + nSubkey))
UnregisterNotification(nId, nSubkey)
end
end, true, true, false, nil)
}
table.insert(tbNotification, data)
local sContent = configData.Content
sContent = string.gsub(sContent, "==PLAYER_NAME==", PlayerData.Base:GetPlayerNickName())
SDKManager:BuildLocalNotification(nId + nSubkey, configData.Title, sContent, nTime)
printLog("NotificationManager 注册推送成功,id:", tostring(nId + nSubkey), "title:", configData.Title, "content:", sContent, "time:", tostring(setTime))
end
function NotificationManager.UnregisterNotification(nId, nSubkey)
if not SDKManager:IsSDKInit() then
return
end
if not NovaAPI.IsMobilePlatform() then
return
end
local tbRemove = {}
for i, data in ipairs(tbNotification) do
if data.id == nId and data.key == nId + nSubkey then
data.timer:_Stop()
table.remove(tbNotification, i)
table.insert(tbRemove, nId + nSubkey)
break
end
end
SDKManager:DeleteLocalNotification(tbRemove)
printLog("NotificationManager 取消推送成功,id:", tostring(nId + nSubkey))
end
local function Uninit()
EventManager.Remove(EventId.CSLuaManagerShutdown, NotificationManager, Uninit)
EventManager.Remove("CS2LuaEvent_OnApplicationFocus", NotificationManager, OnApplicationFocus)
end
function NotificationManager.Init()
EventManager.Add(EventId.CSLuaManagerShutdown, NotificationManager, Uninit)
EventManager.Add("CS2LuaEvent_OnApplicationFocus", NotificationManager, OnApplicationFocus)
end
return NotificationManager
+106 -117
View File
@@ -31,17 +31,6 @@ local MakeNetMsgIdMap = function()
end
end
end
local ProcChangeInfo = function(mapDecodedChangeInfo)
PlayerData.Coin:ChangeCoin(mapDecodedChangeInfo["proto.Res"])
PlayerData.Item:ChangeItem(mapDecodedChangeInfo["proto.Item"])
PlayerData.Char:GetNewChar(mapDecodedChangeInfo["proto.Char"])
PlayerData.Base:ChangeEnergy(mapDecodedChangeInfo["proto.Energy"])
PlayerData.Base:ChangeWorldClass(mapDecodedChangeInfo["proto.WorldClass"])
PlayerData.Base:ChangeTitle(mapDecodedChangeInfo["proto.Title"])
PlayerData.Disc:CreateNewDisc(mapDecodedChangeInfo["proto.Disc"])
PlayerData.Base:ChangeHonorTitle(mapDecodedChangeInfo["proto.Honor"])
PlayerData.HeadData:ChangePlayerHead(mapDecodedChangeInfo["proto.HeadIcon"])
end
local NOTHING_NEED_TO_BE_DONE = function(mapData)
end
local ike_succeed_ack = function(mapData)
@@ -66,6 +55,7 @@ local player_data_succeed_ack = function(mapMsgData)
PlayerData.Base:CacheTitleInfo(mapMsgData.Titles)
PlayerData.Base:CacheHonorTitleInfo(mapMsgData.Honors)
PlayerData.Base:CacheHonorTitleList(mapMsgData.HonorList)
PlayerData.Base:CacheHonorTitleListActivity(mapMsgData.ActivityHonors)
PlayerData.Base:CacheWorldClassInfo(mapMsgData.WorldClass)
PlayerData.Base:CacheSendGiftCount(mapMsgData.SendGiftCnt)
PlayerData.Base:CacheRenameTime(mapMsgData.NicknameResetTime)
@@ -124,12 +114,12 @@ local player_board_set_failed_ack = function(mapMsgData)
end
local player_world_class_reward_receive_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
PlayerData.Base:PlayerWorldClassRewardReceiveSuc(mapMsgData)
end
local player_world_class_advance_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
PlayerData.Base:PlayerWorldClassAdvanceSuc(mapMsgData)
end
local world_class_reward_state_notify = function(mapMsgData)
@@ -137,31 +127,31 @@ local world_class_reward_state_notify = function(mapMsgData)
end
local energy_buy_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
PlayerData.Base:RefreshEnergyBuyCount(mapMsgData.Count)
end
local item_use_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local item_product_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local item_quick_growth_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local fragments_convert_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local player_ping_succeed_ack = function(mapMsgData)
NovaAPI.MarkServerTimeStamp(mapMsgData.ServerTs)
end
local story_settle_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local gacha_spin_succeed_ack = function(mapMsgData)
local CheckNew = function(nTid)
@@ -179,22 +169,15 @@ local gacha_spin_succeed_ack = function(mapMsgData)
return false
end
end
local tbReward = {}
local tbItemId = {}
for _, v in ipairs(mapMsgData.Cards) do
local bNewHandBood = CheckNew(v.Card.Tid)
local bNew = bNewHandBood and table.indexof(tbItemId, v.Card.Tid) < 1
table.insert(tbItemId, v.Card.Tid)
table.insert(tbReward, {
id = v.Card.Tid,
count = v.Card.Qty,
rewardItem = v.Rewards,
bNew = bNew
})
v.Card.bNew = bNew
end
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
PlayerData.Item:CacheFragmentsOverflow(nil, mapMsgData.Change)
end
local mail_list_succeed_ack = function(mapMsgData)
@@ -205,45 +188,45 @@ local mail_read_succeed_ack = function(mapMsgData)
end
local mail_recv_succeed_ack = function(mapMsgData)
local mapDecodeInfo = UTILS.DecodeChangeInfo(mapMsgData.Items)
ProcChangeInfo(mapDecodeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodeInfo)
end
local mail_remove_succeed_ack = function(mapMsgData)
PlayerData.Mail:RemoveMail(mapMsgData)
end
local dictionary_reward_receive_succeed_ack = function(mapMsgData)
local tbDecodeChange = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(tbDecodeChange)
HttpNetHandler.ProcChangeInfo(tbDecodeChange)
end
local char_gem_instance_settle_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local char_gem_instance_sweep_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local skill_instance_sweep_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local activity_detail_succeed_ack = function(mapMsgData)
PlayerData.Activity:CacheAllActivityData(mapMsgData)
end
local activity_periodic_reward_receive_succeed_ack = function(mapMsgData)
local tbDecodeChange = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(tbDecodeChange)
HttpNetHandler.ProcChangeInfo(tbDecodeChange)
end
local activity_periodic_final_reward_receive_succeed_ack = function(mapMsgData)
local tbDecodeChange = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(tbDecodeChange)
HttpNetHandler.ProcChangeInfo(tbDecodeChange)
end
local activity_login_reward_receive_succeed_ack = function(mapMsgData)
local tbDecodeChange = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(tbDecodeChange)
HttpNetHandler.ProcChangeInfo(tbDecodeChange)
end
local activity_trial_reward_receive_succeed_ack = function(mapMsgData)
local tbDecodeChange = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(tbDecodeChange)
HttpNetHandler.ProcChangeInfo(tbDecodeChange)
end
local phone_contacts_info_succeed_ack = function(mapMsgData)
PlayerData.Phone:CacheAddressBookData(mapMsgData.List)
@@ -254,25 +237,25 @@ end
local star_tower_build_delete_succeed_ack = function(mapMsgData)
local tbDecodeChange = UTILS.DecodeChangeInfo(mapMsgData.Change)
PlayerData.StarTower:AddStarTowerTicket(mapMsgData.Ticket)
ProcChangeInfo(tbDecodeChange)
HttpNetHandler.ProcChangeInfo(tbDecodeChange)
end
local quest_reward_recv_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local star_tower_build_whether_save_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
PlayerData.StarTower:AddStarTowerTicket(mapMsgData.Ticket)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local star_tower_give_up_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local star_tower_interact_succeed_ack = function(mapMsgData)
if mapMsgData.Settle then
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Settle.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
end
local star_tower_apply_failed_ack = function()
@@ -280,43 +263,43 @@ local star_tower_apply_failed_ack = function()
end
local tower_growth_node_unlock_succeed_ack = function(mapMsgData)
local tbDecodeChange = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(tbDecodeChange)
HttpNetHandler.ProcChangeInfo(tbDecodeChange)
end
local tower_growth_group_node_unlock_succeed_ack = function(mapMsgData)
local tbDecodeChange = UTILS.DecodeChangeInfo(mapMsgData.ChangeInfo)
ProcChangeInfo(tbDecodeChange)
HttpNetHandler.ProcChangeInfo(tbDecodeChange)
end
local quest_tower_reward_receive_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local npc_affinity_plot_reward_receive_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local npc_affinity_plot_reward_receive_failed_ack = function(mapMsgData)
EventManager.Hit(EventId.ClosePanel, PanelId.PureAvgStory)
end
local friend_receive_energy_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local resident_shop_purchase_succeed_ack = function(mapMsgData)
if not mapMsgData.IsRefresh then
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
end
local daily_shop_reward_receive_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local char_advance_reward_receive_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local achievement_reward_receive_succeed_ack = function(mapMsgData)
ProcChangeInfo(UTILS.DecodeChangeInfo(mapMsgData))
HttpNetHandler.ProcChangeInfo(UTILS.DecodeChangeInfo(mapMsgData))
end
local achievement_change_notify = function(mapMsgData)
PlayerData.Achievement:ChangeAchievementData(mapMsgData)
@@ -327,14 +310,14 @@ end
local monthly_card_rewards_notify = function(mapMsgData)
if mapMsgData.Switch then
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
PlayerData.Daily.ProcessMonthlyCard(mapMsgData)
end
local signin_reward_change_notify = function(mapMsgData)
if mapMsgData.Switch then
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
PlayerData.Daily.ProcessDailyCheckIn(mapMsgData)
end
@@ -346,63 +329,63 @@ local battle_pass_quest_reward_receive_succeed_ack = function(mapMsgData)
end
local battle_pass_reward_receive_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local battle_pass_level_buy_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local battle_pass_order_collect_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.CollectResp.Items)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local mall_order_collect_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Items)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local mall_package_order_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local mall_shop_order_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local gem_convert_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local talent_unlock_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local talent_reset_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local talent_node_reset_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local talent_group_unlock_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local disc_strengthen_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local disc_promote_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local disc_limit_break_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local disc_read_reward_receive_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local mail_state_notify = function(mapMsgData)
PlayerData.Mail:UpdateMailList(mapMsgData)
@@ -424,7 +407,7 @@ local character_skin_change_notify = function(mapMsgData)
PlayerData.Char:SetCharSkinId(mapMsgData.CharId, mapMsgData.SkinId)
end
local world_class_change_notify = function(mapMsgData)
ProcChangeInfo(UTILS.DecodeChangeInfo(mapMsgData.Change))
HttpNetHandler.ProcChangeInfo(UTILS.DecodeChangeInfo(mapMsgData.Change))
end
local world_class_number_notify = function(mapMsgData)
PlayerData.State:CacheWorldClassRewardStateInBoard(mapMsgData.RewardsFlag)
@@ -446,7 +429,7 @@ local char_advance_reward_state_notify = function(mapMsgData)
PlayerData.State:CacheCharactersAdRewards_Notify(mapMsgData)
end
local items_change_notify = function(mapMsgData)
ProcChangeInfo(UTILS.DecodeChangeInfo(mapMsgData))
HttpNetHandler.ProcChangeInfo(UTILS.DecodeChangeInfo(mapMsgData))
end
local friend_state_notify = function(mapMsgData)
PlayerData.Friend:UpdateFriendState(mapMsgData)
@@ -462,16 +445,16 @@ local region_boss_level_apply_succeed_ack = function(mapMsgData)
end
local region_boss_level_settle_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
PlayerData.RogueBoss:RegionBossLevelSettleSuccess(mapMsgData)
end
local region_boss_level_sweep_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local skill_instance_apply_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local week_boss_apply_succeed_ack = function(mapMsgData)
print("week succeed")
@@ -482,7 +465,7 @@ local week_boss_apply_failed_ack = function(mapMsgData)
end
local week_boss_settle_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
PlayerData.RogueBoss:WeeklyCopiesLevelSettleReqSuccess(mapMsgData)
end
local week_boss_settle_failed_ack = function(mapMsgData)
@@ -491,7 +474,7 @@ end
local week_boss_refresh_ticket_notify = function(mapMsgData)
print("week settle reset")
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local handbook_change_notify = function(mapMsgData)
PlayerData.Handbook:UpdateHandbookData(mapMsgData)
@@ -506,11 +489,11 @@ local char_up_change_notify = function(mapMsgData)
end
local daily_instance_settle_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local daily_instance_raid_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local mall_package_state_notify = function(mapMsgData)
RedDotManager.SetValid(RedDotDefine.Mall_Free, nil, mapMsgData.New)
@@ -524,12 +507,12 @@ local dictionary_change_notify = function(mapMsgData)
end
local clear_all_traveler_due_notify = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
PlayerData.TravelerDuel:CacheTravelerDuelLevelData(mapMsgData)
end
local clear_all_region_boss_level_notify = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
PlayerData.RogueBoss:CacheRogueBossData(mapMsgData.RegionBossLevels)
end
local clear_all_week_boss_notify = function(mapMsgData)
@@ -540,7 +523,7 @@ local st_clear_all_star_tower_notify = function(mapMsgData)
end
local clear_all_daily_instance_notify = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
PlayerData.DailyInstance:CacheDailyInstanceLevel(mapMsgData.DailyInstances)
end
local clear_all_char_gem_instance_notify = function(mapMsgData)
@@ -554,7 +537,7 @@ local st_export_build_notify = function(mapMsgData)
end
local char_affinity_final_notify = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
PlayerData.Char:ChangeCharAffinityValue(mapMsgData.Info)
end
local char_affinity_reward_state_notify = function(mapMsgData)
@@ -579,32 +562,32 @@ local phone_chat_change_notify = function(mapMsgData)
end
local character_fragments_overflow_change_notify = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
PlayerData.Item:CacheFragmentsOverflow(mapMsgData)
end
local infinity_tower_settle_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local infinity_tower_daily_reward_receive_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local infinity_tower_plot_reward_receive_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local disc_reset_notify = function(mapMsgData)
PlayerData.Disc:UpdateDiscData(mapMsgData.Id, mapMsgData)
end
local story_complete_notify = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
PlayerData.Avg:CacheAvgData(mapMsgData)
end
local clear_all_story_notify = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
PlayerData.Avg:CacheAvgData(mapMsgData)
end
local activity_login_rewards_notify = function(mapMsgData)
@@ -615,15 +598,15 @@ local star_tower_book_potential_notify = function(mapMsgData)
end
local star_tower_book_event_reward_receive_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local tower_book_fate_card_reward_receive_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local star_tower_book_potential_reward_receive_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local star_tower_book_event_notify = function(mapMsgData)
end
@@ -636,7 +619,7 @@ local tower_book_fate_card_reward_notify = function(mapMsgData)
end
local region_boss_level_challenge_ticket_notify = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
EventManager.Hit("region_boss_ticket_notify", AllEnum.CoinItemId.RogueHardCoreTick)
end
local honor_change_notify = function(mapMsgData)
@@ -715,7 +698,7 @@ local vampire_survivor_reward_select_failed_ack = function()
EventManager.Hit("VampireLevelRewardFailed")
end
local vampire_survivor_quest_reward_receive_succeed_ack = function(mapMsgData)
ProcChangeInfo(UTILS.DecodeChangeInfo(mapMsgData))
HttpNetHandler.ProcChangeInfo(UTILS.DecodeChangeInfo(mapMsgData))
end
local char_affinity_quest_reward_receive_succeed_ack = function(mapMsgData)
if mapMsgData.Info ~= nil and mapMsgData.Info.Rewards ~= nil then
@@ -733,16 +716,16 @@ local char_affinity_quest_reward_receive_succeed_ack = function(mapMsgData)
PlayerData.Char:ChangeCharAffinityValue(mapMsgData.Info)
end
local char_affinity_gift_send_succeed_ack = function(mapMsgData)
ProcChangeInfo(UTILS.DecodeChangeInfo(mapMsgData.Change))
HttpNetHandler.ProcChangeInfo(UTILS.DecodeChangeInfo(mapMsgData.Change))
PlayerData.Base:RefreshSendGiftCount(mapMsgData.SendGiftCnt)
PlayerData.Char:ChangeCharAffinityValue(mapMsgData.Info)
end
local char_recruitment_succeed_ack = function(mapMsgData)
ProcChangeInfo(UTILS.DecodeChangeInfo(mapMsgData))
HttpNetHandler.ProcChangeInfo(UTILS.DecodeChangeInfo(mapMsgData))
end
local agent_reward_receive_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local agent_new_notify = function(mapMsgData)
PlayerData.Dispatch.RefreshWeeklyDispatchs(mapMsgData.Ids)
@@ -752,94 +735,94 @@ local agent_apply_failed_ack = function(mapMsgData)
end
local char_dating_landmark_select_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
PlayerData.Char:ChangeCharAffinityValue(mapMsgData.Info)
end
local char_dating_event_reward_receive_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local char_dating_gift_send_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
PlayerData.Char:ChangeCharAffinityValue(mapMsgData.Info)
end
local char_archive_reward_receive_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local activity_mining_daily_reward_notify = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
EventManager.Hit("Mining_Daily_Reward", mapMsgData)
end
local activity_mining_supplement_reward_notify = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
EventManager.Hit("Mining_Supplement_Reward", mapMsgData)
end
local activity_mining_quest_reward_receive_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.ChangeInfo)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local activity_mining_story_reward_receive_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local activity_mining_dig_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.ChangeInfo)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
EventManager.Hit("Mining_UpdateRigResult", mapMsgData)
end
local activity_mining_energy_convert_notify = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local score_boss_star_reward_receive_succeed_ack = function(mapMsgData)
ProcChangeInfo(UTILS.DecodeChangeInfo(mapMsgData))
HttpNetHandler.ProcChangeInfo(UTILS.DecodeChangeInfo(mapMsgData))
end
local redeem_code_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local notice_change_notify = function(mapMsgData)
EventManager.Hit("NoticeChangeNotify", mapMsgData)
end
local joint_drill_apply_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local joint_drill_sweep_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local joint_drill_settle_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local joint_drill_game_over_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData.Change)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local joint_drill_quest_reward_receive_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local activity_joint_drill_refresh_ticket_notify = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local activity_tower_defense_story_reward_receive_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local activity_tower_defense_quest_reward_receive_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local activity_tower_defense_level_settle_succeed_ack = function(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
ProcChangeInfo(mapDecodedChangeInfo)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
local force_update_notify = function(mapMsgData)
local clientVer = NovaAPI.GetResVersion()
@@ -904,6 +887,8 @@ local BindProcessFunction = function()
[NetMsgId.Id.char_advance_reward_receive_succeed_ack] = char_advance_reward_receive_succeed_ack,
[NetMsgId.Id.char_skin_set_succeed_ack] = NOTHING_NEED_TO_BE_DONE,
[NetMsgId.Id.char_skin_set_failed_ack] = NOTHING_NEED_TO_BE_DONE,
[NetMsgId.Id.char_favorite_set_succeed_ack] = NOTHING_NEED_TO_BE_DONE,
[NetMsgId.Id.char_favorite_set_failed_ack] = NOTHING_NEED_TO_BE_DONE,
[NetMsgId.Id.gacha_spin_succeed_ack] = gacha_spin_succeed_ack,
[NetMsgId.Id.gacha_spin_failed_ack] = HttpNetHandlerPlus.gacha_spin_failed_ack,
[NetMsgId.Id.gacha_spin_sync_ack] = HttpNetHandlerPlus.gacha_spin_sync_ack,
@@ -934,6 +919,7 @@ local BindProcessFunction = function()
[NetMsgId.Id.char_gem_use_preset_succeed_ack] = HttpNetHandlerPlus.char_gem_use_preset_succeed_ack,
[NetMsgId.Id.char_gem_rename_preset_succeed_ack] = HttpNetHandlerPlus.char_gem_rename_preset_succeed_ack,
[NetMsgId.Id.char_gem_equip_gem_succeed_ack] = HttpNetHandlerPlus.char_gem_equip_gem_succeed_ack,
[NetMsgId.Id.char_gem_overlock_succeed_ack] = HttpNetHandlerPlus.char_gem_overlock_succeed_ack,
[NetMsgId.Id.char_gems_import_notify] = HttpNetHandlerPlus.char_gems_import_notify,
[NetMsgId.Id.char_gems_export_notify] = HttpNetHandlerPlus.char_gems_export_notify,
[NetMsgId.Id.star_tower_build_brief_list_get_succeed_ack] = NOTHING_NEED_TO_BE_DONE,
@@ -1283,14 +1269,17 @@ local BindProcessFunction = function()
[NetMsgId.Id.activity_penguin_card_level_settle_succeed_ack] = HttpNetHandlerPlus.activity_penguin_card_level_settle_succeed_ack,
[NetMsgId.Id.activity_penguin_card_level_settle_failed_ack] = NOTHING_NEED_TO_BE_DONE,
[NetMsgId.Id.activity_penguin_card_quest_reward_receive_succeed_ack] = HttpNetHandlerPlus.activity_penguin_card_quest_reward_receive_succeed_ack,
[NetMsgId.Id.activity_penguin_card_quest_reward_receive_failed_ack] = NOTHING_NEED_TO_BE_DONE
[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
}
end
function HttpNetHandler.Init()
local pbSchema = NovaAPI.LoadLuaBytes("GameCore/Network/proto.pb")
assert(PB.load(pbSchema))
BindProcessFunction()
NetMsgIdMap = MakeNetMsgIdMap()
MakeNetMsgIdMap()
EventManager.Add("CS2LuaEvent_OnApplicationFocus", HttpNetHandler, HttpNetHandler.OnCS2LuaEvent_AppFocus)
end
function HttpNetHandler.SendMsg(nNetMsgId, mapMessageData, sUrl, callback)
@@ -17,6 +17,10 @@ function HttpNetHandlerPlus.char_gem_rename_preset_succeed_ack(mapMsgData)
end
function HttpNetHandlerPlus.char_gem_equip_gem_succeed_ack(mapMsgData)
end
function HttpNetHandlerPlus.char_gem_overlock_succeed_ack(mapMsgData)
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
end
function HttpNetHandlerPlus.char_gems_import_notify(mapMsgData)
PlayerData.Equipment:CacheEquipmentDataForChar(mapMsgData)
end
@@ -260,4 +264,12 @@ function HttpNetHandlerPlus.activity_penguin_card_quest_reward_receive_succeed_a
local mapDecodedChangeInfo = UTILS.DecodeChangeInfo(mapMsgData)
HttpNetHandler.ProcChangeInfo(mapDecodedChangeInfo)
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
return HttpNetHandlerPlus
+62
View File
@@ -1,5 +1,6 @@
local NetMsgId = {}
NetMsgId.Id = {
clear_all_activity_golden_spy_levels_notify = -10051,
clear_all_activity_breakout_levels_notify = -10050,
clear_story_set_notify = -10049,
unlock_activity_story_notify = -10048,
@@ -185,6 +186,9 @@ NetMsgId.Id = {
milkout_settle_req = 1401,
milkout_settle_succeed_ack = 1402,
milkout_settle_failed_ack = 1403,
activity_gds_settle_req = 1501,
activity_gds_settle_succeed_ack = 1502,
activity_gds_settle_failed_ack = 1503,
player_formation_req = 2001,
player_formation_succeed_ack = 2002,
player_formation_failed_ack = 2003,
@@ -251,6 +255,15 @@ NetMsgId.Id = {
char_gem_equip_gem_req = 2519,
char_gem_equip_gem_succeed_ack = 2520,
char_gem_equip_gem_failed_ack = 2521,
char_gem_overlock_revert_req = 2522,
char_gem_overlock_revert_succeed_ack = 2523,
char_gem_overlock_revert_failed_ack = 2524,
char_gem_overlock_req = 2525,
char_gem_overlock_succeed_ack = 2526,
char_gem_overlock_failed_ack = 2527,
char_favorite_set_req = 2601,
char_favorite_set_succeed_ack = 2602,
char_favorite_set_failed_ack = 2603,
disc_strengthen_req = 3119,
disc_strengthen_succeed_ack = 3120,
disc_strengthen_failed_ack = 3121,
@@ -365,6 +378,24 @@ NetMsgId.Id = {
star_tower_build_preference_set_req = 4719,
star_tower_build_preference_set_succeed_ack = 4720,
star_tower_build_preference_set_failed_ack = 4721,
potential_preselection_list_req = 4722,
potential_preselection_list_succeed_ack = 4723,
potential_preselection_list_failed_ack = 4724,
potential_preselection_import_req = 4725,
potential_preselection_import_succeed_ack = 4726,
potential_preselection_import_failed_ack = 4727,
potential_preselection_name_set_req = 4728,
potential_preselection_name_set_succeed_ack = 4729,
potential_preselection_name_set_failed_ack = 4730,
potential_preselection_preference_set_req = 4731,
potential_preselection_preference_set_succeed_ack = 4732,
potential_preselection_preference_set_failed_ack = 4733,
potential_preselection_update_req = 4734,
potential_preselection_update_succeed_ack = 4735,
potential_preselection_update_failed_ack = 4736,
potential_preselection_delete_req = 4737,
potential_preselection_delete_succeed_ack = 4738,
potential_preselection_delete_failed_ack = 4739,
build_convert_detail_list_get_req = 4801,
build_convert_detail_list_get_succeed_ack = 4802,
build_convert_detail_list_get_failed_ack = 4803,
@@ -880,6 +911,7 @@ NetMsgId.Id = {
activity_cookie_quest_reward_receive_failed_ack = 11206
}
NetMsgId.MsgName = {
[-10051] = "proto.ActivityGDS",
[-10050] = "proto.Milkout",
[-10049] = "proto.StorySetInfoResp",
[-10048] = "proto.ActivityStoryChapter",
@@ -1065,6 +1097,9 @@ NetMsgId.MsgName = {
[1401] = "proto.MilkoutSettleReq",
[1402] = "proto.ChangeInfo",
[1403] = "proto.Error",
[1501] = "proto.ActivityGDSSettleReq",
[1502] = "proto.ChangeInfo",
[1503] = "proto.Error",
[2001] = "proto.PlayerFormationReq",
[2002] = "proto.Nil",
[2003] = "proto.Error",
@@ -1131,6 +1166,15 @@ NetMsgId.MsgName = {
[2519] = "proto.CharGemEquipGemReq",
[2520] = "proto.Nil",
[2521] = "proto.Error",
[2522] = "proto.CharGemOverlockRevertReq",
[2523] = "proto.ChangeInfo",
[2524] = "proto.Error",
[2525] = "proto.CharGemOverlockReq",
[2526] = "proto.ChangeInfo",
[2527] = "proto.Error",
[2601] = "proto.UI32",
[2602] = "proto.Nil",
[2603] = "proto.Error",
[3119] = "proto.DiscStrengthenReq",
[3120] = "proto.DiscStrengthenResp",
[3121] = "proto.Error",
@@ -1245,6 +1289,24 @@ NetMsgId.MsgName = {
[4719] = "proto.StarTowerBuildPreferenceSetReq",
[4720] = "proto.Nil",
[4721] = "proto.Error",
[4722] = "proto.Nil",
[4723] = "proto.PotentialPreselectionList",
[4724] = "proto.Error",
[4725] = "proto.PotentialPreselectionImportReq",
[4726] = "proto.PotentialPreselection",
[4727] = "proto.Error",
[4728] = "proto.PotentialPreselectionNameSetReq",
[4729] = "proto.Nil",
[4730] = "proto.Error",
[4731] = "proto.PotentialPreselectionPreferenceSetReq",
[4732] = "proto.Nil",
[4733] = "proto.Error",
[4734] = "proto.PotentialPreselectionUpdateReq",
[4735] = "proto.PotentialPreselection",
[4736] = "proto.Error",
[4737] = "proto.PotentialPreselectionDeleteReq",
[4738] = "proto.Nil",
[4739] = "proto.Error",
[4801] = "proto.Nil",
[4802] = "proto.BuildConvertDetailListGetResp",
[4803] = "proto.Error",
+11 -1
View File
@@ -97,6 +97,8 @@ local RedDotDefine = {
Activity_PenguinCard_QuestGroup = "Activity.PenguinCard.Quest.<param>",
Activity_PenguinCard_Quest = "Activity.PenguinCard.Quest.<param>.<param>",
Activity_PenguinCard_Level = "Activity.PenguinCard.Level.<param>",
Activity_Group_PenguinCard_Level = "Activity_Group_New.<param>.PenguinCard",
Activity_Group_TrekkerVersus = "Activity.Group.<param>.TrekkerVersus",
ActivityLevel = "Activity_Group_New.<param>.ActivityLevel",
ActivityLevel_Explore = "Activity_Group_New.<param>.ActivityLevel.Explore",
ActivityLevel_Explore_Level = "Activity_Group_New.<param>.ActivityLevel.Explore.<param>",
@@ -175,6 +177,14 @@ local RedDotDefine = {
VampireTalent = "VampireTalent",
JointDrillQuest = "JointDrillQuest",
TrekkerVersusQuest = "TrekkerVersusQuest",
TrekkerVersusQuest_1 = "TrekkerVersusQuest_1"
TrekkerVersus = "Activity.Group.<param>.TrekkerVersus.<param>",
TrekkerVersusQuest_1 = "Activity.Group.<param>.TrekkerVersus.<param>.Quest",
TrekkerVersusIdleReward = "Activity.Group.<param>.TrekkerVersus.<param>.IdleReward",
TrekkerVersusHeatQuest = "Activity.Group.<param>.TrekkerVersus.<param>.Quest.HeatQuest",
TrekkerVersusDuelQuest = "Activity.Group.<param>.TrekkerVersus.<param>.Quest.DuelQuest",
TrekkerVersusGiftQuest = "Activity.Group.<param>.TrekkerVersus.<param>.Quest.GiftQuest",
TrekkerVersusBattleQuest = "Activity.Group.<param>.TrekkerVersus.<param>.Quest.BattleQuest",
Activity_GoldenSpy = "Activity_Group_New.<param>.GoldenSpy",
Activity_GoldenSpy_Group = "Activity_Group_New.<param>.GoldenSpy.Group.<param>"
}
return RedDotDefine
+5 -5
View File
@@ -68,7 +68,7 @@ function RedDotManager.OnEvent_UnRegisterRedDot(_, sKey, paramJson, objGo)
param = tbParam
elseif tbParam.sParam == "empty" then
param = nil
elseif tbParam.sParam ~= nil then
else
param = tbParam.sParam
end
local bCheck, sNodeKey = RedDotManager.GetNodeKey(sKey, param)
@@ -217,16 +217,16 @@ function RedDotManager.PrintRedDot(sKey, param, bLeaf)
if bLeaf then
v:GetParentKey(tbKey)
end
local sKey = ""
local sCurKey = ""
for i = #tbKey, 1, -1 do
if i == #tbKey then
sKey = tbKey[i]
sCurKey = tbKey[i]
else
sKey = sKey .. "->" .. tbKey[i]
sCurKey = sCurKey .. "->" .. tbKey[i]
end
end
local bindObjCount = v:GetBindObjCount()
printError(string.format("[RedDot] key = %s, redDotCount = %s, bindObjCount = %s", sKey, v.nRedDotCount, bindObjCount))
printError(string.format("[RedDot] key = %s, redDotCount = %s, bindObjCount = %s", sCurKey, v.nRedDotCount, bindObjCount))
end
end
end
+1 -1
View File
@@ -183,7 +183,7 @@ function Timer:GetRemainInterval()
return 0
end
end
function Timer:GetRenmainTime()
function Timer:GetRemainTime()
local nTotalTime = self._nTargetCount * self._nInterval
local nPassedTime = self._nInterval * self._nCurCount + self._nElapsed
if self._status == TimerStatus.Running then
+1 -1
View File
@@ -52,7 +52,7 @@ local ProcUpdateTimer = function()
elseif timer._nScaleType == TimerScaleType.RealTime then
timer:_Run(Time.realtimeSinceStartup, Time.unscaledDeltaTime)
else
timer._Stop()
timer:_Stop()
end
end
end
+4 -5
View File
@@ -608,11 +608,9 @@ function BaseCtrl:SetPngSprite(imgObj, sPath, sSurfix)
return false
else
local sFullPath = sRootPath .. sPath .. ".png"
local bSuc = NovaAPI.SetImageSprite(imgObj, sFullPath)
if not bSuc then
traceback(string.format("icon设置失败:%spanel id%sctrl name%s", sFullPath, tostring(self._panel._nPanelId), tostring(self.__cname)))
end
return bSuc
local _sprite = GameResourceLoader.LoadAsset(ResType.Any, sFullPath, typeof(Sprite), "UI", self._panel._nPanelId)
NovaAPI.SetImageSpriteAsset(imgObj, _sprite)
return true
end
end
function BaseCtrl:SetSprite_FrameColor(imgObj, nRarity, sFrameType, bBigSprites)
@@ -803,6 +801,7 @@ function BaseCtrl:DespawnPrefabInstance(objCtrl, sPoolName)
objCtrl:_Exit()
objCtrl:_Destroy()
AdventureModuleHelper.DespawnPrefabInstance(objCtrl.gameObject, sPoolName)
objCtrl.gameObject = nil
end
end
function BaseCtrl:BindCtrlByNode(goNode, sCtrlName)
+20 -5
View File
@@ -1,5 +1,4 @@
local PanelDefine = {
[PanelId.GMPresetTempPanel] = "Game.Editor.BattlePresetTeamTest.BattlePresetTeamTempPanel",
[PanelId.ExeEditor] = "Game.Actor2D.Editor_BBV.ExeEditorPanel",
[PanelId.BBVEditor] = "Game.Actor2D.Editor_BBV.BBVEditorPanel",
[PanelId.Actor2DEditor] = "Game.Actor2D.Editor.Actor2DEditorPanel",
@@ -105,7 +104,7 @@ local PanelDefine = {
[PanelId.FRQuestComplete] = "Game.UI.FixedRoguelikeEx.FixedRoguelikeQuestCompletePanel",
[PanelId.PopupSkillPanel] = "Game.UI.CommonTipsEx.PopupSkillPanel",
[PanelId.TravelerDuelLevelQuestPanel] = "Game.UI.TravelerDuelLevelSelect.TravelerDuelQuest.TravelerDuelQuestPanel",
[PanelId.TDBattleResultPanel] = "Game.UI.TrekkerVersus.TDBattleResultPanel",
[PanelId.TDBattleResultPanel] = "Game.UI.TrekkerVersus_600002.TDBattleResultPanel",
[PanelId.TDLevelUpgrade] = "Game.UI.TravelerDuelLevelSelect.TDClassUpgradePanel",
[PanelId.CharacterRelation] = "Game.UI.CharacterInfoEx.CharacterPlotPanel",
[PanelId.ExChangePanel] = "Game.UI.ExChange.ExChangePanel",
@@ -138,10 +137,10 @@ local PanelDefine = {
[PanelId.PhonePopUp] = "Game.UI.Phone.PhonePopUpPanel",
[PanelId.DatingLandmark] = "Game.UI.Phone.Dating.DatingLandmarkPanel",
[PanelId.Dating] = "Game.UI.Phone.Dating.DatingPanel",
[PanelId.DatingTest] = "Game.Editor.Phone.DatingTestPanel",
[PanelId.Equipment] = "Game.UI.Equipment.EquipmentPanel",
[PanelId.EquipmentInfo] = "Game.UI.Equipment.EquipmentInfoPanel",
[PanelId.EquipmentInstanceResult] = "Game.UI.BattleResult.EquipmentInstanceResultPanel",
[PanelId.EquipmentUpgrade] = "Game.UI.Equipment.EquipmentUpgradePanel",
[PanelId.EquipmentRename] = "Game.UI.Equipment.EquipmentRenamePanel",
[PanelId.EquipmentAttrPreview] = "Game.UI.Equipment.EquipmentAttrPreviewPanel",
[PanelId.EquipmentRoll] = "Game.UI.Equipment.EquipmentRollPanel",
@@ -267,7 +266,7 @@ local PanelDefine = {
[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.TrekkerVersusPanel",
[PanelId.TrekkerVersus] = "Game.UI.TrekkerVersus_600002.TrekkerVersusPanel",
[PanelId.ActivityLevelsSelectPanel_20101] = "Game.UI.ActivityTheme.20101.ActivityLevels.ActivityLevelsSelectPanel",
[PanelId.ChristmasThemePanel] = "Game.UI.ActivityTheme.20101.ChristmasThemePanel",
[PanelId.BreakOutLevelDetailPanel] = "Game.UI.Play_BreakOut_30101.BreakOutLevelDetailPanel",
@@ -312,7 +311,23 @@ local PanelDefine = {
[PanelId.ActivityLevelsSelectPanel_10106] = "Game.UI.ActivityTheme.10106.ActivityLevels.ActivityLevelsSelectPanel",
[PanelId.Task_10106] = "Game.UI.ActivityTheme.10106.Task.PostalTaskPanel",
[PanelId.PostalThemePanel] = "Game.UI.ActivityTheme.10106.PostalThemePanel",
[PanelId.PostalStory] = "Game.UI.ActivityTheme.10106.Story.PostalStoryPanel"
[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.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.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",
[PanelId.SolodanceThemePanel] = "Game.UI.ActivityTheme.20102.SoloDanceThemePanel",
[PanelId.SolodanceStory] = "Game.UI.MainlineEx_SolodanceStory.MainlineEx_SolodanceStoryPanel",
[PanelId.ActivityLevelsSelectPanel_10107] = "Game.UI.ActivityTheme.10107.ActivityLevels.ActivityLevelsSelectPanel"
}
if NovaAPI.GetClientChannel() == AllEnum.ChannelName.BanShu then
end
+20 -4
View File
@@ -1,6 +1,5 @@
local SpringFestivalThemeCtrl = require("Game.UI.ActivityTheme.10104.SpringFestivalThemeCtrl")
local PanelId = {
GMPresetTempPanel = -5,
AvgEditorMultiLanTool = -6,
ExeEditor = -4,
BBVEditor = -3,
Actor2DEditor = -2,
@@ -130,6 +129,7 @@ local PanelId = {
Equipment = 271,
EquipmentInfo = 272,
EquipmentInstanceLevelSelect = 273,
EquipmentUpgrade = 274,
EquipmentTips = 275,
EquipmentInstanceResult = 276,
StarTowerQuest = 277,
@@ -270,7 +270,6 @@ local PanelId = {
MiningGameGuidePanel_400002 = 353,
BdConvertActPanel = 354,
TowerDefenseGiveupPanel = 355,
DatingTest = 356,
BdConvertBuildDetail = 357,
Shop_30101 = 358,
ShopPopup_30101 = 359,
@@ -328,6 +327,23 @@ local PanelId = {
Shop_10106 = 411,
Task_10106 = 412,
PostalThemePanel = 413,
PostalStory = 414
PostalStory = 414,
RankBuildDetail = 415,
GoldenSpyPanel = 416,
GoldenSpyLevelSelectPanel = 417,
GoldenSpyBuffSelectPanel = 418,
PotentialPreselectionList = 419,
PotentialPreselectionEdit = 420,
ImportPreselection = 421,
PreselectionRename = 422,
GoldenSpyResultPanel = 423,
GoldenSpyBuffTipsPanel = 424,
ActivityLevelsSelectPanel_20102 = 425,
Task_20102 = 426,
Shop_20102 = 427,
SolodanceThemePanel = 430,
SolodanceStory = 431,
ActivityLevelsSelectPanel_10107 = 432,
GmTools = 99999
}
return PanelId
+2 -2
View File
@@ -445,11 +445,11 @@ local ResetTouchEffect = function()
local sPathFormat = Settings.AB_ROOT_PATH .. "UI/CommonEx/TouchEffect/%s.prefab"
local sValue_Main = ConfigTable.GetConfigValue("TouchEffect_Main")
if type(sValue_Main) == "string" and sValue_Main ~= "" then
objMain = GameResourceLoader.LoadAsset(ResType.Any, string.format(sPathFormat, sValue_Main), typeof(GameObject), "UI")
objMain = GameResourceLoader.LoadAsset(ResType.Any, string.format(sPathFormat, sValue_Main), typeof(GameObject))
end
local sValue_Slide = ConfigTable.GetConfigValue("TouchEffect_Slide")
if type(sValue_Slide) == "string" and sValue_Main ~= "" then
objSlide = GameResourceLoader.LoadAsset(ResType.Any, string.format(sPathFormat, sValue_Slide), typeof(GameObject), "UI")
objSlide = GameResourceLoader.LoadAsset(ResType.Any, string.format(sPathFormat, sValue_Slide), typeof(GameObject))
end
if objMain ~= nil or objSlide ~= nil then
local trNode = mapUIRootTransform[AllEnum.SortingLayerName.Overlay]