| | |
| | | { |
| | | onFreePlatformPayOk(); |
| | | } |
| | | //SnxxzGame.Instance.StartCoroutine(DelayQueryRecharge()); |
| | | break; |
| | | case CodeA2U.FreePlatformPayFail: |
| | | if (onFreePlatformPayFail != null) |
| | |
| | | break; |
| | | } |
| | | case CodeA2U.ExitGame: |
| | | if (ChannelPlatform == E_ChannelPlatform.Free) |
| | | { |
| | | // WindowCenter.Instance.Open<ExitGameWin>(); |
| | | } |
| | | else |
| | | // if (ChannelPlatform == E_ChannelPlatform.Free) |
| | | // { |
| | | // // WindowCenter.Instance.Open<ExitGameWin>(); |
| | | // } |
| | | // else |
| | | { |
| | | //默认都是退出游戏 |
| | | Application.Quit(); |
| | |
| | | private Dictionary<string, string> m_PaymentTable = new Dictionary<string, string>(); |
| | | private string m_EncodeKey = "03sujm7gerywdvyd5vkkk772rs4by230"; |
| | | |
| | | //private IEnumerator DelayQueryRecharge() |
| | | //{ |
| | | // yield return WaitingForSecondConst.WaitMS3000; |
| | | // var _package = new CA806_tagCMQueryRecharge(); |
| | | // GameNetSystem.Instance.SendInfo(_package); |
| | | |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 自由SDK支付 fixed sdk 支付逻辑修改 |
| | |
| | | |
| | | public void FreePlatformPayEx(string title, float money, string cpInfo) |
| | | { |
| | | // OrderInfoConfig orderInfo = null; |
| | | // VipModel vipModel = ModelCenter.Instance.GetModel<VipModel>(); |
| | | // if (vipModel.orderInfoToCTGID.ContainsKey(cpInfo) && vipModel.orderInfoToCTGID[cpInfo] != 0) |
| | | // { |
| | | // vipModel.TryGetOrderInfo(vipModel.orderInfoToCTGID[cpInfo], out orderInfo); |
| | | // } |
| | | // else |
| | | // { |
| | | // var keys = OrderInfoConfig.GetKeys(); |
| | | // for (int i = 0; i < keys.Count; i++) |
| | | // { |
| | | // orderInfo = OrderInfoConfig.Get(keys[i]); |
| | | // if (orderInfo != null && orderInfo.OrderInfo == cpInfo) |
| | | // { |
| | | // break; |
| | | // } |
| | | // } |
| | | // } |
| | | // //#if !(UNITY_IOS || UNITY_IPHONE) |
| | | // // string storeOrderInfo = orderInfo.StoreOrderInfo; |
| | | // //#else |
| | | // // string storeOrderInfo = orderInfo.StoreOrderInfo2; |
| | | // //#endif |
| | | |
| | | // #if UNITY_EDITOR |
| | | // Debug.LogFormat("充值: {0}-{1}-{2}", title, money, cpInfo); |
| | | // return; |
| | | OrderInfoConfig orderInfo = null; |
| | | var vipModel = RechargeManager.Instance; |
| | | if (vipModel.orderInfoToCTGID.ContainsKey(cpInfo) && vipModel.orderInfoToCTGID[cpInfo] != 0) |
| | | { |
| | | vipModel.TryGetOrderInfo(vipModel.orderInfoToCTGID[cpInfo], out orderInfo); |
| | | } |
| | | else |
| | | { |
| | | var keys = OrderInfoConfig.GetKeys(); |
| | | for (int i = 0; i < keys.Count; i++) |
| | | { |
| | | orderInfo = OrderInfoConfig.Get(keys[i]); |
| | | if (orderInfo != null && orderInfo.OrderInfo == cpInfo) |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | //#if !(UNITY_IOS || UNITY_IPHONE) |
| | | // string storeOrderInfo = orderInfo.StoreOrderInfo; |
| | | //#else |
| | | // string storeOrderInfo = orderInfo.StoreOrderInfo2; |
| | | // #endif |
| | | |
| | | // m_Json.Clear(); |
| | | // m_Json["code"] = CodeU2A.FreePlatformPay; |
| | | // m_Json["orderId"] = DateTime.Now.ToString("yyyyMMddHHmmss") + UnityEngine.Random.Range(100000, 999999).ToString(); |
| | | // m_Json["mount"] = money.ToString(); |
| | | // m_Json["cpInfo"] = cpInfo; |
| | | // //m_Json["storeOrderInfo"] = storeOrderInfo; |
| | | // m_Json["title"] = title; |
| | | // m_Json["roleID"] = PlayerDatas.Instance.baseData.PlayerID; |
| | | // m_Json["roleName"] = PlayerDatas.Instance.baseData.PlayerName; |
| | | // m_Json["level"] = PlayerDatas.Instance.baseData.LV.ToString(); |
| | | // m_Json["sid"] = ServerListCenter.Instance.currentServer.region_flag; |
| | | // m_Json["serverName"] = ServerListCenter.Instance.currentServer.name; |
| | | // m_Json["familyName"] = PlayerDatas.Instance.baseData.FamilyName; |
| | | // m_Json["job"] = PlayerDatas.Instance.baseData.Job.ToString(); |
| | | // m_Json["money"] = PlayerDatas.Instance.baseData.diamond.ToString(); |
| | | // m_Json["gameName"] = VersionConfig.Get().productName; |
| | | // m_Json["vipLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString(); |
| | | // m_Json["createTime"] = TimeUtility.CreateSeconds.ToString(); |
| | | // m_Json["familyID"] = PlayerDatas.Instance.baseData.FamilyId.ToString(); |
| | | // m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPower.ToString(); |
| | | #if UNITY_EDITOR |
| | | Debug.LogFormat("充值: {0}-{1}-{2}", title, money, cpInfo); |
| | | return; |
| | | #endif |
| | | |
| | | // #if UNITY_IOS |
| | | // m_Json["identifier"] = VersionConfig.Get().bundleIdentifier; |
| | | // #endif |
| | | // SendMessageToSDK(m_Json); |
| | | m_Json.Clear(); |
| | | m_Json["code"] = CodeU2A.FreePlatformPay; |
| | | m_Json["orderId"] = DateTime.Now.ToString("yyyyMMddHHmmss") + UnityEngine.Random.Range(100000, 999999).ToString(); |
| | | m_Json["mount"] = money.ToString(); |
| | | m_Json["cpInfo"] = cpInfo; |
| | | //m_Json["storeOrderInfo"] = storeOrderInfo; |
| | | m_Json["title"] = title; |
| | | m_Json["roleID"] = PlayerDatas.Instance.baseData.PlayerID; |
| | | m_Json["roleName"] = PlayerDatas.Instance.baseData.PlayerName; |
| | | m_Json["level"] = PlayerDatas.Instance.baseData.LV.ToString(); |
| | | m_Json["sid"] = ServerListCenter.Instance.currentServer.region_flag; |
| | | m_Json["serverName"] = ServerListCenter.Instance.currentServer.name; |
| | | m_Json["familyName"] = PlayerDatas.Instance.baseData.FamilyName; |
| | | m_Json["job"] = PlayerDatas.Instance.baseData.Job.ToString(); |
| | | m_Json["money"] = PlayerDatas.Instance.baseData.diamond.ToString(); |
| | | m_Json["gameName"] = VersionConfig.Get().productName; |
| | | m_Json["vipLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString(); |
| | | m_Json["createTime"] = TimeUtility.CreateSeconds.ToString(); |
| | | m_Json["familyID"] = PlayerDatas.Instance.baseData.FamilyId.ToString(); |
| | | m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPower.ToString(); |
| | | |
| | | #if UNITY_IOS |
| | | m_Json["identifier"] = VersionConfig.Get().bundleIdentifier; |
| | | #endif |
| | | SendMessageToSDK(m_Json); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | private void BuildFreePlatformInfo(JsonData json) |
| | | { |
| | | // if (FreePlatformInfo == null) |
| | | // { |
| | | // FreePlatformInfo = new FP_LoginOk(); |
| | | // } |
| | | if (FreePlatformInfo == null) |
| | | { |
| | | FreePlatformInfo = new FP_LoginOk(); |
| | | } |
| | | |
| | | // IDictionary _iDict = json as IDictionary; |
| | | IDictionary _iDict = json as IDictionary; |
| | | |
| | | // if (_iDict.Contains("token")) |
| | | // { |
| | | // FreePlatformInfo.token = json["token"].ToString(); |
| | | // } |
| | | // if (_iDict.Contains("token_expire")) |
| | | // { |
| | | // FreePlatformInfo.tokenExpire = json["token_expire"].ToString(); |
| | | // } |
| | | // else |
| | | // { |
| | | // FreePlatformInfo.tokenExpire = ""; |
| | | // } |
| | | // if (_iDict.Contains("account")) |
| | | // { |
| | | // FreePlatformInfo.account = json["account"].ToString(); |
| | | // } |
| | | if (_iDict.Contains("token")) |
| | | { |
| | | FreePlatformInfo.token = json["token"].ToString(); |
| | | } |
| | | if (_iDict.Contains("token_expire")) |
| | | { |
| | | FreePlatformInfo.tokenExpire = json["token_expire"].ToString(); |
| | | } |
| | | else |
| | | { |
| | | FreePlatformInfo.tokenExpire = ""; |
| | | } |
| | | if (_iDict.Contains("account")) |
| | | { |
| | | FreePlatformInfo.account = json["account"].ToString(); |
| | | } |
| | | |
| | | // if (_iDict.Contains("account_id")) |
| | | // { |
| | | // int.TryParse(json["account_id"].ToString(), out FreePlatformInfo.accountID); |
| | | // } |
| | | if (_iDict.Contains("account_id")) |
| | | { |
| | | int.TryParse(json["account_id"].ToString(), out FreePlatformInfo.accountID); |
| | | } |
| | | |
| | | // if (_iDict.Contains("session_id")) |
| | | // { |
| | | // FreePlatformInfo.sessionID = (string)json["session_id"]; |
| | | // } |
| | | if (_iDict.Contains("session_id")) |
| | | { |
| | | FreePlatformInfo.sessionID = (string)json["session_id"]; |
| | | } |
| | | |
| | | // if (_iDict.Contains("game_id")) |
| | | // { |
| | | // FreePlatformInfo.gameId = (string)json["game_id"]; |
| | | // } |
| | | if (_iDict.Contains("game_id")) |
| | | { |
| | | FreePlatformInfo.gameId = (string)json["game_id"]; |
| | | } |
| | | |
| | | // if (_iDict.Contains("timeStamp")) |
| | | // { |
| | | // FreePlatformInfo.timeStamp = (string)json["timeStamp"]; |
| | | // } |
| | | // if (_iDict.Contains("userName")) |
| | | // { |
| | | // FreePlatformInfo.qkUserName = json["userName"].ToString(); |
| | | // } |
| | | // FreePlatformInfo.phone = 0; |
| | | if (_iDict.Contains("timeStamp")) |
| | | { |
| | | FreePlatformInfo.timeStamp = (string)json["timeStamp"]; |
| | | } |
| | | if (_iDict.Contains("userName")) |
| | | { |
| | | FreePlatformInfo.qkUserName = json["userName"].ToString(); |
| | | } |
| | | FreePlatformInfo.phone = 0; |
| | | } |
| | | |
| | | private void HandleFreePlatformRegisteOk(JsonData json) |
| | |
| | | |
| | | private void HandleFreePlatformLoginOk(JsonData data) |
| | | { |
| | | // BuildFreePlatformInfo(data); |
| | | BuildFreePlatformInfo(data); |
| | | |
| | | // Debug.LogFormat("sdk登录成功:{0}", data.ToJson()); |
| | | // if (onFreePlatformLoginOk != null) |
| | | // { |
| | | // onFreePlatformLoginOk(FreePlatformInfo); |
| | | // } |
| | | Debug.LogFormat("sdk登录成功:{0}", data.ToJson()); |
| | | if (onFreePlatformLoginOk != null) |
| | | { |
| | | onFreePlatformLoginOk(FreePlatformInfo); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | public void CreateRoleOk(string roleID, string roleName, string time) |
| | | { |
| | | // m_Json.Clear(); |
| | | // m_Json["code"] = CodeU2A.CreateRole; |
| | | m_Json.Clear(); |
| | | m_Json["code"] = CodeU2A.CreateRole; |
| | | |
| | | // m_Json["roleID"] = roleID; |
| | | // m_Json["roleName"] = roleName; |
| | | // m_Json["sid"] = ServerListCenter.Instance.currentServer.region_flag; |
| | | // m_Json["serverName"] = ServerListCenter.Instance.currentServer.name; |
| | | // m_Json["familyName"] = PlayerDatas.Instance.baseData.FamilyName; |
| | | // m_Json["level"] = "1"; |
| | | // m_Json["job"] = PlayerDatas.Instance.baseData.Job.ToString(); |
| | | // m_Json["money"] = PlayerDatas.Instance.baseData.diamond.ToString(); |
| | | // m_Json["gameName"] = VersionConfig.Get().productName; |
| | | // m_Json["vipLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString(); |
| | | // m_Json["createTime"] = time; |
| | | // m_Json["familyID"] = PlayerDatas.Instance.baseData.FamilyId.ToString(); |
| | | // m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPower.ToString(); |
| | | // SendMessageToSDK(m_Json); |
| | | m_Json["roleID"] = roleID; |
| | | m_Json["roleName"] = roleName; |
| | | m_Json["sid"] = ServerListCenter.Instance.currentServer.region_flag; |
| | | m_Json["serverName"] = ServerListCenter.Instance.currentServer.name; |
| | | m_Json["familyName"] = PlayerDatas.Instance.baseData.FamilyName; |
| | | m_Json["level"] = "1"; |
| | | m_Json["job"] = PlayerDatas.Instance.baseData.Job.ToString(); |
| | | m_Json["money"] = PlayerDatas.Instance.baseData.diamond.ToString(); |
| | | m_Json["gameName"] = VersionConfig.Get().productName; |
| | | m_Json["vipLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString(); |
| | | m_Json["createTime"] = time; |
| | | m_Json["familyID"] = PlayerDatas.Instance.baseData.FamilyId.ToString(); |
| | | m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPower.ToString(); |
| | | SendMessageToSDK(m_Json); |
| | | } |
| | | |
| | | public void DownloadStart() |
| | |
| | | |
| | | public void RoleLogin() |
| | | { |
| | | // m_Json.Clear(); |
| | | // m_Json["code"] = CodeU2A.RoleLogin; |
| | | m_Json.Clear(); |
| | | m_Json["code"] = CodeU2A.RoleLogin; |
| | | |
| | | // m_Json["roleID"] = PlayerDatas.Instance.baseData.PlayerID.ToString(); |
| | | // m_Json["roleName"] = PlayerDatas.Instance.baseData.PlayerName; |
| | | // m_Json["sid"] = ServerListCenter.Instance.currentServer.region_flag; |
| | | // m_Json["serverName"] = ServerListCenter.Instance.currentServer.name; |
| | | // m_Json["familyName"] = PlayerDatas.Instance.baseData.FamilyName; |
| | | // m_Json["level"] = PlayerDatas.Instance.baseData.LV; |
| | | // m_Json["job"] = PlayerDatas.Instance.baseData.Job.ToString(); |
| | | // m_Json["money"] = PlayerDatas.Instance.baseData.diamond.ToString(); |
| | | // m_Json["gameName"] = VersionConfig.Get().productName; |
| | | // m_Json["vipLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString(); |
| | | // m_Json["createTime"] = TimeUtility.CreateSeconds.ToString(); |
| | | // m_Json["familyID"] = PlayerDatas.Instance.baseData.FamilyId.ToString(); |
| | | // m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPower.ToString(); |
| | | // SendMessageToSDK(m_Json); |
| | | m_Json["roleID"] = PlayerDatas.Instance.baseData.PlayerID.ToString(); |
| | | m_Json["roleName"] = PlayerDatas.Instance.baseData.PlayerName; |
| | | m_Json["sid"] = ServerListCenter.Instance.currentServer.region_flag; |
| | | m_Json["serverName"] = ServerListCenter.Instance.currentServer.name; |
| | | m_Json["familyName"] = PlayerDatas.Instance.baseData.FamilyName; |
| | | m_Json["level"] = PlayerDatas.Instance.baseData.LV; |
| | | m_Json["job"] = PlayerDatas.Instance.baseData.Job.ToString(); |
| | | m_Json["money"] = PlayerDatas.Instance.baseData.diamond.ToString(); |
| | | m_Json["gameName"] = VersionConfig.Get().productName; |
| | | m_Json["vipLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString(); |
| | | m_Json["createTime"] = TimeUtility.CreateSeconds.ToString(); |
| | | m_Json["familyID"] = PlayerDatas.Instance.baseData.FamilyId.ToString(); |
| | | m_Json["fightPower"] = PlayerDatas.Instance.baseData.FightPower.ToString(); |
| | | SendMessageToSDK(m_Json); |
| | | } |
| | | |
| | | public void RoleLevelUp() |