using System; using System.Collections.Generic; namespace RageCoop.Core { internal partial class Packets { /// /// Used to measure the connection latency /// internal class PingPong : Packet { public override PacketType Type => PacketType.PingPong; } /// /// Request direct connection to another client /// internal class ConnectionRequest : Packet { public int TargetID { get; set; } public override PacketType Type => PacketType.ConnectionRequest; public override byte[] Serialize() { var data=new List(10); data.AddInt(TargetID); return data.ToArray(); } public override void Deserialize(byte[] array) { var reader=new BitReader(array); TargetID = reader.ReadInt32(); } } } }