Ejemplo n.º 1
0
        /// <summary>
        /// 删除热更文件
        /// </summary>
        /// <param name="onDelete"></param>
        public void DeleteHotfixDir(Action <bool> onDelete)
        {
            FileMark fileMark = new FileMark(Application.persistentDataPath, FileChecker.DeleteHotfixMark);

            fileMark.Delete();

            DirectoryInfo dir = new DirectoryInfo(AssetLoader.ExternalHotfixPath);

            if (dir.Exists)
            {
                try
                {
                    dir.Delete(true);
                    onDelete?.Invoke(true);
                }
                catch (Exception e)
                {
                    onDelete?.Invoke(false);

                    fileMark.UpdateRecord("true");

                    BuglyAgent.ReportException("DeleteHotfixDir", e.Message, e.StackTrace);
                    PopupManager.ShowAlertWindow(I18NManager.Get("Update_RepairFail"), null,
                                                 I18NManager.Get("Update_RepairCloseGame")).WindowActionCallback = evt =>
                    {
                        Application.Quit();
                    };
                }
            }
            else
            {
                onDelete?.Invoke(true);
            }
        }
Ejemplo n.º 2
0
    void Awake()
    {
        luaenv = new LuaEnv();
        gameObject.AddComponent <OutLog>();
        Mono = gameObject.AddComponent <emptyMono>();
        Application.targetFrameRate = AppConst.lockFrame;
#if ISDEBUG
        //gameObject.AddComponent<TestConsole>();
        m_LastUpdateShowTime = Time.realtimeSinceStartup;
#endif

        #region bugly
        //开启SDK的日志打印,发布版本请务必关闭
#if ISDEBUG
        BuglyAgent.ConfigDebugMode(true);
#else
        BuglyAgent.ConfigDebugMode(false);
#endif
        //注册日志回调,替换使用'Application.RegisterLogCallback(Application.LogCallback)'注册日志回调的方式
        BuglyAgent.RegisterLogCallback(OutLog.HandleLog);

#if UNITY_IPHONE || UNITY_IOS
        BuglyAgent.InitWithAppId("Your App ID");
#elif UNITY_ANDROID
        BuglyAgent.InitWithAppId("7599ce92e1");
#endif
        //如果你确认已在对应的ios工程或Andoird工程初始化SDK,那么在脚本中只需启动C#异常捕获上报功能即可
        BuglyAgent.EnableExceptionHandler();
        #endregion

        EventManager.instance.RegistEvent(NetEventType.OnSetUpdateWindowTipTxt, SetUpdateTipText);
    }
Ejemplo n.º 3
0
        //---------------------------------------------------------------------
        IEnumerator _localLoadAssetBundleAsync(string url, Action <AssetBundle> cb)
        {
            AssetBundle ab = null;

            using (UnityWebRequest www_request = UnityWebRequest.Get(url))
            {
                yield return(www_request.SendWebRequest());

                if (www_request.isHttpError || www_request.isNetworkError)
                {
                    BuglyAgent.PrintLog(LogSeverity.LogError, www_request.error);
                }
                else
                {
                    if (www_request.responseCode == 200)
                    {
                        ab = DownloadHandlerAssetBundle.GetContent(www_request);
                    }
                }
            }

            if (cb != null)
            {
                cb.Invoke(ab);
            }
        }
Ejemplo n.º 4
0
        //---------------------------------------------------------------------
        IEnumerator _wwwLoadTextureAsync(string url, Action <Texture> cb)
        {
            Texture texture = null;

            using (UnityWebRequest www_request = UnityWebRequest.Get(url))
            {
                www_request.downloadHandler = new DownloadHandlerTexture();
                yield return(www_request.SendWebRequest());

                if (www_request.isHttpError || www_request.isNetworkError)
                {
                    BuglyAgent.PrintLog(LogSeverity.LogError, www_request.error);
                }
                else
                {
                    if (www_request.responseCode == 200)
                    {
                        texture = ((DownloadHandlerTexture)www_request.downloadHandler).texture;
                    }
                }
            }

            if (cb != null)
            {
                cb.Invoke(texture);
            }
        }
