This commit is contained in:
xiekaidong 2023-05-08 09:47:58 +08:00
parent 2c341db47c
commit 55ec0dd76c
16 changed files with 73 additions and 72 deletions

View File

@ -96,12 +96,12 @@ function DataManager:initWithServerData(data)
Logger.printTable(data) Logger.printTable(data)
end end
self.todayFirstLogin = data.today_first_login self.todayFirstLogin = data.today_first_login
self.PlayerData:init(data.PlayerData) -- self.PlayerData:init(data.PlayerData)
self.ChapterData:init(data.chapter) self.ChapterData:init(data.chapter)
self.HeroData:init(data.HeroData) self.HeroData:init(data.bag.heros)
self.BagData:init(data.BagData) self.BagData:init(data.bag)
self.FormationData:init(data.FormationData) self.FormationData:init(data.fight_info)
self.TutorialData:init(data.TutorialData) self.TutorialData:init(data.guide)
self.ActivityData:init() self.ActivityData:init()
self.GodPigData:init() self.GodPigData:init()
-- self.IdleData:clear(data.IdleData) -- self.IdleData:clear(data.IdleData)

View File

@ -83,7 +83,6 @@ function Game:initOther()
BF.exports.SafeAreaManager = require "app/common/safe_area_manager" BF.exports.SafeAreaManager = require "app/common/safe_area_manager"
BF.exports.BaseModule = require "app/module/base_module" BF.exports.BaseModule = require "app/module/base_module"
BF.exports.ModuleManager = require "app/common/module_manager" BF.exports.ModuleManager = require "app/common/module_manager"
BF.exports.ServerBaseData = require "app/server/data/server_base_data"
BF.exports.DataManager = require "app/common/data_manager" BF.exports.DataManager = require "app/common/data_manager"
BF.exports.DOTweenManager = require "app/common/dotween_manager" BF.exports.DOTweenManager = require "app/common/dotween_manager"
BF.exports.FSMManager = require "app/common/state_machine_manager" BF.exports.FSMManager = require "app/common/state_machine_manager"
@ -151,7 +150,6 @@ function Game:specialForIdea()
SafeAreaManager = SafeAreaManager or require "app/common/safe_area_manager" SafeAreaManager = SafeAreaManager or require "app/common/safe_area_manager"
BaseModule = BaseModule or require "app/module/base_module" BaseModule = BaseModule or require "app/module/base_module"
ModuleManager = ModuleManager or require "app/common/module_manager" ModuleManager = ModuleManager or require "app/common/module_manager"
ServerBaseData = ServerBaseData or require "app/server/data/server_base_data"
DataManager = DataManager or require "app/common/data_manager" DataManager = DataManager or require "app/common/data_manager"
DOTweenManager = DOTweenManager or require "app/common/dotween_manager" DOTweenManager = DOTweenManager or require "app/common/dotween_manager"
FSMManager = FSMManager or require "app/common/state_machine_manager" FSMManager = FSMManager or require "app/common/state_machine_manager"

View File

