本文整理匯總了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());
}
示例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.");
}
示例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
}
示例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 );
}
示例5: Register6017
public static void Register6017( int packetID, int length, bool ingame, OnPacketReceive onReceive )
{
m_6017Handlers[packetID] = new PacketHandler( packetID, length, ingame, onReceive );
}
示例6: Register
public static void Register(int packetID, bool ingame, OnPacketReceive onReceive)
{
m_Handlers[packetID] = new PacketHandler(packetID, 0, ingame, onReceive);
}
示例7: PacketReceiveSimulation
public PacketReceiveSimulation(byte[] sentBytes, int length, string message, PacketHandler handler)
: base(sentBytes, length, message)
{
Handler = handler;
}