Ejemplo n.º 5
0
        //---------------------------------------------------------------------
        IEnumerator _wwwLoadTextAsync(string url, Action <string> cb)
        {
            string s = string.Empty;

            using (UnityWebRequest www_request = UnityWebRequest.Get(url))
            {
                yield return(www_request.SendWebRequest());

                if (www_request.isHttpError || www_request.isNetworkError)
                {
                    BuglyAgent.PrintLog(LogSeverity.LogError, www_request.error);
                }
                else
                {
                    if (www_request.responseCode == 200)
                    {
                        s = www_request.downloadHandler.text;
                    }
                }
            }

            if (cb != null)
            {
                cb.Invoke(s);
            }
        }
Ejemplo n.º 6
0
 public static void SetAutoReportLogLevel(int level)
 {
     try
     {
         if (level == 5) //BuglyLogLevelVerbose
         {
             BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.Log);
         }
         else if (level == 4) //BuglyLogLevelDebug
         {
             BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogDebug);
         }
         else if (level == 3) //BuglyLogLevelInfo
         {
             BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogInfo);
         }
         else if (level == 2) //BuglyLogLevelWarn
         {
             BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogWarning);
         }
         else if (level == 1) //BuglyLogLevelError
         {
             BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogError);
         }
         else if (level == 0) //BuglyLogLevelSilent
         {
             BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogException);
             BuglyAgent.ConfigDebugMode(false);
         }
     }
     catch (Exception ex)
     {
         MSDKLog.LogError("SetAutoReportLogLevel with unknown error = \n" + ex.Message + "\n" + ex.StackTrace);
     }
 }
