Example #1
0
    private void OnApplicationPause(bool pause)
    {
        UnityEngine.Debug.LogWarning("OnApplicationPause  == " + pause);
        if (TsPlatform.IsMobile)
        {
            if (NmFacebookManager.instance.IsFacebook)
            {
                return;
            }
            if (NrTSingleton <NrMainSystem> .Instance.m_bIsBilling)
            {
                return;
            }
            GameObject gameObject = GameObject.Find("OmniataManager");
            if (gameObject == null)
            {
                gameObject = new GameObject("OmniataManager");
            }
            if (gameObject != null)
            {
                OmniataComponent component = gameObject.GetComponent <OmniataComponent>();
                if (component && !pause)
                {
                    DateTime dateTime  = DateTime.Now.ToLocalTime();
                    DateTime arg_AE_0  = dateTime;
                    DateTime dateTime2 = new DateTime(1970, 1, 1, 0, 0, 0, 0);
                    int      num       = (int)(arg_AE_0 - dateTime2.ToLocalTime()).TotalSeconds;
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    dictionary.Add("ts", num.ToString());
                    dictionary.Add("step", "pauseoff");
                    dictionary.Add("device", SystemInfo.deviceUniqueIdentifier);
                    if (TsPlatform.IsAndroid)
                    {
                        dictionary.Add("version", TsPlatform.APP_VERSION_AND);
                    }
                    else if (TsPlatform.IsIPhone)
                    {
                        dictionary.Add("version", TsPlatform.APP_VERSION_IOS);
                    }
                    component.TrackLoad(dictionary);
                }
            }
            if (pause && Scene.CurScene > Scene.Type.LOGIN)
            {
                NrTSingleton <FiveRocksEventManager> .Instance.Placement("Game_end");

                UnityEngine.Debug.LogWarning("OnApplicationPause");
                NrTSingleton <NrMainSystem> .Instance.OnApplicationPause();

                BaseNet_Game.GetInstance().Quit();
            }
            else if (NrWebViewObject.GetGameObject() == null)
            {
                UnityEngine.Debug.LogWarning("NrWebViewObject == NULL");
            }
        }
    }
Example #2
0
    public static void DownloadOmniataLog(bool bStart)
    {
        DateTime dateTime  = DateTime.Now.ToLocalTime();
        DateTime arg_29_0  = dateTime;
        DateTime dateTime2 = new DateTime(1970, 1, 1, 0, 0, 0, 0);
        int      num       = (int)(arg_29_0 - dateTime2.ToLocalTime()).TotalSeconds;
        Dictionary <string, string> dictionary = new Dictionary <string, string>();

        dictionary.Add("ts", num.ToString());
        if (bStart)
        {
            dictionary.Add("step", "loading_start");
        }
        else
        {
            dictionary.Add("step", "loading_complete");
        }
        dictionary.Add("device", SystemInfo.deviceUniqueIdentifier);
        if (TsPlatform.IsAndroid)
        {
            dictionary.Add("version", TsPlatform.APP_VERSION_AND);
        }
        else if (TsPlatform.IsIPhone)
        {
            dictionary.Add("version", TsPlatform.APP_VERSION_IOS);
        }
        GameObject pkGoOminiata = StageSystemCheck.pkGoOminiata;

        if (pkGoOminiata)
        {
            OmniataComponent component = pkGoOminiata.GetComponent <OmniataComponent>();
            if (component)
            {
                component.TrackLoad(dictionary);
            }
        }
    }