gameLobby method

  1. @override
Stream<GameInfo> gameLobby(
  1. PlayerID playerID,
  2. GameCode code
)
override

Implementation

@override
Stream<GameInfo> gameLobby(PlayerID playerID, GameCode code) async* {
  final sc = StreamController<GameInfo>();
  _socket!.on(IOChannel.lobby.string, (d) {
    final gameInfo = GameInfo.fromJson(d as Map<String, dynamic>);
    sc.add(gameInfo);
    logger.info('Got Lobby $gameInfo');
  });

  yield* sc.stream;
  await sc.close();
}