Changed connection.d to cast to packettype and recieve a ushort.