Exemple #1
0
        private static INameProvider InitializeNameProvider()
        {
            var dictFile = Path.Combine(CacheFolderLocation, $"{ObfOsuHash}.dic");

#if !DEBUG || !DONT_USE_CACHED_DICT
            if (File.Exists(dictFile))
            {
                XConsole.PrintInfo("Found cached name dictionary file for this assembly! Loading names...");
                return(SimpleNameProvider.Initialize(dictFile));
            }
            else
#endif
            {
                XConsole.PrintInfo("No cached name dictionary found! Initializing DefaultNameProvider (NameMapper)...");

#if DEBUG
                var debugOut = FancyOutput;
#else
                ConcurrentQueue <string> debugOut = null;
#endif

                MapperNameProvider.Initialize(_cleanOsuModule, _obfOsuModule, debugOut);

#if !DEBUG || !DONT_USE_CACHED_DICT
                File.WriteAllBytes(dictFile, MapperNameProvider.Instance.Pack());
#endif

                return(MapperNameProvider.Instance);
            }
        }
Exemple #2
0
        private static INameProvider InitializeNameMapper()
        {
            var dictFile = Path.Combine(_cachePath, $"{_osuHash}.dic");

            if (File.Exists(dictFile))
            {
                return(SimpleNameProvider.Initialize(dictFile));
            }

            MapperNameProvider.Initialize(_cleanOsuModule, _obfOsuModule);

            File.WriteAllBytes(dictFile, MapperNameProvider.Instance.Pack());

            return(MapperNameProvider.Instance);
        }