class_docstr: A Remote Starcraft II environment for playing vs other agents or humans.
  
  Unlike SC2Env, this doesn't actually start any instances and only connects
  to a remote instance.
  
  This assumes a 2 player game, and works best with play_vs_agent.py.
class_docstr_tok: ["A","Remote","Starcraft","II","environment","for","playing","vs","other","agents","or","humans",".","Unlike","SC2Env",",","this","does","n't","actually","start","any","instances","and","only","connects","to","a","remote","instance",".","This","assumes","a","2","player","game",",","and","works","best","with","play_vs_agent.py","."]
docstr: Make sure this stays synced with bin/agent_remote.py.
docstr_tok: ["Make","sure","this","stays","synced","with","bin\/agent_remote.py","."]
code: def _connect_remote(
      self,
      host,
      host_port,
      lan_ports,
      race,
      name,
      map_inst,
      save_map,
      interface,
      agent_interface_format,
  ):
      """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._game_info = [self._controllers[0].game_info()]
  
      if not self._map_name:
          self._map_name = self._game_info[0].map_name
  
      self._features = [
          features.features_from_game_info(
              game_info=self._game_info[0],
              agent_interface_format=agent_interface_format,
          )
      ]
  
      self._in_game = True
      logging.info("Game joined.")
  
file_path: pysc2/pysc2/env/remote_sc2_env.py
imports: from typing import Sequence
  from absl import logging
  from pysc2 import maps
  from pysc2 import run_configs
  from pysc2.env import sc2_env
  from pysc2.lib import features
  from pysc2.lib import remote_controller
  from pysc2.lib import run_parallel
  from s2clientprotocol import sc2api_pb2
label_desc: Use image node_id 3 for calling the RemoteSC2Env obj's underlying member method code with example usage: obj._connect_remote(host, host_port, lan_ports, race, name, map_inst, save_map, interface, agent_interface_format) without return types