示例#1
0
 /// <summary>
 ///     Creates a <see cref="GamePacket" /> with a header, channel, and protocol.
 /// </summary>
 /// <param name="id">Id of the packet</param>
 /// <param name="channel">Channel</param>
 /// <param name="flags">Protocol to send packet</param>
 public GamePacket(short id, PacketChannel channel, PacketProtocolFlags flags = PacketProtocolFlags.Reliable)
 {
     packetData = new GamePacketData(id);
     Channel    = channel;
     Flags      = flags;
 }
示例#2
0
 /// <summary>
 ///     Creates a <see cref="GamePacket" /> with the event arguements for packets.
 /// </summary>
 /// <param name="args"></param>
 public GamePacket(GamePacketEventArgs args)
 {
     packetData = new GamePacketData(args);
     Channel    = args.Channel;
     Flags      = args.ProtocolFlag;
 }
示例#3
0
 /// <summary>
 ///     Creates a <see cref="GamePacket" /> from a packet.
 /// </summary>
 /// <param name="packet">Packet</param>
 public GamePacket(Packet packet)
 {
     packetData = new GamePacketData(packet.Id);
     Channel    = packet.Channel;
     Flags      = packet.Flags;
 }
示例#4
0
 /// <summary>
 ///     Creates a <see cref="GamePacket" /> with the packet data.
 /// </summary>
 /// <param name="data">Bytes of the packet</param>
 public GamePacket(byte[] data)
 {
     packetData = new GamePacketData(data);
 }