baremote package

Using a device as a game controller (in development for 1.9).

class baremote.RemoteAppMode[source]

Bases: AppMode

The app-mode for using a device as a game controller.

This turns a phone or tablet into a controller for a game on the same network; it is the future home of the BombSquad Remote app (in development for 1.9).

Currently a placeholder with no ui of its own: it connects to the first game it finds, and while connected the device’s touchscreen controls (or a keyboard or gamepad) drive a player in that game. Progress is reported as screen-messages and ba.net log lines. It is not in the project’s default app-modes, so the app never selects it on its own; it can be switched to manually via the dev-console’s AppModes tab.

classmethod can_handle_intent(intent: AppIntent) → bool[source]

Override this to define indent handling for an app-mode.

handle_intent(intent: AppIntent) → None[source]

Handle an intent.

on_activate(config: AppModeConfig) → None[source]

Called when the mode is becoming the active one for the app.

config is the object created by new_app_mode_config() for this activation, possibly amended by plugins. Modes that define their own config type should begin with assert isinstance(config, TheirConfig) to recover the concrete type, then set themselves (and any app-subsystems they use) up from it.

on_deactivate() → None[source]

Called when the mode stops being the active one for the app.

On platforms where the app is explicitly exited (such as desktop PC) this will also be called at app shutdown.

To best cover both mobile and desktop style platforms, actions such as saving state should generally happen in response to both on_deactivate() and on_app_active_changed() (when active is False).

test_random_input: bool = False

Testing hook – send random presses instead of real input (for headless runs, which have no input devices). Takes effect on the next activation.

test_scan_targets: list[tuple[str, int]] | None = None

Testing hook – if set, the client queries only these (address, port) pairs instead of broadcasting, so a test run can’t latch onto some other game on the network. Takes effect on the next activation.

class baremote.RemoteAppSubsystem[source]

Bases: object

Subsystem for Remote functionality in the app.

If has_python_app_subsystem is enabled for our feature-set, the single shared instance of this class can be accessed as remote on the App instance.