/// <summary> /// Initializes a new instance of the <see cref="GamePacket" /> class. /// </summary> /// <param name="args"> /// GamePacket event data /// </param> public GamePacket(GamePacketEventArgs args) { this.packetData = new GamePacketData(args); this.Channel = args.Channel; this.Flags = args.ProtocolFlag; }
/// <summary> /// Initializes a new instance of the <see cref="GamePacket" /> class. /// </summary> /// <param name="id"> /// Id of the packet /// </param> /// <param name="channel"> /// The Channel /// </param> /// <param name="flags"> /// Protocol to send packet /// </param> public GamePacket(short id, PacketChannel channel, PacketProtocolFlags flags = PacketProtocolFlags.Reliable) { this.packetData = new GamePacketData(id); this.Channel = channel; this.Flags = flags; }
/// <summary> /// Initializes a new instance of the <see cref="GamePacket" /> class. /// </summary> /// <param name="data"> /// Bytes of the packet /// </param> public GamePacket(byte[] data) { this.packetData = new GamePacketData(data); }
/// <summary> /// Initializes a new instance of the <see cref="GamePacket" /> class. /// </summary> /// <param name="packet"> /// The Packet /// </param> public GamePacket(Packet packet) { this.packetData = new GamePacketData(packet.Id); this.Channel = packet.Channel; this.Flags = packet.Flags; }