| | |
| | | using LitJson;
|
| | | using System.IO;
|
| | | using Snxxz.UI;
|
| | | using System.Text;
|
| | |
|
| | | public class VersionUtility : Singleton<VersionUtility>
|
| | | {
|
| | |
| | | step = Step.None;
|
| | | var tables = new Dictionary<string, string>();
|
| | | tables["uid"] = ModelCenter.Instance.GetModel<LoginModel>().sdkLoginResult.account;
|
| | | var url = StringUtility.Contact("https://api.maoergame.com/update/download/url?", HttpRequest.HashtablaToString(tables));
|
| | | Debug.Log("猫耳强更url:" + url);
|
| | | HttpRequest.Instance.RequestHttpPost(url, string.Empty, HttpRequest.defaultHttpContentType, 1, OnMaoErVersionCheckResult);
|
| | | var url = "https://api.maoergame.com/update/download/url";
|
| | | Debug.LogFormat("猫耳强更url:{0} uid:{1} ", url, ModelCenter.Instance.GetModel<LoginModel>().sdkLoginResult.account);
|
| | | HttpRequest.Instance.RequestHttpPost(url, tables, HttpRequest.defaultHttpContentType, 1, OnMaoErVersionCheckResult);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnMaoErVersionCheckResult(bool ok, string result)
|
| | | {
|
| | | Debug.Log("猫耳强更 result:" + result);
|
| | | UTF8Encoding utf8 = new UTF8Encoding();
|
| | | Byte[] encodedBytes = utf8.GetBytes(result);
|
| | | String decodedString = utf8.GetString(encodedBytes);
|
| | |
|
| | | Debug.LogFormat("猫耳强更请求返回结果 result:{0}", decodedString);
|
| | | if (ok)
|
| | | {
|
| | | try
|