Ejemplo n.º 1
0
        void IAmAware.SelfReport(SelfProblemType problem, Exception e)
        {
            string debind = $"{(mainMod!=null?"m":"-")}{((mainMod?.userModInstance as Mod) != null ? "M" : "-")}" +
                            $"{(report != null ? "R":"-")}";

            if (e != null)
            {
                UnityEngine.Debug.LogError($"[{Versioning.FULL_PACKAGE_NAME}] ERROR (s{debind}) - {Report.SelfProblemText(problem)}: {Report.ExMessage(e, true, 1)}");
            }
            else
            {
                UnityEngine.Debug.LogError($"[{Versioning.FULL_PACKAGE_NAME}] ERROR (se{debind}) - {Report.SelfProblemText(problem)}");
            }
            if (mainMod != null && report != null)
            {
                (mainMod.userModInstance as Mod).report.ReportSelf(problem, e);
            }
        }
Ejemplo n.º 2
0
        internal static void SelfReport(SelfProblemType problem, Exception e = null)
        {
#if DEVELOPER
            /* skip reporting first run problems if the mod has just been installed */
            if (firstRun && problem == SelfProblemType.NotLoadedFirst)
            {
                return;
            }
#endif

            if (mainMod == null)
            {
                /* used when installing the helper for the first time,
                 * before handover
                 */
                UnityEngine.Debug.LogError($"[{Versioning.FULL_PACKAGE_NAME}] ERROR - (no mainMod) {Report.SelfProblemText(problem)}: {Report.ExMessage(e, true, 1)}");
            }
            else
            {
                /* this should also include an indication of who is reporting (eg, helper) */
                (mainMod.userModInstance as IAmAware).SelfReport(problem, e);
            }
        }