This commit is contained in:
edy
2026-07-08 17:47:04 +08:00
parent 8ab9226e89
commit 24bd71052e
13 changed files with 30892 additions and 39577 deletions
+72 -53
View File
@@ -9,7 +9,7 @@ using Newtonsoft.Json;
using BingoBrain;
using System.Linq;
using System.Text;
using DontConfuse;
namespace BingoBrain
{
public class ConfigSystem_sdk
@@ -83,23 +83,6 @@ namespace BingoBrain
AppDispatcher.Instance.Dispatch(CsjInfoC.LoginInit);
GameHelper.PostFunnelLogin("loadFinish");
}
// else //没有就从StreamingAssets读取
// {
// var path = $"{Application.streamingAssetsPath}/Config/{configFileName}.txt";
// #if UNITY_IOS
// path = "file://" + path;
// #endif
// // Debug.Log($"[UNITY] Load config from streaming asset: {path}");
// IsfvKit.StartCoroutine(CachKit.GetTextFromUrl(path, configFileName, content =>
// {
// ParseConfig(content);
// // UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.NetLoadingUI_Close);
// AppDispatcher.Instance.Dispatch(CsjInfoC.LoginInit);
// GameHelper.PostFunnelLogin("loadFinish");
// }, configFileSavePath));
// }
}
private void ParseConfig(string json)
@@ -114,50 +97,86 @@ namespace BingoBrain
{
json = Encoding.UTF8.GetString(Base64Kit_sdk.Decrypt(Encoding.UTF8.GetBytes(json),
"com.matchgame.captaindicedubloons"));
// json = Base64Kit.Decode(json, "com.matchgame.captaindicedubloons");
}
Debug.Log("转化后的json" + json);
SetConfig(json);
if (true)
{
SdkManager.Instance.RefreshUrl();
}
// CtrlDispatcher.Instance.Dispatch(CtrlMsg.Game_StartBefore);
Debug.Log(LoginModel_sdk.Instance.reg_time);
Debug.Log(GetRegisteredCalendarDaysByUTC(LoginModel_sdk.Instance.reg_time));
int reg_days = GetRegisteredCalendarDaysByUTC(LoginModel_sdk.Instance.reg_time);
bool open_dark_wv = true;
if (SDKConfig.h6Conf.switchCondition != null)
{
for (int i = 0; i < SDKConfig.h6Conf.switchCondition.retentionConf.Count; i++)
{
if ((reg_days >= SDKConfig.h6Conf.switchCondition.retentionConf[i].days.min) &&
(reg_days <= SDKConfig.h6Conf.switchCondition.retentionConf[i].days.max))
{
if (UnityEngine.Random.Range(0, 100) >= SDKConfig.h6Conf.switchCondition.retentionConf[i].prob)
{
open_dark_wv = false;
}
break;
}
}
}
Debug.Log(open_dark_wv);
if (open_dark_wv)
{
SdkManager.Instance.OpenWv();
// int flyswitch = ConfigSystem.GetConfig<CommonModel>().flyswitch;
// int propswitch = ConfigSystem.GetConfig<CommonModel>().propswitch;
// float top_offset = 150;//fgui中的顶部信息的高度
// float buttom_offset = 0;
// if (Screen.safeArea.y != 0)
// {//刘海屏
// top_offset += Screen.safeArea.y;
// }
// SdkManager.Instance.setFlyBtnTag(flyswitch == 1);
// SdkManager.Instance.setRewardBtnTag(propswitch == 1);
// SdkManager.Instance.SetBtn(ConfigSystem.GetConfig<CommonModel>().propCoord[0], ConfigSystem.GetConfig<CommonModel>().propCoord[1], 60, 60);
// SdkManager.Instance.SetPadding(0, top_offset / GRoot.inst.height, 0, buttom_offset / GRoot.inst.height);
SdkManager.Instance.SetDarkThough(true);
SdkManager.Instance.ShowH5View(false);
SdkManager.Instance.RefreshUrl();
}
}
public int GetRegisteredCalendarDaysByUTC(long regTimeTimestamp)
{
// 1. 转换为 0时区 的日期部分(抹去具体时分秒,变成 00:00:00)
DateTime regDateUtc = DateTimeOffset.FromUnixTimeSeconds(regTimeTimestamp).UtcDateTime.Date;
// 2. 获取当前 0时区 的日期部分
DateTime nowDateUtc = DateTimeOffset.UtcNow.UtcDateTime.Date;
// 3. 两个 0时区的日期直接相减
TimeSpan difference = nowDateUtc - regDateUtc;
int days = difference.Days;
return days < 0 ? 0 : days;
}
public RootObject SDKConfig;
private void SetConfig(string json_)
{
SDKConfig = JsonConvert.DeserializeObject<RootObject>(json_);
// for (int i = 0; i < SDKConfig.h5Conf.links.Count; i++)
// {
// light_weblist.Add(data_new[i]);
// }
// List<int> type_list = new List<int>();
// for (int i = 0; i < SDKConfig.h6Conf.layerConfList.Count; i++)
// {
// dark_weblist.Add(data_new[i]);
// if (!type_list.Contains(data_new[i].wvType))
// {
// web_through_str += data_new[i].wvthrough;
// web_through_str += "|";
// type_list.Add(data_new[i].wvType);
// }
// }
// web_through_str.Remove(web_through_str.Length - 1);
for (int i = 0; i < SDKConfig.h5Conf.links.Count; i++)
{
if (SDKConfig.h5Conf.links[i].maxF5Times < 0)
{
SDKConfig.h5Conf.links[i].maxF5Times = 99999;
}
}
for (int i = 0; i < SDKConfig.h6Conf.layerConfList.Count; i++)
{
for (int j = 0; j < SDKConfig.h6Conf.layerConfList[i].links.Count; j++)
{
if (SDKConfig.h6Conf.layerConfList[i].links[j].maxF5Times < 0)
{
SDKConfig.h6Conf.layerConfList[i].links[j].maxF5Times = 99999;
}
}
}
}