public UDPPacket(PonykartPacket contents, ReliableUDPConnection sender) { Protocol = NetworkManager.Protocol; CID = (UInt32)sender.ConnectionID; SequenceNo = sender.NextSequenceNumber; Ack = sender.RemoteSeqNo; AckField = sender.AckField; Contents = contents; Responded = contents.Volatile; }
/// <summary> /// Creates a connection, given a destination to send to and a connection ID. /// </summary> public Connection(UdpClient sender, IPEndPoint destinationep, UInt32 cid) { var LobbyGUI = LKernel.Get<UIMain>().GetGUI("menu lobby gui"); LobbyLabel = LobbyGUI.GetControl<Label>("lobby label"); UDPConnection = new ReliableUDPConnection(sender, destinationep, cid, this); UDPConnection.OnPacketRecv += (p) => PacketHandler(p.Contents); OutgoingQueue = new Queue<Message>(); Cid = cid; nm = LKernel.GetG<NetworkManager>(); }