當前位置: 首頁>>代碼示例>>C#>>正文


C# Network.PacketHandler類代碼示例

本文整理匯總了C#中Server.Network.PacketHandler的典型用法代碼示例。如果您正苦於以下問題:C# PacketHandler類的具體用法?C# PacketHandler怎麽用?C# PacketHandler使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PacketHandler類屬於Server.Network命名空間,在下文中一共展示了PacketHandler類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: AddReceivePacket

 public void AddReceivePacket(byte[] processedBytes, int length, string message, PacketHandler handler)
 {
     byte[] toAdd = new byte[processedBytes.Length];
     for (int i = 0; i < length; i++)
     {
         toAdd[i] = processedBytes[i];
     }
     Packets.Enqueue(new PacketReceiveSimulation(toAdd, length, message, handler));
     Console.WriteLine("Logging Received Packet: " + PacketHandlers.Handlers[handler.PacketID].OnReceive.Method.ToString());
 }
開發者ID:greeduomacro,項目名稱:UO-Forever,代碼行數:10,代碼來源:PacketSimulation.cs

示例2: Initialize

        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.");
        }
開發者ID:WildGenie,項目名稱:uo-ext,代碼行數:15,代碼來源:UOExtAdapter.cs

示例3: Configure

		public static void Configure()
		{
			EventSink.QuestGumpRequest += XmlQuest.QuestButton;

			ContentChangeParent = PacketHandlers.GetHandler(0x66);
			UseReqParent = PacketHandlers.GetHandler(0x06);
			LookReqParent = PacketHandlers.GetHandler(0x09);

			PacketHandlers.Register(0x66, 0, true, BaseEntryBook.ContentChange);
			PacketHandlers.Register(0x06, 5, true, XmlAttach.UseReq);
			PacketHandlers.Register(0x09, 5, true, XmlAttach.LookReq);

			#if CLIENT6017
			PacketHandlers.Register6017(0x66, 0, true, BaseEntryBook.ContentChange);
			PacketHandlers.Register6017(0x06, 5, true, XmlAttach.UseReq);
			PacketHandlers.Register6017(0x09, 5, true, XmlAttach.LookReq);
			#endif
		}
開發者ID:greeduomacro,項目名稱:UO-Forever,代碼行數:18,代碼來源:PacketHandlerOverrides.cs

示例4: RegisterExtended

		public static void RegisterExtended( int packetID, bool ingame, OnPacketReceive onReceive )
		{
			if ( packetID >= 0 && packetID < 0x100 )
				m_ExtendedHandlersLow[packetID] = new PacketHandler( packetID, 0, ingame, onReceive );
			else
				m_ExtendedHandlersHigh[packetID] = new PacketHandler( packetID, 0, ingame, onReceive );
		}
開發者ID:Grimoric,項目名稱:RunUO.2.3.r1083,代碼行數:7,代碼來源:PacketHandlers.cs

示例5: Register6017

		public static void Register6017( int packetID, int length, bool ingame, OnPacketReceive onReceive )
		{
			m_6017Handlers[packetID] = new PacketHandler( packetID, length, ingame, onReceive );
		}
開發者ID:Grimoric,項目名稱:RunUO.2.3.r1083,代碼行數:4,代碼來源:PacketHandlers.cs

示例6: Register

 public static void Register(int packetID, bool ingame, OnPacketReceive onReceive)
 {
     m_Handlers[packetID] = new PacketHandler(packetID, 0, ingame, onReceive);
 }
開發者ID:Crome696,項目名稱:ServUO,代碼行數:4,代碼來源:ProtocolExtensions.cs

示例7: PacketReceiveSimulation

 public PacketReceiveSimulation(byte[] sentBytes, int length, string message, PacketHandler handler) 
     : base(sentBytes, length, message)
 {
     Handler = handler;
 }
開發者ID:greeduomacro,項目名稱:UO-Forever,代碼行數:5,代碼來源:PacketSimulation.cs


注:本文中的Server.Network.PacketHandler類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。