Merge branch '0功能/用户隐私协议' into china/dev
commit
20b685f694
|
@ -188,5 +188,39 @@ namespace GameLogic
|
|||
string v = NetInfo.GetInfo(key);
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
// 判断设置是否激活
|
||||
public Boolean IsSettingActive(string settingType)
|
||||
{
|
||||
string s_isActive = "Setting." + settingType + ".isActive";
|
||||
string s_versionCode = "Setting." + settingType + ".versionCode";
|
||||
string isActive = this.GetConfigInfo(s_isActive);
|
||||
if (isActive != null && isActive.Equals("1"))
|
||||
{
|
||||
if (!AppConst.isSDK)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
int vc = AndroidDeviceInfo.Instance.GetVersionCode();
|
||||
if (vc >= Convert.ToInt32(this.GetConfigInfo(s_versionCode)))
|
||||
{
|
||||
//符合包版本
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public string GetSettingValue(string settingType)
|
||||
{
|
||||
if (this.IsSettingActive(settingType))
|
||||
{
|
||||
string s_value = "Setting." + settingType + ".value";
|
||||
string value = this.GetConfigInfo(s_value);
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -45,6 +45,16 @@ namespace GameLogic {
|
|||
[SerializeField]
|
||||
Text msg;
|
||||
/// <summary>
|
||||
/// 消息
|
||||
/// </summary>
|
||||
[SerializeField]
|
||||
GameObject proto;
|
||||
/// <summary>
|
||||
/// 消息
|
||||
/// </summary>
|
||||
[SerializeField]
|
||||
GameObject grant;
|
||||
/// <summary>
|
||||
/// title
|
||||
/// </summary>
|
||||
[SerializeField]
|
||||
|
@ -53,11 +63,30 @@ namespace GameLogic {
|
|||
/// 点击回调
|
||||
/// </summary>
|
||||
UnityAction<int> action;
|
||||
/// <summary>
|
||||
/// 隐私协议按钮
|
||||
/// </summary>
|
||||
[SerializeField]
|
||||
Button[] protoButton;
|
||||
[SerializeField]
|
||||
Button[] privateButton;
|
||||
|
||||
|
||||
protected void Awake()
|
||||
{
|
||||
buttonL.onClick.AddListener(LClickHandler);
|
||||
buttonR.onClick.AddListener(RClickHandler);
|
||||
buttonC.onClick.AddListener(CClickHandler);
|
||||
|
||||
foreach(Button b in protoButton)
|
||||
{
|
||||
b.onClick.AddListener(ProtoClickHandler);
|
||||
}
|
||||
foreach (Button b in privateButton)
|
||||
{
|
||||
b.onClick.AddListener(PrivateClickHandler);
|
||||
}
|
||||
|
||||
title.text = SLanguageMoreLanguageMgr.Instance.GetLanguageChValBykey(more_language.TIPS);
|
||||
}
|
||||
|
||||
|
@ -87,6 +116,56 @@ namespace GameLogic {
|
|||
{
|
||||
CallBack(2);
|
||||
}
|
||||
/// <summary>
|
||||
/// 用户隐私协议按钮点击事件
|
||||
/// </summary>
|
||||
private void ProtoClickHandler()
|
||||
{
|
||||
string UserChannel = ConfigManager.Instance.GetSettingValue("USER_CHANNEL");
|
||||
string Channel = VersionManager.Instance.GetVersionInfo("channel");
|
||||
string serverUrl = VersionManager.Instance.GetVersionInfo("serverUrl");
|
||||
string ChannelID = UserChannel != null ? UserChannel : Channel;
|
||||
string url = serverUrl + "jl_loginserver/getAgreement?gamePack=" + ChannelID;
|
||||
NetworkManager.Instance.SendGetHttp(url, null, (string json) =>
|
||||
{
|
||||
Hashtable info = MiniJSON.jsonDecode(json) as Hashtable;
|
||||
Hashtable parms = info["parms"] as Hashtable;
|
||||
string instructions = parms["instructions"] as string;
|
||||
if (ConfigManager.Instance.IsSettingActive("INNER_WEB_CONTROL"))
|
||||
{
|
||||
SDK.SDKManager.Instance.OpenWeb(instructions);
|
||||
}
|
||||
else
|
||||
{
|
||||
Application.OpenURL(url);
|
||||
}
|
||||
}, null, null);
|
||||
}
|
||||
/// <summary>
|
||||
/// 用户隐私协议按钮点击事件
|
||||
/// </summary>
|
||||
private void PrivateClickHandler()
|
||||
{
|
||||
string UserChannel = ConfigManager.Instance.GetSettingValue("USER_CHANNEL");
|
||||
string Channel = VersionManager.Instance.GetVersionInfo("channel");
|
||||
string serverUrl = VersionManager.Instance.GetVersionInfo("serverUrl");
|
||||
string ChannelID = UserChannel != null ? UserChannel : Channel;
|
||||
string url = serverUrl + "jl_loginserver/getAgreement?gamePack=" + ChannelID;
|
||||
NetworkManager.Instance.SendGetHttp(url, null, (string json) =>
|
||||
{
|
||||
Hashtable info = MiniJSON.jsonDecode(json) as Hashtable;
|
||||
Hashtable parms = info["parms"] as Hashtable;
|
||||
string privacy = parms["privacy"] as string;
|
||||
if (ConfigManager.Instance.IsSettingActive("INNER_WEB_CONTROL"))
|
||||
{
|
||||
SDK.SDKManager.Instance.OpenWeb(privacy);
|
||||
}
|
||||
else
|
||||
{
|
||||
Application.OpenURL(url);
|
||||
}
|
||||
}, null, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 回调
|
||||
|
@ -110,6 +189,9 @@ namespace GameLogic {
|
|||
public void Show(string strL, string strR, string msg, UnityAction<int> action)
|
||||
{
|
||||
this.gameObject.SetActive(true);
|
||||
this.msg.gameObject.SetActive(true);
|
||||
this.proto.gameObject.SetActive(false);
|
||||
this.grant.gameObject.SetActive(false);
|
||||
this.buttonL.gameObject.SetActive(true);
|
||||
this.buttonR.gameObject.SetActive(true);
|
||||
this.buttonC.gameObject.SetActive(false);
|
||||
|
@ -128,6 +210,9 @@ namespace GameLogic {
|
|||
public void Show(string strc, string msg, UnityAction<int> action)
|
||||
{
|
||||
this.gameObject.SetActive(true);
|
||||
this.msg.gameObject.SetActive(true);
|
||||
this.proto.gameObject.SetActive(false);
|
||||
this.grant.gameObject.SetActive(false);
|
||||
this.buttonL.gameObject.SetActive(false);
|
||||
this.buttonR.gameObject.SetActive(false);
|
||||
this.buttonC.gameObject.SetActive(true);
|
||||
|
@ -146,11 +231,58 @@ namespace GameLogic {
|
|||
public void Show(string msg)
|
||||
{
|
||||
this.gameObject.SetActive(true);
|
||||
this.msg.gameObject.SetActive(true);
|
||||
this.proto.gameObject.SetActive(false);
|
||||
this.grant.gameObject.SetActive(false);
|
||||
this.buttonL.gameObject.SetActive(false);
|
||||
this.buttonR.gameObject.SetActive(false);
|
||||
this.buttonC.gameObject.SetActive(false);
|
||||
this.msg.text = msg;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 显示用户隐私协议
|
||||
/// </summary>
|
||||
/// <param name="strL"></param>
|
||||
/// <param name="strR"></param>
|
||||
/// <param name="msg"></param>
|
||||
public void ShowProto(string strL, string strR, string msg, UnityAction<int> action)
|
||||
{
|
||||
this.gameObject.SetActive(true);
|
||||
this.msg.gameObject.SetActive(false);
|
||||
this.proto.gameObject.SetActive(true);
|
||||
this.grant.gameObject.SetActive(false);
|
||||
this.buttonL.gameObject.SetActive(true);
|
||||
this.buttonR.gameObject.SetActive(true);
|
||||
this.buttonC.gameObject.SetActive(false);
|
||||
this.buttonLText.text = strL;
|
||||
this.buttonRText.text = strR;
|
||||
this.action = action;
|
||||
//设置显示内容
|
||||
this.proto.GetComponent<Text>().text = msg;
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示权限申请
|
||||
/// </summary>
|
||||
/// <param name="strL"></param>
|
||||
/// <param name="strR"></param>
|
||||
/// <param name="msg"></param>
|
||||
public void ShowGrant(string strC, string msg, UnityAction<int> action)
|
||||
{
|
||||
this.gameObject.SetActive(true);
|
||||
this.msg.gameObject.SetActive(false);
|
||||
this.proto.gameObject.SetActive(false);
|
||||
this.grant.gameObject.SetActive(true);
|
||||
this.buttonL.gameObject.SetActive(false);
|
||||
this.buttonR.gameObject.SetActive(false);
|
||||
this.buttonC.gameObject.SetActive(true);
|
||||
this.buttonCText.text = strC;
|
||||
this.action = action;
|
||||
//设置显示内容
|
||||
this.grant.transform.Find("Scroll View/Viewport/Text").GetComponent<Text>().text = msg;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,11 +30,12 @@ namespace GameLogic
|
|||
UpdateMsgBox msgBox;
|
||||
|
||||
AssetBundle bundle;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
msgBox.gameObject.SetActive(false);
|
||||
//StartCoroutine(GetGameConfig());
|
||||
BeginUpdatePlatform();
|
||||
//BeginUpdatePlatform();
|
||||
}
|
||||
|
||||
public IEnumerator LoadFromStream(Action<Sprite> act)
|
||||
|
@ -58,6 +59,7 @@ namespace GameLogic
|
|||
else
|
||||
{
|
||||
Hashtable table = MiniJSON.jsonDecode(uwr.downloadHandler.text) as Hashtable;
|
||||
// 背景图
|
||||
string bgName = table["UpdatePanelBG"] as string;
|
||||
string texPath = Application.streamingAssetsPath + "/Res/" + bgName + ".png";
|
||||
#if UNITY_IOS
|
||||
|
@ -104,8 +106,85 @@ namespace GameLogic
|
|||
img.color = new Color(1f, 1f, 1f, 1f);
|
||||
go.SetActive(true);
|
||||
go2.SetActive(true);
|
||||
|
||||
|
||||
// 用户隐私协议
|
||||
TryGetUserAgree(() =>
|
||||
{
|
||||
BeginUpdatePlatform();
|
||||
});
|
||||
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
private void TryGetUserAgree(Action a)
|
||||
{
|
||||
// 判断是否需要显示用户隐私界面
|
||||
Boolean needUserAgree = ConfigManager.Instance.IsSettingActive("APP_START_USER_AGREE");
|
||||
if (!needUserAgree)
|
||||
{
|
||||
if (a != null)
|
||||
{
|
||||
a();
|
||||
}
|
||||
return;
|
||||
}
|
||||
// 判断是否已经同意
|
||||
bool isAgree = PlayerPrefs.GetInt("APP_IsAgreeUser", 0) == 1;
|
||||
if (isAgree)
|
||||
{
|
||||
if (a != null)
|
||||
{
|
||||
a();
|
||||
}
|
||||
return;
|
||||
}
|
||||
// 没同意则弹窗提示
|
||||
string proto = "在您使用我们(猕猴桃)的服务前,请您务必审慎阅读、" +
|
||||
"充分理解<color=#00A7FF>猕猴桃用户协议</color>和<color=#00A7FF>猕猴桃隐私政策</color>的各条款。" +
|
||||
"<color=#FFFAD4><b>同时,您应特别注意前述协议中免除或者限制我们责任的条款、对您权利进行限制的、约定争议解决方式和司法管辖的条款。" +
|
||||
"</b></color>如您已经详细阅读并同意<color=#00A7FF>猕猴桃用户协议</color>和<color=#00A7FF>猕猴桃隐私政策</color>," +
|
||||
"请点击“同意”开始使用我们的服务。";
|
||||
msgBox.ShowProto("不同意", "同意", proto, (r1) =>
|
||||
{
|
||||
if (r1 == 1)
|
||||
{
|
||||
string grant = "为确保您的游戏体验,我们将在您使用我们的服务过程中申请以下权限,届时您可以选择同意或者拒绝开启相关权限,若是拒绝则会影响部分功能:" +
|
||||
"\n\n" +
|
||||
"<b> 储存权限 </b>" +
|
||||
"我们访问您的储存权限是为了向您提供游戏截图保存功能" +
|
||||
"\n\n" +
|
||||
"<b> 电话权限 </b>" +
|
||||
"我们访问您的电话权限是为了分析游戏的运行状态,优化游戏体验";
|
||||
|
||||
msgBox.ShowGrant("确定", grant,(result) =>
|
||||
{
|
||||
PlayerPrefs.SetInt("APP_IsAgreeUser", 1);
|
||||
if (a != null)
|
||||
{
|
||||
a();
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
msgBox.Show("退出游戏", "查看协议", "需要同意本隐私权政策才能继续游戏,若仍不同意本隐私权政策,很遗憾我们将无法为您提供服务。", (r2) =>
|
||||
{
|
||||
if (r2 == 1)
|
||||
{
|
||||
TryGetUserAgree(a);
|
||||
}
|
||||
else
|
||||
{
|
||||
Application.Quit();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
string updatePanelBg = ConfigManager.Instance.GetConfigInfo("Setting.UPDATE_PANEL_BG.value");
|
||||
|
@ -118,21 +197,21 @@ namespace GameLogic
|
|||
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Escape))
|
||||
{
|
||||
if(AppConst.isSDK && App.SDKMgr.IsSupportExit())
|
||||
{
|
||||
App.SDKMgr.ExitGame();
|
||||
}
|
||||
else
|
||||
{
|
||||
msgBox.Show(SLanguageMoreLanguageMgr.Instance.GetLanguageChValBykey(more_language.CANEL), SLanguageMoreLanguageMgr.Instance.GetLanguageChValBykey(more_language.CONFIRM), SLanguageMoreLanguageMgr.Instance.GetLanguageChValBykey(more_language.CONFIRM_CLOSE), (result) =>
|
||||
{
|
||||
if (result == 1)
|
||||
Application.Quit();
|
||||
});
|
||||
}
|
||||
}
|
||||
//if (Input.GetKeyDown(KeyCode.Escape))
|
||||
//{
|
||||
// if(AppConst.isSDK && App.SDKMgr.IsSupportExit())
|
||||
// {
|
||||
// App.SDKMgr.ExitGame();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// msgBox.Show(SLanguageMoreLanguageMgr.Instance.GetLanguageChValBykey(more_language.CANEL), SLanguageMoreLanguageMgr.Instance.GetLanguageChValBykey(more_language.CONFIRM), SLanguageMoreLanguageMgr.Instance.GetLanguageChValBykey(more_language.CONFIRM_CLOSE), (result) =>
|
||||
// {
|
||||
// if (result == 1)
|
||||
// Application.Quit();
|
||||
// });
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
// void Start()
|
||||
|
|
Loading…
Reference in New Issue