【防沉迷】修复切服不生效,添加防沉迷登录提示
parent
1dd4e984cb
commit
45ddf4e09e
|
@ -33,7 +33,7 @@ end
|
|||
-- 获取包名
|
||||
function PackageManager.GetPackageID()
|
||||
-- 优先使用sdk自带的
|
||||
if LoginManager.SdkSubChannel then
|
||||
if LoginManager.SdkSubChannel and LoginManager.SdkSubChannel ~= "" then
|
||||
return LoginManager.SdkSubChannel
|
||||
end
|
||||
-- 否则使用配置的
|
||||
|
|
|
@ -44,25 +44,32 @@ function this.Initialize()
|
|||
AppConst.SdkChannel = result[5] or ""
|
||||
this.extData = result[6] or ""
|
||||
this.p_appId = result[7] or ""
|
||||
this.SdkSubChannel = result[8]
|
||||
this.SdkSubChannel = result[8] or ""
|
||||
AppConst.SdkPackageName = AndroidDeviceInfo.Instance:GetPackageName()
|
||||
end
|
||||
-- 判断是否是注册并登录
|
||||
if this.isRegister then
|
||||
this.isRegister = false
|
||||
-- 触发创建账户的事件
|
||||
this.TrackCreateAccount()
|
||||
-- 发送登录成功事件
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.LoginSuccess.OnLoginSuccess,result[1])
|
||||
else
|
||||
this.CheckIsRegister(AppConst.OpenId, function(isRegister)
|
||||
if isRegister then
|
||||
-- 触发创建账户的事件
|
||||
this.TrackCreateAccount()
|
||||
end
|
||||
-- 判断是否是注册并登录
|
||||
if this.isRegister then
|
||||
this.isRegister = false
|
||||
-- 触发创建账户的事件
|
||||
this.TrackCreateAccount()
|
||||
-- 发送登录成功事件
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.LoginSuccess.OnLoginSuccess,result[1])
|
||||
end)
|
||||
else
|
||||
this.CheckIsRegister(AppConst.OpenId, function(isRegister)
|
||||
if isRegister then
|
||||
-- 触发创建账户的事件
|
||||
this.TrackCreateAccount()
|
||||
end
|
||||
-- 发送登录成功事件
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.LoginSuccess.OnLoginSuccess,result[1])
|
||||
end)
|
||||
end
|
||||
else
|
||||
local errCode = result[2]
|
||||
if not errCode then
|
||||
PopupTipPanel.ShowTip("登录失败")
|
||||
elseif errCode == "101" then
|
||||
MsgPanel.ShowOne("根据国家防沉迷相关规定,我们将不再向未成年人提供服务,敬请谅解!")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue