コード例 #1
0
        /// <summary>
        /// 获取指定服务器的状态,如果可以进入则直接进入
        /// </summary>
        public void CheckServerStateAndEnter(ServerInfo serverInfo, GetServerStateFinishedDelegate getServerStateFinishedCallback = null, bool enter = true)
        {
            if (serverInfo == null)
            {
                return;
            }

            GlobalConfig globalConfig = GlobalConfig.GetInstance();

            GlobalConfig.LoginInfoStruct loginInfo = globalConfig.LoginInfo;

#if UNITY_IPHONE
            string sign = string.Format("server_id={0}&game_mark={1}&device_mark={2}&show_marked={3}&account={4}",
                                        serverInfo.ServerId, GlobalConfig.Instance.GameMark, globalConfig.DeviceMark, globalConfig.ServerType, loginInfo.AccName);
            Debug.Log(string.Format("controlServer_oriSign_SrvSt2 = {0}", sign));
            sign = WWW.EscapeURL(Utils.AES.Encode(sign, Const.CS_URL_KEY, Const.CS_URL_IV));

            var url = string.Format("{0}SrvSt2?sign={1}", GlobalConfig.Instance.CSURLVEX, sign);
#else
            string url = globalConfig.CSURLV + "GetServerState?server_id=" + serverInfo.ServerId
                         + "&game_mark=" + GlobalConfig.Instance.GameMark
                         + "&device_mark=" + globalConfig.DeviceMark
                         + "&show_marked=" + globalConfig.ServerType
                         + "&account=" + loginInfo.AccName;
#endif

            MainGame.HttpRequest.GET(url, OnGetServerStateFinished, serverInfo);

            mGetServerStateFinishedCallback = getServerStateFinishedCallback;

            mEnterWhenGetServerStateFinished = enter;
        }
コード例 #2
0
 public void ClearAllCallback()
 {
     mGetServerDataFinishedCallback            = null;
     mGetLastLoginServerInfoFinishedCallback   = null;
     mGetAllRegionFinishedCallback             = null;
     mGetLatelyLoginServerListFinishedCallback = null;
     mGetAllRecommServerFinishedCallback       = null;
     mGetServerListFinishedCallback            = null;
     mGetServerStateFinishedCallback           = null;
 }