1 module draklib.protocol.connected;
2 import draklib.core : RakNetInfo;
3 import draklib.bytestream : ByteStream;
4 import draklib.protocol.packet;
5 
6 class ConnectedPingPacket : Packet {
7 	long time;
8 	
9 	override {
10 		protected void _encode(ref ByteStream stream) {
11 			stream.writeLong(time);
12 		}
13 		
14 		protected void _decode(ref ByteStream stream) {
15 			time = stream.readLong();
16 		}
17 		
18 		ubyte getID() {
19 			return RakNetInfo.CONNECTED_PING;
20 		}
21 		
22 		uint getSize() {
23 			return 9;
24 		}
25 	}
26 }
27 
28 class ConnectedPongPacket : ConnectedPingPacket {
29 	override {
30 		ubyte getID() {
31 			return RakNetInfo.CONNECTED_PONG;
32 		}
33 	}
34 }