protected override void OnStart(string[] args) { FileInfo info = new System.IO.FileInfo(Path.Combine(serverPath, "log4net.config")); log4net.Config.XmlConfigurator.Configure(info); m_baseFacade = new ConfigFacade(serverPath, "*.txt", false); m_baseFacade.RegistConfigProcessor(this, "*"); m_baseFacade.LoadAll(); m_baseFacade.Enable = true; }
void LoadDBFacade(string path) { m_scriptFacade = new ConfigFacade(Path.Combine(path, "script"), "*.sql", false); //注册默认处理器 m_scriptFacade.RegistConfigProcessor(SqlScriptManager.Instance, "*"); m_scriptFacade.LoadAll(LogWrapper.Warn); //开始监听文件变化 m_scriptFacade.Enable = true; }
/// <summary> /// 注册监听器,并加载游戏配置文件 /// </summary> void LoadGameFacade(string path) { m_gameFacade = new ConfigFacade(path, "*.txt", true); m_gameFacade.RegistConfigProcessor(ApcManager.Instance, "APC"); m_gameFacade.RegistConfigProcessor(NpcManager.Instance, "NPC"); m_gameFacade.RegistConfigProcessor(ScenePinManager.Instance, "ScenePin"); m_gameFacade.RegistConfigProcessor(HideApcManager.Instance, "APCFactory", "HideAPC"); m_gameFacade.RegistConfigProcessor(VisibleAPCManager.Instance, "APCFactory", "VisibleAPC"); m_gameFacade.RegistConfigProcessor(BoxManager.Instance, "Box"); m_gameFacade.RegistConfigProcessor(PartManager.Instance, "Part"); //注册默认处理器 m_gameFacade.RegistConfigProcessor(GameConfigAccess.Instance, "*"); m_gameFacade.LoadAll(LogWrapper.Warn); //开始监听文件变化 m_gameFacade.Enable = true; }
/// <summary> /// 注册监听器,并加载基本配置文件 /// </summary> /// <param name="path"></param> void LoadBaseFacade(string path) { m_baseFacade = new ConfigFacade(path, "*.txt", false); m_baseFacade.RegistConfigProcessor(RareGoodsManager.Instance, "RareGoods.txt"); m_baseFacade.RegistConfigProcessor(BondBuyManager.Instance, "OneBondBuy.txt"); m_baseFacade.RegistConfigProcessor(PetAccess.Instance, "PetConfig.txt"); m_baseFacade.RegistConfigProcessor(StringFilter.Instance, "FilterWord.txt"); m_baseFacade.RegistConfigProcessor(NameManager.Instance, "WhiteChars.txt"); m_baseFacade.RegistConfigProcessor(AwardManager.Instance, "Award.txt"); m_baseFacade.RegistConfigProcessor(TipManager.Instance, "Tip.txt"); m_baseFacade.RegistConfigProcessor(CommandManager.Instance, "Command.txt"); m_baseFacade.RegistConfigProcessor(RoleManager.Instance, "RoleInfo.txt"); m_baseFacade.RegistConfigProcessor(GMManager.Instance, "GMList.txt"); m_baseFacade.RegistConfigProcessor(BlackListManager.Instance, "IPBlackList.txt"); m_baseFacade.RegistConfigProcessor(WatchPlayerManager.Instance, "WatchPlayer.txt"); m_baseFacade.RegistConfigProcessor(OrderTypeManager.Instance, "OrderType.txt"); m_baseFacade.RegistConfigProcessor(ServerManager.Instance, "server" + ConfigLoader.Config.Zoneid + ".txt"); m_baseFacade.LoadAll(LogWrapper.Warn); //开始监听文件变化 m_baseFacade.Enable = true; }