Exemple #1
0
    public void StartApplication(Action <float, string> onLoadConfig)
    {
#if UNITY_WEBPLAYER
        if (!Application.isEditor && Application.isWebPlayer)
        {
            //if (!Security.PrefetchSocketPolicy(AppConfig.SocketUrl, AppConfig.SocketPort, 999))
            if (!Security.PrefetchSocketPolicy("210.245.94.106", 9933, 999))
            {
                Debug.LogError("Security Exception. Policy file load failed!");
            }
            else
            {
                Debug.LogWarning("Security Good. Policy file load success!");
            }
        }
#endif

        sleepTimeout        = Screen.sleepTimeout;
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
        setting             = new PuSetting(onLoadConfig);

        //PingManager.Instance.Load();

        PuMain.Setting.Threading.QueueOnMainThread(() =>
        {
            PuMain.Dispatcher.onWarningUpgrade += Dispatcher_onWarningUpgrade;
            PuMain.Dispatcher.onDailyGift      += Dispatcher_onDailyGift;
            PuMain.Dispatcher.onNoticeMessage  += Dispatcher_onNoticeMessage;
        });

        SocialService.SocialStart();

        currentNetworkType = Application.internetReachability;
    }