static void Init() { s_versionConfig = (Dictionary <string, object>)FrameWork.Json.Deserialize(ReadVersionContent()); s_hotUpdateConfig = ConfigManager.GetData(c_HotUpdateConfigName); string downLoadServicePath = null; bool isTest = s_hotUpdateConfig[c_UseTestDownLoadPathKey].GetBool(); //获取下载地址 if (SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_UpdateDownLoadPath, "") != "") { downLoadServicePath = SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_UpdateDownLoadPath, ""); } else { if (isTest) { downLoadServicePath = s_hotUpdateConfig[c_testDownLoadPathKey].GetString(); } else { downLoadServicePath = s_hotUpdateConfig[c_downLoadPathKey].GetString(); } } string downLoadPath = downLoadServicePath + "/" + platform + "/" + Application.version + "/"; s_versionFileDownLoadPath = downLoadPath + c_versionFileName.ToLower(); s_ManifestFileDownLoadPath = downLoadPath + AssetsManifestManager.c_ManifestFileName; s_resourcesFileDownLoadPath = downLoadPath; Debug.Log("=====>" + s_versionFileDownLoadPath); }
/// <summary> /// 检测实名总开关 /// </summary> private void TestRealNameSwitch() { string l_openRealName = SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_OpenRealName, "false"); openRealName = (l_openRealName == "true"); //重打包工具控制总开关 //上报服务器 }
/// <summary> /// 检查是否要直接登录,如果是那就直接登录(默认选择筛选后的第0个登录) /// </summary> /// <param name="datas">返回可登录选项</param> /// <returns></returns> public static bool CheckAutoLoginOrGetLoginPlatforms(out List <LoginConfigData> datas) { datas = new List <LoginConfigData>(); List <LoginConfigData> allConfigs = DataGenerateManager <LoginConfigData> .GetAllDataList(); string sdkStr = SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_LoginPlatform, ""); if (!string.IsNullOrEmpty(sdkStr)) { string[] arrStr = sdkStr.Split('|'); foreach (var item in arrStr) { LoginConfigData con = DataGenerateManager <LoginConfigData> .GetData(item); if (con != null) { datas.Add(con); } else { Debug.LogError("获取登录配置失败:" + item); } } } else { //Debug.LogError("获取登录配置失败:" + item); foreach (var d in allConfigs) { List <string> platforms = null; if (d.m_SupportPlatform == null) { platforms = new List <string>(); } else { platforms = new List <string>(d.m_SupportPlatform); } if (d.m_UseItem || platforms.Contains(Application.platform.ToString())) { datas.Add(d); } } } string directlyLoginStr = SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_DirectlyLogin, "false"); bool directlyLogin = bool.Parse(directlyLoginStr); if (directlyLogin) { LoginConfigData d = datas[0]; Login(d.m_loginName, "", "", d.m_CustomInfo); return(true); } return(false); }
static void GetURI() { URL = URLManager.GetURL(SDKInterfaceDefine.PropertiesKey_SelectServerURL); if (!string.IsNullOrEmpty(SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_SelectServerURL, null))) { URL = SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_SelectServerURL, null); } }
public override void Init() { if ((StoreName)Enum.Parse(typeof(StoreName), SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_StoreName, "None")) == StoreName.m4399) { Debug.Log("=========4399 PayClass Init==========="); StorePayController.OnPayCallBack += OnPayResultCallBack; } }
public override void Init() { if ((StoreName)Enum.Parse(typeof(StoreName), SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_StoreName, "None")) == StoreName.UC) { Debug.Log("=========UC PayClass Init==========="); GlobalEvent.AddTypeEvent <PrePay2Client>(OnPrePay); StorePayController.OnPayCallBack += OnPayResultCallBack; } }
public override void Init() { Debug.LogWarning("=========vivoPayClass Init==========="); //SDKManagerNew.OnPayCallBack += SetPayResult; GlobalEvent.AddTypeEvent <PrePay2Client>(OnPrePay); appid = SDKManager.GetProperties("vivo", "AppID", appid); mchID = SDKManager.GetProperties("vivo", "MchID", mchID); appSecret = SDKManager.GetProperties("vivo", "AppSecret", appSecret); }
public void StartSelectServer(GameServerAreaData gameServerArea) { Debug.Log("开始选服"); if (ApplicationManager.Instance.m_AppMode == AppMode.Release) { RuntimePlatform platform = Application.platform; //if (Application.isEditor) //{ // if (platform == RuntimePlatform.OSXEditor) // platform = RuntimePlatform.IPhonePlayer; // else // { // platform = RuntimePlatform.Android; // } //} string defaultChannel = "GameCenter"; string channel = SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_ChannelName, defaultChannel); GameInfoCollecter.AddNetworkStateInfoValue("渠道", channel); string selectNetworkPath = gameServerArea.m_SelectServerURL; SelectSeverController.Start(selectNetworkPath, Application.version, platform, channel, (data) => { SelectNetworkData select = null; bool isSelectRight = false; if (data == null || data.Count == 0) { Debug.LogError("没有合适的服务器!"); //return; string networkID = SDKManager.GetProperties("NetworkID", "3"); select = DataGenerateManager <SelectNetworkData> .GetData(networkID); } else { int r = UnityEngine.Random.Range(0, data.Count); select = data[r]; isSelectRight = true; } GameInfoCollecter.AddNetworkStateInfoValue("是否正确匹配服务器", isSelectRight); GameInfoCollecter.AddNetworkStateInfoValue("匹配服务器", select.m_serverIP + ":" + select.m_port); GameInfoCollecter.AddNetworkStateInfoValue("服务器描述", select.m_description); SelectServerCompleted(select); }); } else { if (OnSelectServerLocal != null) { OnSelectServerLocal(SelectServerCompleted); } } }
public override void Init() { m_SDKName = StoreName.IAppPay.ToString(); Debug.LogWarning("=========IAppPayClass Init==========="); //SDKManagerNew.OnPayCallBack += SetPayResult; GlobalEvent.AddTypeEvent <PrePay2Client>(OnPrePay); appid = SDKManager.GetProperties(StoreName.IAppPay.ToString(), "AppID", appid); mchID = SDKManager.GetProperties(StoreName.IAppPay.ToString(), "MchID", mchID); appSecret = SDKManager.GetProperties(StoreName.IAppPay.ToString(), "AppSecret", appSecret); }
public override void Init() { if ((StoreName)Enum.Parse(typeof(StoreName), SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_StoreName, "None")) == StoreName.VIVO) { Debug.LogWarning("=========vivoPayClass Init==========="); //SDKManagerNew.OnPayCallBack += SetPayResult; GlobalEvent.AddTypeEvent <PrePay2Client>(OnPrePay); appid = SDKManager.GetProperties("vivo", "AppID", appid); mchID = SDKManager.GetProperties("vivo", "MchID", mchID); appSecret = SDKManager.GetProperties("vivo", "AppSecret", appSecret); } }
private void GetHotUpdatePath(List <HotUpdatePathData> datas, string error) { if (!string.IsNullOrEmpty(error)) { Finish("Download HotUpdatePathData failed :" + error); return; } else { string channel = SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_ChannelName, "GameCenter"); Debug.Log("Download HotUpdatePathData count:" + datas.Count); HotUpdatePathData pathData = null; foreach (var d in datas) { if (d.m_key == channel) { pathData = d; break; } } if (pathData == null) { Finish("No Channel in HotUpdatePathData Channel:" + channel); return; } string m_HotupdatePath = pathData.m_HotupdatePath; string testPath = PlayerPrefs.GetString(P_SelectHotUpdateTestPath, ""); if (!string.IsNullOrEmpty(testPath)) { //使用测试地址 m_HotupdatePath = testPath; } Debug.Log("Start hotUpdate in Channel:" + channel + "\nPath:" + m_HotupdatePath); if (ApplicationManager.Instance.UseAssetsBundle) { HotUpdateManager.StartHotUpdate(m_HotupdatePath, ReceviceUpdateStatus); } else { HotUpdateStatusInfo info = new HotUpdateStatusInfo(); info.m_status = HotUpdateStatusEnum.NoUpdate; info.m_loadState = new LoadState(); info.m_loadState.isDone = true; info.m_loadState.progress = 1f; ReceviceUpdateStatus(info); } } }
public static void Pay(string goodID, float price, string goodsName, string currency, string userID) { PayInfo payInfo = new PayInfo(goodID, goodsName, "", FrameWork.SDKManager.GoodsType.NORMAL, "", price, currency, userID); NetworkVerificationImplement.SetBuyResendMessage(new StoreBuyGoods2Server(), true); if (Application.platform == RuntimePlatform.Android) { string sdkName = SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_StoreName, null); SDKManager.Pay(sdkName, payInfo); } else { SDKManager.Pay(payInfo); } }
public void StartSelectServer(GameServerAreaDataGenerate gameServerArea) { Debug.Log("开始选服"); if (ApplicationManager.Instance.m_AppMode == AppMode.Release) { RuntimePlatform platform = Application.platform; if (Application.isEditor) { if (platform == RuntimePlatform.OSXEditor) { platform = RuntimePlatform.IPhonePlayer; } else { platform = RuntimePlatform.Android; } } string channel = SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_ChannelName, "GameCenter"); string selectNetworkPath = gameServerArea.m_SelectServerURL; SelectSeverController.Start(selectNetworkPath, Application.version, platform, channel, (data) => { SelectNetworkData select = null; if (data == null || data.Count == 0) { Debug.LogError("没有合适的服务器!"); //return; string networkID = SDKManager.GetProperties("NetworkID", "3"); select = DataGenerateManager <SelectNetworkData> .GetData(networkID); } else { int r = UnityEngine.Random.Range(0, data.Count); select = data[r]; } SelectServerCompleted(select); }); } else { if (OnSelectServerLocal != null) { OnSelectServerLocal(SelectServerCompleted); } } }
/// <summary> /// 选择支付方式 /// </summary> /// <param name="goodsInfo"></param> private static void SelectPayPlatform(LocalizedGoodsInfo goodsInfo) { if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.WindowsEditor) { List <PayPlatformInfo> allPayPlatformInfos = SDKManager.GetAllPayPlatformInfos(); //无支付方式- 错误 if (allPayPlatformInfos.Count == 0) { OnVerificationResultCallBack(new PayResult(-9, goodsInfo.goodsID, "No Pay Platform")); Debug.LogError("SelectPayPlatform error: no Pay Platform ->" + SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_StoreName, "--")); } else if (allPayPlatformInfos.Count == 1) { //单一支付方式,直接调用 OnOnSelectPayPlatform(goodsInfo, allPayPlatformInfos[0]); } else { //多种支付方式,派发事件 if (NeedSelectPayPlatformCallBack != null) { NeedSelectPayPlatformCallBack(goodsInfo, allPayPlatformInfos); } else { Debug.LogError("请监听 StorePayController.NeedSelectPayPlatformCallBack , 并在回调时打开选择支付方式的界面。 玩家选择支付方式后, 再调用StorePayController.OnSelectPayPlatformCallBack 通知框架"); Debug.LogError("为了不卡住流程, 暂时默认调用第一个支付方式"); if (OnSelectPayPlatformCallBack != null) { OnSelectPayPlatformCallBack(goodsInfo, allPayPlatformInfos[0]); } else { OnVerificationResultCallBack(new PayResult(-11, goodsInfo.goodsID, "Pay Platform CallBack Null")); Debug.LogError("OnSelectPayPlatformCallBack error: null"); } } } } else { //ios,暂时没有选择支付方式 这一步骤 OnOnSelectPayPlatform(goodsInfo, new PayPlatformInfo()); } }
static void Init() { s_versionConfig = (Dictionary <string, object>)FrameWork.Json.Deserialize(ReadVersionContent()); s_hotUpdateConfig = ConfigManager.GetData(c_HotUpdateConfigName); //获取下载地址 //优先从注入数据中查询 string downLoadServicePath = null; if (ApplicationManager.AppMode == AppMode.Release) { if (string.IsNullOrEmpty(SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_UpdateDownLoadPath, ""))) { downLoadServicePath = s_hotUpdateConfig[c_downLoadPathKey].GetString(); } else { downLoadServicePath = SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_UpdateDownLoadPath, ""); } } else { if (string.IsNullOrEmpty(SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_TestUpdateDownLoadPath, ""))) { downLoadServicePath = s_hotUpdateConfig[c_testDownLoadPathKey].GetString(); } else { downLoadServicePath = SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_TestUpdateDownLoadPath, ""); } downLoadServicePath = s_hotUpdateConfig[c_testDownLoadPathKey].GetString(); } string downLoadPath = downLoadServicePath + "/" + platform + "/" + Application.version + "/"; s_versionFileDownLoadPath = downLoadPath + c_versionFileName.ToLower(); s_ManifestFileDownLoadPath = downLoadPath + AssetsManifestManager.c_ManifestFileName; s_resourcesFileDownLoadPath = downLoadPath; Debug.Log("=====>" + s_versionFileDownLoadPath); }
public override void Init() { if (SDKManager.IncludeThePayPlatform(StoreName.WX)) { Debug.LogWarning("=========WXPayClass Init==========="); //SDKManagerNew.OnPayCallBack += SetPayResult; GlobalEvent.AddTypeEvent <PrePay2Client>(OnPrePay); appid = SDKManager.GetProperties("WeiXin", "AppID", appid); mchID = SDKManager.GetProperties("WeiXin", "MchID", mchID); appSecret = SDKManager.GetProperties("WeiXin", "AppSecret", appSecret); } //if ((StoreName)Enum.Parse(typeof(StoreName), SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_StoreName, "None")) // == StoreName.WX) //{ //} }
/// <summary> /// 初始化 /// </summary> /// <param name="pathArr">默认大区列表下载地址(重打包后将不会使用)</param> public static void Init(string[] pathArr) { Debug.Log("GamePrepareFlowController初始化"); bool isTestMode = PlayerPrefs.GetInt(UseTestMode, 0) == 0 ? false : true; if (isTestMode) { string url = PlayerPrefs.GetString(TestDownloadRegionURL, ""); Debug.Log("进入GamePrepareFlowController test mode!\n URL:" + url); if (string.IsNullOrEmpty(url)) { Debug.LogError("GamePrepareFlowController test mode 获取的测试URL 为 null"); } pathArr = new string[] { url }; } else { string selectNetworkPath = SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_SelectNetworkPath, ""); if (!string.IsNullOrEmpty(selectNetworkPath)) { pathArr = selectNetworkPath.Split('|'); } } FlowManager.AddFlowItems(new FlowItemBase[] { new DownloadRegionServerListFlowItem(), new HotupdateFlowItem(), new PreLoadResFlowItem(), new SelectServerFlowItem() }); FlowManager.GetFlowItem <DownloadRegionServerListFlowItem>().SetURLs(pathArr); FlowManager.GetFlowItem <DownloadRegionServerListFlowItem>().OnFinished += OnDownloadRegionServerListFlowItemFinish; }
public override void Init() { m_SDKName = "PublicPayClass"; storeName = (StoreName)Enum.Parse(typeof(StoreName), SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_StoreName, "None")); //有其他的payClass符合就不启动public pay if (!SDKManager.GetHasPayService(storeName.ToString())) { GlobalEvent.AddTypeEvent <PrePay2Client>(OnPrePay); Debug.Log("PublicPayClass Init m_SDKName:>" + m_SDKName + "<"); } GlobalEvent.AddEvent(StoreName.WX, null); //GlobalEvent.DispatchEvent("Fight",) GlobalEvent.DispatchTypeEvent <InputUIOnClickEvent>(null); GlobalEvent.AddTypeEvent <InputUIOnClickEvent>((e, objs) => { }); SDKManager.GoodsInfoCallBack += OnGoodsInfoCallBack; }
private static void SendDeviceInfo(string userID) { Dictionary <string, string> datas = new Dictionary <string, string>(); datas.Add("uuid", userID); string channel = "Windows"; #if UNITY_ANDROID && !UNITY_EDITOR channel = "Android"; #endif #if UNITY_IOS && !UNITY_EDITOR channel = "IOS"; #endif //Debug.Log("OnLoginEvent : " + e.state + " Error: " + e.error); string[] deviceInfo = SystemInfo.deviceModel.Split(' '); string cc = SDKManager.GetProperties(SDKInterfaceDefine.FileName_ChannelProperties, channel); datas.Add("channel", cc); datas.Add("brand", deviceInfo[0]); datas.Add("deviceName", SystemInfo.deviceModel); datas.Add("version", ApplicationManager.Version); datas.Add("processorType", SystemInfo.processorType.ToString()); datas.Add("processorCount", SystemInfo.processorCount.ToString()); string net = "移动网络"; if (Application.internetReachability == NetworkReachability.NotReachable) { net = "无网络"; } else if (Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork) { net = "wifi"; } datas.Add("net", net); datas.Add("systemLanguage", Application.systemLanguage.ToString()); datas.Add("memorySize", SystemInfo.systemMemorySize.ToString()); datas.Add("graphicMemorySize", SystemInfo.graphicsMemorySize.ToString()); datas.Add("shaderLevel", SystemInfo.graphicsShaderLevel.ToString()); datas.Add("graphicDeviceType", SystemInfo.graphicsDeviceType.ToString()); string[] os = SystemInfo.operatingSystem.Split(' '); datas.Add("os", os[0]); datas.Add("ov", SystemInfo.operatingSystem); int w = Screen.width; int h = Screen.height; if (w < h) { w = Screen.height; h = Screen.width; } datas.Add("resolution", w + "x" + h); SDKManager.Log(ReportUserData, datas); }