示例#1
0
		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;
			}
		}
示例#2
0
        /// <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());
        }
示例#3
0
文件: InitMgr.cs 项目: pallmall/WCell
        /// <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();
        }
示例#4
0
        /// <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());
        }
示例#5
0
文件: InitMgr.cs 项目: pallmall/WCell
        /// <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();
        }
示例#6
0
 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);
 }
示例#7
0
    	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;
    	}
示例#8
0
        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);
        }