miduo_client/Assets/ManagedResources/~Lua/Modules/Net/IndicationManager.lua

1077 lines
45 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

IndicationManager = {}
local this = IndicationManager
function this.Initialize()
Game.GlobalEvent:AddEvent(Protocal.Connect, this.RegisterMessage)
this.canPopUpBagMaxMessage=false
this.getRewardFromMailMessage=false
end
function this.RegisterMessage(network)
if network.type ~= SocketType.LOGIN then
return
end
local socket = network.socket
-- 无尽换期刷新地图信息
socket:RegistNetMessage(MessageTypeProto_pb.ENDLESS_MAP_CHANGE_INDICATION, this.RefreshMapData)
-- 监听服务器跨天状态N
socket:RegistNetMessage(MessageTypeProto_pb.FIVE_PLAYER_REFLUSH_INDICATION, this.RefreshUpdateIndication)
socket:RegistNetMessage(MessageTypeProto_pb.ZeroPlayerUpdateIndication, this.ZeroRefreshUpdateIndication)
--监听红点推送
socket:RegistNetMessage(MessageTypeProto_pb.SEND_RED_POINT_INDICATION, this.ReceiveRedPoint)
--福利红包推送
socket:RegistNetMessage(MessageTypeProto_pb.WELFARE_RED_PACKET_INFO, this.WelfareRedPacketPush)
socket:RegistNetMessage(MessageTypeProto_pb.UPDATE_BAG_INDICATION, this.BackUpDataBagItemIdNumber)
socket:RegistNetMessage(MessageTypeProto_pb.SEND_CHAT_INFO_INDICATION, this.ReceiveFriendChat)
socket:RegistNetMessage(MessageTypeProto_pb.MISSION_UPDATE_INDICATION, this.RefreshMissionList)
-- 监听服务器推送
socket:RegistNetMessage(MessageTypeProto_pb.ADVENTURE_BOSS_FIND_INDICATION, this.ReceiveChatMsg)
-- 监听Boss被杀
socket:RegistNetMessage(MessageTypeProto_pb.ADVENTURE_BOSS_KILL_INDICATION, this.GetBossInfo)
socket:RegistNetMessage(MessageTypeProto_pb.ALL_GIFTGOODS_INDICATION, this.RefreshGiftGoods)
-- 监听服务器好友删除,好友赠送体力推送 --type 1:申请好友 2: 添加好友
socket:RegistNetMessage(MessageTypeProto_pb.SEND_FRIEND_INFO_INDICATION, this.ReceiveFriendApplication)
-- 监听服务器好友申请,好友添加推送 --type 1:删除好友 2: 赠送体力
socket:RegistNetMessage(MessageTypeProto_pb.SEND_FRIEND_STATE_INDICATION, this.ReceiveFriendDeleteState)
-- 监听商店数据推送
socket:RegistNetMessage(MessageTypeProto_pb.STORE_UPDATE_INDICATION, this.ReceiveShopData)
--刷新活动
socket:RegistNetMessage(MessageTypeProto_pb.ACTIVITY_UPDATE_INDICATION, this.RefreshActivityList)
socket:RegistNetMessage(MessageTypeProto_pb.ACTIVITY_UPDATE_PROGRESS_INDICATION, this.ActivityUpdateProgressIndication)
-- 公会推送
socket:RegistNetMessage(MessageTypeProto_pb.FAMILY_JOIN_INDICATION, this.GuildJoinSuccess)
socket:RegistNetMessage(MessageTypeProto_pb.FAMILY_KICK_INDICATION, this.GuildKickOut)
socket:RegistNetMessage(MessageTypeProto_pb.FAMILY_POSITION_UPDATE_INDICAITON, this.GuildPositionUpdate)
socket:RegistNetMessage(MessageTypeProto_pb.FAMILY_CHANGE_BASE_INDICATION, this.GuildDataUpdate)
socket:RegistNetMessage(MessageTypeProto_pb.FAMILY_WALK_INDICATION, this.GuildWalkUpdate)
socket:RegistNetMessage(MessageTypeProto_pb.FAMILY_QUICK_SET_DEFEND_INDICATION, this.GuildFightDefendUpdate)
socket:RegistNetMessage(MessageTypeProto_pb.FAMILY_FIGHT_MATCHING_SUCCESS_INDICATION, this.GuildFightMatchingSuccess)
socket:RegistNetMessage(MessageTypeProto_pb.FAMILY_DEFEATE_INDICATION, this.GuildFightBeKilled)
socket:RegistNetMessage(MessageTypeProto_pb.FAMILY_REFUSE_JOIN_INDICATION, this.GuildBeRefused)
socket:RegistNetMessage(MessageTypeProto_pb.FamilyFeteRewardProcessIndication, this.GuildFeteRewardProcess)
socket:RegistNetMessage(MessageTypeProto_pb.DEATH_PATH_STATUS_CHANGE_INDICATION, this.GuildRefreshDeathPosStatus)
socket:RegistNetMessage(MessageTypeProto_pb.DEATH_PATH_DO_REWARD_INDICATION, this.GuildDoRewardIndication)
socket:RegistNetMessage(MessageTypeProto_pb.DEATH_PATH_FIRST_CHANGE_INDICATION, this.GuildFirstChangeIndication)
--
socket:RegistNetMessage(MessageTypeProto_pb.UPDATE_USER_EXP_INDICATION, this.UpdateUserExp)
--秘盒跨季度刷新
socket:RegistNetMessage(MessageTypeProto_pb.UPDATE_SECRET_BOX_SEASON_INDICATION, this.UpdateSecretSeasonData)
-- 服务器要让我滚出图
socket:RegistNetMessage(MessageTypeProto_pb.MAP_OUT_INDICATION, this.TimeToFuckOutMap)
-- 刷新事件点时间
socket:RegistNetMessage(MessageTypeProto_pb.ENDLESS_REFRESH_INDICAITON, this.FreshPointShowTime)
-- 支付成功推送
socket:RegistNetMessage(MessageTypeProto_pb.NOTIFY_PAY_SUCCESS_INDICATION, this.PaySuccess)
-- 渠道强制改名推送
socket:RegistNetMessage(MessageTypeProto_pb.PLAYER_BACKCINFO_INDICATION, this.PlayerBackCInfo)
---调查问卷推送
socket:RegistNetMessage(MessageTypeProto_pb.QUESTION_INDICATION, this.RefreshQuestionnaire)
-- 空刷小怪
socket:RegistNetMessage(MessageTypeProto_pb.ENDLESS_MONSTER_REFRESH_INDICATION, this.MapNewAMonster)
-- 血战奖励积分变化刷新
socket:RegistNetMessage(MessageTypeProto_pb.BLOODY_SCORE_CHANGE_INDICATION, this.BloodyScoreChanged)
-- 无尽副本编队数据变化
socket:RegistNetMessage(MessageTypeProto_pb.ENDLESS_MAP_SET_TEAM_INDICATION, this.EndLessTeamChange)
--道具直购
socket:RegistNetMessage(MessageTypeProto_pb.DIRECT_BUY_GOODS_INDICATION, this.DirectBuyGoods)
-- 任务重置刷新
socket:RegistNetMessage(MessageTypeProto_pb.TREASURE_REFRESH_INDICATION, this.RestTreasureTaskData)
-- 戒灵秘宝等级推送
socket:RegistNetMessage(MessageTypeProto_pb.TREASURE_LEVELUP_INDICATION, this.RefreshTreasureLevel)
-- 幸运转盘
socket:RegistNetMessage(MessageTypeProto_pb.LUCKWHEEL_POOL_INDICATION, this.ReceiveLuckyTurnData)
-- 战斗胜利更新关卡ID
socket:RegistNetMessage(MessageTypeProto_pb.MAIN_LEVEL_FIGHT_UPDATE_INDICATION, this.FreshFightId)
-- 累充金额推送
socket:RegistNetMessage(MessageTypeProto_pb.REFRESH_RECHARGE_INDICATION, this.RefreshAccuMoneyNum)
-- 巅峰战阶段切换
socket:RegistNetMessage(MessageTypeProto_pb.CHAMPION_PROGRESS_UPDATE_INDICATION, this.TopMatchStageUpdate)
-- 竞猜成功
socket:RegistNetMessage(MessageTypeProto_pb.CHAMPION_GUESS_SUCCESS_INDICATION, this.TopMatchGuessSuccess)
-- 特权解锁
socket:RegistNetMessage(MessageTypeProto_pb.PRIVILLEGE_ADD_INDICATION, this.OnPrivilegeUpdate)
-- 远征更新圣物信息
socket:RegistNetMessage(MessageTypeProto_pb.EXPEDITION_HOLY_BAG_INDICATION, this.RefreshExpeditionHalidom)
-- 远征更新节点和己方信息
socket:RegistNetMessage(MessageTypeProto_pb.EXPEDITION_NOINFO_INDICATION, this.RefreshExpeditionNodeAndHeros)
-- 月卡激活推送
socket:RegistNetMessage(MessageTypeProto_pb.MONTHCARD_INDICATION, this.RefreshMonthCardData)
-- 公会车迟阶段推送
socket:RegistNetMessage(MessageTypeProto_pb.CAR_DELAY_PROGRESS_INDICATION, this.RefreshGuildCarDelayProgressData)
-- 公会援助信息推送
socket:RegistNetMessage(MessageTypeProto_pb.GuildHelpInfoIndication, this.RefreshGuildAidInfoData)
-- 公会援助日志信息推送
socket:RegistNetMessage(MessageTypeProto_pb.GuildHelpLogIndication, this.GuildHelpLogIndication)
-- 猎妖之路推送
socket:RegistNetMessage(MessageTypeProto_pb.ExpeditionResetIndication, this.ExpeditionResetIndication)
--大闹天宫 天宫秘宝 积分 和 任务状态推送
socket:RegistNetMessage(MessageTypeProto_pb.EXPEDITION_TREASURE_STATE_INDICATION, this.TreasureStateIndicaion)
socket:RegistNetMessage(MessageTypeProto_pb.SITUATION_INFO_INDICATION, this.SiTuaTionInfoIndication)
--公户副本推送
socket:RegistNetMessage(MessageTypeProto_pb.GUILD_CHALLENGE_INDICATION, this.GuildTranscriptIndication)
--公户副本推送
socket:RegistNetMessage(MessageTypeProto_pb.GUILD_CHALLENGE_BUY_BUFF_INDICATION, this.GuildChallengeBuyBuffIndication)
socket:RegistNetMessage(MessageTypeProto_pb.HERO_SKIN_USE_INDICATION, this.HeroSkinUseIndication)
-- 鸿蒙阵数据推送
socket:RegistNetMessage(MessageTypeProto_pb.HONGMENG_INFO_INDICATION,this.HongMengIndication)
socket:RegistNetMessage(MessageTypeProto_pb.HONGMENG_STELE_NEW_HAND_INDICATION,this.OpenHongMengTowerGuideIndication)
--跨服天梯信息推送
socket:RegistNetMessage(MessageTypeProto_pb.GetWorldArenaInfoIndication, this.GetWorldArenaInfoIndication)
socket:RegistNetMessage(MessageTypeProto_pb.WorldLevelIndication, this.WorldLevelIndication)
socket:RegistNetMessage(MessageTypeProto_pb.SendFourChallengeInfoIndication, this.SendFourChallengeInfoIndication)
-- 充值成功订单推送
socket:RegistNetMessage(MessageTypeProto_pb.RECHARGE_SUCCESS_INDICATION, this.RechargeSuccessOrder)
-- 礼包拍脸推送
socket:RegistNetMessage(MessageTypeProto_pb.PUSH_WELFARE_RESPONSE, this.BackPatFaceData)
-- 山河社稷图推送
socket:RegistNetMessage(MessageTypeProto_pb.HARD_STAGE_INFO_RESPONSE, this.HardStageResponse)
-- 神印信息推送
socket:RegistNetMessage(MessageTypeProto_pb.PurpleMansionSealIndication, this.PracticeImprintData)
-- Vip等级奖励信息推送
socket:RegistNetMessage(MessageTypeProto_pb.VIP_LEVEL_STATE_RESPONSE, this.RefreshLevleRewardDatas)
-- --心愿抽卡信息推送
socket:RegistNetMessage(MessageTypeProto_pb.wishDrawCardIndication, this.WishDrawCardInfoIndication)
-- --心愿抽卡信息推送
socket:RegistNetMessage(MessageTypeProto_pb.ENDLESS_TREASURE_REFRESH_INDICATION, this.EenlessTreasureRefreshIndication)
--称号激活推送
socket:RegistNetMessage(MessageTypeProto_pb.USER_TITLE_ADD_INDICATION, this.UserTitleAddIndicaiton)
--是否跨服推送
socket:RegistNetMessage(MessageTypeProto_pb.IsCrossIndication, this.IsCrossIndication)
--七界试炼推送
socket:RegistNetMessage(MessageTypeProto_pb.SevenWorldInfoIndication, this.SevenWorldInfoIndication)
socket:RegistNetMessage(MessageTypeProto_pb.EQUIP_BOOK_INDICATION, this.EquipBookInfoIndication)
-- 周卡推送
socket:RegistNetMessage(MessageTypeProto_pb.WeekCardIndicationInfoResponse, this.WeekCardIndication)
-- 灵脉被抢夺推送
socket:RegistNetMessage(MessageTypeProto_pb.CrossLingmaiIndicationResponse, this.LingMaiIndication)
end
function this.EquipBookInfoIndication(buff)
local data = buff:DataByte()
local msg = HeroInfoProto_pb.EquipBookIndication()
msg:ParseFromString(data)
EquipManager.InitHaveEquipDatas(msg.changeEquipList)
end
--后端推送激活的称号
function this.UserTitleAddIndicaiton(buff)
local data = buff:DataByte()
local msg = PlayerInfoProto_pb.UserTitleAddIndication()
msg:ParseFromString(data)
LogRed(" id=="..msg.decorationId.." time=="..msg.time)
PlayerManager.SetPlayerTitleTime(msg.decorationId,msg.time)
end
--后端推送福利红包数据
function this.EenlessTreasureRefreshIndication(buffer)
local data = buffer:DataByte()
local msg = MapInfoProto_pb.EndlessTreasureInfoResponse()
msg:ParseFromString(data)
local num = BagManager.GetItemCountById(EndLessMapManager.scoreValueId)
BagManager.HeroLvUpUpdateItemsNum(EndLessMapManager.scoreValueId, num)
EndLessMapManager.InitTreasureData(msg)
Game.GlobalEvent:DispatchEvent(GameEvent.EndLess.QinglongSerectRefresh)
end
--后端推送福利红包数据
function this.WelfareRedPacketPush(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.WelfareRedPacketPush()
msg:ParseFromString(data)
if msg.redpacket then
MyGuildManager.SetMyGuidRedPackage(msg.redpacket)
--CheckRedPointStatus(RedPointType.Guid_SendPackage)
--CheckRedPointStatus(RedPointType.Guid_GetPackage)
MyGuildManager.ReuqsetRedPackage()
end
-- BagManager.BagIndicationRefresh(msg)
end
function this.OpenHongMengTowerGuideIndication(buffer)
local data = buffer:DataByte()
local msg = HeroInfoProto_pb.HongmengSteleNewHandIndication()
msg:ParseFromString(data)
GuideManager.HongMengGuideFun(msg.state)
end
function this.HongMengIndication(buffer)
local data = buffer:DataByte()
local msg = HeroInfoProto_pb.HongmengInfoIndication()
msg:ParseFromString(data)
HarmonyManager.GetHongMengServerData(msg)
-- local data2 = ConfigManager.GetConfigData(ConfigName.SpecialConfig,101).Value
-- LogError("data2:"..tostring(data2))
-- local d = string.split(data2,"#")
-- LogError("msg.hongmengTabletMax:"..tostring(msg.hongmengTabletMax))
-- if msg.hongmengTabletMax >= tonumber(d[2]) then
-- HarmonyManager:SetHongMengTowerUpLimit(msg.hongmengTabletMax)
-- end
-- LogError("服务器发来的hongmengGuards长度"..tostring(#msg.hongmengGuards))
-- if msg.hongmengGuards then
-- -- for i = 1, #msg.hongmengGuards do
-- -- if msg.hongmengGuards[i].heroId == "" then
-- -- Log("鸿蒙守卫:"..i.."为nil")
-- -- else
-- -- Log("鸿蒙守卫:"..i..HeroManager.GetSingleHeroData(msg.hongmengGuards[i].heroId).name)
-- -- end
-- -- end
-- HarmonyManager.UpdateHongMengDataGuards(msg.hongmengGuards)
-- end
-- LogError("服务器发来的hongmengAdditions长度"..tostring(#msg.hongmengAdditions))
-- if msg.hongmengAdditions then
-- for i = 1, #msg.hongmengAdditions do
-- -- body
-- end
-- HarmonyManager.UpdateHongMengDataAdditions(msg.hongmengAdditions)
-- end
-- if msg.hongmengResonacnes then
-- HarmonyManager.UpdateHongMengDataHeroInfos(msg.hongmengResonacnes)
-- end
-- if GuideManager.IsFirstOpenHarmonyBei then
-- GuideManager.IsFirstOpenHarmonyBei = false
-- for i = 1, #HarmonyManager.hongmengGuards do
-- if HarmonyManager.hongmengGuards[i].heroId ~= "" then
-- local _heroData = HeroManager.GetSingleHeroData(HarmonyManager.hongmengGuards[i].heroId)
-- HeroManager.UpdateSingleHeroDatas(_heroData.dynamicId, 1, _heroData.star, 0, _heroData.upStarId)
-- end
-- end
-- end
-- --鸿蒙数据有变化时更新英雄战力数据
-- for i = 1, #msg.hongmengGuards do
-- if msg.hongmengGuards[i].heroId~="" then
-- HeroManager.UpdateSingleHeroWarPower(msg.hongmengGuards[i].heroId)
-- end
-- end
-- for i = 1, #msg.hongmengResonacnes do
-- if msg.hongmengResonacnes[i].heroId~="" then
-- HeroManager.UpdateSingleHeroWarPower(msg.hongmengResonacnes[i].heroId)
-- end
-- end
end
function this.SendFourChallengeInfoIndication(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.FourChallengeGetInfoResponse()
msg:ParseFromString(data)
LogGreen("刷新四灵")
MonsterCampManager.InitFourMonsterData(msg)
MonsterCampManager.SetFriendHelpHero({},nil)
MonsterCampManager.SetMyHelpHeroData(nil)
end
function this.HeroSkinUseIndication(buffer)
local data = buffer:DataByte()
local msg = HeroInfoProto_pb.GetSkinIndication()
msg:ParseFromString(data)
--LogGreen("获得了新的皮肤")
if msg.skinInfo then
LogBlue("msg.skinInfo.skinId:"..msg.skinInfo.skinId.." msg.skinInfo[i].overTime:"..msg.skinInfo.overTime)
HeroSkinManager.InitialSkin(msg,1)
else
LogBlue("没有皮肤")
end
end
function this.SiTuaTionInfoIndication(buffer)
local data = buffer:DataByte()
local msg = MapInfoProto_pb.GetAllSituationInfoResponse()
msg:ParseFromString(data)
--LogGreen("5点到了开始刷新了,发了消息GameEvent.FunctionCtrl.OnXuanYuanFunctionClose")
XuanYuanMirrorManager.UpdateMirrorState(msg)
Game.GlobalEvent:DispatchEvent(GameEvent.FunctionCtrl.OnXuanYuanFunctionChange)
end
function this.RefreshActivityList(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.ActivityUpateIndication()
msg:ParseFromString(data)
ActivityGiftManager.RefreshActivityData(msg)
Game.GlobalEvent:DispatchEvent(GameEvent.FunctionCtrl.OnFunctionOpen)
end
--服务器五点刷新推送相关任务的状态数据
function this.RefreshUpdateIndication(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.FivePlayerUpdateIndication()
msg:ParseFromString(data)
ActivityGiftManager.FiveAMRefreshActivityProgress(msg)
TaskManager.RefreshTypeTaskInfo(msg.userMissionInfo)
VipManager.FiveAMRefreshLocalData(msg.hadTakeDailyBox)
PrivilegeManager.FiveAMRefreshLocalData(msg.privilege)
MapTrialManager.RefreshAttachVipData()
OperatingManager.SetSignInData(msg.SignInInfo)
CheckRedPointStatus(RedPointType.FirstRecharge)
PatFaceManager.SetisFirstLogVal(0)
ShopManager.isOpenNoviceGift=false
ActivityGiftManager.isFirstForSupremeHero=false
BindPhoneNumberManager.InitBindInfo(msg.playerBindPhone)
LuckyTurnTableManager.ReceiveServerDataForFive(msg.posInfos,msg.posInfosAdvance)
MonthCardManager.BackSetMonthCardGetStateData(msg.MonthDailyTake)
MyGuildManager.SetMyFeteInfo_FiveRefresh(msg)
MyGuildManager.SetGuildHelpInfo_FiveRefresh(msg)
-- CarbonManager.dailyChallengeInfo=msg.dailyChallengeInfo
-- LogBlue("Indication 推送数据"..#msg.dailyChallengeInfo)
Timer.New(function()
AdventureManager.RefreshAttachVipData()
Game.GlobalEvent:DispatchEvent(GameEvent.Adventure.OnRefreshNextDayData)
end, 2, 1, true):Start()
--先刷新完数据,再派发事件做界面刷新
Game.GlobalEvent:DispatchEvent(GameEvent.FiveAMRefresh.ServerNotifyRefresh)
--刷新极速探险免费次数
Game.GlobalEvent:DispatchEvent(GameEvent.Adventure.OnFastBattleChanged)
--五点刷新拍脸
Game.GlobalEvent:DispatchEvent(GameEvent.Activity.OnPatFaceRedRefresh)
Game.GlobalEvent:DispatchEvent(GameEvent.LikeAbility.RefreshRemainTimes)
CheckRedPointStatus(RedPointType.LikeabilityRed)
CheckRedPointStatus(RedPointType.SecretTer_HaveFreeTime)
CheckRedPointStatus(RedPointType.DailyGift)
CheckRedPointStatus(RedPointType.GrowthPackage)
CheckRedPointStatus(RedPointType.Guild_Fete)
CheckRedPointStatus(RedPointType.Guild_AidBox)
CheckRedPointStatus(RedPointType.Guild_AidGuild)
CheckRedPointStatus(RedPointType.Guild_AidMy)
CheckRedPointStatus(RedPointType.TaiChuMiJuan)
LuckyTurnTableManager.SetTimes(msg.hadLuckTime,msg.hadAdvanceLuckyTime)
CheckRedPointStatus(RedPointType.Arena_Free)
--抽奖勾选重置
PlayerManager.ResetLocalData(1)--初始化所有本地的每日一刷--1是五点推送、2是登陆检测
GuildTranscriptManager.SetCanSweep1()
DeathPosManager.InitData()--十绝阵跨天状态刷新
end
function this.ZeroRefreshUpdateIndication()
end
--服务器推送红点信息
function this.ReceiveRedPoint(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.RedPointInfo()
msg:ParseFromString(data)
-- 显示红点
RedpotManager.SetServerRedPointStatus(msg.type, RedPointStatus.Show)
end
--后端更新背包数据
function this.BackUpDataBagItemIdNumber(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.UpdateBagIndication()
msg:ParseFromString(data)
BagManager.BagIndicationRefresh(msg)
end
-- 好友数据单独处理
function this.ReceiveFriendChat(buffer)
local data = buffer:DataByte()
local msg = ChatProto_pb.SendChatInfoIndication()
msg:ParseFromString(data)
for i = 1, #msg.chatInfo do
msg.chatInfo[i].senderName = PracticeManager.SetNameColor(msg.chatInfo[i].senderName,msg.chatInfo[i].practiceLevel)
end
if msg.type == 1 then
FriendChatManager.ReceiveFriendChat(msg)
elseif msg.type == 2 then
LogGreen("收到了跑马灯消息")
ChatManager.ReceiveFamilyChat(msg)
end
end
--服务器推送相关任务的状态数据
function this.RefreshMissionList(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.MissionUpdateListIndication()
msg:ParseFromString(data)
--LogBlue("收到了服务器的刷新数据")
TaskManager.RefreshTypeTaskInfo(msg.userMissionInfo)
Game.GlobalEvent:DispatchEvent(GameEvent.TreasureOfHeaven.TaskRefresh)
end
-- 接收服务器数据
function this.ReceiveChatMsg(buffer)
--Log("收到新的外敌数据")
local data = buffer:DataByte()
local msg = FightInfoProto_pb.AdventureBossFindIndication()
msg:ParseFromString(data)
--TODO: 服务器主动推送的数据与原数据不同,需特殊处理
-- 只保留三十条数据
table.insert(AdventureManager.adventureChatList, msg.adventureBossInfo)
if #AdventureManager.adventureChatList > 30 then
table.remove(AdventureManager.adventureChatList, 1)
end
-- 是否需要刷新显示标志位
AdventureManager.IsChatListNew = true
-- 聊天数据刷新
Game.GlobalEvent:DispatchEvent(GameEvent.Adventure.OnChatListChanged)
-- 判断新增外敌是否在外敌列表中,不在则保存
local data = AdventureManager.GetEnemyDataByBossId(msg.adventureBossInfo.bossId)
if not data then
table.insert(AdventureManager.adventrueEnemyList, msg.adventureBossInfo)
AdventureManager.SortEnemyList()
-- 数据刷新
Game.GlobalEvent:DispatchEvent(GameEvent.Adventure.OnEnemyListChanged)
end
end
--拉去Boss外敌信息
function this.GetBossInfo(buffer)
local data = buffer:DataByte()
local msg = FightInfoProto_pb.AdventureBossKillIndication()
msg:ParseFromString(data)
AdventureManager.GetAdventureBossFlushRequest(msg)
local removeIndex = nil
for i, v in ipairs(AdventureManager.adventrueEnemyList) do
if v.bossId == msg.bossId then
removeIndex = i
end
end
if removeIndex then
table.remove(AdventureManager.adventrueEnemyList, removeIndex)
AdventureManager.SortEnemyList()
-- 是否需要刷新显示标志位
AdventureManager.IsChatListNew = true
-- 聊天数据刷新
Game.GlobalEvent:DispatchEvent(GameEvent.Adventure.OnChatListChanged)
Game.GlobalEvent:DispatchEvent(GameEvent.Adventure.OnEnemyListChanged)
end
end
function this.RefreshGiftGoods(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.AllGiftGoodsIndication()
msg:ParseFromString(data)
OperatingManager.SetBasicValues(msg.GiftGoodsInfo)
Game.GlobalEvent:DispatchEvent(GameEvent.GrowGift.RechargeGift)
-- LogYellow("发送了GameEvent.GrowGift.RechargeGift")
end
-- 接收服务器好友申请,添加
function this.ReceiveFriendApplication(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.sendFriendInfoIndication()
msg:ParseFromString(data)
local friendApplicationData = msg.Friends
if (msg.type == 1) then
GoodFriendManager.OnFriendDataRefresh(3, msg)
--GoodFriendManager.friendApplicationData[friendApplicationData.id] = friendApplicationData
Game.GlobalEvent:DispatchEvent(GameEvent.Friend.OnFriendApplication, GoodFriendManager.friendApplicationData)
end
if (msg.type == 2) then
GoodFriendManager.OnFriendDataRefresh(1, msg)
-- GoodFriendManager.friendAllData[friendApplicationData.id] = friendApplicationData
GoodFriendManager.friendApplicationData[friendApplicationData.id] = nil
RedPointManager.PlayerPrefsSetStr(PlayerManager.uid .. "redPointApplication", 1)
Game.GlobalEvent:DispatchEvent(GameEvent.Friend.OnFriendList, GoodFriendManager.friendAllData)
Game.GlobalEvent:DispatchEvent(GameEvent.Friend.OnFriendApplication, GoodFriendManager.friendApplicationData)
end
CheckRedPointStatus(RedPointType.Friend_Application)
CheckRedPointStatus(RedPointType.Friend_GetAllReward)
end
-- 接收服务器好友删除,赠送体力推送
function this.ReceiveFriendDeleteState(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.SendFriendStateIndication()
msg:ParseFromString(data)
if (msg.type == 1) then
GoodFriendManager.friendAllData[msg.friendId] = nil
--this.friendSearchData[msg.friendId].isHaveApplication=1
Game.GlobalEvent:DispatchEvent(GameEvent.Friend.OnFriendDelete, msg.friendId)
end
if (msg.type == 2) then
GoodFriendManager.friendAllData[msg.friendId].haveReward = 1
end
CheckRedPointStatus(RedPointType.Friend_GetAllReward)
Game.GlobalEvent:DispatchEvent(GameEvent.Friend.OnFriendList, GoodFriendManager.friendAllData)
end
-- 接收商店数据
function this.ReceiveShopData(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.storeUpdateIndication()
msg:ParseFromString(data)
ShopManager.UpdateShopData(msg)
end
-- 加入公会成功推送
function this.GuildJoinSuccess(buffer)
local data = buffer:DataByte()
local msg = Family_pb.FamilyJoinIndicaion()
msg:ParseFromString(data)
local isSelf = msg.familyUserInfo.roleUid == PlayerManager.uid
Log("服务器推送:有人成功加入公会,是不是自己:" .. tostring(isSelf))
if isSelf then
MyGuildManager.SetMyGuildInfo(msg)
MyGuildManager.SetMyMemInfo(msg)
MyGuildManager.SetMyFeteInfo(msg)
-- 初始化一遍数据
MyGuildManager.InitAllData(function()
-- 发送数据更新事件
Game.GlobalEvent:DispatchEvent(GameEvent.Guild.JoinGuildSuccess)
-- 显示tip
GuildManager.AddGuildTip(GUILD_TIP_TYPE.JOIN, msg.familyBaseInfo.name)
end)
else
-- 不是自己暂不做处理
--MyGuildManager.RequestMyGuildMembers()
end
end
-- 被踢出公会推送
function this.GuildKickOut(buffer)
local data = buffer:DataByte()
local msg = Family_pb.KickOutIndication()
msg:ParseFromString(data)
Log("服务器推送:被踢出公会, uid" .. msg.uid)
MyGuildManager.BeKickOut(msg)
end
-- 被踢出公会推送
function this.GuildBeRefused(buffer)
Log("服务器推送:公会申请被拒绝")
local data = buffer:DataByte()
local msg = Family_pb.RefuseJoinFamily()
msg:ParseFromString(data)
GuildManager.AddGuildTip(GUILD_TIP_TYPE.REFUSE, msg.name)
end
-- 职位变更推送
function this.GuildPositionUpdate(buffer)
local data = buffer:DataByte()
local msg = Family_pb.FamilyPositionUpdateIndication()
msg:ParseFromString(data)
Log("服务器推送:公会职位变化, uid = "..msg.uid..", pos = "..msg.position)
MyGuildManager.UpdateGuildPosition(msg)
end
-- 公会信息推送
function this.GuildDataUpdate(buffer)
Log("服务器推送:公会信息改变")
local data = buffer:DataByte()
local msg = Family_pb.FamilyChangeIndication()
msg:ParseFromString(data)
MyGuildManager.SetMyGuildInfo(msg)
end
-- 公会成员行走
function this.GuildWalkUpdate(buffer)
-- 不在公会主界面不接收,打开公会主界面时会刷新
if not UIManager.IsOpen(UIName.GuildMainCityPanel) then
return
end
Log("服务器推送:公会行走信息改变")
local data = buffer:DataByte()
local msg = Family_pb.FamilyWalkIndicaiton()
msg:ParseFromString(data)
MyGuildManager.UpdateWalkData(msg)
end
-- 公会战防守阵容改变推送
function this.GuildFightDefendUpdate(buffer)
-- 不在公会主界面不接收,打开界面时会刷新
if not UIManager.IsOpen(UIName.GuildMainCityPanel) then
return
end
Log("服务器推送:公会战防守阵容信息改变")
local data = buffer:DataByte()
local msg = Family_pb.FamilyDefendInfo()
msg:ParseFromString(data)
GuildFightManager.UpdateDefendStageData(msg)
end
-- 公会战匹配成功
function this.GuildFightMatchingSuccess(buffer)
-- 不在公会主界面不接收,打开界面时会刷新
if not UIManager.IsOpen(UIName.GuildMainCityPanel) then
return
end
Log("服务器推送:公会战匹配成功")
local data = buffer:DataByte()
local msg = Family_pb.EnemyFamily()
msg:ParseFromString(data)
GuildFightManager.SetEnemyBaseData(msg)
end
-- 公会战匹配成功
function this.GuildFightBeKilled(buffer)
Log("服务器推送:公会战有人被打败")
-- 不在公会主界面不接收,打开界面时会刷新
local data = buffer:DataByte()
local msg = Family_pb.DefeatResponse()
msg:ParseFromString(data)
Log("服务器推送:公会战有人被打败, uid = " .. msg.uid)
GuildFightManager.KillSomeBody(msg)
end
-- 公会祭祀进度
function this.GuildFeteRewardProcess(buffer)
local data = buffer:DataByte()
local msg = Family_pb.FamilyFeteRewardProcessIndication()
msg:ParseFromString(data)
Log("服务器推送:公会祭祀进度更新,score= "..msg.score)
MyGuildManager.SetMyFeteInfo_ByScore(msg)
Game.GlobalEvent:DispatchEvent(GameEvent.Guild.OnRefreshFeteProcess)
end
--公会十绝阵阶段刷新
function this.GuildRefreshDeathPosStatus(buffer)
local data = buffer:DataByte()
local msg = Family_pb.DeathPathStatusChangeIndication()
msg:ParseFromString(data)
Log("服务器推送:公会十绝阵阶段刷新,status= "..msg.status)
DeathPosManager.status=msg.status
if msg.status == 1 then
DeathPosManager.battleTime=DeathPosManager.maxBattleTime
else
DeathPosManager.battleTime = 0
end
Game.GlobalEvent:DispatchEvent(GameEvent.Guild.RefreshDeathPosStatus)
end
--公会十绝阵 其他玩家领取奖励推送
function this.GuildDoRewardIndication(buffer)
local data = buffer:DataByte()
local msg = Family_pb.DoRewardIndication()
msg:ParseFromString(data)
-- --LogGreen("indicationmanager "..msg.info.uid.." itemId"..msg.info.itemId.." itemCount "..msg.info.itemCount.." position "..msg.info.position.." username "..msg.info.username)
DeathPosManager.SetDoRewardIndication(msg.info)
Game.GlobalEvent:DispatchEvent(GameEvent.Guild.RefreshDeathPosReward)
end
--十绝阵第一名修改推送
function this.GuildFirstChangeIndication(buffer)
local data = buffer:DataByte()
local msg = Family_pb.DeathPathFirstChangeIndication()
msg:ParseFromString(data)
-- LogBlue("indicationmanager 公会Id "..msg.changeInfo.gid.." 公会名 "..msg.changeInfo.guildName.." 位置 "..msg.changeInfo.pathId)
DeathPosManager.SetGuildInfoIndication(msg.changeInfo)
Game.GlobalEvent:DispatchEvent(GameEvent.Guild.RefreshFirstChangeData)
end
function this.ActivityUpdateProgressIndication(buffer)
local data = buffer:DataByte()
local message = PlayerInfoProto_pb.ActivityUpateProgressIndication()
message:ParseFromString(data)
ActivityGiftManager.RefreshActivityProgressData(message)
end
function this.UpdateUserExp(buffer)
local data = buffer:DataByte()
local message = PlayerInfoProto_pb.UpdateUserExpIndicaiton()
message:ParseFromString(data)
PlayerManager.BcakUpdateUserExp(message)
if message.drop and #message.drop > 0 then
BagManager.GetItemListFromTempBag(message.drop)
end
end
function this.UpdateSecretSeasonData(buffer)
local data = buffer:DataByte()
local message = PlayerInfoProto_pb.UpdateSecretBoxSeasonIndication()
message:ParseFromString(data)
SecretBoxManager.RefreshSeasonTime(message)
end
-- 滚出图
function this.TimeToFuckOutMap(buffer)
if UIManager.IsOpen(UIName.BattleFailPopup) then
UIManager.ClosePanel(UIName.BattleFailPopup)
end
if UIManager.IsOpen(UIName.BattleWinPopup) then
UIManager.ClosePanel(UIName.BattleWinPopup)
end
if UIManager.IsOpen(UIName.BattlePanel) then
BattleLogic.IsEnd = true
UIManager.ClosePanel(UIName.BattlePanel)
end
if UIManager.IsOpen(UIName.FormationPanel) then
UIManager.ClosePanel(UIName.FormationPanel)
end
Game.GlobalEvent:DispatchEvent(GameEvent.Map.OnForceGetOutMap)
end
-- 刷新地图事件点的显示时间
function this.FreshPointShowTime(buffer)
local data = buffer:DataByte()
local msg = MapInfoProto_pb.EndlessTimeIndication()
msg:ParseFromString(data)
EndLessMapManager.InitRefreshPoint(msg.infos)
EndLessMapManager.isAddPoint = true
MapManager.PanelCloseCallBack(UIName.MapOptionPanel, function()
Game.GlobalEvent:DispatchEvent(GameEvent.Map.OnAddCountTimePoint)
end)
end
-- 强制改名
function this.PlayerBackCInfo(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.PlayerBackCInfoIndication()
msg:ParseFromString(data)
Log("服务器推送:强制改名为:" .. msg.nickName)
NameManager.SetRoleName(msg.nickName)
PlayerManager.nickName = msg.nickName
Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnChangeName)
end
--支付成功
function this.PaySuccess(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.NotifyPaySuccessfulIndicaiton()
msg:ParseFromString(data)
Log("支付成功!道具名称:" .. msg.goodsId)
--if LoginManager.pt_pId == 2 then --TODO:九游渠道不允许客户端接受回调处理,通过监听服务器推送处理
local tip = GetLanguageStrById(ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig, msg.goodsId).Tip)
PopupTipPanel.ShowTip(tip)
--FirstRechargeManager.RefreshAccumRechargeValue(msg.goodsId)
-- 延时0.5秒刷新。避免sdk支付时商店次数未刷新界面刷新的问题
Timer.New(function()
Game.GlobalEvent:DispatchEvent(GameEvent.MoneyPay.OnPayResultSuccess, msg.goodsId)
end, 0.5):Start()
--end
end
--调查问卷
function this.RefreshQuestionnaire(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.QuestionIndication()
msg:ParseFromString(data)
if msg.state == 1 then
QuestionnaireManager.SetQuestionState(0)
QuestionnaireManager.RefreshQuestionData()
else
QuestionnaireManager.ResetArgs()
QuestionnaireManager.SetQuestionState(-1)
end
Game.GlobalEvent:DispatchEvent(GameEvent.Questionnaire.OnQuestionnaireChange, msg.state)
end
-- 空地生成小怪
function this.MapNewAMonster(buffer)
local data = buffer:DataByte()
local msg = MapInfoProto_pb.RefreshMonsterResponse()
msg:ParseFromString(data)
for i = 1, #msg.cell do
local pos = msg.cell[i].cellId
local mapPointId = msg.cell[i].pointId
local config = ConfigManager.GetConfigData(ConfigName.MapPointConfig, mapPointId)
if config.Style == 5 and config.icon == 10 and CarbonManager.carbonType == CARBON_TYPE.ENDLESS then
PopupTipPanel.ShowTip("遗迹中央传来一股令人不安的气息~")
end
MapManager.pointAtkPower[msg.cell[i].cellId] = msg.cell[i].monsterForce
Log("无尽副本服务器推送数据,在空地上生成小怪!")
MapManager.PanelCloseCallBack(UIName.BattleEndPanel, function()
CallBackOnPanelOpen(UIName.MapPanel, function ()
Game.GlobalEvent:DispatchEvent(GameEvent.Map.PointAdd, pos, mapPointId)
end)
--local u, v = Map_Pos2UV(pos)
--Log(string.format("生成一只小怪,位置是(%s, %s)", u, v))
end)
end
end
-- 空地生成小怪
function this.BloodyScoreChanged(buffer)
local data = buffer:DataByte()
local msg = RoomProto_pb.BloodyScoreChangeIndication()
msg:ParseFromString(data)
MatchDataManager.SetRewardScore(msg.myscore)
end
-- 无尽副本换编队刷新最大血量值
function this.EndLessTeamChange(buffer)
local data = buffer:DataByte()
local msg = MapInfoProto_pb.EndlessSetTeamIndication()
msg:ParseFromString(data)
EndLessMapManager.UpDateTeamMaxHp(msg.info)
end
function this.DirectBuyGoods(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.DirectBuyIndication()
msg:ParseFromString(data)
Log("异妖直购 购买成功 " .. msg.goodsId)
PatFaceManager.ShowBuyLaterDrop(msg)
end
function this.RefreshMapData(buffer)
local data = buffer:DataByte()
local msg = MapInfoProto_pb.EndlessMapChange()
msg:ParseFromString(data)
Log("推送的世界ID " .. msg.mapId)
EndLessMapManager.openMapId = msg.mapId
NetManager.RefreshEnergyRequest({1},function()
end)
end
function this.RestTreasureTaskData(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.TreasureRefreshIndication()
msg:ParseFromString(data)
TaskManager.ResetTreasureTaskInfo(msg.tasks)
end
function this.RefreshTreasureLevel(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.TreasureLevelUpIndication()
msg:ParseFromString(data)
--LogGreen("青龙秘宝等级更新了:"..msg.level)
QinglongSerectTreasureManager.SetLevel(msg.level)
QinglongSerectTreasureManager.SetTreasureBuyStatus(msg.hadBuy)
QinglongSerectTreasureManager.UpdateTreasureState2()
end
--幸运转盘
function this.ReceiveLuckyTurnData(buffer)
local data=buffer:DataByte()
local msg=PlayerInfoProto_pb.LuckWheelIndication()
msg:ParseFromString(data)
--Log("==YSP== 服务器推送 幸运转盘数据 "..tostring(msg.posInfos))
LuckyTurnTableManager.ReceiveServerData(msg.posInfos,msg.posInfosAdvance)
end
-- 更新关卡ID
function this.FreshFightId(buffer)
local data=buffer:DataByte()
local msg=FightInfoProto_pb.MainLevelFightUpdateIndication()
msg:ParseFromString(data)
FightPointPassManager.RefreshFightId(msg)
end
-- 后端推送累充金额
function this.RefreshAccuMoneyNum(buffer)
-- Log("推送充值金额")
local data=buffer:DataByte()
local msg=PlayerInfoProto_pb.RefreshRechargeIndication()
msg:ParseFromString(data)
VipManager.RefreshChargeMoney(msg.amount, false)
MonthCardManager.RefreshMonthCardChargeMoney(msg)
end
-- 巅峰战阶段更新
function this.TopMatchStageUpdate(buffer)
-- Log("巅峰战阶段切换")
local data = buffer:DataByte()
local msg = ArenaInfoProto_pb.ChampionProgressUpdateIndication()
msg:ParseFromString(data)
ArenaTopMatchManager.UpdateTopMatchStage(msg)
end
-- 巅峰战竞猜成功
function this.TopMatchGuessSuccess(buffer)
-- Log("巅峰战竞猜奖励发放")
local data = buffer:DataByte()
local msg = ArenaInfoProto_pb.ChampionGuessSuccessIndication()
msg:ParseFromString(data)
-- ArenaTopMatchManager.OnGuessSuccess(msg)
end
-- 巅峰战竞猜成功
function this.OnPrivilegeUpdate(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.PrivilegeIndication()
msg:ParseFromString(data)
-- Log("特权解锁")
PrivilegeManager.OnPrivilegeUpdate(msg.infos)
end
function this.RefreshExpeditionHalidom(buffer)
local data = buffer:DataByte()
local msg = Expedition_pb.ExpeditionEquipIndication()
msg:ParseFromString(data)
ExpeditionManager.UpdateHalidomValue(msg)
end
function this.RefreshExpeditionNodeAndHeros(buffer)
local data = buffer:DataByte()
local msg = Expedition_pb.ExpeditionNodeInfoIndication()
msg:ParseFromString(data)
-- if msg.nodeInfo then
-- --LogGreen(" ******* 推送更新远征 msg.nodeInfo "..#msg.nodeInfo)
-- else
-- --LogGreen(" ******* 推送更新远征 msg.nodeInfo nil")
-- end
-- if msg.heroInfo then
-- --LogGreen(" ******* 推送更新远征 msg.heroInfo "..#msg.heroInfo)
-- else
-- --LogGreen(" ******* 推送更新远征 msg.heroInfo nil")
-- end
ExpeditionManager.UpdateHeroHpValue(msg.heroInfo)
ExpeditionManager.UpdateNodeValue(msg.nodeInfo)
end
function this.RefreshMonthCardData(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.MonthCardIndication()
msg:ParseFromString(data)
MonthCardManager.UpdateMonthCardData(msg)
end
function this.RefreshGuildCarDelayProgressData(buffer)
local data = buffer:DataByte()
local msg = Family_pb.CarDelayProgressIndication()
msg:ParseFromString(data)
GuildCarDelayManager.SetProgressData(msg)
end
function this.RefreshGuildAidInfoData(buffer)
local data = buffer:DataByte()
local msg = Family_pb.GuildHelpInfoIndication()
msg:ParseFromString(data)
MyGuildManager.SetSingleGuildHelpInfo(msg)
end
function this.GuildHelpLogIndication(buffer)
local data = buffer:DataByte()
local msg = Family_pb.GuildHelpLogIndication()
msg:ParseFromString(data)
MyGuildManager.SetSingleGuildHelpLogInfo(msg)
end
function this.ExpeditionResetIndication(buffer)
local data = buffer:DataByte()
local msg = Expedition_pb.GetExpeditionResponse()--ExpeditionResetIndication()
msg:ParseFromString(data)
PlayerPrefs.SetInt(PlayerManager.uid.."Expedition", 0)
ExpeditionManager.SetExpeditionState(3)
ExpeditionManager.expeditionLeve = 1
ExpeditionManager.allSHoly = {}
ExpeditionManager.InitExpeditionData(msg)
ExpeditionManager.RefreshPanelShowByState()
end
function this.TreasureStateIndicaion(buffer)
local data = buffer:DataByte()
local msg = Expedition_pb.TreasureStateIndicaion()--ExpeditionResetIndication()
msg:ParseFromString(data)
-- --LogGreen("msg.score :"..msg.score.." msg.resetTime:"..msg.resetTime)
TreasureOfHeavenManger.UpdateData(msg)
LogPink("推回来的数据长度"..#msg.treasureRewardState)
end
function this.GuildTranscriptIndication(buffer)
local data = buffer:DataByte()
local msg = Family_pb.GuildChallengeIndication()
msg:ParseFromString(data)
-- --LogGreen("%%%%%%%%%%msg.curBoss: "..msg.curBoss.." msg.blood: "..msg.blood.." msg.isKill: "..msg.isKill)
GuildTranscriptManager.RefreshGuildTranscriptInfo(msg)
end
function this.GuildChallengeBuyBuffIndication(buffer)
local data = buffer:DataByte()
local msg = Family_pb.GuildChallengeBuyBuffIndication()
msg:ParseFromString(data)
-- --LogGreen("%%%%%%%%%%%msg.buffCount: "..msg.buffCount.." msg.buffTime: "..msg.buffTime)
GuildTranscriptManager.RefreshGuildTranscriptBuffInfo(msg)
end
function this.WorldLevelIndication(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.WorldLevelIndication()
msg:ParseFromString(data)
PlayerManager.RefreshWorldLeveData(msg.worldLeve)
end
function this.RechargeSuccessOrder(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.RechargeSuccessIndication()
msg:ParseFromString(data)
PayManager.RechargeSuccessOrder(msg)
end
--后端拍脸推送
function this.BackPatFaceData(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.PushWelfareResponse()
msg:ParseFromString(data)
PatFaceManager.SetPatFaceDaqta(msg)
end
--山河社稷图推送
function this.HardStageResponse(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.HardStageResponse()
msg:ParseFromString(data)
FightLevelManager.UpdataChapterData(msg.info,true)
FightLevelManager.SetDailyRewardData(msg)
end
--神印信息推送
function this.PracticeImprintData(buffer)
local data = buffer:DataByte()
local msg = HeroInfoProto_pb.PurpleMansionSealIndication()
msg:ParseFromString(data)
PracticeManager.UpdataImprintDataFromServer(msg.sealList)
end
--Vip等级奖励推送
function this.RefreshLevleRewardDatas(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.VipLevelStateResponse()
msg:ParseFromString(data)
VipManager.InitLevleRewardDatas(msg)
end
--跨服天梯
function this.GetWorldArenaInfoIndication(buffer)
local data = buffer:DataByte()
-- local msg = WorldProto_pb.GetWorldArenaInfoIndication()
-- msg:ParseFromString(data)
-- LogPink("%%%%%%%%%%%msg.arenaInfo: "..#msg.arenaInfo.arenaEnemys.." msg.stage: "..msg.stage.." msg.endTime: "..msg.endTime)
-- LogPink("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
-- JumpServerManager.IndicationHightLadderData(msg)
JumpServerManager.ZeroRefreshPanel()
end
--心愿抽卡信息推送
function this.WishDrawCardInfoIndication(buffer)
local data = buffer:DataByte()
local msg = HeroInfoProto_pb.wishDrawCardIndication()
msg:ParseFromString(data)
RecruitManager.GetWishCardData(msg)
end
--是否跨服推送
function this.IsCrossIndication(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.IsCrossIndication()
msg:ParseFromString(data)
PlayerManager.isCross = msg.isCross
Game.GlobalEvent:DispatchEvent(GameEvent.JumpServerHeightLadder.CrossStateChange)
end
--七界试炼信息推送
function this.SevenWorldInfoIndication(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.SevenWorldInfoResponse()
msg:ParseFromString(data)
QiJieShiLianManager.GetServerData(msg,function ()
Game.GlobalEvent:DispatchEvent(GameEvent.QiJieShiLian.RefreshPanel)
if UIManager.IsOpen(UIName.FormationPanelV2) then
UIManager.ClosePanel(UIName.FormationPanelV2)
end
if UIManager.IsOpen(UIName.ExpeditionMonsterInfoPopup) then
UIManager.ClosePanel(UIName.ExpeditionMonsterInfoPopup)
end
end)
end
-- 周卡推送
function this.WeekCardIndication(buffer)
local data = buffer:DataByte()
local msg = ActivityProto_pb.WeekCardIndicationInfoResponse()
msg:ParseFromString(data)
WeekCardManager.UpdateAllWeekCard(msg)
end
-- 灵脉被抢夺推送
function this.LingMaiIndication(buffer)
local data = buffer:DataByte()
local msg = ArenaInfoProto_pb.CrossLingmaiIndicationResponse()
msg:ParseFromString(data)
NetManager.LingMaiRecordRequest(function ()
if #LingMaiMiJingManager.recordData > 0 then
PlayerPrefs.SetString(PlayerManager.uid.."LingMai", tostring(LingMaiMiJingManager.recordData[1].time))
else
PlayerPrefs.SetString(PlayerManager.uid.."LingMai","")
end
CheckRedPointStatus(RedPointType.LingMaiMiJing)
Game.GlobalEvent:DispatchEvent(GameEvent.LingMaiMiJing.RefreshPanel)
LogError("收到了后端发来的Indication")
end)
end
return this