本文整理汇总了C#中Config.BindAssembly方法的典型用法代码示例。如果您正苦于以下问题:C# Config.BindAssembly方法的具体用法?C# Config.BindAssembly怎么用?C# Config.BindAssembly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Config
的用法示例。
在下文中一共展示了Config.BindAssembly方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
public virtual void Initialize()
{
MessageDispatcher.RegisterAssembly(Context.PluginAssembly);
if (UseConfig)
{
Config = new Config(ConfigPath);
Config.Load();
Config.BindAssembly(Context.PluginAssembly);
}
}
示例2: Initialize
public static void Initialize()
{
if (Initialized)
return;
if (!Debugger.IsAttached) // the debugger handle the unhandled exceptions
AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
AppDomain.CurrentDomain.ProcessExit += OnProcessExit;
Config = new Config(ConfigPath);
foreach (var assembly in m_hierarchy)
{
Config.BindAssembly(assembly);
Config.RegisterAttributes(assembly);
}
Config.Load();
logger.Info("{0} loaded", Path.GetFileName(Config.FilePath));
var d2oSource = new D2OSource();
d2oSource.AddReaders(DofusDataPath);
DataProvider.Instance.AddSource(d2oSource);
var maps = new D2PSource(new D2pFile(DofusMapsD2P));
DataProvider.Instance.AddSource(maps);
// todo : langs
var d2iSource = new D2ISource(Languages.English);
d2iSource.AddReaders(DofusI18NPath);
DataProvider.Instance.AddSource(d2iSource);
MITM = new MITM.MITM(new MITMConfiguration
{
FakeAuthHost = BotAuthHost,
FakeAuthPort = BotAuthPort,
FakeWorldHost = BotWorldHost,
FakeWorldPort = BotWorldPort,
RealAuthHost = RealAuthHost,
RealAuthPort = RealAuthPort
});
MessageDispatcher.DefineHierarchy(m_hierarchy);
foreach (var assembly in m_hierarchy)
{
MessageDispatcher.RegisterSharedAssembly(assembly);
}
PluginManager.Instance.LoadAllPlugins();
DispatcherTask = new DispatcherTask(new MessageDispatcher(), MITM);
DispatcherTask.Start(); // we have to start it now to dispatch the initialization msg
var msg = new HostInitializationMessage();
DispatcherTask.Dispatcher.Enqueue(msg, MITM);
msg.Wait();
Initialized = true;
}
示例3: Initialize
public static void Initialize()
{
if (Initialized)
return;
UIManager.Instance.SetBusy(true);
try
{
if (!Debugger.IsAttached) // the debugger handle the unhandled exceptions
AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
AppDomain.CurrentDomain.ProcessExit += OnProcessExit;
UIManager.Instance.BusyMessage = "Load config ...";
Config = new Config(ConfigPath);
foreach (Assembly assembly in m_hierarchy)
{
Config.BindAssembly(assembly);
Config.RegisterAttributes(assembly);
}
Config.Load();
logger.Info("{0} loaded", Path.GetFileName(Config.FilePath));
UIManager.Instance.BusyMessage = "Loading D2O files ...";
ObjectDataManager.Instance.AddReaders(Path.Combine(GetDofusPath(), DofusDataPath));
I18NDataManager.Instance.DefaultLanguage = Languages.English;
I18NDataManager.Instance.AddReaders(Path.Combine(GetDofusPath(), DofusI18NPath));
IconsManager.Instance.Initialize(Path.Combine(GetDofusPath(), DofusItemIconPath));
UIManager.Instance.BusyMessage = "Starting redis server ...";
logger.Info("Starting redis server ...");
RedisServerHost.Instance.ExecutablePath = RedisServerExe;
RedisServerHost.Instance.StartOrFindProcess();
UIManager.Instance.BusyMessage = string.Format("Loading {0}...", MapsManager.MapsDataFile);
logger.Info("Loading {0}...", MapsManager.MapsDataFile);
ProgressionCounter progression = MapsManager.Instance.Initialize(Path.Combine(GetDofusPath(), DofusMapsD2P));
if (progression != null)
ExecuteProgress(progression);
UIManager.Instance.BusyMessage = "Loading maps positions ...";
logger.Info("Loading maps positions ...");
progression = MapsPositionManager.Instance.Initialize();
if (progression != null)
ExecuteProgress(progression);
UIManager.Instance.BusyMessage = "Loading submaps ...";
logger.Info("Loading submaps ...");
progression = SubMapsManager.Instance.Initialize();
if (progression != null)
ExecuteProgress(progression);
MITM = new MITM.MITM(new MITMConfiguration
{
FakeAuthHost = BotAuthHost,
FakeAuthPort = BotAuthPort,
FakeWorldHost = BotWorldHost,
FakeWorldPort = BotWorldPort,
RealAuthHost = RealAuthHost,
RealAuthPort = RealAuthPort
});
MessageDispatcher.DefineHierarchy(m_hierarchy);
foreach (Assembly assembly in m_hierarchy)
{
MessageDispatcher.RegisterSharedAssembly(assembly);
}
UIManager.Instance.BusyMessage = "Loading plugins ...";
PluginManager.Instance.LoadAllPlugins();
DispatcherTask = new DispatcherTask(new MessageDispatcher(), MITM);
DispatcherTask.Start(); // we have to start it now to dispatch the initialization msg
BotManager.Instance.Initialize();
var msg = new HostInitializationMessage();
DispatcherTask.Dispatcher.Enqueue(msg, MITM);
msg.Wait();
}
finally
{
UIManager.Instance.SetBusy(false);
}
Initialized = true;
}
示例4: Initialize
private static void Initialize()
{
AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
AppDomain.CurrentDomain.ProcessExit += OnProcessExit;
Config = new Config(ConfigPath);
Config.Load();
foreach (var assembly in m_hierarchy)
{
Config.BindAssembly(assembly);
}
var d2oSource = new D2OSource();
d2oSource.AddReaders(Config.GetStatic("DofusDataPath", @"C:\Program Files (x86)\Dofus 2\app\data\common"));
DataProvider.Instance.AddSource(d2oSource);
var maps = new D2PSource(new D2pFile(Config.GetStatic("DofusMapsD2P", @"C:\Program Files (x86)\Dofus 2\app\content\maps\maps0.d2p")));
DataProvider.Instance.AddSource(maps);
var d2iSource = new D2ISource(Languages.English);
d2iSource.AddReaders(Config.GetStatic("DofusI18NPath", @"C:\Program Files (x86)\Dofus 2\app\data\i18n"));
DataProvider.Instance.AddSource(d2iSource);
MITM = new MITM.MITM(new MITMConfiguration
{
FakeAuthHost = Config.GetStatic("BotAuthHost", "localhost"),
FakeAuthPort = Config.GetStatic("BotAuthPort", 5555),
FakeWorldHost = Config.GetStatic("BotWorldHost", "localhost"),
FakeWorldPort = Config.GetStatic("BotWorldPort", 5556),
RealAuthHost = Config.GetStatic("RealAuthHost", "213.248.126.180"),
RealAuthPort = Config.GetStatic("RealAuthPort", 5555)
});
MessageDispatcher.DefineHierarchy(m_hierarchy);
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
MessageDispatcher.RegisterAssembly(assembly);
}
PluginManager.Instance.LoadAllPlugins();
DispatcherTask = new DispatcherTask(new MessageDispatcher(), MITM);
DispatcherTask.Start(); // we have to start it now to dispatch the initialization msg
var msg = new HostInitializationMessage();
DispatcherTask.Dispatcher.Enqueue(msg, MITM);
msg.Wait();
}