public static void Initialize() { m_OldEFHandler = PacketHandlers.GetHandler(0xEF); PacketHandlers.Register(0xEF, 21, false, new Server.Network.OnPacketReceive(LoginServerSeed)); PacketHandlers.Register(Config.EncapsulationHeader, 0, false, new Server.Network.OnPacketReceive(UOExtPacket)); uint ip = (uint)(BitConverter.ToInt32(IPAddress.Parse(Config.IP).GetAddressBytes(), 0)); m_UOExtSupport = new UOExtSupport(); m_UOExtSupport.SetStatic(); m_handler = UOExt.PacketHandler.Instatinate(); Console.WriteLine("UOExt: Adapter started."); }
public static PacketHandler Instatinate(){ PacketHandler hndlr = new PacketHandler(); Assembly ass = Assembly.GetCallingAssembly(); Type[] types = ass.GetTypes(); for (int i = 0; i < types.Length; i++) { if (types[i].IsSubclassOf(typeof(CSharpServerPlugin))) { CSharpServerPlugin plg = (CSharpServerPlugin)(types[i]).GetConstructor(Type.EmptyTypes).Invoke(null); plg.UOExtInitialize(hndlr); hndlr.m_Plugins.Add(hndlr); } } return hndlr; }