Exemple #1
0
        public static void Init(InitMgr mgr)
        {
            if (!m_initialized)
            {
                DefinitionDir = new DirectoryInfo(Path.Combine(RealmServerConfiguration.ContentDir, "Packets"));

                var paAsm = typeof(PacketParser).Assembly;
                if (mgr == null)
                {
                    InitMgr.Initialize(paAsm);
                }
                else
                {
                    mgr.AddStepsOfAsm(paAsm);
                }

                m_packetWriters = new Dictionary <string, IndentTextWriter>();

                LoadDefinitions();

                m_initialized = true;
                DumpDir.Create();

                //LoginHandler.ClientDisconnected += OnDisconnect;
            }
        }
Exemple #2
0
        public static bool Init(string toolsRoot, params Assembly[] assemblies)
        {
            ToolConfig.ToolsRoot    = toolsRoot;
            RealmServ.EntryLocation = Path.GetFullPath(ToolConfig.WCellRealmServerConsoleExe);
            var realmServ = RealmServ.Instance;             // make sure to create the RealmServ instance first

            ToolConfig.InitCfg();

            LogUtil.SetupConsoleLogging();

            Log.Info("Output Directory: {0}", new DirectoryInfo(ToolConfig.OutputDir).FullName);
            if (!Directory.Exists(ToolConfig.OutputDir))
            {
                Directory.CreateDirectory(ToolConfig.OutputDir);
            }

            RealmServerConfiguration.Instance.AutoSave = false;
            RealmServerConfiguration.ContentDirName    = Path.GetFullPath(ToolConfig.ContentDir);
            RealmServerConfiguration.Initialize();
            RealmAddonMgr.AddonDir = ToolConfig.AddonDir;

            Log.Info("Content Directory: " + new DirectoryInfo(RealmServerConfiguration.ContentDir).FullName);

            if (!InitMgr.Initialize(typeof(Tools).Assembly) ||
                !InitMgr.Initialize(typeof(PacketAnalyzer).Assembly))
            {
                Log.Error("Cancelled - Press any key to exit...");
                Console.ReadKey();
                return(false);
            }

            foreach (var asm in assemblies)
            {
                if (!InitMgr.Initialize(asm))
                {
                    Log.Error("Unable to initialize Assembly: \"{0}\" - Press any key to exit...", asm);
                    return(false);
                }
                ToolCommandHandler.Instance.AddCmdsOfAsm(asm);
                Mgr.AddStaticMethodsOfAsm(asm);
            }

            Mgr.AddStaticMethodsOfAsm(typeof(Tools).Assembly);
            return(true);
        }
Exemple #3
0
        static Program()
        {
            LogUtil.SetupConsoleLogging();

            Console.WriteLine("Output Directory: " + new DirectoryInfo(Program.OutputDir).FullName);
            if (!Directory.Exists(Program.OutputDir))
            {
                Directory.CreateDirectory(Program.OutputDir);
            }

            RealmServer.RealmServer.Instance.Configuration.ContentDir = ContentDir;
            RealmServer.RealmServer.Instance.Configuration.AddonDir   = AddonDir;
            Console.WriteLine("Content Directory: " + new DirectoryInfo(RealmServer.RealmServer.Instance.Configuration.ContentDir).FullName);

            InitMgr.Initialize(typeof(Program).Assembly);

            ItemMgr.LoadOnStartup = false;
        }