本文整理汇总了C#中OnPacketReceive类的典型用法代码示例。如果您正苦于以下问题:C# OnPacketReceive类的具体用法?C# OnPacketReceive怎么用?C# OnPacketReceive使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OnPacketReceive类属于命名空间,在下文中一共展示了OnPacketReceive类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PacketHandler
public PacketHandler( PacketType packetID, int length, int minimunLength, OnPacketReceive onReceive )
{
_PacketID = packetID;
_Length = length;
_MinimumLength = minimunLength;
_OnReceive = onReceive;
}
示例2: PacketHandler
public PacketHandler(PacketType type, int length, int minimumLength, OnPacketReceive onReceive)
{
_PacketId = type;
_Length = length;
_MinimumLength = minimumLength;
_OnReceive = onReceive;
}
示例3: PacketHandler
public PacketHandler(int packetID, int length, bool registeredonly, OnPacketReceive onReceive)
{
this.m_PacketID = packetID;
this.m_Length = length;
this.m_RegisteredOnly = registeredonly;
this.m_OnReceive = onReceive;
}
示例4: RegisterExtended
public void RegisterExtended(int packetID, OnPacketReceive onReceive)
{
if (packetID >= 0 && packetID < 0x100)
_extendedHandlersLow[packetID] = new PacketHandler(packetID, 0, onReceive);
else
_extendedHandlersHigh[packetID] = new PacketHandler(packetID, 0, onReceive);
}
示例5: ClientPacketHandler
public ClientPacketHandler(PacketType type, int length, int minimumLength, OnPacketReceive onReceive)
{
_packetId = type;
_length = length;
_minimumLength = minimumLength;
_onReceive = onReceive;
}
示例6: Register
/// <summary>
/// Registers a Packet to Listen for
/// </summary>
/// <param name="name"> </param>
/// <param name="packetID">PacketID</param>
/// <param name="length">
/// Length of the Incoming Data
/// <para>NOTE: this must be EXACTLY the Length! Too much Data will be handled as a new Packet!</para>
/// </param>
/// <param name="onReceive">CallBack Function - will be called on Packet income</param>
public static void Register(string name, short packetID, int length, OnPacketReceive onReceive) {
if (Handlers.ContainsKey(packetID)) {
throw new Exception(String.Format("Packet {0} already exists!", packetID));
}
Handlers.Add(packetID, new PacketHandler(name, packetID, length, onReceive));
}
示例7: PacketHandler
public PacketHandler(int packetID, int length, bool ingame, OnPacketReceive onReceive)
{
m_PacketID = packetID;
m_Length = length;
m_Ingame = ingame;
m_OnReceive = onReceive;
}
示例8: Configure
public static void Configure()
{
PacketHandlers.RemoveExtendedHandler( 0x13 );
PacketHandlers.RemoveExtendedHandler( 0x15 );
OnPacketReceive handler = new OnPacketReceive( EmptyHandler );
PacketHandlers.RegisterExtended( 0x13, true, handler );
PacketHandlers.RegisterExtended( 0x15, true, handler );
}
示例9: PacketHandler
/// <summary>
/// Constructs a new PacketHandler instance.
/// </summary>
/// <param name="id">The ID of the ProcessedPacket instance to handle.</param>
/// <param name="Encrypted">Is the ProcessedPacket instance encrypted?</param>
/// <param name="size">The size of the ProcessedPacket instance. 0 if variable length.</param>
/// <param name="handler">A OnPacketReceive instance.</param>
public PacketHandler(byte id, bool Encrypted, ushort size, OnPacketReceive handler)
{
this.m_ID = id;
this.m_Length = size;
this.m_Handler = handler;
this.m_Encrypted = Encrypted;
if (size == 0)
m_VarLength = true;
else
m_VarLength = false;
}
示例10: Initialize
public static void Initialize()
{
m_OldWalkReq = Server.Network.PacketHandlers.GetHandler( 0x02 ).OnReceive;
Server.Network.PacketHandlers.Register( 0x02, 7, true, new OnPacketReceive( MovementHandler ) );
Server.Network.PacketHandlers.Register( 0xAD, 0, true, new OnPacketReceive( UnicodeSpeech ) );
new MovementController().Start();
Mobile.AsciiClickMessage = true;
Mobile.GuildClickMessage = true;
Mobile.DisableHiddenSelfClick = false;
EventSink.Login += new LoginEventHandler( OnLogin );
EventSink.Logout += new LogoutEventHandler( OnLogout );
EventSink.Connected += new ConnectedEventHandler( EventSink_Connected );
EventSink.Disconnected += new DisconnectedEventHandler( EventSink_Disconnected );
}
示例11: Register
public static void Register( int packetID, bool ingame, OnPacketReceive onReceive )
{
m_Handlers[packetID] = new PacketHandler( packetID, 0, ingame, onReceive );
}
示例12: Register
public static void Register(PacketType packetId, int length, int minimumLength, OnPacketReceive onReceive)
{
MHandlers[(byte) packetId] = new PacketHandler(packetId, length, minimumLength, onReceive);
}
示例13: Register
private static void Register(short opcode, OnPacketReceive<LoginConnection> e)
{
m_LHandlers[opcode] = new PacketHandler<LoginConnection>(opcode, e);
m_Maintained++;
}
示例14: PacketHandler
/// <summary>
/// Registers a new PacketHandler for a single Packet
/// </summary>
/// <param name="packetID"></param>
/// <param name="length"></param>
/// <param name="ingame"></param>
/// <param name="onReceive"></param>
public PacketHandler(string name, short packetID, int length, OnPacketReceive onReceive) {
mName = name;
mPacketID = packetID;
mLength = length;
mOnReceive = onReceive;
}
示例15: PacketHandler
public PacketHandler(int packetId, int length, OnPacketReceive onReceive)
{
_packetId = packetId;
_length = length;
_onReceive = onReceive;
}