Пример #1
0
        public void UpdateException(object obj, eExceptionType exceptionType = 0)
        {
            lock (LockException)
            {
                if (exceptionType == 0)
                {
                    ExceptionCount = 0;
                    return;
                }

                switch (exceptionType)
                {
                case eExceptionType.LoginFail:
                    FireExceptionEvent(new ExceptionMessage(exceptionType), obj);
                    break;

                default:
                    if (ExceptionCount >= 8 && ServerType == eServerType.Ibet)
                    {
                        FireExceptionEvent(new ExceptionMessage(exceptionType), obj);
                    }
                    else if (ExceptionCount >= 30 && ServerType == eServerType.Sbo)
                    {
                        FireExceptionEvent(new ExceptionMessage(exceptionType), obj);
                    }
                    else
                    {
                        ExceptionCount++;
                    }
                    break;
                }
            }
        }
Пример #2
0
        public void UpdateException(eExceptionType exceptionType = 0, string msg = "")
        {
            lock (LockException)
            {
                if (exceptionType == 0)
                {
                    ExceptionCount = 0;
                    return;
                }

                switch (exceptionType)
                {
                case eExceptionType.LoginFail:
                    FireExceptionEvent(new ExceptionMessage(exceptionType));
                    break;

                default:
                    if (ExceptionCount >= 4)
                    {
                        FireExceptionEvent(new ExceptionMessage(exceptionType));
                    }
                    else
                    {
                        ExceptionCount++;
                    }
                    break;
                }
            }
        }
Пример #3
0
    public CrashReporter MakeInitial(string projectname = "", eCrashWriteType type = eCrashWriteType.EWRITEMAIL, string clientVersion = "", string gmailID = "", string gmailPWD = "", string mailingList = "", eExceptionType level = eExceptionType.Exception)
    {
        m_eWriteMode          = type;
        m_tCrashReporterLevel = level;

                #if UNITY_EDITOR
        m_eWriteMode = eCrashWriteType.EWRITEFILE;
                #endif
        if (m_eWriteMode == eCrashWriteType.EWRITEOFF)
        {
            return(null);
        }

        m_bCrashCatched = false;
        UnityEngine.Debug.Log("CrashReporter Start!!! Mode:" + m_eWriteMode.ToString());
                #if !UNITY_5_4_OR_NEWER
        Application.RegisterLogCallback(HandleException);
        Application.RegisterLogCallbackThreaded(HandleExceptionThread);
                #else
        Application.logMessageReceived         += HandleException;
        Application.logMessageReceivedThreaded += HandleExceptionThread;
                #endif

        if (projectname.Length > 0)
        {
            m_strProjectName = projectname;
        }

        if (clientVersion.Length > 0)
        {
            m_strBuild_version = clientVersion;
        }

        if (gmailID.Length > 0)
        {
            m_stServerInfo.AddSmtp(new SmtpMailInfo(gmailID, gmailPWD, "smtp.gmail.com", true));
        }

        m_strMailingList = "";
        if (mailingList.Length > 0)
        {
            m_strMailingList = mailingList;
        }

        m_stUserInfo.userID   = "";
        m_stUserInfo.userUID  = "";
        m_stUserInfo.nickname = "";
        m_stUserInfo.teamname = "";


        Routine(UpdateCrashRepoter());

        return(this);
    }
Пример #4
0
        public static void RegisterWAPException(eExceptionType exceptionType,UInt32 exceptionID, String exceptionName, String className,
            String methodName,String exceptionDescription)
        {
            if (WAPExceptionDict.ContainsKey(exceptionID))
                return;
            var ed = new ExceptionDescriber
            {
                ExceptionType = exceptionType,
                ExceptionID = exceptionID,
                ExceptionName = exceptionName,
                ClassName = className,
                MethodName = methodName,
                ExceptionDescription = exceptionDescription
            };

            WAPExceptionDict.Add(ed.ExceptionID, ed);
        }
Пример #5
0
    public void SetCrashReporterOnlineInfo(string strConfigFileHost)
    {
#if !UNITY_EDITOR
        m_bUpdateWaitServerInfo = true;
        Routine(WebRequest(strConfigFileHost + "?" + Time.time, null, (msg) => {
            string json     = msg;
            Hashtable table = SG.MiniJsonExtensions.hashtableFromJson(json);

            try {
                m_eWriteMode     = (eCrashWriteType)System.Enum.Parse(typeof(eCrashWriteType), table["mode"].ToString());
                m_strMailingList = table["MailingList"].ToString();

                try {
                    m_tCrashReporterLevel = eExceptionType.None;
                    ArrayList arr         = (ArrayList)table["CrashReporterLevel"];
                    foreach (string item in arr)
                    {
                        m_tCrashReporterLevel |= (eExceptionType)Enum.Parse(typeof(eExceptionType), item);
                    }
                } catch {
                    m_tCrashReporterLevel = eExceptionType.Exception;
                }

                if (m_eWriteMode == eCrashWriteType.EWRITEMAIL)
                {
                    ArrayList list = (ArrayList)table["GmailList"];
                    foreach (Hashtable item in list)
                    {
                        m_stServerInfo.SetServerHost("");
                        m_stServerInfo.AddSmtp(new SmtpMailInfo(item["id"].ToString(), item["pwd"].ToString(), "smtp.gmail.com", true));
                    }
                }
                else if (m_eWriteMode == eCrashWriteType.EWRITESERVER)
                {
                    //					m_stServerInfo.GetCurrentSmtp().userID

                    m_stServerInfo.ClearSmtpList();
                    m_stServerInfo.ResetSmtpIndex();

                    Hashtable hash = (Hashtable)table["ServerInfo"];
                    m_stServerInfo.SetServerHost(hash["host"].ToString());

                    ArrayList list = (ArrayList)hash["SmtpList"];
                    foreach (Hashtable item in list)
                    {
                        m_stServerInfo.AddSmtp(new SmtpMailInfo(item["id"].ToString(), item["pwd"].ToString(), item["smtp"].ToString(), (bool)item["ssl"]));
                    }
                }
            } catch (Exception ex) {
                Debug.LogError(ex.Message);
                m_eWriteMode = eCrashWriteType.EWRITEGAv3;
            }

            m_bUpdateWaitServerInfo = false;
            UnityEngine.Debug.Log("CrashReporter Change Mode:" + m_eWriteMode.ToString());
        }, () => {
            m_eWriteMode            = eCrashWriteType.EWRITEGAv3;
            m_bUpdateWaitServerInfo = false;
        }));
#endif
    }
Пример #6
0
    public static CrashReporter StartCrashReporter(GameObject go, string projectname = "", eCrashWriteType type = eCrashWriteType.EWRITEMAIL, string clientVersion = "", string gmailID = "", string gmailPWD = "", string mailingList = "", eExceptionType level = eExceptionType.Exception)
    {
        if (go.GetComponent <MonoBehaviour> () == null)
        {
            throw new Exception("monobehaviour object not set : for use coroutine works");
        }

        if (go.GetComponent <CrashReporter>() != null)
        {
            Destroy(go.GetComponent <CrashReporter>());
        }

        return(go.AddComponent <CrashReporter>().MakeInitial(projectname, type, clientVersion, gmailID, gmailPWD, mailingList, level));
    }
Пример #7
0
 public ExceptionMessage(eExceptionType exceptionType, string msg)
 {
     ExceptionType = exceptionType;
     Message       = msg;
 }
Пример #8
0
 public ExceptionMessage(eExceptionType exceptionType)
 {
     ExceptionType = exceptionType;
 }