Beispiel #1
0
    /** 初始化服务器列表 */
    public static void loadServerList(Action func)
    {
        _loader.setCompleteCall(() =>
        {
            XML xml = _loader.getXML();

            if (xml != null)
            {
                foreach (XML xl in xml.getChildrenByName("server"))
                {
                    serverList.add(xl.getProperty("name"));
                    serverList.add(xl.getProperty("value"));
                }
            }
            else
            {
                Ctrl.throwError("未找到服务器列表配置:", ShineGlobal.serverListPath);
            }

            _loader.unload();
            func();
        });

        _loader.loadStreamingAsset(ShineGlobal.serverListPath);
    }
Beispiel #2
0
    /** 初始化 */
    public static void load(Action func)
    {
        _loader = new ShineLoader();

        _loader.setCompleteCall(() =>
        {
            XML xml = _loader.getXML();

            foreach (XML xl in xml.getChildrenByName("loginURL"))
            {
                loginURLs.add(xl.getProperty("value"));
            }

            loginHttpURL = getRandomLoginURL();
            cdnURL       = xml.getChildrenByNameOne("cdnURL").getProperty("value");

            //正式版本
            if (ShineSetting.isRelease)
            {
                ShineGlobal.cdnSourcePath = cdnURL;
            }

            XML tt;

            if ((tt = xml.getChildrenByNameOne("isOfficial")) != null)
            {
                ShineSetting.isOfficial = StringUtils.strToBoolean(tt.getProperty("value"));
            }

            _loader.unload();
            func();
        });

        _loader.loadStreamingAsset(ShineGlobal.settingPath);
    }