【隐私协议】修改隐私协议的配置方式,查看协议的连接由GM协议配置的母包配置
parent
ab20dc943c
commit
2b74430e61
|
@ -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";
|
||||
Boolean isActive = this.GetConfigInfo(s_isActive).Equals("1");
|
||||
if (isActive)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -121,14 +121,50 @@ namespace GameLogic {
|
|||
/// </summary>
|
||||
private void ProtoClickHandler()
|
||||
{
|
||||
SDK.SDKManager.Instance.OpenWeb("http://www.baidu.com");
|
||||
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()
|
||||
{
|
||||
SDK.SDKManager.Instance.OpenWeb("http://www.baidu.com");
|
||||
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>
|
||||
|
|
|
@ -30,9 +30,7 @@ namespace GameLogic
|
|||
UpdateMsgBox msgBox;
|
||||
|
||||
AssetBundle bundle;
|
||||
|
||||
bool needUserAgree;
|
||||
|
||||
|
||||
void Awake()
|
||||
{
|
||||
msgBox.gameObject.SetActive(false);
|
||||
|
@ -61,10 +59,6 @@ namespace GameLogic
|
|||
else
|
||||
{
|
||||
Hashtable table = MiniJSON.jsonDecode(uwr.downloadHandler.text) as Hashtable;
|
||||
// 判断是否需要用户隐私协议
|
||||
string userAgree = table["UserAgree"] as string;
|
||||
needUserAgree = userAgree == "1";
|
||||
Debug.Log("是否需要用户隐私协议222:" + needUserAgree);
|
||||
// 背景图
|
||||
string bgName = table["UpdatePanelBG"] as string;
|
||||
string texPath = Application.streamingAssetsPath + "/Res/" + bgName + ".png";
|
||||
|
@ -127,7 +121,7 @@ namespace GameLogic
|
|||
private void TryGetUserAgree(Action a)
|
||||
{
|
||||
// 判断是否需要显示用户隐私界面
|
||||
Debug.Log("是否需要用户隐私协议:" + needUserAgree);
|
||||
Boolean needUserAgree = ConfigManager.Instance.IsSettingActive("APP_START_USER_AGREE");
|
||||
if (!needUserAgree)
|
||||
{
|
||||
if (a != null)
|
||||
|
@ -138,7 +132,6 @@ namespace GameLogic
|
|||
}
|
||||
// 判断是否已经同意
|
||||
bool isAgree = PlayerPrefs.GetInt("APP_IsAgreeUser", 0) == 1;
|
||||
Debug.Log("判断是否已经同意:" + isAgree);
|
||||
if (isAgree)
|
||||
{
|
||||
if (a != null)
|
||||
|
|
Loading…
Reference in New Issue