@ -6,16 +6,16 @@ function FormationManager:upHeroToStageFormation(heroId, matchType)
return return
end end
local args = { local args = {
formationType = GConst.BattleConst.BATTLE_TYPE.STAGE, -- formationType = GConst.BattleConst.BATTLE_TYPE.STAGE,
matchType = matchType, -- matchType = matchType,
heroId = heroId id = heroId
} }
-- self:sendMessage(ProtoMsgType.FromMsgEnum., args, {}, self.upHeroToStageFormationFinish) self:sendMessage(ProtoMsgType.FromMsgEnum.HeroPutOnReq, args, {}, self.upHeroToStageFormationFinish)
end end
function FormationManager:upHeroToStageFormationFinish(result) function FormationManager:upHeroToStageFormationFinish(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.FormationData:upHeroToFormation(GConst.BattleConst.BATTLE_TYPE.STAGE, matchType, heroId) DataManager.FormationData:init(result)
DataManager.HeroData:setDirty() DataManager.HeroData:setDirty()
end end
end end

View File

@ -14,12 +14,12 @@ function HeroManager:upgradeHero(heroId, heroEntity)
return return
end end
-- self:sendMessage(ProtoMsgType.FromMsgEnum., args, {}, self.upgradeHeroFinish, BIReport.ITEM_GET_TYPE.UPGRADE_HERO) self:sendMessage(ProtoMsgType.FromMsgEnum.HeroUpgradeReq, {id = heroId}, {}, self.upgradeHeroFinish, BIReport.ITEM_GET_TYPE.UPGRADE_HERO)
end end
function HeroManager:upgradeHeroFinish(result) function HeroManager:upgradeHeroFinish(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.HeroData:setHeroLv(result.heroId, result.lv) DataManager.HeroData:setHeroLv(result.hero.id, result.hero.level)
DataManager.HeroData:setDirty() DataManager.HeroData:setDirty()
end end
end end

View File

@ -23,15 +23,13 @@ function TutorialManager:sendTutorialId(id, callback)
self.sendTutorialIdCallback = callback self.sendTutorialIdCallback = callback
-- self:sendMessage(ProtoMsgType.FromMsgEnum., args, {}, self.sendTutorialIdFinish) self:sendMessage(ProtoMsgType.FromMsgEnum.GuideFundMarkReq, args, {}, self.sendTutorialIdFinish)
end end
function TutorialManager:sendTutorialIdFinish(result) function TutorialManager:sendTutorialIdFinish(result)
Logger.printTable(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then if result.err_code == GConst.ERROR_STR.SUCCESS then
if result.id then if result.reqData.id then
-- BIReport:postTutorialStep(result.id) BIReport:postTutorialStep(result.reqData.id)
-- DataManager.TutorialData:markFuncTutorialFinish(result.id)
end end
if self.sendTutorialIdCallback then if self.sendTutorialIdCallback then

View File

@ -992,7 +992,7 @@ function NetManager:getNotCheckResponse(msgName)
-- then -- then
-- return true -- return true
-- end -- end
return false return true
end end
function NetManager:getNotAddCostsRsp(msgName) function NetManager:getNotAddCostsRsp(msgName)

View File

@ -2,8 +2,8 @@ local ProtoMsgType = {
FromMsgId = { FromMsgId = {
[132242856] = "ChapterSettlementReq", [132242856] = "ChapterSettlementReq",
[132244689] = "ChapterSettlementRsp", [132244689] = "ChapterSettlementRsp",
[361733825] = "SkipGuideReq", [516281556] = "GuideFundMarkReq",
[361735658] = "SkipGuideRsp", [516283389] = "GuideFundMarkRsp",
[565555292] = "MallPayNtf", [565555292] = "MallPayNtf",
[565621982] = "MallPayReq", [565621982] = "MallPayReq",
[565623815] = "MallPayRsp", [565623815] = "MallPayRsp",
@ -18,8 +18,6 @@ local ProtoMsgType = {
[1115038364] = "BattlePassBoughtNtf", [1115038364] = "BattlePassBoughtNtf",
[1122994860] = "AdFreeDailyGiftReq", [1122994860] = "AdFreeDailyGiftReq",
[1122996693] = "AdFreeDailyGiftRsp", [1122996693] = "AdFreeDailyGiftRsp",
[1304663451] = "MarkGuideReq",
[1304665284] = "MarkGuideRsp",
[1471116409] = "BindReq", [1471116409] = "BindReq",
[1471118242] = "BindRsp", [1471118242] = "BindRsp",
[1473507638] = "TaskTutorRewardReq", [1473507638] = "TaskTutorRewardReq",
@ -52,6 +50,8 @@ local ProtoMsgType = {
[3190730044] = "KickOutNtf", [3190730044] = "KickOutNtf",
[3224230499] = "SevenDayTaskRewardReq", [3224230499] = "SevenDayTaskRewardReq",
[3224232332] = "SevenDayTaskRewardRsp", [3224232332] = "SevenDayTaskRewardRsp",
[3309820798] = "HeroPutOnReq",
[3309822631] = "HeroPutOnRsp",
[3370485095] = "MonCardRewardReq", [3370485095] = "MonCardRewardReq",
[3370486928] = "MonCardRewardRsp", [3370486928] = "MonCardRewardRsp",
[3421843875] = "TaskDailyRewardReq", [3421843875] = "TaskDailyRewardReq",
@ -66,14 +66,16 @@ local ProtoMsgType = {
[3846223098] = "MallActTriggerGiftNtf", [3846223098] = "MallActTriggerGiftNtf",
[3904148760] = "GMReq", [3904148760] = "GMReq",
[3904150593] = "GMRsp", [3904150593] = "GMRsp",
[3933875617] = "ChapterStartReq",
[3933877450] = "ChapterStartRsp",
[4256333947] = "ExistReq", [4256333947] = "ExistReq",
[4256335780] = "ExistRsp", [4256335780] = "ExistRsp",
}, },
FromMsgToId = { FromMsgToId = {
ChapterSettlementReq = 132242856, ChapterSettlementReq = 132242856,
ChapterSettlementRsp = 132244689, ChapterSettlementRsp = 132244689,
SkipGuideReq = 361733825, GuideFundMarkReq = 516281556,
SkipGuideRsp = 361735658, GuideFundMarkRsp = 516283389,
MallPayNtf = 565555292, MallPayNtf = 565555292,
MallPayReq = 565621982, MallPayReq = 565621982,
MallPayRsp = 565623815, MallPayRsp = 565623815,
@ -88,8 +90,6 @@ local ProtoMsgType = {
BattlePassBoughtNtf = 1115038364, BattlePassBoughtNtf = 1115038364,
AdFreeDailyGiftReq = 1122994860, AdFreeDailyGiftReq = 1122994860,
AdFreeDailyGiftRsp = 1122996693, AdFreeDailyGiftRsp = 1122996693,
MarkGuideReq = 1304663451,
MarkGuideRsp = 1304665284,
BindReq = 1471116409, BindReq = 1471116409,
BindRsp = 1471118242, BindRsp = 1471118242,
TaskTutorRewardReq = 1473507638, TaskTutorRewardReq = 1473507638,
@ -122,6 +122,8 @@ local ProtoMsgType = {
KickOutNtf = 3190730044, KickOutNtf = 3190730044,
SevenDayTaskRewardReq = 3224230499, SevenDayTaskRewardReq = 3224230499,
SevenDayTaskRewardRsp = 3224232332, SevenDayTaskRewardRsp = 3224232332,
HeroPutOnReq = 3309820798,
HeroPutOnRsp = 3309822631,
MonCardRewardReq = 3370485095, MonCardRewardReq = 3370485095,
MonCardRewardRsp = 3370486928, MonCardRewardRsp = 3370486928,
TaskDailyRewardReq = 3421843875, TaskDailyRewardReq = 3421843875,
@ -136,14 +138,16 @@ local ProtoMsgType = {
MallActTriggerGiftNtf = 3846223098, MallActTriggerGiftNtf = 3846223098,
GMReq = 3904148760, GMReq = 3904148760,
GMRsp = 3904150593, GMRsp = 3904150593,
ChapterStartReq = 3933875617,
ChapterStartRsp = 3933877450,
ExistReq = 4256333947, ExistReq = 4256333947,
ExistRsp = 4256335780, ExistRsp = 4256335780,
}, },
FromMsgEnum = { FromMsgEnum = {
ChapterSettlementReq = "ChapterSettlementReq", ChapterSettlementReq = "ChapterSettlementReq",
ChapterSettlementRsp = "ChapterSettlementRsp", ChapterSettlementRsp = "ChapterSettlementRsp",
SkipGuideReq = "SkipGuideReq", GuideFundMarkReq = "GuideFundMarkReq",
SkipGuideRsp = "SkipGuideRsp", GuideFundMarkRsp = "GuideFundMarkRsp",
MallPayNtf = "MallPayNtf", MallPayNtf = "MallPayNtf",
MallPayReq = "MallPayReq", MallPayReq = "MallPayReq",
MallPayRsp = "MallPayRsp", MallPayRsp = "MallPayRsp",
@ -158,8 +162,6 @@ local ProtoMsgType = {
BattlePassBoughtNtf = "BattlePassBoughtNtf", BattlePassBoughtNtf = "BattlePassBoughtNtf",
AdFreeDailyGiftReq = "AdFreeDailyGiftReq", AdFreeDailyGiftReq = "AdFreeDailyGiftReq",
AdFreeDailyGiftRsp = "AdFreeDailyGiftRsp", AdFreeDailyGiftRsp = "AdFreeDailyGiftRsp",
MarkGuideReq = "MarkGuideReq",
MarkGuideRsp = "MarkGuideRsp",
BindReq = "BindReq", BindReq = "BindReq",
BindRsp = "BindRsp", BindRsp = "BindRsp",
TaskTutorRewardReq = "TaskTutorRewardReq", TaskTutorRewardReq = "TaskTutorRewardReq",
@ -192,6 +194,8 @@ local ProtoMsgType = {
KickOutNtf = "KickOutNtf", KickOutNtf = "KickOutNtf",
SevenDayTaskRewardReq = "SevenDayTaskRewardReq", SevenDayTaskRewardReq = "SevenDayTaskRewardReq",
SevenDayTaskRewardRsp = "SevenDayTaskRewardRsp", SevenDayTaskRewardRsp = "SevenDayTaskRewardRsp",
HeroPutOnReq = "HeroPutOnReq",
HeroPutOnRsp = "HeroPutOnRsp",
MonCardRewardReq = "MonCardRewardReq", MonCardRewardReq = "MonCardRewardReq",
MonCardRewardRsp = "MonCardRewardRsp", MonCardRewardRsp = "MonCardRewardRsp",
TaskDailyRewardReq = "TaskDailyRewardReq", TaskDailyRewardReq = "TaskDailyRewardReq",
@ -206,6 +210,8 @@ local ProtoMsgType = {
MallActTriggerGiftNtf = "MallActTriggerGiftNtf", MallActTriggerGiftNtf = "MallActTriggerGiftNtf",
GMReq = "GMReq", GMReq = "GMReq",
GMRsp = "GMRsp", GMRsp = "GMRsp",
ChapterStartReq = "ChapterStartReq",
ChapterStartRsp = "ChapterStartRsp",
ExistReq = "ExistReq", ExistReq = "ExistReq",
ExistRsp = "ExistRsp", ExistRsp = "ExistRsp",
}, },

View File

@ -13,15 +13,13 @@ function CheatMessageBox:showCheatMessageBox(params)
uiMap["cheating_ui.title_bg_img.bg1.player_id_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.COPY_ID)) uiMap["cheating_ui.title_bg_img.bg1.player_id_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.COPY_ID))
uiMap["cheating_ui.title_bg_img.bg2.player_id_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.COPY_MAIL)) uiMap["cheating_ui.title_bg_img.bg2.player_id_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.COPY_MAIL))
local ServerGameData = require "app/module/server/server_game_data" local objectId = ""
local objectId = ServerGameData:getServerPlayerId() or ""
uiMap["cheating_ui.title_bg_img.bg1.player_id"]:setText("PlayerID:" .. objectId) uiMap["cheating_ui.title_bg_img.bg1.player_id"]:setText("PlayerID:" .. objectId)
uiMap["cheating_ui.title_bg_img.bg2.player_id"]:setText("LonelySurvivorTech@cobbygame.com") uiMap["cheating_ui.title_bg_img.bg2.player_id"]:setText("LonelySurvivorTech@cobbygame.com")
uiMap["cheating_ui.title_bg_img.bg1.player_id_btn"]:addClickListener(function() uiMap["cheating_ui.title_bg_img.bg1.player_id_btn"]:addClickListener(function()
local ServerGameData = require "app/module/server/server_game_data" -- local objectId = :getServerPlayerId() or ""
local objectId = ServerGameData:getServerPlayerId() or "" -- GFunc.copyStr(objectId)
GFunc.copyStr(objectId)
end) end)
uiMap["cheating_ui.title_bg_img.bg2.player_id_btn"]:addClickListener(function() uiMap["cheating_ui.title_bg_img.bg2.player_id_btn"]:addClickListener(function()
@ -37,8 +35,7 @@ function CheatMessageBox:showCheatMessageBox(params)
platform = "IOS" platform = "IOS"
end end
local ServerGameData = require "app/module/server/server_game_data" local objectId = ""
local objectId = ServerGameData:getServerPlayerId() or ""
local body = "\nPlease don't delete the information below\n===========\nGameName: Lonely Survivor\n" local body = "\nPlease don't delete the information below\n===========\nGameName: Lonely Survivor\n"
body = body .. "GameVersion: " .. Platform:getClientVersion() .. "\n" body = body .. "GameVersion: " .. Platform:getClientVersion() .. "\n"

View File

@ -109,9 +109,7 @@ function GameSettingUI:_addListeners()
end) end)
uiMap["game_setting_ui.bg.player_id_btn"]:addClickListener(function() uiMap["game_setting_ui.bg.player_id_btn"]:addClickListener(function()
local ServerGameData = require "app/module/server/server_game_data" -- GFunc.copyStr(objectId)
local objectId = ServerGameData:getServerPlayerId() or ""
GFunc.copyStr(objectId)
end) end)
uiMap["game_setting_ui.bg.bg.facebook"]:addClickListener(function() uiMap["game_setting_ui.bg.bg.facebook"]:addClickListener(function()

View File

@ -107,8 +107,10 @@ end
function MainCityUI:_bind() function MainCityUI:_bind()
self:bind(DataManager.ChapterData, "isDirty", function() self:bind(DataManager.ChapterData, "isDirty", function()
if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN then if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN then
if self.subComps[self.selectedIndex] then
self.subComps[self.selectedIndex]:refreshChapter(true) self.subComps[self.selectedIndex]:refreshChapter(true)
end end
end
end, true) end, true)
self:bind(DataManager.PlayerData, "dirty", function(binder, value) self:bind(DataManager.PlayerData, "dirty", function(binder, value)
self:refreshRoleInfo() self:refreshRoleInfo()
@ -124,17 +126,23 @@ function MainCityUI:_bind()
self:bind(DataManager.HeroData, "isDirty", function(binder, value) self:bind(DataManager.HeroData, "isDirty", function(binder, value)
if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.HERO then if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.HERO then
if self.subComps[self.selectedIndex] then
self.subComps[self.selectedIndex]:refresh() self.subComps[self.selectedIndex]:refresh()
end
self:refreshBottomRp() self:refreshBottomRp()
elseif self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN then elseif self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN then
if self.subComps[self.selectedIndex] then
self.subComps[self.selectedIndex]:refreshStageFormaion() self.subComps[self.selectedIndex]:refreshStageFormaion()
end end
end
end) end)
self:bind(DataManager.BagData.ItemData, "dirty", function(binder, value) self:bind(DataManager.BagData.ItemData, "dirty", function(binder, value)
if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN and self.subComps[self.selectedIndex] then if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN and self.subComps[self.selectedIndex] then
if self.subComps[self.selectedIndex] then
self.subComps[self.selectedIndex]:refreshStageFormaion() self.subComps[self.selectedIndex]:refreshStageFormaion()
end end
end
end) end)
end end

View File

@ -13,7 +13,7 @@ end
function BagData:init(data) function BagData:init(data)
if data then if data then
self.ItemData:init(data.ItemData) self.ItemData:init(data)
else else
self.ItemData:init() self.ItemData:init()
end end

View File

@ -1,5 +1,4 @@
local ItemEntity = require "app/userdata/bag/item_entity" local ItemEntity = require "app/userdata/bag/item_entity"
local ServerGameData = require "app/server/server_game_data"
local ItemConst = require "app/module/item/item_const" local ItemConst = require "app/module/item/item_const"
local ItemData = class("ItemData", BaseData) local ItemData = class("ItemData", BaseData)
@ -30,10 +29,10 @@ function ItemData:init(data)
parmas.gold = info.count parmas.gold = info.count
CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(parmas) CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(parmas)
end end
if info.cfg_id == GConst.ItemConst.ITEM_ID_VIT then if info.id == GConst.ItemConst.ITEM_ID_VIT then
DataManager.PlayerData:setVit(info.count) DataManager.PlayerData:setVit(info.count)
end end
self:_add(info.cfg_id, info.count) self:_add(info.id, info.count)
end end
end end
self.recoveryList = {} self.recoveryList = {}
@ -41,16 +40,16 @@ function ItemData:init(data)
if data.recoveries then if data.recoveries then
local recoveryCfg = ConfigManager:getConfig("recovery") local recoveryCfg = ConfigManager:getConfig("recovery")
for k, v in ipairs(data.recoveries) do for k, v in ipairs(data.recoveries) do
local recoveryInfo = recoveryCfg[v.cfg_id] local recoveryInfo = recoveryCfg[v.id]
if recoveryInfo then if recoveryInfo then
local obj = { local obj = {
cfg_id = v.cfg_id, cfg_id = v.id,
ts = v.ts, ts = v.ts,
limit = recoveryInfo.limit, limit = recoveryInfo.limit,
recoveryType = recoveryInfo.type, recoveryType = recoveryInfo.type,
time = recoveryInfo.time time = recoveryInfo.time
} }
self.recoveryMap[v.cfg_id] = obj self.recoveryMap[v.id] = obj
table.insert(self.recoveryList, obj) table.insert(self.recoveryList, obj)
end end
end end
@ -279,7 +278,6 @@ function ItemData:updateCd()
self:recoveryItem(v) -- 根据间隔时间增加 self:recoveryItem(v) -- 根据间隔时间增加
end end
end end
ServerGameData.BagData.ItemData:recoveryItems()
end end
return ItemData return ItemData

View File

@ -173,7 +173,7 @@ end
function ChapterData:getChapterMaxWave(chapterId) function ChapterData:getChapterMaxWave(chapterId)
chapterId = chapterId or self:getChapterId() chapterId = chapterId or self:getChapterId()
if chapterId <= self.maxChapterId then if chapterId <= self.data.maxChapterId then
return self:getChapterCfgMaxWave(chapterId) return self:getChapterCfgMaxWave(chapterId)
else else
return self.maxWave return self.maxWave
@ -227,7 +227,7 @@ function ChapterData:getIsHaveRewardsMinId()
if chapterBefore == nil then if chapterBefore == nil then
break break
end end
if chapterBefore == self.maxChapterId then if chapterBefore == self.data.maxChapterId then
chapterBefore = self:getNextChapter(self.data.maxChapterId) chapterBefore = self:getNextChapter(self.data.maxChapterId)
break break
end end
@ -273,7 +273,7 @@ end
function ChapterData:getChapterPassed(chapterId) function ChapterData:getChapterPassed(chapterId)
chapterId = chapterId or self:getChapterId() chapterId = chapterId or self:getChapterId()
if chapterId <= self.maxChapterId then if chapterId <= self.data.maxChapterId then
return true return true
else else
return self.maxWave >= self:getChapterCfgMaxWave(chapterId) return self.maxWave >= self:getChapterCfgMaxWave(chapterId)
@ -304,7 +304,7 @@ function ChapterData:fightChapter(chapterId, maxChapterId, maxWave)
end end
self.data.chapterInfo[chapterId].total_count = (self.data.chapterInfo[chapterId].total_count or 0) + 1 self.data.chapterInfo[chapterId].total_count = (self.data.chapterInfo[chapterId].total_count or 0) + 1
if maxChapterId <= self.maxChapterId then if maxChapterId <= self.data.maxChapterId then
return return
end end

View File

@ -3,14 +3,15 @@ local FormationData = class("FormationData", BaseData)
function FormationData:init(data) function FormationData:init(data)
self.data.dirty = false self.data.dirty = false
self.formations = {} self.formations = {}
if data and data.formations then if data and data.heroes then
for formationType, formation in pairs(data.formations) do -- for formationType, formation in pairs(data.heroes) do
local clientFormation = {} local clientFormation = {}
self.formations[formationType] = clientFormation -- self.formations[formationType] = clientFormation
for matchTypeStr, heroId in pairs(formation) do self.formations[GConst.BattleConst.BATTLE_TYPE.STAGE] = clientFormation -- 暂时写死
clientFormation[tonumber(matchTypeStr)] = heroId for matchType, heroId in pairs(data.heroes) do
end clientFormation[matchType] = heroId
end end
-- end
end end
end end

View File

@ -17,8 +17,8 @@ end
function HeroData:init(data) function HeroData:init(data)
self.heroes = {} self.heroes = {}
if data then if data then
for _, heroInfo in pairs(data.heroes) do for id, heroInfo in pairs(data) do
self:addHero(heroInfo.cfg_id, heroInfo.lv) self:addHero(heroInfo.id, heroInfo.level)
end end
end end

View File

@ -22,14 +22,11 @@ function TutorialData:init(data)
self.inTutorial = false self.inTutorial = false
-- 功能开启引导列表 -- 功能开启引导列表
self.funcTutorialMap = {} self.funcTutorialMap = {}
if data.markedGuide then if data.func then
for k,v in pairs(data.markedGuide) do for id,v in pairs(data.func) do
local id = tonumber(k)
if id then
self.funcTutorialMap[id] = v self.funcTutorialMap[id] = v
end end
end end
end
end end
function TutorialData:getIsHaveTutorial() function TutorialData:getIsHaveTutorial()