本文整理汇总了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;
}