Пример #1
0
    public void CheckiOSAuditVersion()
    {
        //iOS版本,检查是否是iOS审核版本
        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            Utils.ShowMessagePanel("正在获取服务器信息...", messagePanel);
            ResponseHandle handler = delegate(string jsonString){
                Debug.Log("GetCheckIOSAuditUpdateVersion: " + jsonString);
                Utils.HideMessagePanel(messagePanel);
                //加入玩家已经游戏了,那么跳转到Gameplay Scene。否则什么都不需要坐。
                CheckIOSAuditVersionResponse resp = JsonConvert.DeserializeObject <CheckIOSAuditVersionResponse>(jsonString);
                if (resp.isAuditVersion)
                {
                    userNameInputField.gameObject.SetActive(true);
                    passwordInputField.gameObject.SetActive(true);
                    loginButton.image.sprite = loginBtnSprite;
                    isAuditVersion           = true;
                }
                else
                {
                    CheckUpdate();
                }
            };

            ResponseHandle errorHandler = delegate(string error) {
                Debug.Log("errorHandler is called");
                Utils.HideMessagePanel(messagePanel);
                Utils.ShowConfirmMessagePanel("连接服务器失败,请检查你的网络", confirmMessagePanel);
            };

            var req = new {
                platform   = Utils.GetPlatform(),
                version    = Application.version,
                clientInfo = Utils.GetClientInfo(),
                userInfo   = Utils.GetUserInfo()
            };

            StartCoroutine(ServerUtils.PostRequest(ServerUtils.CheckIOSAuditVersionUrl(), JsonConvert.SerializeObject(req), handler, errorHandler));
        }
        else
        {
            CheckUpdate();
        }
    }