Beispiel #1
0
    public static void DoReport()
    {
        DateTime now = DateTime.Now;
        string   str = string.Concat("report.", now.ToString(), ".txt");

        str = str.Replace('\\', '-');
        str = str.Replace('/', '-');
        str = str.Replace(' ', '\u005F');
        str = str.Replace(':', '.');
        now = DateTime.Now;
        File.WriteAllText(str, string.Concat("Report Generated ", now.ToString(), "\r\n"));
        ServerPerformance.ComponentReport(str, "All Objects", UnityEngine.Object.FindObjectsOfType <Transform>());
        ServerPerformance.ComponentReport(str, "Entities", UnityEngine.Object.FindObjectsOfType <BaseEntity>());
        ServerPerformance.ComponentReport(str, "Rigidbodies", UnityEngine.Object.FindObjectsOfType <Rigidbody>());
        string str1 = str;

        UnityEngine.Object[] array = (
            from x in (IEnumerable <Collider>)UnityEngine.Object.FindObjectsOfType <Collider>()
            where !x.enabled
            select x).ToArray <Collider>();
        ServerPerformance.ComponentReport(str1, "Disabled Colliders", array);
        string str2 = str;

        array = (
            from x in (IEnumerable <Collider>)UnityEngine.Object.FindObjectsOfType <Collider>()
            where x.enabled
            select x).ToArray <Collider>();
        ServerPerformance.ComponentReport(str2, "Enabled Colliders", array);
        if (SingletonComponent <SpawnHandler> .Instance)
        {
            SingletonComponent <SpawnHandler> .Instance.DumpReport(str);
        }
    }
Beispiel #2
0
    public static void DoReport()
    {
        string str = ("report." + DateTime.Now.ToString() + ".txt").Replace('\\', '-').Replace('/', '-').Replace(' ', '_').Replace(':', '.');

        File.WriteAllText(str, "Report Generated " + DateTime.Now.ToString() + "\r\n");
        ServerPerformance.ComponentReport(str, "All Objects", (Object[])Object.FindObjectsOfType <Transform>());
        ServerPerformance.ComponentReport(str, "Entities", (Object[])Object.FindObjectsOfType <BaseEntity>());
        ServerPerformance.ComponentReport(str, "Rigidbodies", (Object[])Object.FindObjectsOfType <Rigidbody>());
        ServerPerformance.ComponentReport(str, "Disabled Colliders", (Object[])((IEnumerable <Collider>)Object.FindObjectsOfType <Collider>()).Where <Collider>((Func <Collider, bool>)(x => !x.get_enabled())).ToArray <Collider>());
        ServerPerformance.ComponentReport(str, "Enabled Colliders", (Object[])((IEnumerable <Collider>)Object.FindObjectsOfType <Collider>()).Where <Collider>((Func <Collider, bool>)(x => x.get_enabled())).ToArray <Collider>());
        if (!Object.op_Implicit((Object)SingletonComponent <SpawnHandler> .Instance))
        {
            return;
        }
        ((SpawnHandler)SingletonComponent <SpawnHandler> .Instance).DumpReport(str);
    }