Ejemplo n.º 7
0
 static public int InitWithAppId_s(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         System.String a1;
         checkType(l, 1, out a1);
         BuglyAgent.InitWithAppId(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
Ejemplo n.º 8
0
    public static void Initialize()
    {
        //---- Enable the debug log print,Release下需要设为false
#if DEBUG
        BuglyAgent.ConfigDebugMode(true);
#else
        BuglyAgent.ConfigDebugMode(false);
#endif

        //---- Config default channel, version, user
        //BuglyAgent.ConfigDefault (null, null, null, 0);

        //---- Config auto report log level, default is LogSeverity.LogError, so the LogError, LogException log will auto report
        BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogError);

        //---- Config auto quit the application make sure only the first one c# exception log will be report, please don't set TRUE if you do not known what are you doing.
        //BuglyAgent.ConfigAutoQuitApplication (false);

        //---- If you need register Application.RegisterLogCallback(LogCallback), you can replace it with this method to make sure your function is ok.
        //BuglyAgent.RegisterLogCallback (null);

        //---- Init the bugly sdk and enable the c# exception handler.
        BuglyAgent.InitWithAppId(_BuglyAppID);

        //---- TODO Required. If you do not need call 'InitWithAppId(string)' to initialize the sdk(may be you has initialized the sdk it associated Android or iOS project),
        //---- please call this method to enable c# exception handler only.
        //BuglyAgent.EnableExceptionHandler ();

        //---- TODO NOT Required. If you need to report extra data with exception, you can set the extra handler
        //BuglyAgent.SetLogCallbackExtrasHandler (MyLogCallbackExtrasHandler);

        BuglyAgent.PrintLog(LogSeverity.LogInfo, "Bugly init complete, time: {0}", System.DateTime.Now);
        //Debug.Log(HobaString.Format("Bugly init complete, time: {0}, verion: v{1}", System.DateTime.Now, BuglyAgent.PluginVersion));
    }
Ejemplo n.º 9
0
        private static void HandleClientClientSyncCommand(uint dwFrqNo, CSDT_FRAPBOOT_CC ccSynDt)
        {
            int           num           = 0;
            FRAME_CMD_PKG fRAME_CMD_PKG = FRAME_CMD_PKG.New();

            TdrError.ErrorType errorType = fRAME_CMD_PKG.unpack(ref ccSynDt.stSyncInfo.szBuff, (int)ccSynDt.stSyncInfo.wLen, ref num, 0u);
            DebugHelper.Assert(errorType == 0);
            if (errorType == null)
            {
                IFrameCommand frameCommand = FrameCommandFactory.CreateFrameCommand(ref fRAME_CMD_PKG);
                if (frameCommand != null)
                {
                    frameCommand.playerID = ccSynDt.dwObjID;
                    frameCommand.frameNum = dwFrqNo;
                    Singleton <FrameSynchr> .GetInstance().PushFrameCommand(frameCommand);
                }
                else if ((FrameWindow._frameExceptionCounter += 1) <= 30)
                {
                    BuglyAgent.ReportException(new Exception("CreateFrameCommandException"), "create ccSync frame command error!");
                }
            }
            else if ((FrameWindow._frameExceptionCounter += 1) <= 30)
            {
                BuglyAgent.ReportException(new Exception("TdrUnpackException"), "CCSync unpack error!");
            }
            fRAME_CMD_PKG.Release();
        }
Ejemplo n.º 10
0
    public override void Start()
    {
        if (AppConfig.Instance.needChooseServer == false)
        {
            //测试的时候不用选服
            EnterGame();
            return;
        }

        Debug.Log("versionServer=>" + AppConfig.Instance.versionServer);

        FileMark fileMark = new FileMark(Application.persistentDataPath, FileChecker.DeleteHotfixMark);

        if (_isCallbackTypeSwitch == LoginCallbackType.RepairResource || fileMark.ReadRecord() == "true")
        {
            if (_isCallbackTypeSwitch != LoginCallbackType.RepairResource)
            {
                BuglyAgent.ReportException("UpdateController Start", "app restart for repair", "none");
            }

            FileChecker checker = new FileChecker();
            checker.CleanForRepair(isDelete =>
            {
                if (isDelete)
                {
                    FlowText.ShowMessage(I18NManager.Get("Update_RepairFinish"));
                    ConnetToServer();
                }
            });
        }
        else
        {
            ConnetToServer();
        }
    }
Ejemplo n.º 11
0
        static void InitBugly()
        {
            if (Application.isEditor)
            {
                return;
            }

            // Enable the debug log print
            BuglyAgent.ConfigDebugMode(enable: Config.enableDebug);
            // Config default channel, version, user
            BuglyAgent.ConfigDefault(channel: Config.store, $"{Config.versionName}-{Config.versionCode}",
                                     user: UserInfoManager.getUserInfo().userId ?? "anonymous", 0);
            // Config auto report log level, default is LogSeverity.LogError, so the LogError, LogException log will auto report
            BuglyAgent.ConfigAutoReportLogLevel(level: LogSeverity.LogWarning);
            // Config auto quit the application make sure only the first one c# exception log will be report, please don't set TRUE if you do not known what are you doing.
            BuglyAgent.ConfigAutoQuitApplication(false);
            // If you need register Application.RegisterLogCallback(LogCallback), you can replace it with this method to make sure your function is ok.
            BuglyAgent.RegisterLogCallback(null);

            // Init the bugly sdk and enable the c# exception handler.
            BuglyAgent.InitWithAppId(appId: Config.buglyId);

            // please call this method to enable c# exception handler only.
            BuglyAgent.EnableExceptionHandler();
        }
Ejemplo n.º 12
0
    public void InitBuglyAgent()
    {
        string AppKey_ios;
        string AppKey_Android;

        if (DebugConfigController.Instance.FormalData)
        {
            AppKey_Android = ConfigurationController.Instance.BuglyAppKey_AndroidFormal;
            AppKey_ios     = ConfigurationController.Instance.BuglyAppKey_iosFormal;
        }
        else
        {
            AppKey_Android = ConfigurationController.Instance.BuglyAppKey_AndroidTest;
            AppKey_ios     = ConfigurationController.Instance.BuglyAppKey_iosTest;
        }
        // 开启SDK的日志打印,发布版本请务必关闭
        BuglyAgent.ConfigDebugMode(false);
        // 注册日志回调,替换使用 'Application.RegisterLogCallback(Application.LogCallback)'注册日志回调的方式
        if (DebugConfigController.Instance._Debug)
        {
            BuglyAgent.RegisterLogCallback(LogCallback);
        }


#if UNITY_IPHONE || UNITY_IOS
        BuglyAgent.InitWithAppId(AppKey_ios);
#elif UNITY_ANDROID
        BuglyAgent.InitWithAppId(AppKey_Android);
#endif

        // 如果你确认已在对应的iOS工程或Android工程中初始化SDK,那么在脚本中只需启动C#异常捕获上报功能即可
        BuglyAgent.EnableExceptionHandler();

        //Application.logMessageReceivedThreaded += LogCallback;
    }
Ejemplo n.º 13
0
    protected override void StartMain()
    {
        if (GameConfigProject.instance.testView)
        {
            return;
        }
        bool initSucess = false;

        try {
            luaState.DoFile(startLuaName);  //初始化脚本,如果出错了,那么很有可能是更新出错,把本地的缓存删除再次尝试
            initSucess = true;
        } catch (Exception ex) {
            #if !UNITY_EDITOR
            PlayerPrefs.DeleteAll();
            FileUtility.DirectoryDelete(Application.persistentDataPath, true);
            BuglyAgent.ReportException(ex, "Lua初始化失败:");
            #endif
            Debug.LogError("Lua初始化失败:" + ex);
        }

        if (!initSucess)
        {
            try {
                Debug.Log("Lua初始化失败,删除缓存再次尝试!");
                luaState.DoFile(startLuaName);  //初始化失败后,删除磁盘缓存,再次初始化
            } catch (Exception ex) {
                BuglyAgent.ReportException(ex, "Lua初始化失败:");
                Debug.LogError("Lua再次初始化失败:" + ex);
            }
        }
        levelLoaded        = luaState.GetFunction("ApplicationEvent.on_level_was_loaded");
        onApplicationFocus = luaState.GetFunction("ApplicationEvent.on_app_focus");
    }
Ejemplo n.º 14
0
        //---------------------------------------------------------------------
        IEnumerator _wwwLoadTextListAsync(List <string> list_url, Action <List <string> > cb)
        {
            List <string> list_string = new List <string>();

            foreach (var i in list_url)
            {
                using (UnityWebRequest www_request = UnityWebRequest.Get(i))
                {
                    yield return(www_request.SendWebRequest());

                    if (www_request.isHttpError || www_request.isNetworkError)
                    {
                        BuglyAgent.PrintLog(LogSeverity.LogError, www_request.error);
                    }
                    else
                    {
                        if (www_request.responseCode == 200)
                        {
                            list_string.Add(www_request.downloadHandler.text);
                        }
                    }
                }
            }

            if (cb != null)
            {
                cb.Invoke(list_string);
            }
        }
Ejemplo n.º 15
0
        private void Awake()
        {
            _page1       = transform.Find("Page1").GetComponent <RawImage>();
            _page1.color = new Color(1, 1, 1, 0.5f);

            Tweener tween1 = _page1.DOFade(1, 0.6f);

            DOTween.Sequence()
            .Append(tween1)
            .AppendInterval(1.0f)
            .AppendInterval(1.0f)
            .onComplete = () => { SceneManager.LoadSceneAsync("Main").completed += OnLoadScene; };

            if ((float)Screen.height / Screen.width > 1.80)
            {
                CanvasScaler scaler = transform.GetComponent <CanvasScaler>();
                scaler.matchWidthOrHeight = 1.0f;
            }

            if (Application.platform == RuntimePlatform.IPhonePlayer)
            {
                BuglyAgent.ConfigDebugMode(false);
                BuglyAgent.ConfigAutoQuitApplication(false);
//                BuglyAgent.InitWithAppId ("6f4e68ecf4"); //新马
                BuglyAgent.InitWithAppId("f50da4d1b1");   //国内
            }
        }
Ejemplo n.º 16
0
 static public int PrintLog_s(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         LogSeverity a1;
         a1 = (LogSeverity)LuaDLL.luaL_checkinteger(l, 1);
         System.String a2;
         checkType(l, 2, out a2);
         System.Object[] a3;
         checkParams(l, 3, out a3);
         BuglyAgent.PrintLog(a1, a2, a3);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
Ejemplo n.º 17
0
 static public int constructor(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         BuglyAgent o;
         o = new BuglyAgent();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
Ejemplo n.º 18
0
 static public int ConfigAutoReportLogLevel_s(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         LogSeverity a1;
         a1 = (LogSeverity)LuaDLL.luaL_checkinteger(l, 1);
         BuglyAgent.ConfigAutoReportLogLevel(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
Ejemplo n.º 19
0
 static public int SetLogCallbackExtrasHandler_s(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         System.Func <System.Collections.Generic.Dictionary <System.String, System.String> > a1;
         checkDelegate(l, 1, out a1);
         BuglyAgent.SetLogCallbackExtrasHandler(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
Ejemplo n.º 20
0
        //---------------------------------------------------------------------
        void _onSocketError(object rec, SocketErrorEventArgs args)
        {
            BuglyAgent.PrintLog(LogSeverity.Log, args.Exception.Message);
            BuglyAgent.ReportException(args.Exception, args.Exception.Message);

            _onSocketClose();
        }
Ejemplo n.º 21
0
        private static void HandleClientStateSyncCommand(uint dwFrqNo, CSDT_FRAPBOOT_ACNTSTATE stateSyncDt)
        {
            IFrameCommand frameCommand = null;

            switch (stateSyncDt.bStateChgType)
            {
            case 1:
                frameCommand = FrameCommandFactory.CreateSCSyncFrameCommand <SvrDisconnectCommand>();
                break;

            case 2:
                frameCommand = FrameCommandFactory.CreateSCSyncFrameCommand <SvrReconnectCommand>();
                break;

            case 3:
                frameCommand = FrameCommandFactory.CreateSCSyncFrameCommand <SvrRunawayCommand>();
                break;
            }
            if (frameCommand != null)
            {
                frameCommand.playerID = stateSyncDt.dwObjID;
                frameCommand.frameNum = dwFrqNo;
                Singleton <FrameSynchr> .GetInstance().PushFrameCommand(frameCommand);
            }
            else if ((FrameWindow._frameExceptionCounter += 1) <= 30)
            {
                BuglyAgent.ReportException(new Exception("CreateFrameCommandException"), "create stateChange frame command error!");
            }
        }
Ejemplo n.º 22
0
 public static void SetCrashHappenCallback(string callbackName)
 {
     if (callbackName != null)
     {
         BuglyAgent.GetInstance().SetCrashHappenCallback(callbackName);
     }
 }
Ejemplo n.º 23
0
 private void ReportException(Exception ecp)
 {
     if (++this.reportCount <= 15)
     {
         BuglyAgent.ReportException(ecp, ecp.Message);
     }
 }
Ejemplo n.º 24
0
    void Awake()
    {
        // Enable the debug log print
        BuglyAgent.ConfigDebugMode(false);
        // Config default channel, version, user
        BuglyAgent.ConfigDefault(null, null, null, 0);
        // Config auto report log level, default is LogSeverity.LogError, so the LogError, LogException log will auto report
        BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogError);
        // Config auto quit the application make sure only the first one c# exception log will be report, please don't set TRUE if you do not known what are you doing.
        BuglyAgent.ConfigAutoQuitApplication(false);
        // If you need register Application.RegisterLogCallback(LogCallback), you can replace it with this method to make sure your function is ok.
        BuglyAgent.RegisterLogCallback(null);

        // Init the bugly sdk and enable the c# exception handler.
        BuglyAgent.InitWithAppId(BuglyAppID);

        // TODO Required. If you do not need call 'InitWithAppId(string)' to initialize the sdk(may be you has initialized the sdk it associated Android or iOS project),
        // please call this method to enable c# exception handler only.
        BuglyAgent.EnableExceptionHandler();

        // TODO NOT Required. If you need to report extra data with exception, you can set the extra handler
        BuglyAgent.SetLogCallbackExtrasHandler(MyLogCallbackExtrasHandler);

        Destroy(this);
    }
Ejemplo n.º 25
0
    // Extra data handler to packet data and report them with exception.
    // Please do not do hard work in this handler
    static Dictionary <string, string> MyLogCallbackExtrasHandler()
    {
        // TODO Test log, please do not copy it
        BuglyAgent.PrintLog(LogSeverity.Log, "extra handler");

        // TODO Sample code, please do not copy it
        Dictionary <string, string> extras = new Dictionary <string, string> ();

        extras.Add("ScreenSolution", string.Format("{0}x{1}", Screen.width, Screen.height));
        extras.Add("deviceModel", SystemInfo.deviceModel);
        extras.Add("deviceName", SystemInfo.deviceName);
        extras.Add("deviceType", SystemInfo.deviceType.ToString());

        extras.Add("deviceUId", SystemInfo.deviceUniqueIdentifier);
        extras.Add("gDId", string.Format("{0}", SystemInfo.graphicsDeviceID));
        extras.Add("gDName", SystemInfo.graphicsDeviceName);
        extras.Add("gDVdr", SystemInfo.graphicsDeviceVendor);
        extras.Add("gDVer", SystemInfo.graphicsDeviceVersion);
        extras.Add("gDVdrID", string.Format("{0}", SystemInfo.graphicsDeviceVendorID));

        extras.Add("graphicsMemorySize", string.Format("{0}", SystemInfo.graphicsMemorySize));
        extras.Add("systemMemorySize", string.Format("{0}", SystemInfo.systemMemorySize));
        extras.Add("UnityVersion", Application.unityVersion);

        BuglyAgent.PrintLog(LogSeverity.LogInfo, "Package extra data");
        return(extras);
    }
 private static void CloseUpload()
 {
     if (SynchrReport._isUploading)
     {
         return;
     }
     if (SynchrReport._uploadList != null)
     {
         for (int i = 0; i < SynchrReport._uploadList.get_Count(); i++)
         {
             if (SynchrReport._uploadList.get_Item(i) != null)
             {
                 SynchrReport._uploadList.get_Item(i).Close();
             }
         }
         SynchrReport._uploadList = null;
     }
     SynchrReport._uploadIndex = -1;
     if (SynchrReport._isSelfUnsync && !SynchrReport._isAlerted)
     {
         SynchrReport._isAlerted = true;
         if (MonoSingleton <Reconnection> .instance.isProcessingRelayRecover)
         {
             Singleton <CUIManager> .GetInstance().OpenMessageBox(Singleton <CTextManager> .GetInstance().GetText("MultiGame_Not_Sync"), enUIEventID.Lobby_ConfirmErrExit, false);
         }
         else
         {
             Singleton <CUIManager> .GetInstance().OpenMessageBox(Singleton <CTextManager> .GetInstance().GetText("MultiGame_Not_Sync_Try"), enUIEventID.Battle_MultiHashInvalid, false);
         }
         DebugHelper.CustomLog("HashCheckInvalid!");
         BuglyAgent.ReportException(new LobbyMsgHandler.HashCheckInvalide("HaskCheckInvalide"), "MultiGame not synced!");
     }
 }
Ejemplo n.º 27
0
    void InitBuglySDK()
    {
        // TODO NOT Required. Set the crash reporter type and log to report
        // BuglyAgent.ConfigCrashReporter (1, 2);

        // TODO NOT Required. Enable debug log print, please set false for release version
#if DEBUG
        BuglyAgent.ConfigDebugMode(true);
#endif
        BuglyAgent.ConfigDebugMode(true);
        // TODO NOT Required. Register log callback with 'BuglyAgent.LogCallbackDelegate' to replace the 'Application.RegisterLogCallback(Application.LogCallback)'
        // BuglyAgent.RegisterLogCallback (CallbackDelegate.Instance.OnApplicationLogCallbackHandler);

        // BuglyAgent.ConfigDefault ("Bugly", null, "ronnie", 0);

        #if UNITY_IPHONE || UNITY_IOS
        BuglyAgent.InitWithAppId(BuglyAppIDForiOS);
        #elif UNITY_ANDROID
        BuglyAgent.InitWithAppId(BuglyAppIDForAndroid);
        #endif

        // TODO Required. If you do not need call 'InitWithAppId(string)' to initialize the sdk(may be you has initialized the sdk it associated Android or iOS project),
        // please call this method to enable c# exception handler only.
        BuglyAgent.EnableExceptionHandler();

        // TODO NOT Required. If you need to report extra data with exception, you can set the extra handler
//        BuglyAgent.SetLogCallbackExtrasHandler (MyLogCallbackExtrasHandler);

        BuglyAgent.PrintLog(LogSeverity.LogInfo, "Init the bugly sdk");
    }
Ejemplo n.º 28
0
 // Token: 0x0601564E RID: 87630 RVA: 0x0056D1F0 File Offset: 0x0056B3F0
 private static void _OnUncaughtExceptionHandler(object sender, UnhandledExceptionEventArgs args)
 {
     if (args == null || args.ExceptionObject == null)
     {
         return;
     }
     try
     {
         if (args.ExceptionObject.GetType() != typeof(Exception))
         {
             return;
         }
     }
     catch
     {
         if (UnityEngine.Debug.isDebugBuild)
         {
             UnityEngine.Debug.Log("BuglyAgent: Failed to report uncaught exception");
         }
         return;
     }
     if (!BuglyAgent.IsInitialized)
     {
         return;
     }
     if (BuglyAgent._uncaughtAutoReportOnce)
     {
         return;
     }
     BuglyAgent._HandleException((Exception)args.ExceptionObject, null, true);
 }
Ejemplo n.º 29
0
 // Token: 0x0601564B RID: 87627 RVA: 0x0056D038 File Offset: 0x0056B238
 private static void _RegisterExceptionHandler()
 {
     try
     {
         if (BuglyAgent.< > f__mg$cache0 == null)
         {
             BuglyAgent.< > f__mg$cache0 = new Application.LogCallback(BuglyAgent._OnLogCallbackHandler);
         }
         Application.RegisterLogCallback(BuglyAgent.< > f__mg$cache0);
         AppDomain currentDomain = AppDomain.CurrentDomain;
         if (BuglyAgent.< > f__mg$cache1 == null)
         {
             BuglyAgent.< > f__mg$cache1 = new UnhandledExceptionEventHandler(BuglyAgent._OnUncaughtExceptionHandler);
         }
         currentDomain.UnhandledException += BuglyAgent.< > f__mg$cache1;
         BuglyAgent._isInitialized         = true;
         BuglyAgent.DebugLog(null, "Register the log callback in Unity {0}", new object[]
         {
             Application.unityVersion
         });
     }
     catch
     {
     }
     BuglyAgent.SetUnityVersion();
 }
Ejemplo n.º 30
0
 // Token: 0x06015639 RID: 87609 RVA: 0x0056CF5C File Offset: 0x0056B15C
 public static void PrintLog(LogSeverity level, string format, params object[] args)
 {
     if (string.IsNullOrEmpty(format))
     {
         return;
     }
     BuglyAgent.LogRecord(level, string.Format(format, args));
 }
Ejemplo n.º 31
0
 public static void UnregisterLogCallback(BuglyAgent.LogCallbackDelegate handler)
 {
     if (handler != null)
     {
         BuglyAgent.DebugLog(null, "Remove log callback handler", new object[0]);
         BuglyAgent.LogCallbackEventHandler = (BuglyAgent.LogCallbackDelegate)Delegate.Remove(BuglyAgent.LogCallbackEventHandler, handler);
     }
 }