docs: def _connect_remote(self, host, host_port, lan_ports, race, name, map_inst,
                        save_map, interface):
      """Make sure this stays synced with bin/agent_remote.py."""
      # Connect!
      logging.info("Connecting...")
      self._controllers = [remote_controller.RemoteController(host, host_port)]
      logging.info("Connected")
  
      if map_inst and save_map:
        run_config = run_configs.get()
        self._controllers[0].save_map(map_inst.path, map_inst.data(run_config))
  
      # Create the join request.
      join = sc_pb.RequestJoinGame(options=interface)
      join.race = race
      join.player_name = name
      join.shared_port = 0  # unused
      join.server_ports.game_port = lan_ports.pop(0)
      join.server_ports.base_port = lan_ports.pop(0)
      join.client_ports.add(
          game_port=lan_ports.pop(0), base_port=lan_ports.pop(0))
  
      logging.info("Joining game.")
      self._controllers[0].join_game(join)
      self._in_game = True
      logging.info("Game joined.")