sendRoomInfo method

void sendRoomInfo(
  1. Channel channel
)

Implementation

void sendRoomInfo(Channel channel) {
  final room = getChannelRoom(channel);
  final player = room?.getChannel(channel);
  if (room == null || player == null) {
    sendMessage(
      RpcNetworkerPacket.named(name: SwampEvent.welcome, data: Uint8List(0)),
      channel,
    );
    return;
  }
  final info = RoomInfo(
    currentId: player,
    flags: room.roomFlags.value,
    maxPlayers: 0,
    roomId: room.roomId,
  );
  sendMessage(
    RpcNetworkerPacket.named(name: SwampEvent.roomInfo, data: info.toBytes()),
    channel,
  );
}