RoomInfo.fromBytes constructor
- Uint8List data
Creates a RoomInfo instance from a byte array.
Implementation
factory RoomInfo.fromBytes(Uint8List data) {
if (data.length < 5) {
throw FormatException('Room info packets must contain at least 5 bytes');
}
return RoomInfo(
flags: data[0],
maxPlayers: data[1] << 8 | data[2],
currentId: data[3] << 8 | data[4],
roomId: data.sublist(5),
);
}