public static void Init(InitMgr mgr) { if (!m_initialized) { DefinitionDir = new DirectoryInfo(Path.Combine(RealmServer.Instance.Configuration.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; } }
/// <summary>Initializes all Types of the given Assembly.</summary> /// <returns>Whether initialization could be performed for all found steps.</returns> public static bool Initialize(Assembly asm) { InitMgr initMgr = new InitMgr(); initMgr.AddStepsOfAsm(asm); return(initMgr.PerformInitialization()); }
/// <summary> /// Initializes all Types of the given Assembly. /// </summary> /// <returns>Whether initialization could be performed for all found steps.</returns> public static bool Initialize(Assembly asm) { var initMgr = new InitMgr(); initMgr.AddStepsOfAsm(asm); return initMgr.PerformInitialization(); }
/// <summary>Initializes the given Type.</summary> /// <returns>Whether initialization could be performed for all found steps in the given type.</returns> public static bool Initialize(Type type) { InitMgr initMgr = new InitMgr(); List <DependentInitializationStep> dependentInitors = new List <DependentInitializationStep>(); initMgr.AddStepsOfType(type, dependentInitors); initMgr.InitDependencies(dependentInitors); return(initMgr.PerformInitialization()); }
/// <summary> /// Initializes the given Type. /// </summary> /// <returns>Whether initialization could be performed for all found steps in the given type.</returns> public static bool Initialize(Type type) { var initMgr = new InitMgr(); var dependencies = new List<InitializationDependency>(); initMgr.AddStepsOfType(type, dependencies); initMgr.InitDependencies(dependencies); return initMgr.PerformInitialization(); }
public object[] GetArgs(InitMgr mgr) { ParameterInfo[] parameters = InitMethod.GetParameters(); object[] objArray = null; if (parameters.Length == 1 && parameters[0].ParameterType == typeof(InitMgr)) { objArray = new object[1] { mgr } } ; return(objArray); }
public object[] GetArgs(InitMgr mgr) { var paramInfo = InitMethod.GetParameters(); object[] args = null; if (paramInfo.Length == 1) { if (paramInfo[0].ParameterType == typeof(InitMgr)) { args = new object[] { mgr }; } } return args; }
public object[] GetArgs(InitMgr mgr) { var paramInfo = InitMethod.GetParameters(); object[] args = null; if (paramInfo.Length == 1) { if (paramInfo[0].ParameterType == typeof(InitMgr)) { args = new object[] { mgr }; } } return(args); }