Skip to content

Pause the GAMA experiment when no active player/client remains connected #158

Description

@FlorianBarbe

Context

The SIMPLE Unity package now sends a pause_experiment message as a local safety net when:

  • Unity Play Mode is stopped
  • Unity Play Mode is paused
  • a Unity static preview capture succeeds

However, this should also be handled by simple.webplatform as a second safety layer. If Unity closes unexpectedly, crashes, loses the websocket, or if a preview/player disappears without sending the expected cleanup message, the GAMA experiment can keep running even though no player is connected anymore.

Current behavior

When the Unity player/preview disconnects or disappears, the webplatform may remove or lose the player connection, but the GAMA experiment can continue running.

This causes the simulation to keep advancing in GAMA without any active Unity client.

Expected behavior

simple.webplatform should monitor active players/clients for the current GAMA experiment.

When the last active player/client disappears, the webplatform should send:

{ "type": "pause_experiment" }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions