toBytes method
Implementation
Uint8List toBytes() {
final bytes = Uint8List(5 + roomId.length);
bytes[0] = flags;
bytes[1] = maxPlayers >> 8;
bytes[2] = maxPlayers & 0xFF;
bytes[3] = currentId >> 8;
bytes[4] = currentId & 0xFF;
bytes.setAll(5, roomId);
return bytes;
}