local LuaFuncEntry = {} local LuaUpdater = require('Main/LuaUpdater') local EventSystem = require('Event/EventSystem') local JSON = require("cjson") local HttpReq = require('Http/HttpReq') local private = {} --C#执行lua函数,需此处定义FuncType,调用时传key,例:LuaFuncProxy.CallFunc("HotfixReady"); local FuncType = { HotfixReady = 1, PackReady = 2, PackFinish = 3, OnLoadGameLevel = 5, ConnectingUI = 11, ShowGameQuit = 15, RebootGameMsg = 16, SetVolume = 17, ResetVolume = 18, NetworkStateChange = 20, BatteryStatusChange = 21, BatteryLevelChange = 22, PauseLevel = 23, SendEnterWorld = 24, OnNetConnectionSuccess = 25, TimeLineActive = 26, HotfixFinishDownload = 27, HotfixFinishNoDownload = 28, FuncType_SkuDetail = 29, LocalizationSetParamOrderData = 30, OnTimelineStart = 32, OnTimelineFinish = 33, OnNofiticationState = 34, OnItemRarityTimelineFinish = 35, OnHrefClick = 36, PingPongTimeout = 38, OnReceiveLuaMsg = 39, OnReceiveLuaMsgTimeout = 40, NetConnectedTick = 41, OnPaySuccess = 42, SkuDetailFailed = 43, OnLoginChatServer = 44, OnRecvChatMsgByCS = 45, SetStagePackSize = 46, OnOrientationChange = 47, UpdatePadStatus = 48, UpdatePadProgress = 49, OnPadMobileDataRequestResult = 50, OnUploadLogCallBack = 51, GetStartLoginData = 53, GetShardListFail = 54, OnUpdateSDKUserInfo = 55, PlayDialogue = 56, SkipTimeline = 57, LowMemoryCallback = 58, GetNewMessageNum = 59, OnNetworkPingCompleted = 60, GetResolutionConfig = 61, GetHeroTransparentRenderQueue = 62, OnRecordFinishSuccess = 63, --录制成功回调 OnRecordFinishFail = 64, --录制失败回调 OnRecordStartResult = 65, --开始录制的回调,只有成功才做录制表现 OnIOSCellularDataStateChange = 66, MicrophonePermissionCallBack = 70, --关掉micphone的提示 ChatVoiceRoomActionCallback = 71, --语音房间回调 GetPersistentPlayerData = 72, SetPersistentPlayerData = 73, GetPersistentDeviceData = 74, SetPersistentDeviceData = 75, OnEntityVisualStateChanged = 80, OnModelComponentLayerActiveType = 81, SDKAuthInfoRequest = 90; SDKLoginFailed = 91, OnPayFailed = 92, OnEnableMicrophoneFailed = 93, OnEnableMicrophoneSuccess = 94, OnOpenGiftExchangeCompeletion = 95, OnRebootOver = 97, OnClickScreen = 98, GetGCDuration = 99, OnLuaStateShutdown = 100, OnApplicationPause = 101, OnApplicationQuit = 102, OnTimelinePause = 103, --timeline暂停 OnClickSkipTimeline = 104, --timelinet跳过 OnPreloadAssetsCompleted = 105, --国服三方商城 OnCanShowLoginCode = 106, OnOpenLoginCodeOver = 107, OnPayResult = 108, OnBIEvent = 200, OnBIEventHotfixDownload = 201, OnBIEventBDC = 202, OnBIEventTimelineSkip = 203, OnBIEventServerBDC = 204, --日本规约 隐私 资金决策法 特定商品取引法 CBT返利 回调 OnLoadUseRegulationsSucc = 205; OnLoadUseRegulationsFailed = 206; OnLoadPrivateRegulationSucc = 207; OnLoadPrivateRegulationFailed = 208; OnLoadCommodityTradingSucc = 209; OnLoadCommodityTradingFailed = 210; OnLoadFundSettlementSucc = 211; OnLoadFundSettlementFailed = 212; OnCbtActivityInfoCB = 213; --处理键盘输入 PressKeyboard = 214; ReleaseKeyboard = 215; SetKeyMapInput = 216; --通知PAD校验结果 OnPADCheckResult = 217, --Lua异步加载资源成功回调 GetInstanceAssetAsync = 218, --上报关键行为 CriticalReport = 219, OnSwitchCDNUrl = 1001, --国内英雄存储权限弹框回调 OnAgreeProtocolWithCallBack = 1002, --国内英雄BDC完成回调 OnBDCInitCompleteCallBack = 1003, OnBackButtonPressed = 2001, --Tcp异常统计 OnTcpDisconnectReason = 3001, --处理deeplink OnDeeplink = 4001, --自动化测试 PocoMsg = 5001, --timeline GetTimeLineIdsParam = 6001, --获取timelineids参数 SyncNodeTransToGameActor = 6002, --同步节点信息 RecoveryGameActor = 6003, --恢复节点信息 SyncAnimationToGameActor = 6004, --同步主角动画 GetHeroBlackRoomAnimPath = 6005, --小黑屋动画路径 --PC包 OnScanQrcodeSuccess = 10001, --扫码成功 OnScreenResolutionChanged = 10002, OnLaunchBarcodeScanner = 10003, --海外扫码回调 OnOpenQrCodeError = 10004, --打开二维码失败 BeginShowUncompressProgress = 10005, FinishUncompressInternal = 10006, --c#调用cheat函数 OnHandleCheatFunc = 20001, --派发主城事件 OnDispatchHomeMainEvent = 20002, } LuaFuncEntry.FuncType = FuncType function LuaFuncEntry.Startup() CSExt.SetMainEntryFunc(private.MainEntryFunc, FuncType) private.mainEntryFuncTable = {} private.InitMainEntryFuncTable() end function LuaFuncEntry.Shutdown() CSExt.SetMainEntryFunc(nil, nil) end --设置mainEntryFunc:注册/注销 local select = select function LuaFuncEntry.SetupMainEntryFunc(isRegist, ...) local count = select('#',...) for i = 1, count ,2 do local funcType = select(i,...) local func = select(i+1,...) if isRegist then private.mainEntryFuncTable[funcType] = func else private.mainEntryFuncTable[funcType] = nil end end end function private.RegistMainEntryFunc(funcType, func) private.mainEntryFuncTable[funcType] = func end -- 注册MainEntryFunc function private.InitMainEntryFuncTable() private.RegistMainEntryFunc(FuncType.OnPayFailed,private.OnTokenFail) private.RegistMainEntryFunc(FuncType.ShowGameQuit,function(...)LuaInputManager.ShowExitGameMessageBox()end) private.RegistMainEntryFunc(FuncType.OnNetConnectionSuccess, private.OnNetConnectionSuccess) private.RegistMainEntryFunc(FuncType.LocalizationSetParamOrderData,function(...) Localization.SetParamOrderData(...) end) private.RegistMainEntryFunc(FuncType.FuncType_SkuDetail, private.OnGetSkuDetail) private.RegistMainEntryFunc(FuncType.OnTimelineStart,function(...) if not NetManager.IsLaunch() then return SystemManager.OnTimelineStart(...) end return false end) private.RegistMainEntryFunc(FuncType.OnTimelineFinish,function(...) if not NetManager.IsLaunch() then SystemManager.OnTimelineFinish(...) end return false end) private.RegistMainEntryFunc(FuncType.OnPreloadAssetsCompleted,function(...) ExpLevelManager.OnPreloadAssetsCompleted(...) end) private.RegistMainEntryFunc(FuncType.OnHrefClick, private.OnHrefClick) private.RegistMainEntryFunc(FuncType.OnBIEvent,function(...) BIManager.SendWithEncode(...) end) private.RegistMainEntryFunc(FuncType.OnBIEventHotfixDownload,function(...) BIManager.SendDownloadEvent(...) end) private.RegistMainEntryFunc(FuncType.OnBIEventBDC,function(...) private.SendBDCSdkLoginState(...) end) private.RegistMainEntryFunc(FuncType.OnBIEventServerBDC,function(...) BIManager.SendBDCServerEvent(...) end) private.RegistMainEntryFunc(FuncType.PingPongTimeout,function(...) NetManager.OnPingPongTimeout(...) end) private.RegistMainEntryFunc(FuncType.OnReceiveLuaMsg,function(...) NetManager.OnMessageResp(...) end) private.RegistMainEntryFunc(FuncType.OnReceiveLuaMsgTimeout,function(...) NetManager.OnMsgTimeOutResp(...) end) private.RegistMainEntryFunc(FuncType.NetConnectedTick,function(...) NetManager.OnNetConnectedTick(...) end) private.RegistMainEntryFunc(FuncType.OnPaySuccess, private.OnPaySuccess) private.RegistMainEntryFunc(FuncType.OnPayResult, private.OnPayResult) private.RegistMainEntryFunc(FuncType.OnOpenGiftExchangeCompeletion, private.OnOpenGiftExchangeCompeletion) private.RegistMainEntryFunc(FuncType.OnAgreeProtocolWithCallBack,function(...) end) --国内iOS点击隐私协议统一回调,暂不接入 private.RegistMainEntryFunc(FuncType.OnBDCInitCompleteCallBack,function(...) if UNITY_IOS then logging.crit(LTAG.CRIT, "OnBDCInitCompleteCallBack", ...) BIManager.DispatchBIClientEvent(BIManager.EventName.BDC_GameLaunch) BIManager.DispatchBIClientEvent(BIManager.EventName.BDC_GameFirstPage) end end) private.RegistMainEntryFunc(FuncType.OnOrientationChange,function(...) UIManager.OnOrientationChange(...) end) private.RegistMainEntryFunc(FuncType.OnBackButtonPressed, private.OnBackButtonPressed) private.RegistMainEntryFunc(FuncType.OnClickScreen, private.OnClickScreen) private.RegistMainEntryFunc(FuncType.OnUploadLogCallBack, private.OnUploadLog) private.RegistMainEntryFunc(FuncType.GetStartLoginData,function(...) return private.GetStartLoginData() end) private.RegistMainEntryFunc(FuncType.GetTimeLineIdsParam, private.OnGetTimeLineIdsParam) private.RegistMainEntryFunc(FuncType.SyncNodeTransToGameActor, private.OnSyncNodeTransToGameActor) private.RegistMainEntryFunc(FuncType.RecoveryGameActor, private.OnRecoveryGameActor) private.RegistMainEntryFunc(FuncType.SyncAnimationToGameActor, private.OnSyncAnimationToGameActor) private.RegistMainEntryFunc(FuncType.GetHeroBlackRoomAnimPath, private.OnGetHeroBlackRoomAnimPath) private.RegistMainEntryFunc(FuncType.LowMemoryCallback,function(...) BIManager.OnLowMemoryCallback() end) private.RegistMainEntryFunc(FuncType.OnTcpDisconnectReason,function(...) NetManager.OnTcpDisconnectReason(...) end) private.RegistMainEntryFunc(FuncType.OnNetworkPingCompleted,function(...) EventSystem.Dispatch(EventID.OnNetworkPingCompleted, ...) end) private.RegistMainEntryFunc(FuncType.GetPersistentPlayerData,function(...) local key = ... return PersistentData.PlayerData:Get(key) end) private.RegistMainEntryFunc(FuncType.SetPersistentPlayerData,function(...) local key, value = ... PersistentData.PlayerData:Set(key, value, true) end) private.RegistMainEntryFunc(FuncType.GetPersistentDeviceData,function(...) local key = ... return PersistentData.DeviceData:Get(key) end) private.RegistMainEntryFunc(FuncType.SetPersistentDeviceData,function(...) local key, value = ... PersistentData.DeviceData:Set(key, value, true) end) private.RegistMainEntryFunc(FuncType.OnEntityVisualStateChanged, private.OnEntityVisualStateChanged) private.RegistMainEntryFunc(FuncType.OnLoadUseRegulationsSucc,function(...) private.HandleCBForJP(FuncType.OnLoadUseRegulationsSucc, ...) end) private.RegistMainEntryFunc(FuncType.OnLoadUseRegulationsFailed,function(...) private.HandleCBForJP(FuncType.OnLoadUseRegulationsFailed, ...) end) private.RegistMainEntryFunc(FuncType.OnLoadPrivateRegulationSucc,function(...) private.HandleCBForJP(FuncType.OnLoadPrivateRegulationSucc, ...) end) private.RegistMainEntryFunc(FuncType.OnLoadPrivateRegulationFailed,function(...) private.HandleCBForJP(FuncType.OnLoadPrivateRegulationFailed, ...) end) private.RegistMainEntryFunc(FuncType.OnLoadFundSettlementSucc,function(...) private.HandleCBForJP(FuncType.OnLoadFundSettlementSucc, ...) end) private.RegistMainEntryFunc(FuncType.OnLoadFundSettlementFailed,function(...) private.HandleCBForJP(FuncType.OnLoadFundSettlementFailed, ...) end) private.RegistMainEntryFunc(FuncType.OnLoadCommodityTradingSucc,function(...) private.HandleCBForJP(FuncType.OnLoadCommodityTradingSucc, ...) end) private.RegistMainEntryFunc(FuncType.OnLoadCommodityTradingFailed,function(...) private.HandleCBForJP(FuncType.OnLoadCommodityTradingFailed, ...) end) private.RegistMainEntryFunc(FuncType.OnDeeplink, private.OnDeeplink) private.RegistMainEntryFunc(FuncType.PocoMsg,function(...) return private.HandlePocoMsg(...) end) private.RegistMainEntryFunc(FuncType.PressKeyboard,function(...) LuaInputManager.PressKeyboard(...) end) private.RegistMainEntryFunc(FuncType.ReleaseKeyboard,function(...) LuaInputManager.ReleaseKeyboard(...) end) private.RegistMainEntryFunc(FuncType.GetInstanceAssetAsync,function(...) EventSystem.Dispatch(EventID.GetInstanceAssetAsync, ...) end) private.RegistMainEntryFunc(FuncType.CriticalReport,function(...) BIManager.HandleCriticalReport(...) end) private.RegistMainEntryFunc(FuncType.OnScreenResolutionChanged,function(...) EventSystem.Dispatch(EventID.Refresh_RenderTextureSize) EventSystem.Dispatch(EventID.Game_ScreenResolutionChanged) end) private.RegistMainEntryFunc(FuncType.OnDispatchHomeMainEvent,function(...) EventSystem.Dispatch(...) end) end --用于在Lua和C#之间进行通信的入口接口,参数由C#端按需传入,在这里根据funcType分别处理 function private.MainEntryFunc(funcType, ...) local func = private.mainEntryFuncTable[funcType] if func then return func(...) end end function private.OnEntityVisualStateChanged(rder, toVisual) NotSyncBattleSetter.OnConvertRenderVisual(rder, toVisual) end function private.SendBDCSdkLoginState(bdcKey, loginstatekey, loginstate) BIManager.SendBDCEvent(bdcKey, loginstatekey, loginstate, "event_name", BIManager.EventName.BDC_SDKLogin) end function private.OnClickKickCallback() SDKUtil.OnClickKickCallback() end --token 失效提示 返回登录 function private.OnTokenFail(msg) local tokenInvalidErrorCode = 2110; --token 失效错误码 local bannedUserPaymentErrorCode = 1005; --被封禁用户进行支付时候的提示错误码(只有非NTSDK支付的地区需要) local ids = Const_IDS.IDS_Pay_TokenError if UNITY_IOS then --IOS if tonumber(msg) == tokenInvalidErrorCode then logging.warn(LTAG.WARN , "OnPayFailed token Invalid, call OnLogoutSuccess to relogin") UTL.MessageBox.ShowOnlyOkNoCloseBox(Const_IDS.IDS_WARNING, UIUtils.GetLocalizedTxt(ids), private.OnClickKickCallback) elseif tonumber(msg) == bannedUserPaymentErrorCode then if GameAppInfo.IsChinesePackage() then UTL.MessageBox.ShowOnlyOkNoCloseBox(Const_IDS.IDS_WARNING, UIUtils.GetLocalizedTxt(Const_IDS.IDS_Account_Bans)) end end else --安卓 local content = JSON.decode(msg); if content ~= nil and tonumber(content.code) == tokenInvalidErrorCode then logging.warn(LTAG.WARN , "OnPayFailed token Invalid, call OnLogoutSuccess to relogin") UTL.MessageBox.ShowOnlyOkNoCloseBox(Const_IDS.IDS_WARNING, UIUtils.GetLocalizedTxt(ids), private.OnClickKickCallback) elseif content ~= nil and tonumber(content.code) == bannedUserPaymentErrorCode then if GameAppInfo.IsChinesePackage() then UTL.MessageBox.ShowOnlyOkNoCloseBox(Const_IDS.IDS_WARNING, UIUtils.GetLocalizedTxt(Const_IDS.IDS_Account_Bans)) end end end end function private.OnNetConnectionSuccess(...) NetManager.OnNetConnectionSuccess() MDL.Login.OnConnectionRequest() end function private.OnHrefClick(text) if CTL.ChannelChat then CTL.ChannelChat.OnHrefClick(text) else if string.find( text ,"http") then UnityEngine.Application.OpenURL(text) end end end function private.OnPaySuccess(payInfo) local info = JSON.decode(payInfo) private.SendPaySuccessBI(info.product_id) end function private.SendPaySuccessBI(productId) local eventName = nil for i, v in DataSheetManager.IAP:GetEnumerator() do if v.IapID == productId then eventName = v.BILog break end end if not string.isNilOrEmpty(eventName) then EventSystem.Dispatch(EventID.BI_OnPaySuccess, eventName) end end --现在支付的回调各个端不统一,最终应该统一成这个,目前这个只有PC回调过来 function private.OnPayResult(code, productId) if code == "200" then private.SendPaySuccessBI(productId) elseif code == "-4" then UTL.MessageBox.ShowOnlyOkNoCloseBox(Const_IDS.IDS_WARNING, UIUtils.GetLocalizedTxt(Const_IDS.IDS_Pay_TokenError), private.OnClickKickCallback) end end function private.OnOpenGiftExchangeCompeletion(code) if UNITY_IOS then if code=="2" then logging.crit(LTAG.CRIT, "打开礼包兑换失败", code) UTL.MessageBox.ShowOnlyOkNoCloseBox(Const_IDS.IDS_WARNING, UIUtils.GetLocalizedTxt(Const_IDS.IDS_Pay_TokenError), private.OnClickKickCallback) end end end function private.OnBackButtonPressed() if CTL.WinLogin.IsUsePCNtSdk() then if SDKUtil.IsExistSdkPanle() then return end end -- 新手强制引导,UIHomeMain会被关闭,需要在UIView OnBackButtonPressed方法响应前return if CTL.PlayerGuide and CTL.PlayerGuide.IsForceGuiding() and UIManager.IsViewOpened(Const_UI_Lua.UIEnum.UIPlayerGuideDialogue) then return end -- 在键位设置界面设置的时候,按返回键不应该返回 if MDL.Setting.isEditing then return end EventSystem.Dispatch(EventID.OnBackButtonPressed_Event) UIManager.OnBackButtonPressed() end function private.OnClickScreen(...) if MDL == nil then return end if MDL.Loading.GetIsLoadingState() then return end -- 这里是用控制战斗中是否显示点击特效的代码 -- if BattleDataGetter.IsSyncLevel() or BattleDataGetter.IsStandaloneBattleLevel() then -- return -- end EventSystem.Dispatch(EventID.Base_OnClickScreen, ...) --检测是否登录了sdk if GameAppInfo.IsChinesePackage() then if NetManager.IsLaunch() and not UIManager.IsFocus(Const_UI_Lua.UIEnum.UILoginMain) then return end --判断sdk是否正在登录,否则有空隙,会再次发出请求,导致返回错误码211,重启游戏,会报空指针 --参见国服https://bugly.qq.com/v2/crash-reporting/errors/fa25ceb71b/161011?pid=1# if not SDKUtil.IsHasUserInfo() and not SDKUtil.IsLogging then SDKUtil.AutoLogin() end end end --code = 200 ,表示上传成功 --code = 3003 ,表示上传失败 --code = 3004,表示本地没有可上传的日志 --code = 0,AUTOBUILD_PLATFORM_STANDLONEWINDOWS的情况下表示PC包上传成功 function private.OnUploadLog(code) if GameAppInfo.IsPCPackage() then SettingAPI.SetLogFilePause(false) end if code == "200" then CTL.Tips.AddTipsMsg(Const_IDS.IDS_UploadLog_Success) elseif code == "3003" then CTL.Tips.AddTipsMsg(Const_IDS.IDS_UploadLog_Fail) elseif code == "3004" then CTL.Tips.AddTipsMsg(Const_IDS.IDS_UploadLog_Nodata) end end function private.GetStartLoginData() --这里的数据是跨网络发送到服务器使用的,需要严格保证顺序和格式,编码和换行符都要一致 local sdkChannelUID = SDKUtil.SdkChannelUID if UNITY_IOS and GameAppInfo.IsChinesePackage() then sdkChannelUID = SDKUtil.HeroUserId end local loginData = { SDKUtil.ChannelID, SDKUtil.SytemUniqueID, AppInfo.marketVersion, SDKUtil.DeviceType, SDKUtil.MobileOS, AppInfo.hotfixCodeFromServer, AuxUtil.BIIpAddress, SDKUtil.AdvertisingID, SDKUtil.SystemMemorySize, SDKUtil.AdsJson, SDKUtil.DeviceID, SDKUtil.ProjectID, sdkChannelUID or "", SDKUtil.BDCServerBean, Localization.GetLanguage2Server(), string.format("%s_%s", DEF.LOCAL_HOTFIX_CODE or "", LoginProxy.Get_HotfixVer()), SDKUtil.BDCDeviceId or "", BIManager.GetBIChannelID(), SDKUtil.PlatformType, } if not GameAppInfo.IsPCPackage() and GameAppInfo.IsOverseaPackage() and GameAppInfo.IsVersionGreaterThan110000() then table.insert(loginData, SDKUtil.GetTEDistinctId()) else table.insert(loginData, SystemInfo.deviceUniqueIdentifier) end return table.concat(loginData, "\n") end function private.OnGetTimeLineIdsParam(paramType) if paramType == "1" then --玩家自己的名字 return PlayerInfoManager.PlayerName elseif paramType == "2" then for _, entity in pairs(LogicUpdateManager._entityDic) do if entity.isHero and not entity:IsPlayerSelf() then return BattleDataGetter.GetEntityName(entity) end end end end function private.OnSyncNodeTransToGameActor(paramType, ...) if paramType == 1 then local params = table.pack(...) --设置玩家自己的位置等信息 LogicUpdateManager._curEntity.ExpEntity.RenderEntity:SetTrans(params[1], params[3], params[4], params[5]) LogicUpdateManager._curEntity.ExpEntity.RenderEntity:SetTransY(params[2]) elseif paramType == 2 then local params = table.pack(...) for _, entity in pairs(LogicUpdateManager._entityDic) do if entity.isHero and not entity:IsPlayerSelf() then entity.ExpEntity.RenderEntity:SetTrans(params[1], params[3], params[4], params[5]) entity.ExpEntity.RenderEntity:SetTransY(params[2]) return end end elseif paramType == 3 then LogicUpdateManager._curEntity.ExpEntity:SetActorVisible(...) end end function private.OnRecoveryGameActor(paramType) if paramType == 1 then --设置玩家自己的位置等信息 LogicUpdateManager._curEntity.ExpEntity:ApplyExpTrans() LogicUpdateManager._curEntity.ExpEntity:ApplyExpTransY() elseif paramType == 2 then for _, entity in pairs(LogicUpdateManager._entityDic) do if entity.isHero and not entity:IsPlayerSelf() then entity.ExpEntity:ApplyExpTrans() entity.ExpEntity:ApplyExpTransY() return end end end end function private.OnSyncAnimationToGameActor(animName) LogicUpdateManager._curEntity.ExpEntity:PlayAnimationDirectly(animName) end function private.OnGetHeroBlackRoomAnimPath() local curEntity = LogicUpdateManager._curEntity local heroBlackRoomAnimPath = curEntity._logicInitData._modelData.AnimID if curEntity._logicInitData.HeroAppearanceID and curEntity._logicInitData.HeroAppearanceID>0 then local heroAppearanceData = DataSheetManager.HeroAppearance:GetDataByID(curEntity._logicInitData.HeroAppearanceID) local modelData = DataSheetManager.MonsterModelData:GetDataByID(heroAppearanceData.BattleModel) heroBlackRoomAnimPath = modelData.AnimID end return string.format("Assets/Actor/AnimationSplit/Animation_L/%s/%s_SA_cam.anim", heroBlackRoomAnimPath, heroBlackRoomAnimPath) end function private.HandleCBForJP(funcType, msg) if funcType == FuncType.OnLoadUseRegulationsSucc then private.HandleSuccCBFromJP(msg, 1) elseif funcType == FuncType.OnLoadPrivateRegulationSucc then private.HandleSuccCBFromJP(msg, 2) elseif funcType == FuncType.OnLoadCommodityTradingSucc then private.HandleSuccCBFromJP(msg, 3) elseif funcType == FuncType.OnLoadFundSettlementSucc then private.HandleSuccCBFromJP(msg, 4) else private.HandleFailedCBFromJP() end end function private.HandleSuccCBFromJP(msg, type) UIManager.OpenView(Const_UI_Lua.UIEnum.UIUserLawJP, { callbackMsg = msg, type = type}); end function private.HandleFailedCBFromJP() CTL.Tips.AddTipsMsg(Const_IDS.IDS_JP_LoginAgreement_ContentNotObtained) end function private.OnDeeplink(url) --logging.log(LTAG.LOG, "OnDeeplinkFromCSharp:", url) if string.isNilOrEmpty(url) then return end if NetManager.IsLaunch() then -- 登录阶段缓存,进主城派发 PersistentData.DeviceData:Set(LuaConst.DEEPLINKURLKEY, url, true) else --进游戏后发生的deeplink派发,然后立刻清掉 local key, param = UTL.String.CheckDeeplink(url) EventSystem.Dispatch(EventID.DeepLink_Event, key, param) PersistentData.DeviceData:Remove(LuaConst.DEEPLINKURLKEY,true) end end function private.HandlePocoMsg(...) local p = private.poco if not p then p = require("Tools/PocoAgent") private.poco = p end return p.HandleMsg(...) end function private.OnGetSkuDetail(...) logging.crit(LTAG.CRIT," OnGetSkuDetail ") if GameAppInfo.IsMacPackage() then CTL.Login.OnGetSkuDetail(...) else MDL.Currency.SetSkuDetail(...) end end return LuaFuncEntry