Esempio n. 1
0
        private static void ExcludeModuleManagers(ref HashSet <string> nativeClasses)
        {
            string[] moduleNames        = ModuleMetadata.GetModuleNames();
            int      derivedFromClassID = BaseObjectTools.StringToClassID("GlobalGameManager");

            foreach (string str in moduleNames)
            {
                if (ModuleMetadata.GetModuleStrippable(str))
                {
                    int[]            moduleClasses = ModuleMetadata.GetModuleClasses(str);
                    HashSet <int>    set           = new HashSet <int>();
                    HashSet <string> other         = new HashSet <string>();
                    foreach (int num3 in moduleClasses)
                    {
                        if (BaseObjectTools.IsDerivedFromClassID(num3, derivedFromClassID))
                        {
                            set.Add(num3);
                        }
                        else
                        {
                            other.Add(BaseObjectTools.ClassIDToString(num3));
                        }
                    }
                    if ((other.Count != 0) && !nativeClasses.Overlaps(other))
                    {
                        foreach (int num5 in set)
                        {
                            nativeClasses.Remove(BaseObjectTools.ClassIDToString(num5));
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        private static HashSet <string> GetAllStrippableModules()
        {
            HashSet <string> stringSet = new HashSet <string>();

            foreach (string moduleName in ModuleMetadata.GetModuleNames())
            {
                if (ModuleMetadata.GetModuleStrippable(moduleName))
                {
                    stringSet.Add(moduleName);
                }
            }
            return(stringSet);
        }
Esempio n. 3
0
        private static HashSet <string> GetAllStrippableModules()
        {
            HashSet <string> hashSet = new HashSet <string>();

            string[] moduleNames = ModuleMetadata.GetModuleNames();
            for (int i = 0; i < moduleNames.Length; i++)
            {
                string text = moduleNames[i];
                if (ModuleMetadata.GetModuleStrippable(text))
                {
                    hashSet.Add(text);
                }
            }
            return(hashSet);
        }
Esempio n. 4
0
        private static HashSet <string> GetRequiredStrippableModules(HashSet <string> nativeClasses)
        {
            HashSet <string> stringSet = new HashSet <string>();

            foreach (string moduleName in ModuleMetadata.GetModuleNames())
            {
                if (ModuleMetadata.GetModuleStrippable(moduleName))
                {
                    HashSet <string> classNames = CodeStrippingUtils.GetClassNames((IEnumerable <int>)ModuleMetadata.GetModuleClasses(moduleName));
                    if (nativeClasses.Overlaps((IEnumerable <string>)classNames))
                    {
                        stringSet.Add(moduleName);
                    }
                }
            }
            return(stringSet);
        }
Esempio n. 5
0
        private static HashSet <string> GetRequiredStrippableModules(HashSet <string> nativeClasses)
        {
            HashSet <string> set = new HashSet <string>();

            foreach (string str in ModuleMetadata.GetModuleNames())
            {
                if (ModuleMetadata.GetModuleStrippable(str))
                {
                    HashSet <string> classNames = GetClassNames(ModuleMetadata.GetModuleClasses(str));
                    if (nativeClasses.Overlaps(classNames))
                    {
                        set.Add(str);
                    }
                }
            }
            return(set);
        }
Esempio n. 6
0
 private static void ExcludeModuleManagers(ref HashSet <UnityType> nativeClasses)
 {
     string[] moduleNames = ModuleMetadata.GetModuleNames();
     string[] array       = moduleNames;
     for (int i = 0; i < array.Length; i++)
     {
         string moduleName = array[i];
         if (ModuleMetadata.GetModuleStrippable(moduleName))
         {
             UnityType[]         moduleTypes = ModuleMetadata.GetModuleTypes(moduleName);
             HashSet <UnityType> hashSet     = new HashSet <UnityType>();
             HashSet <UnityType> hashSet2    = new HashSet <UnityType>();
             UnityType[]         array2      = moduleTypes;
             for (int j = 0; j < array2.Length; j++)
             {
                 UnityType unityType = array2[j];
                 if (unityType.IsDerivedFrom(CodeStrippingUtils.GameManagerTypeInfo))
                 {
                     hashSet.Add(unityType);
                 }
                 else
                 {
                     hashSet2.Add(unityType);
                 }
             }
             if (hashSet2.Count != 0)
             {
                 if (!nativeClasses.Overlaps(hashSet2))
                 {
                     foreach (UnityType current in hashSet)
                     {
                         nativeClasses.Remove(current);
                     }
                 }
                 else
                 {
                     foreach (UnityType current2 in hashSet)
                     {
                         nativeClasses.Add(current2);
                     }
                 }
             }
         }
     }
 }
Esempio n. 7
0
 private static void ExcludeModuleManagers(ref HashSet <string> nativeClasses)
 {
     string[] moduleNames = ModuleMetadata.GetModuleNames();
     string[] array       = moduleNames;
     for (int i = 0; i < array.Length; i++)
     {
         string moduleName = array[i];
         if (ModuleMetadata.GetModuleStrippable(moduleName))
         {
             int[]            moduleClasses = ModuleMetadata.GetModuleClasses(moduleName);
             HashSet <int>    hashSet       = new HashSet <int>();
             HashSet <string> hashSet2      = new HashSet <string>();
             int[]            array2        = moduleClasses;
             for (int j = 0; j < array2.Length; j++)
             {
                 int num = array2[j];
                 if (BaseObjectTools.IsDerivedFromClassID(num, CodeStrippingUtils.gameManagerClassId))
                 {
                     hashSet.Add(num);
                 }
                 else
                 {
                     hashSet2.Add(BaseObjectTools.ClassIDToString(num));
                 }
             }
             if (hashSet2.Count != 0)
             {
                 if (!nativeClasses.Overlaps(hashSet2))
                 {
                     foreach (int current in hashSet)
                     {
                         nativeClasses.Remove(BaseObjectTools.ClassIDToString(current));
                     }
                 }
                 else
                 {
                     foreach (int current2 in hashSet)
                     {
                         nativeClasses.Add(BaseObjectTools.ClassIDToString(current2));
                     }
                 }
             }
         }
     }
 }
Esempio n. 8
0
        private static HashSet <string> GetRequiredStrippableModules(HashSet <string> nativeClasses, StrippingInfo strippingInfo)
        {
            HashSet <string> hashSet  = new HashSet <string>();
            HashSet <string> hashSet2 = new HashSet <string>();

            string[] moduleNames = ModuleMetadata.GetModuleNames();
            for (int i = 0; i < moduleNames.Length; i++)
            {
                string text = moduleNames[i];
                if (ModuleMetadata.GetModuleStrippable(text))
                {
                    HashSet <string> classNames = CodeStrippingUtils.GetClassNames(ModuleMetadata.GetModuleClasses(text));
                    if (nativeClasses.Overlaps(classNames))
                    {
                        hashSet2.Add(text);
                        if (strippingInfo != null)
                        {
                            foreach (string current in classNames)
                            {
                                if (nativeClasses.Contains(current))
                                {
                                    strippingInfo.RegisterDependency(text, current);
                                    if (BaseObjectTools.IsDerivedFromClassID(BaseObjectTools.StringToClassID(current), CodeStrippingUtils.gameManagerClassId))
                                    {
                                        strippingInfo.RegisterDependency(current, "Required by Module");
                                    }
                                    hashSet.Add(current);
                                }
                            }
                        }
                    }
                }
            }
            if (strippingInfo != null)
            {
                foreach (string current2 in nativeClasses)
                {
                    if (!hashSet.Contains(current2))
                    {
                        strippingInfo.RegisterDependency("Core", current2);
                    }
                }
            }
            return(hashSet2);
        }
Esempio n. 9
0
        private static HashSet <string> GetRequiredStrippableModules(HashSet <string> nativeClasses)
        {
            HashSet <string> hashSet = new HashSet <string>();

            string[] moduleNames = ModuleMetadata.GetModuleNames();
            for (int i = 0; i < moduleNames.Length; i++)
            {
                string text = moduleNames[i];
                if (ModuleMetadata.GetModuleStrippable(text))
                {
                    HashSet <string> classNames = CodeStrippingUtils.GetClassNames(ModuleMetadata.GetModuleClasses(text));
                    if (nativeClasses.Overlaps(classNames))
                    {
                        hashSet.Add(text);
                    }
                }
            }
            return(hashSet);
        }
Esempio n. 10
0
        private static HashSet <string> GetRequiredStrippableModules(HashSet <UnityType> nativeClasses, StrippingInfo strippingInfo)
        {
            HashSet <UnityType> hashSet  = new HashSet <UnityType>();
            HashSet <string>    hashSet2 = new HashSet <string>();

            string[] moduleNames = ModuleMetadata.GetModuleNames();
            for (int i = 0; i < moduleNames.Length; i++)
            {
                string text = moduleNames[i];
                if (ModuleMetadata.GetModuleStrippable(text))
                {
                    HashSet <UnityType> hashSet3 = new HashSet <UnityType>(ModuleMetadata.GetModuleTypes(text));
                    if (nativeClasses.Overlaps(hashSet3))
                    {
                        hashSet2.Add(text);
                        if (strippingInfo != null)
                        {
                            foreach (UnityType current in hashSet3)
                            {
                                if (nativeClasses.Contains(current))
                                {
                                    strippingInfo.RegisterDependency(StrippingInfo.ModuleName(text), current.name);
                                    hashSet.Add(current);
                                }
                            }
                        }
                    }
                }
            }
            if (strippingInfo != null)
            {
                foreach (UnityType current2 in nativeClasses)
                {
                    if (!hashSet.Contains(current2))
                    {
                        strippingInfo.RegisterDependency(StrippingInfo.ModuleName("Core"), current2.name);
                    }
                }
            }
            return(hashSet2);
        }
Esempio n. 11
0
        private static void ExcludeModuleManagers(ref HashSet <string> nativeClasses)
        {
            string[] moduleNames = ModuleMetadata.GetModuleNames();
            int      classId     = BaseObjectTools.StringToClassID("GlobalGameManager");

            foreach (string moduleName in moduleNames)
            {
                if (ModuleMetadata.GetModuleStrippable(moduleName))
                {
                    int[]            moduleClasses = ModuleMetadata.GetModuleClasses(moduleName);
                    HashSet <int>    intSet        = new HashSet <int>();
                    HashSet <string> stringSet     = new HashSet <string>();
                    foreach (int num in moduleClasses)
                    {
                        if (BaseObjectTools.IsDerivedFromClassID(num, classId))
                        {
                            intSet.Add(num);
                        }
                        else
                        {
                            stringSet.Add(BaseObjectTools.ClassIDToString(num));
                        }
                    }
                    if (stringSet.Count != 0 && !nativeClasses.Overlaps((IEnumerable <string>)stringSet))
                    {
                        using (HashSet <int> .Enumerator enumerator = intSet.GetEnumerator())
                        {
                            while (enumerator.MoveNext())
                            {
                                int current = enumerator.Current;
                                nativeClasses.Remove(BaseObjectTools.ClassIDToString(current));
                            }
                        }
                    }
                }
            }
        }