Ejemplo n.º 1
0
        /// <summary>
        /// 创建SDK角色信息.
        /// </summary>
        /// <returns>SDK角色信息.</returns>
        /// <param name="iRoleId">角色ID(必须为数字).</param>
        /// <param name="iRoleName">角色名(不能为空,不能为null).</param>
        /// <param name="iRoleLevel">角色等级(必须为数字,不能为0,默认1).</param>
        /// <param name="iZoneID">游戏区ID(必须为数字,不能为0,默认为1).</param>
        /// <param name="iZoneName">游戏区名(不能为空,不能为null).</param>
        /// <param name="iBalance">游戏币余额(必须为数字,默认0).</param>
        /// <param name="iVip">VIP等级(必须为数字,默认诶1).</param>
        /// <param name="iPartyName">当前所属帮派(不能为空,不能为null,默认:无帮派).</param>
        /// <param name="iRoleCTime">角色创建时间(单位:秒).</param>
        /// <param name="iRoleLevelMTime">角色等级变化时间(单位:秒).</param>
        public override SDKRoleBaseInfo SDKCreateRoleInfo(
            string iRoleId, string iRoleName, string iRoleLevel, string iZoneID, string iZoneName,
            string iBalance, string iVip, string iPartyName, string iRoleCTime, string iRoleLevelMTime)
        {
            // 接入易接SDK的场合
            if (true == BuildInfo.GetInstance().Data.Options.isOptionValid(TSDKOptions.OneSDK))
            {
                OneSDKRoleInfo _roleIfo = new OneSDKRoleInfo();
                if (null == _roleIfo)
                {
                    this.Error("SDKCreateRoleInfo()::Memory New Error!!!(OneSDKRoleInfo)");
                    return(null);
                }
                _roleIfo.Reset();

                _roleIfo.ID       = iRoleId;
                _roleIfo.Name     = iRoleName;
                _roleIfo.Level    = iRoleLevel;
                _roleIfo.ZoneID   = iZoneID;
                _roleIfo.ZoneName = iZoneName;
                _roleIfo.Balance  = iBalance;
//				_roleIfo.Vip = iVip;
//				_roleIfo.PartyName = iPartyName;
                _roleIfo.CTime          = iRoleCTime;
                _roleIfo.RoleLevelMTime = iRoleLevelMTime;
                return(_roleIfo);
            }
            return(null);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 上传检测
        /// </summary>
        private IEnumerator UploadCheck()
        {
            // 重置版本
            UploadList.GetInstance().AppVersion    = BuildInfo.GetInstance().BuildVersion;
            UploadList.GetInstance().CenterVersion = BuildInfo.GetInstance().CenterVersion;
            yield return(new WaitForEndOfFrame());

            // 初始化上传进度计数器
            UploadList.GetInstance().InitProgressCounter();
            yield return(new WaitForEndOfFrame());

            // 需要上传
            if (UploadList.GetInstance().isUploadNecessary == true)
            {
                this.UploadPreConfirmNotification(
                    UploadList.GetInstance().GetTotalCount(),
                    UploadList.GetInstance().GetTotalDatasize());
            }
            else
            {
                this.isStarted    = false;
                this._isCompleted = true;

                // 无效上传 重置状态为:OK
                this._State = TRunState.OK;
            }
        }
Ejemplo n.º 3
0
        static void InitForAndroidBuild()
        {
            // 清空下载目录
            DownloadList _instance = DownloadList.GetInstance();

            if (_instance != null)
            {
                _instance.Clear(true);
            }
            BuildSettings.GetInstance(BuildSettings.AssetFileDir);

            // 清空Plugins/Android目录
            ClearPluginsAndroid();

            // 重置Plugins/Android
            ResetPluginsAndroid();

            // 设置相关AndroidSDK相关设定
            IAndroidSDKSettings androidSDK = GetCurAndroidSDKSetting();

            if (androidSDK != null)
            {
                string gameName    = BuildInfo.GetInstance().BuildName;
                string packageName = BuildInfo.GetInstance().BuildID;
                // 打包Android(apk文件)之前,提前应用设定
                androidSDK.PreApplyAndroidBuild(gameName, packageName);
            }
            else
            {
                BuildLogger.LogWarning("Android SDK invalid!!");
            }

            // 刷新
            UtilsAsset.AssetsRefresh();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 取得安卓SDK实例.
        /// </summary>
        /// <returns>The android SDK instance.</returns>
        private AndroidSDKBase GetAndroidSDKInstance()
        {
            AndroidSDKBase _objRet       = null;
            TPlatformType  _platformType = BuildInfo.GetInstance().PlatformType;

            switch (_platformType)
            {
            case TPlatformType.Huawei:
            {
                _objRet = new HuaweiSDK();
            }
            break;

            case TPlatformType.Tiange:
            {
                _objRet = new TiangeSDK();
            }
            break;

            case TPlatformType.Android:
            case TPlatformType.iOS:
            case TPlatformType.None:
            default:
            {
                this.Error("GetAndroidSDKInstance():The platformType is invalid setting in buildinfo.asset!!!(TPlatformType:{0})",
                           _platformType);
            }
            break;
            }
            return(_objRet);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 支付函数.
        /// </summary>
        /// <param name="iTarget">游戏对象.</param>
        /// <param name="iIAPItemPrice">购买道具价格.</param>
        /// <param name="iIAPItemName">购买道具名.</param>
        /// <param name="iIAPItemCount">购买道具数量.</param>
        /// <param name="iOtherDIYInfo">其他自定义信息.</param>
        /// <param name="iNotifyUrl">支付结果通知URL(一般与游戏服务器上设置该URL).</param>
        /// <param name="iOnPayCompleted">支付完成回调函数.</param>
        protected override void SDKPay(
            GameObject iTarget,
            int iIAPItemPrice,
            string iIAPItemName,
            int iIAPItemCount,
            string iOtherDIYInfo,
            string iNotifyUrl,
            Action <string> iOnPayCompleted)
        {
            this.Info("SDKPay()::Price:{0} Name:{1} Count:{2} OtherDIYInfo:{3} NotifyUrl:{4}/ Target:{5} Callback:{6}",
                      iIAPItemPrice, iIAPItemName, iIAPItemCount, iOtherDIYInfo, iNotifyUrl,
                      iTarget.name, iOnPayCompleted.Method.Name);

            // 接入易接SDK的场合
            if (true == BuildInfo.GetInstance().Data.Options.isOptionValid(TSDKOptions.OneSDK))
            {
                OneSDKLibs.Instance.Pay(
                    iTarget, iIAPItemPrice, iIAPItemName, iIAPItemCount,
                    iOtherDIYInfo, iNotifyUrl, iOnPayCompleted);
            }
            else
            {
                this.Error("SDKLogout():There is invalid options settings in sdk settings!!!");
            }
        }
Ejemplo n.º 6
0
 /// <summary>
 /// 更新等级信息(升级时).
 /// </summary>
 /// <param name="iRoleInfo">角色信息.</param>
 public override void SDKUpdateRoleInfoWhenEnterServer(SDKRoleBaseInfo iRoleInfo)
 {
     // 接入易接SDK的场合
     if (true == BuildInfo.GetInstance().Data.Options.isOptionValid(TSDKOptions.OneSDK))
     {
         OneSDKLibs.Instance.UpdateRoleInfoWhenEnterServer(((OneSDKRoleInfo)iRoleInfo));
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 退出.
 /// </summary>
 /// <param name="iTarget">游戏对象.</param>
 /// <param name="iOnExited">退出回调函数.</param>
 public override void SDKExit(
     GameObject iTarget        = null,
     Action <string> iOnExited = null)
 {
     // 接入易接SDK的场合
     if (true == BuildInfo.GetInstance().Data.Options.isOptionValid(TSDKOptions.OneSDK))
     {
         OneSDKLibs.Instance.Exit(iTarget, iOnExited);
     }
 }
Ejemplo n.º 8
0
        /// <summary>
        /// 应用.
        /// </summary>
        /// <param name="iUserInfo">用户数据.</param>
        public void Apply(OneSDKUserInfo iUserInfo)
        {
            this.Reset();

            this.app      = iUserInfo.ProductCode;
            this.sdk      = iUserInfo.ChannelId;
            this.uin      = iUserInfo.ChannelUserId;
            this.sess     = iUserInfo.Token;
            this.channel  = iUserInfo.ChannelId;
            this.platform = BuildInfo.GetInstance().PlatformType.ToString();
            this.option   = "OneSDK";
        }
Ejemplo n.º 9
0
 /// <summary>
 /// SDK解析用户信息.
 /// </summary>
 /// <returns>用户信息.</returns>
 /// <param name="iUserInfo">用户信息(Json格式数据).</param>>
 protected override SDKAccountBaseInfo SDKParserAccountInfo(string iUserInfo)
 {
     // 接入易接SDK的场合
     if (true == BuildInfo.GetInstance().Data.Options.isOptionValid(TSDKOptions.OneSDK))
     {
         return(OneSDKLibs.Instance.ParserLoginResponseInfo(iUserInfo));
     }
     else
     {
         return(JsonUtility.FromJson <TinageAccountInfo> (iUserInfo));
     }
 }
Ejemplo n.º 10
0
        static void InitForAndroidBuild()
        {
            // 清空下载目录
            DownloadList _instance = DownloadList.GetInstance();

            if (_instance != null)
            {
                _instance.Clear(true);
            }
            // 初始化打包信息
            BuildSettings.GetInstance(BuildSettings.AssetFileDir);

                        #if UNITY_ANDROID
            // 设定选项
            // 天鸽的场合
            if (TPlatformType.Tiange == BuildInfo.GetInstance().PlatformType)
            {
                // 初始化SDK设定信息&导入最新
                TiangeSDKSettings.GetInstance(TiangeSDKSettings.AssetFileDir).ImportFromJsonFile(true);
                BuildLogger.LogMessage("TiangeSDKSettings -> ImportFromJsonFile().");
                BuildLogger.LogMessage("TiangeSDKSettings::OneSDK:{0}(MetaData:{1}).",
                                       TiangeSDKSettings.GetInstance().Data.Options.isOptionValid(BuildSystem.Options.TSDKOptions.OneSDK).ToString(),
                                       TiangeSDKSettings.GetInstance().Data.Options.OneSDK.MetaDatas.Count.ToString());

                TiangeSDKSettings.GetInstance().Data.Options.OptionsSettings =
                    BuildInfo.GetInstance().Data.Options.OptionsSettings;
            }

            // 清空Plugins/Android目录
            ClearPluginsAndroid();

            // 重置Plugins/Android
            ResetPluginsAndroid();

            // 设置相关AndroidSDK相关设定
            IAndroidSDKSettings androidSDK = GetCurAndroidSDKSetting();
            if (androidSDK != null)
            {
                string gameName    = BuildInfo.GetInstance().BuildName;
                string packageName = BuildInfo.GetInstance().BuildID;
                // 打包Android(apk文件)之前,提前应用设定
                androidSDK.PreApplyAndroidBuild(gameName, packageName);
            }
            else
            {
                BuildLogger.LogWarning("Android SDK invalid!!");
            }
                        #endif

            // 刷新
            UtilsAsset.AssetsRefresh();
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 登出.
        /// </summary>
        public void Logout()
        {
            if (TPlatformType.None == BuildInfo.GetInstance().PlatformType)
            {
                UtilsLog.Error("AndroidLibs", "Logout():The platformType is none in buildinfo.asset file!!!");
                return;
            }

            AndroidJavaClass  jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
            AndroidJavaObject jo = jc.GetStatic <AndroidJavaObject>("currentActivity");

            jo.Call("UToA_Logout");
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 创建角色信息.
        /// </summary>
        /// <returns>角色信息.</returns>
        public static SDKRoleBaseInfo CreateRoleInfo()
        {
            SDKRoleBaseInfo _roleInfo = null;

            if (true == BuildInfo.GetInstance().Data.Options.isOptionValid(TSDKOptions.OneSDK))
            {
                OneSDKRoleInfo _roleInfoTmp = new OneSDKRoleInfo();


                _roleInfo = _roleInfoTmp;
            }
            return(_roleInfo);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 登出.
        /// </summary>
        protected override void SDKLogout()
        {
            this.Info("SDKLogout()");

            // 接入易接SDK的场合
            if (true == BuildInfo.GetInstance().Data.Options.isOptionValid(TSDKOptions.OneSDK))
            {
                OneSDKLibs.Instance.Logout();
            }
            else
            {
                this.Error("SDKLogout():There is invalid options settings in sdk settings!!!");
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 取得上传服务器传输用URL.
        /// <服务器地址>:<端口号>/<工程名(例:NFF)>
        /// </summary>
        /// <returns>服务器传输地址.</returns>
        /// <param name="iServerInfo">上传服务器信息.</param>
        private static string GetUploadServerPostURL(
            UploadServerInfo iServerInfo)
        {
            string serverPostUrl = GetUploadServerPostBaseURL(iServerInfo);
            string rootDir       = GetInstance().UploadServer.RootDir;

            if (false == string.IsNullOrEmpty(rootDir))
            {
                serverPostUrl = string.Format("{0}/{1}", serverPostUrl, rootDir);
            }
            serverPostUrl = string.Format("{0}/{1}",
                                          serverPostUrl, BuildInfo.GetInstance().BuildName);

//			 UtilsLog.Info ("GetUploadServerPostURL", "ServerPostURL:{0}", serverPostUrl);

            return(serverPostUrl);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 登陆.
        /// </summary>
        /// <param name="iTarget">登陆对象.</param>
        /// <param name="iOnLoginCompleted">登陆完成.</param>
        public void Login(
            GameObject iTarget,
            Action <string> iOnLoginCompleted)
        {
            if (TPlatformType.None == BuildInfo.GetInstance().PlatformType)
            {
                UtilsLog.Error("AndroidLibs", "Login():The platformType is none in buildinfo.asset file!!!");
                return;
            }
            if (null == iTarget)
            {
                return;
            }

            AndroidJavaClass  jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
            AndroidJavaObject jo = jc.GetStatic <AndroidJavaObject>("currentActivity");

            jo.Call("UToA_Login", iTarget.name, iOnLoginCompleted.Method.Name);
        }
Ejemplo n.º 16
0
        /// <summary>
        /// 初始化Appliction.
        /// </summary>
        protected void InitApplicationInfo()
        {
            XmlNode manifestNode = GetManifestNode();

            if (null == manifestNode)
            {
                return;
            }
            XmlElement _manifestNode = manifestNode as XmlElement;

            if (null == _manifestNode)
            {
                return;
            }
            // Android NameSpace
            this.AndroidNameSpace = this.GetNodeAttribute_s(_manifestNode, "xmlns:android");

            XmlNode appNode = this.GetApplicationNode();

            if (null == appNode)
            {
                return;
            }
            XmlElement _appNode = appNode as XmlElement;

            if (null == _appNode)
            {
                return;
            }
            // Icon
            this.SetNodeAttribute(_appNode, "icon", "@drawable/app_icon");

            // debug
            if (TBuildMode.Debug == BuildInfo.GetInstance().BuildMode)
            {
                this.SetNodeAttribute(_appNode, "debuggable", "true");
            }
            else
            {
                this.SetNodeAttribute(_appNode, "debuggable", "false");
            }
        }
Ejemplo n.º 17
0
        /// <summary>
        /// 取得下载服务器传输用URL.
        /// <服务器地址Url>/<工程名(例:NFF)>
        /// </summary>
        /// <returns>下载服务器传输地址.</returns>
        /// <param name="iServerInfo">下载服务器信息.</param>
        private static string GetDownloadServerPostURL(
            DownloadServerInfo iServerInfo)
        {
            string serverPostUrl = GetDwonloadServerPostBaseURL(iServerInfo);
            string rootDir       = GetInstance().UploadServer.RootDir;

            if (false == string.IsNullOrEmpty(rootDir))
            {
                serverPostUrl = string.Format("{0}/{1}", serverPostUrl, rootDir);
            }
            if (string.IsNullOrEmpty(serverPostUrl) == true)
            {
                return(null);
            }
            else
            {
                return(string.Format("{0}/{1}",
                                     serverPostUrl, BuildInfo.GetInstance().BuildName));
            }
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 登录.
        /// </summary>
        /// <param name="iTarget">登陆启动的目标对象.</param>
        /// <param name="iOnCompleted">完成回调函数.</param>
        protected override void SDKLogin(
            GameObject iTarget,
            Action <string> iOnCompleted)
        {
            this.Info("SDKLogin()");

            // 接入易接SDK的场合
            if (true == BuildInfo.GetInstance().Data.Options.isOptionValid(TSDKOptions.OneSDK))
            {
                OneSDKLibs.Instance.Login(
                    iTarget, iOnCompleted,
                    this.loginCheckBaseUrl, this.loginCheckCallback,
                    this.OnLoginCheckSuccessed, this.OnLoginCheckFailed,
                    this.autoReloginMaxCount, this.autoReloginCallback);
            }
            else
            {
                this.Error("SDKLogin():There is invalid options settings in sdk settings!!!");
            }
        }
Ejemplo n.º 19
0
        /// <summary>
        /// 更新&生成上传列表信息.
        /// </summary>
        /// <param name="iBundleType">Bundle Type.</param>
        /// <param name="iHashCodes">HashCode列表(Unity3d打包生成).</param>
        public void UpdateUploadList(TBundleType iBundleType, Dictionary <string, string> iHashCodes = null)
        {
            UploadList list = UploadList.GetInstance();

            if (list == null)
            {
                return;
            }

            list.AppVersion    = BuildInfo.GetInstance().BuildVersion;
            list.CenterVersion = BuildInfo.GetInstance().CenterVersion;

            // MainManifest
            if (TBundleType.Normal == iBundleType)
            {
                list.AddMainManifestAssetsTarget();
            }

            // 遍历Bundles
            foreach (BundleMap loop in this.Maps)
            {
                if (loop.Type != iBundleType)
                {
                    continue;
                }

                string hashCode = null;
                if (iHashCodes != null)
                {
                    hashCode = this.GetHashCodeOfBundle(iHashCodes, loop.ID);
                }

                // Bundle
                list.AddTarget(loop, TUploadFileType.Bundle, hashCode);
                if ((true == list.ManifestUpload) && (TBundleType.Scene != loop.Type))
                {
                    // Manifest(Normal)
                    list.AddTarget(loop, TUploadFileType.NormalManifest);
                }
            }
        }
Ejemplo n.º 20
0
        /// <summary>
        /// 取得下载资源用URL(Ftp格式).
        /// </summary>
        /// <returns>下载资源用URL(Ftp格式).</returns>
        /// <param name="iServerInfo">下载服务器信息.</param>
        public static string GetDownloadBaseURL(
            DownloadServerInfo iServerInfo)
        {
            string serverPostUrl   = GetDownloadServerPostURL(iServerInfo);
            string downloadBaseUrl = string.Format("http://{0}/bundles", serverPostUrl);

            // BuildTarget
                        #if UNITY_ANDROID
            downloadBaseUrl = string.Format("{0}/Android", downloadBaseUrl);
                        #endif

                        #if UNITY_IOS || UNITY_IOS
            downloadBaseUrl = string.Format("{0}/iOS", downloadBaseUrl);
                        #endif

            // AppVersion
            downloadBaseUrl = string.Format("{0}/{1}", downloadBaseUrl, BuildInfo.GetInstance().BuildVersion);

            // UtilsLog.Info ("GetDownloadBaseURL", "DownloadBaseUrl:{0}", downloadBaseUrl);
            return(downloadBaseUrl);
        }
Ejemplo n.º 21
0
        /// <summary>
        /// 取得玩家信息.
        /// </summary>
        /// <param name="iTarget">游戏对象.</param>
        /// <param name="iOnCompleted">完成回调函数.</param>
        protected override void SDKGetPlayerInfo(
            GameObject iTarget,
            Action <string> iOnCompleted = null)
        {
            if (TPlatformType.None == BuildInfo.GetInstance().PlatformType)
            {
                this.Error("GetPlayerInfo():The platformType is none in buildinfo.asset file!!!");
                return;
            }

            if (false == Application.isMobilePlatform)
            {
                return;
            }

            AndroidJavaClass  jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
            AndroidJavaObject jo = jc.GetStatic <AndroidJavaObject>("currentActivity");

            jo.Call("UToA_GetPlayerInfo",
                    iTarget.name,
                    iOnCompleted.Method.Name);
        }
Ejemplo n.º 22
0
        /// <summary>
        /// 解析支付信息.
        /// </summary>
        /// <returns>支付信息.</returns>
        /// <param name="iPayInfo">支付信息(Json格式数据).</param>
        /// <param name="iOnPaymentSuccessed">支付成功回调函数.</param>
        protected override SDKPaymentBaseInfo SDKParserPaymentInfo(
            string iPayInfo,
            Action <SDKAccountBaseInfo, string> iOnPaymentSuccessed)
        {
#if IAP_UI_TEST
            iOnPaymentSuccessed(null, null);
            return(null);
#else
            if (null == iOnPaymentSuccessed)
            {
                this.Warning("SDKParserPaymentInfo()::OnPaymentSuccessed is null!!!");
            }

            // 接入易接SDK的场合
            if (true == BuildInfo.GetInstance().Data.Options.isOptionValid(TSDKOptions.OneSDK))
            {
                return(OneSDKLibs.Instance.ParserPayResponseInfo(iPayInfo, iOnPaymentSuccessed));
            }
            else
            {
                return(JsonUtility.FromJson <TiangePaymentInfo> (iPayInfo));
            }
#endif
        }
Ejemplo n.º 23
0
        /// <summary>
        /// 取得当前AndroidSDK设定信息.
        /// </summary>
        /// <returns>当前AndroidSDK设定信息.</returns>
        static IAndroidSDKSettings GetCurAndroidSDKSetting()
        {
            IAndroidSDKSettings settings = null;

            // 平台类型
            TPlatformType platformType = BuildInfo.GetInstance().PlatformType;

            BuildLogger.LogMessage("PlatformType:{0}.", platformType.ToString());

            switch (platformType)
            {
            // 华为
            case TPlatformType.Huawei:
            {
                settings = HuaweiSDKSettings.GetInstance();
            }
            break;

            // 天鸽
            case TPlatformType.Tiange:
            {
                settings = TiangeSDKSettings.GetInstance();
            }
            break;

            case TPlatformType.None:
            case TPlatformType.iOS:
            default:
            {
                // 清空/Plugins/Android下的文件
            }
            break;
            }

            return(settings);
        }
Ejemplo n.º 24
0
        /// <summary>
        /// 登陆.
        /// </summary>
        /// <param name="iTarget">登陆对象.</param>
        /// <param name="iOnLoginCompleted">登陆完成.</param>
        public void AddPlayerInfo(
            GameObject iTarget,
            String iGameRank,
            String iGameRole,
            String iGameArea,
            String iGameSociaty,
            Action <string> iOnAddPlayerInfoCompleted = null)
        {
            if (TPlatformType.None == BuildInfo.GetInstance().PlatformType)
            {
                UtilsLog.Error("AndroidLibs", "AddPlayerInfo():The platformType is none in buildinfo.asset file!!!");
                return;
            }

            if (false == Application.isMobilePlatform)
            {
                return;
            }

            AndroidJavaClass  jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
            AndroidJavaObject jo = jc.GetStatic <AndroidJavaObject>("currentActivity");

            if (null != iOnAddPlayerInfoCompleted)
            {
                jo.Call("UToA_AddPlayerInfo",
                        iTarget.name,
                        iGameRank, iGameRole, iGameArea, iGameSociaty,
                        iOnAddPlayerInfoCompleted.Method.Name);
            }
            else
            {
                jo.Call("UToA_AddPlayerInfo",
                        iTarget.name,
                        iGameRank, iGameRole, iGameArea, iGameSociaty, null);
            }
        }
Ejemplo n.º 25
0
        public static string GetDownloadBasePath()
        {
            string path = string.Format("{0}/{1}", _downloadBaseUrl, BuildInfo.GetInstance().BuildVersionCode);

            return(path);
        }
Ejemplo n.º 26
0
        /// <summary>
        /// 打包资源文件
        /// </summary>
        /// <param name="buildTarget">Build target.</param>
        /// <param name="needCompress">If set to <c>true</c> need compress.</param>
        private static void BuildAssetBundle(BuildTarget buildTarget, bool needCompress = false)
        {
            const string funcBlock = "AssetBundlesBuild.BuildAssetBundle()";

            BuildLogger.OpenBlock(funcBlock);

            // 设置上传的打包类型
            UploadList.GetInstance().BuildTarget = buildTarget.ToString();

            BundlesConfig bcConfig = BundlesConfig.GetInstance();

            if ((null == bcConfig) || (0 >= bcConfig.Resources.Count))
            {
                BuildLogger.LogError("BuildAssetBundle::BundlesConfig is invalid!!!");
                return;
            }

            // 清空依赖关系列表
            BundlesMap bundlesMap = BundlesMap.GetInstance();

            if (null == bundlesMap)
            {
                BuildLogger.LogError("BuildAssetBundle::bundlesMap is invalid!!!");
                return;
            }
            bundlesMap.Clear();

            List <BundleResource> allConfig = bcConfig.Resources;

            // make bundle config
            foreach (BundleResource bc in allConfig)
            {
                // filter file
                if (bc.Mode == BundleMode.OneDir)
                {
                    string    bundleId = BundlesMap.GetBundleID(bc.Path);
                    BundleMap bm       = bundlesMap.GetOrCreateBundlesMap(bundleId);

                    bm.ID   = bundleId;
                    bm.Path = bc.Path;

                    // 取得当前目录的文件列表
                    List <string> files = GetAllFiles(bc.Path);

                    // 遍历文件列表
                    foreach (string file in files)
                    {
                        // .DS_Store文件
                        if (file.EndsWith(".DS_Store") == true)
                        {
                            continue;
                        }
                        // *.meta文件
                        if (file.EndsWith(".meta") == true)
                        {
                            continue;
                        }

                        // 若为忽略文件,则跳过
                        if (bcConfig.isIgnoreFile(bc, file) == true)
                        {
                            bm.RemoveIgnorFile(file);
                            continue;
                        }
                        bm.AddFile(file);
                    }

                    bundlesMap.Maps.Add(bm);
                }
                else if (bc.Mode == BundleMode.SceneOneToOne)
                {
                    // 取得当前目录的文件列表
                    List <string> files = GetAllFiles(bc.Path);

                    foreach (string file in files)
                    {
                        // .DS_Store文件
                        if (file.EndsWith(".DS_Store") == true)
                        {
                            continue;
                        }
                        // *.meta文件
                        if (file.EndsWith(".meta") == true)
                        {
                            continue;
                        }
                        // 若非场景文件,则跳过
                        if (file.EndsWith(".unity") == false)
                        {
                            continue;
                        }

                        // 若为忽略文件,则跳过
                        string    bundleId = BundlesMap.GetBundleID(file);
                        BundleMap bm       = bundlesMap.GetOrCreateBundlesMap(bundleId);
                        if (bcConfig.isIgnoreFile(bc, file) == true)
                        {
                            bm.RemoveIgnorFile(file);
                            continue;
                        }

                        bm.ID   = bundleId;
                        bm.Path = bc.Path;
                        bm.Type = TBundleType.Scene;
                        bm.AddFile(file);

                        bundlesMap.Maps.Add(bm);
                    }
                }
                else if (bc.Mode == BundleMode.FileOneToOne)
                {
                    // 取得当前目录的文件列表
                    List <string> files = GetAllFiles(bc.Path);

                    foreach (string file in files)
                    {
                        // .DS_Store文件
                        if (file.EndsWith(".DS_Store") == true)
                        {
                            continue;
                        }
                        // *.meta文件
                        if (file.EndsWith(".meta") == true)
                        {
                            continue;
                        }

                        // 若为忽略文件,则跳过
                        string    bundleId = BundlesMap.GetBundleID(file);
                        BundleMap bm       = bundlesMap.GetOrCreateBundlesMap(bundleId);
                        if (bcConfig.isIgnoreFile(bc, file) == true)
                        {
                            bm.RemoveIgnorFile(file);
                            continue;
                        }

                        bm.ID   = bundleId;
                        bm.Path = bc.Path;
                        bm.AddFile(file);

                        bundlesMap.Maps.Add(bm);
                    }
                }
                else if (bc.Mode == BundleMode.TopDirOneToOne)
                {
                    // 取得目录列表
                    string[] directories = Directory.GetDirectories(bc.Path);
                    if ((directories == null) || (directories.Length <= 0))
                    {
                        BuildLogger.LogWarning("The no subfolder in this path!!!(dir:{0})",
                                               bc.Path);
                        continue;
                    }

                    foreach (string dir in directories)
                    {
                        // 取得当前目录的文件列表
                        List <string> files = GetAllFiles(dir);

                        string bundleId = BundlesMap.GetBundleID(dir);
                        bundleId = BundlesMap.GetBundleID(dir);
                        if (string.IsNullOrEmpty(bundleId) == true)
                        {
                            continue;
                        }
                        BundleMap bm = bundlesMap.GetOrCreateBundlesMap(bundleId);
                        bm.ID   = bundleId;
                        bm.Path = bc.Path;

                        foreach (string file in files)
                        {
                            // .DS_Store文件
                            if (file.EndsWith(".DS_Store") == true)
                            {
                                continue;
                            }
                            // *.meta文件
                            if (file.EndsWith(".meta") == true)
                            {
                                continue;
                            }

                            // 若为忽略文件,则跳过
                            if (bcConfig.isIgnoreFile(bc, file) == true)
                            {
                                bm.RemoveIgnorFile(file);
                                continue;
                            }

                            bm.AddFile(file);
                        }

                        bundlesMap.Maps.Add(bm);
                    }
                }
            }

            // 目录检测
            string checkDir = UploadList.GetInstance().BundlesOutputDir;

            if (Directory.Exists(checkDir) == false)
            {
                Directory.CreateDirectory(checkDir);
            }
            checkDir = UploadList.GetInstance().BundlesOutputDirOfNormal;
            if (Directory.Exists(checkDir) == false)
            {
                Directory.CreateDirectory(checkDir);
            }
            checkDir = UploadList.GetInstance().BundlesOutputDirOfScene;
            if (Directory.Exists(checkDir) == false)
            {
                Directory.CreateDirectory(checkDir);
            }

            bool successed             = false;
            AssetBundleManifest result = null;

            string[]           allAssets = null;
            AssetBundleBuild[] targets   = null;

            // 一般Bundles
            try {
                targets = bundlesMap.GetAllNormalBundleTargets();
                BuildAssetBundleOptions options = BuildAssetBundleOptions.UncompressedAssetBundle;
                result = BuildPipeline.BuildAssetBundles(
                    UploadList.GetInstance().BundlesOutputDirOfNormal,
                    targets,
                    options,
                    buildTarget);
                BuildLogger.LogMessage(" -> BuildPipeline.BuildAssetBundles");
                if (result != null)
                {
                    allAssets = result.GetAllAssetBundles();
                    if ((allAssets != null) && (targets.Length == allAssets.Length))
                    {
                        successed = true;
                    }
                }
            } catch (Exception exp) {
                BuildLogger.LogException("BuildAssetBundles Detail : {0}", exp.Message);
                successed = false;
            }

            // 更新导出标志位
            if (successed == true)
            {
                BuildLogger.LogMessage(" -> BundlesConfig.UpdateBundleStateWhenCompleted");

                Dictionary <string, string> hashCodes = new Dictionary <string, string>();
                foreach (string asset in allAssets)
                {
                    Hash128 hashCode = result.GetAssetBundleHash(asset);
                    if (string.IsNullOrEmpty(hashCode.ToString()) == true)
                    {
                        continue;
                    }
                    string fileSuffix = UploadList.GetInstance().FileSuffix;
                    string key        = asset;
                    if (string.IsNullOrEmpty(fileSuffix) == false)
                    {
                        fileSuffix = fileSuffix.ToLower();
                        fileSuffix = string.Format(".{0}", fileSuffix);
                        key        = key.Replace(fileSuffix, "");
                    }
                    hashCodes[key] = hashCode.ToString();
                }
                // 初始化检测信息(Hash Code)
                bundlesMap.UpdateUploadList(TBundleType.Normal, hashCodes);
                BuildLogger.LogMessage(" -> BundlesMap.UpdateUploadList Normal");
            }

            // Scene Bundles
            List <SceneBundleInfo> targetScenes = bundlesMap.GetAllSceneBundleTargets();

            if ((targetScenes != null) && (targetScenes.Count > 0))
            {
                foreach (SceneBundleInfo scene in targetScenes)
                {
                    if ((scene == null) ||
                        (scene.GetAllTargets() == null) ||
                        (scene.GetAllTargets().Length <= 0))
                    {
                        continue;
                    }
                    try {
                        BuildOptions options = BuildOptions.BuildAdditionalStreamedScenes;
                        if (TBuildMode.Debug == BuildInfo.GetInstance().BuildMode)
                        {
                            options |= BuildOptions.Development;
                        }
                        string sceneState = BuildPipeline.BuildPlayer(
                            scene.GetAllTargets(),
                            UploadList.GetLocalSceneBundleFilePath(scene.BundleId),
                            buildTarget,
                            options);
                        BuildLogger.LogMessage(" -> BuildPipeline.BuildStreamedSceneAssetBundle(State:{0})", sceneState);
                    } catch (Exception exp) {
                        BuildLogger.LogException("BuildStreamedSceneAssetBundle Detail:{0}", exp.Message);
                        successed = false;
                    }
                }
            }

            // 更新导出标志位
            if (successed == true)
            {
                BuildLogger.LogMessage(" -> BundlesConfig.UpdateBundleStateWhenCompleted");

                // 初始化检测信息(Hash Code)
                bundlesMap.UpdateUploadList(TBundleType.Scene);
                BuildLogger.LogMessage(" -> BundlesMap.UpdateUploadList Scene");
            }

            BuildInfo.GetInstance().ExportToJsonFile();
            BuildLogger.LogMessage(" -> BuildInfo.ExportToJsonFile");

            BuildLogger.CloseBlock();
        }
Ejemplo n.º 27
0
        static void BuildForAndroid()
        {
            const string funcBlock = "ProjectBuild.BuildForAndroid()";

            BuildLogger.OpenBlock(funcBlock);

            // 设定打包信息
            SetBuildInfoFromParameters();

            TBuildMode buildMode = BuildInfo.GetInstance().BuildMode;

            BuildLogger.LogMessage("BuildMode:{0}", buildMode.ToString());

            // 输出格式({ProjectName}_v{ProjectVersion}_{buildNumber}_YYYYMMDDHHMMSS.apk)
            string buildTime = BuildParameters.BuildTime;

            // 输出路径
            // 游戏输出目录(Android):{OutputDir}/Android/{ProjectName}
            string outputDir = GetOutputDir(BuildTarget.Android, BuildParameters.OutputDir);

            if (outputDir == null)
            {
                BuildLogger.LogException("Create Dir Failed.!!(Dir:{0})",
                                         BuildParameters.OutputDir);
                throw new ApplicationException();
            }

            // 打包选项
            BuildOptions buildOptionTmp = BuildOptions.None;

            if (TBuildMode.Debug == buildMode)
            {
                buildOptionTmp |= BuildOptions.Development;
                buildOptionTmp |= BuildOptions.AllowDebugging;
                buildOptionTmp |= BuildOptions.ConnectWithProfiler;
            }
            else
            {
                bool isCheatMode = BuildParameters.IsCheatMode;
                if (true == isCheatMode)
                {
                    buildOptionTmp |= BuildOptions.Development;
                }
            }
            BuildLogger.LogMessage("BuildOption:{0}", ((int)buildOptionTmp).ToString());

            // 版本号
            string buildVersion = BuildInfo.GetInstance().BuildVersion;

            if (string.IsNullOrEmpty(buildVersion) == false)
            {
                PlayerSettings.bundleVersion = buildVersion;
            }
            BuildLogger.LogMessage("BuildVersion:{0}", buildVersion);

            // buildVersionCode
            int buildVersionCode = BuildInfo.GetInstance().BuildVersionCode;

            PlayerSettings.Android.bundleVersionCode = buildVersionCode;
            BuildLogger.LogMessage("BundleVersionCode:{0}", buildVersionCode.ToString());

            // 中心服务器版本号
            string centerVersion = BuildInfo.GetInstance().CenterVersion;

            BuildLogger.LogMessage("CenterVersion:{0}", centerVersion);

            // 工程名
            string projectName = BuildInfo.GetInstance().BuildName;

            BuildLogger.LogMessage("ProjectName:{0}", projectName);

            // 游戏名字
            string gameName = BuildParameters.GameName;

            if (true == string.IsNullOrEmpty(gameName))
            {
                gameName = projectName;
            }
            PlayerSettings.productName = gameName;
            BuildLogger.LogMessage("GameName:{0}", gameName);

            // BuildID
            string buildID = BuildInfo.GetInstance().BuildID;

            if (false == string.IsNullOrEmpty(buildID))
            {
#if UNITY_5_5_OR_NEWER
                PlayerSettings.applicationIdentifier = buildID;
#else
                PlayerSettings.bundleIdentifier = buildID;
#endif
            }
            BuildLogger.LogMessage("BuildID:{0}", buildID);

            // 初始化
            InitForAndroidBuild();
            BuildLogger.LogMessage(" --> InitForAndroidBuild()");

            // Apk输出路径
            int buildNumber = BuildInfo.GetInstance().BuildNumber;
            BuildLogger.LogMessage("BuildNumber:{0}", buildNumber.ToString());

            string apkPath = string.Format("{0}/{1}_{2}_v{3}_-_{4}_{5}.apk",
                                           outputDir,
                                           projectName,
                                           buildMode,
                                           buildVersion,
                                           buildTime, buildID);
            if (0 < buildNumber)
            {
                apkPath = string.Format("{0}/{1}_{2}_v{3}_{4}_{5}_{6}.apk",
                                        outputDir,
                                        projectName,
                                        buildMode,
                                        buildVersion,
                                        buildNumber,
                                        buildTime, buildID);
            }
            BuildLogger.LogMessage("Apk File Path:{0}", apkPath);

            // 输出打包信息
            OutputBuildInfo(buildVersion, projectName);

            // 开发者模式
            if (BuildOptions.Development == buildOptionTmp)
            {
                // 打包之前,移除非资源对象
                AssetBundles.Common.MoveUnResources();
            }

            // Android下IL2CPP不支持,所以设置回Mono
            PlayerSettings.SetPropertyInt("ScriptingBackend", (int)ScriptingImplementation.Mono2x, BuildTarget.Android);

            string error = BuildPipeline.BuildPlayer(GetBuildScenes(), apkPath, BuildTarget.Android, buildOptionTmp);

            // 开发者模式
            if (BuildOptions.Development == buildOptionTmp)
            {
                // 打包之后,恢复非资源对象
                AssetBundles.Common.MoveBackUnResources();
            }

            if (error != null && !error.Equals("") && !(error.Length == 0))
            {
                BuildLogger.LogException("Android Build Failed!!!(error:{0})", error);
                BuildLogger.CloseBlock();
                throw new ApplicationException();
            }
            else
            {
                BuildLogger.LogMessage("Android Build Successed.");
            }
            BuildLogger.CloseBlock();
        }
Ejemplo n.º 28
0
        static void ExportXcodeProject()
        {
            const string funcBlock = "ProjectBuild.ExportXcodeProject()";

            BuildLogger.OpenBlock(funcBlock);

            // 设定打包信息
            SetBuildInfoFromParameters();
            // 平台类型
            BuildInfo.GetInstance().PlatformType = TPlatformType.iOS;

            TBuildMode buildMode = BuildInfo.GetInstance().BuildMode;

            BuildLogger.LogMessage("BuildMode:{0}", buildMode.ToString());

            // 初始化
            InitForExportXcodeProject();
            BuildLogger.LogMessage(" --> InitForExportXcodeProject()");

            // 预定义宏
            //PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.iOS, "GAMELINK");

            // 游戏输出目录(iOS):{OutputDir}/iOS/{ProjectName}
            string outputDir = GetOutputDir(BuildTarget.iOS, null);

            if (outputDir == null)
            {
                BuildLogger.LogException("Create Dir Failed.!!(Dir:{0})",
                                         BuildParameters.OutputDir);
                throw new ApplicationException();
            }

            // 打包选项
            BuildOptions buildOptionTmp = BuildOptions.None;

            if (TBuildMode.Debug == buildMode)
            {
                buildOptionTmp |= BuildOptions.Development;
                buildOptionTmp |= BuildOptions.AllowDebugging;
                buildOptionTmp |= BuildOptions.ConnectWithProfiler;
            }
            else
            {
                bool isCheatMode = BuildParameters.IsCheatMode;
                if (true == isCheatMode)
                {
                    buildOptionTmp |= BuildOptions.Development;
                }
            }
            BuildLogger.LogMessage("BuildOption:{0}", ((int)buildOptionTmp).ToString());

            // 工程名
            string projectName = BuildInfo.GetInstance().BuildName;

            BuildLogger.LogMessage("ProjectName:{0}", projectName);

            // 游戏名字
            string gameName = BuildParameters.GameName;

            if (true == string.IsNullOrEmpty(gameName))
            {
                gameName = projectName;
            }
            PlayerSettings.iOS.applicationDisplayName = gameName;
            BuildLogger.LogMessage("GameName:{0}", gameName);

            // BuildID
            string buildID = BuildInfo.GetInstance().BuildID;

            if (false == string.IsNullOrEmpty(buildID))
            {
#if UNITY_5_5_OR_NEWER
                PlayerSettings.applicationIdentifier = buildID;
#else
                PlayerSettings.bundleIdentifier = buildID;
#endif
            }
            BuildLogger.LogMessage("BuildID:{0}", buildID);

            // 版本号
            string buildVersion = BuildInfo.GetInstance().BuildVersion;
            PlayerSettings.bundleVersion = buildVersion;
            BuildLogger.LogMessage("BuildVersion:{0}", buildVersion);

            // 中心服务器版本号
            string centerVersion = BuildInfo.GetInstance().CenterVersion;
            BuildLogger.LogMessage("CenterVersion:{0}", centerVersion);

            // XCode工程目录
            string XcodeProject = string.Format("{0}/XcodeProject", outputDir);

            // 输出打包信息
            OutputBuildInfo(buildVersion, projectName);

            // 开发者模式
            if (BuildOptions.Development == buildOptionTmp)
            {
                // 打包之前,将非资源对象,临时移动到临时文件夹
                AssetBundles.Common.MoveUnResources();
            }

            // 打包成XCode工程目录
                        #if UNITY_5_OR_NEWER
            string error = BuildPipeline.BuildPlayer(
                GetBuildScenes(),
                XcodeProject,
                BuildTarget.iOS, buildOptionTmp);
                        #else
            string error = BuildPipeline.BuildPlayer(
                GetBuildScenes(),
                XcodeProject,
                BuildTarget.iOS, buildOptionTmp);
                        #endif

            // 开发者模式
            if (BuildOptions.Development == buildOptionTmp)
            {
                // 恢复非资源性文件
                AssetBundles.Common.MoveBackUnResources();
            }

            // 存在错误则,打包编译失败
            if (error != null && !error.Equals("") && !(error.Length == 0))
            {
                BuildLogger.LogException("iOS Build Failed!!!(error:{0})", error);
                BuildLogger.CloseBlock();
                throw new ApplicationException();
            }
            else
            {
                BuildLogger.LogMessage("iOS Build Successed.");
            }
            BuildLogger.CloseBlock();
        }
Ejemplo n.º 29
0
        /// <summary>
        /// 检测服务器上得各个路径.
        /// </summary>
        /// <returns><c>true</c>, OK, <c>false</c> NG.</returns>
        private IEnumerator CheckDirsOnServer()
        {
            string buildName = BuildInfo.GetInstance().BuildName;

            // 上传服务器信息
            UploadServerInfo server = ServersConf.GetInstance().UploadServer;

            if (server == null)
            {
                this._State = TRunState.GetServerInfoFailed;
                yield return(null);
            }

            // 取得上传URL
            string uploadBaseUrl = ServersConf.GetUploadBaseURL(server);

            int    startIndex = uploadBaseUrl.IndexOf(buildName);
            string dirsInfo   = uploadBaseUrl.Substring(startIndex);

            string[] dirNames = dirsInfo.Split('/');

            string curUrl     = uploadBaseUrl.Substring(0, startIndex - 1);
            string createdDir = null;

            for (int i = 0; i < dirNames.Length; ++i)
            {
                if (this.CheckDirOnServer(server, curUrl, dirNames [i], ref createdDir) == true)
                {
                    curUrl = string.Format("{0}/{1}", curUrl, dirNames [i]);
                    yield return(new WaitForEndOfFrame());
                }
                else
                {
                    this._State = TRunState.CheckDirFailed;
                    yield return(null);
                }
            }

            // 检测目录
            // Url:<ParentUrl>/bundles
            if (this.CheckDirOnServer(server, curUrl, "bundles", ref createdDir) == true)
            {
                curUrl = string.Format("{0}/{1}", curUrl, "bundles");
                yield return(new WaitForEndOfFrame());
            }
            else
            {
                this._State = TRunState.CheckDirFailed;
                yield return(null);
            }

            // Url:<ParentUrl>/<BuildTarget>
            string buildTarget = UploadList.GetInstance().BuildTarget;

            if (this.CheckDirOnServer(server, curUrl, buildTarget, ref createdDir) == true)
            {
                curUrl = string.Format("{0}/{1}", curUrl, buildTarget);
                yield return(new WaitForEndOfFrame());
            }
            else
            {
                this._State = TRunState.CheckDirFailed;
                yield return(null);
            }

            // Url:<ParentUrl>/<AppVersion>
            string appVersion = UploadList.GetInstance().AppVersion;

            if (this.CheckDirOnServer(server, curUrl, appVersion, ref createdDir) == true)
            {
                curUrl = string.Format("{0}/{1}", curUrl, appVersion);
                yield return(new WaitForEndOfFrame());
            }
            else
            {
                this._State = TRunState.CheckDirFailed;
                yield return(null);
            }

            // Url:<ParentUrl>/Normal
            string subUrlTmp        = curUrl;
            string subCreatedDirTmp = createdDir;

            if (this.CheckDirOnServer(server, subUrlTmp,
                                      UploadList.AssetBundleDirNameOfNormal, ref subCreatedDirTmp) == true)
            {
                subUrlTmp = string.Format("{0}/{1}", subUrlTmp, UploadList.AssetBundleDirNameOfNormal);
                yield return(new WaitForEndOfFrame());
            }
            else
            {
                this._State = TRunState.CheckDirFailed;
                yield return(null);
            }

            // Url:<ParentUrl>/Scene
            subUrlTmp        = curUrl;
            subCreatedDirTmp = createdDir;
            if (this.CheckDirOnServer(server, subUrlTmp,
                                      UploadList.AssetBundleDirNameOfScenes, ref subCreatedDirTmp) == true)
            {
                subUrlTmp = string.Format("{0}/{1}", subUrlTmp, UploadList.AssetBundleDirNameOfScenes);
                yield return(new WaitForEndOfFrame());
            }
            else
            {
                this._State = TRunState.CheckDirFailed;
                yield return(null);
            }

            yield return(null);
        }
Ejemplo n.º 30
0
        /// <summary>
        /// 设定打包信息
        /// </summary>
        private static void SetBuildInfoFromParameters()
        {
            // 平台类型
            TPlatformType platformType = BuildParameters.PlatformType;

            if (TPlatformType.None != platformType)
            {
                BuildInfo.GetInstance().PlatformType = platformType;
            }

            // 工程名
            string projectName = BuildParameters.ProjectName;

            if (false == string.IsNullOrEmpty(projectName))
            {
                BuildInfo.GetInstance().BuildName = projectName;
            }

            // 打包ID
            string buildID = BuildParameters.BuildId;

            if (false == string.IsNullOrEmpty(buildID))
            {
                BuildInfo.GetInstance().BuildID = buildID;
            }

            // 打包模式
            TBuildMode buildMode = BuildParameters.BuildMode;

            if (TBuildMode.None != buildMode)
            {
                BuildInfo.GetInstance().BuildMode = buildMode;
            }

            // 版本号
            string buildVersion = BuildParameters.BuildVersion;

            if (false == string.IsNullOrEmpty(buildVersion))
            {
                BuildInfo.GetInstance().BuildVersion = buildVersion;
            }

            // VersionCode
            int buildVersionCode = BuildParameters.BuildVersionCode;

            if (-1 != buildVersionCode)
            {
                BuildInfo.GetInstance().BuildVersionCode = buildVersionCode;
            }

            // 中心服务器版本号
            string centerVersion = BuildParameters.CenterVersion;

            if (false == string.IsNullOrEmpty(centerVersion))
            {
                BuildInfo.GetInstance().CenterVersion = centerVersion;
            }

            // 打包号
            int buildNumber = BuildParameters.BuildNumber;

            if (-1 < buildNumber)
            {
                BuildInfo.GetInstance().BuildNumber = buildNumber;
            }

            // 是否跳过下载
            bool isSkipDownload = BuildParameters.IsSkipDownload;

            ServersConf.GetInstance().SkipDownload = isSkipDownload;
        }