Skip to content

Fix #158#165

Open
RoiArthurB wants to merge 6 commits into
mainfrom
fix-#158
Open

Fix #158#165
RoiArthurB wants to merge 6 commits into
mainfrom
fix-#158

Conversation

@RoiArthurB

Copy link
Copy Markdown
Contributor

Pull Request

Checklist

  • Code is complete and ready for review
  • Tests have been added/updated (if applicable)
  • Documentation has been updated (if applicable)

Description

Related Issue

#158

RoiArthurB and others added 6 commits July 16, 2026 14:16
Avoid having to connect to random `adb-2G0YC1ZF8Q05RW-KEQjyK._adb-tls-connect._tcp`
…starts

Fixes #156 — Unity preview failed when GAMA was started before the
WebPlatform: 'do create_player(...)' hit 'nil value detected' and the
player was permanently stuck in a dead loop.

Root causes:
- experiment_id/experiment_state were blindly poisoned by any
  SimulationStatus, even for experiments the platform never launched
- the authoritative experiment id returned by the 'load' ack was
  misstored as experiment_name and never used
- in_game was committed before GAMA acked create_player, so one failure
  permanently suppressed retries

Fix (verified against a live GAMA GUI-server):
- Track experiment ownership: experiment_id is only set from our own
  load ack or a successful probe adoption
- Probe proactively on ConnectionSuccessful (GAMA never re-broadcasts
  SimulationStatus to new clients) with 'string(paused)+"|"+string(cycle)':
  fails exactly when no live simulation exists, and carries the real
  RUNNING/PAUSED state on success
- Adopt usable pre-existing experiments (players auto-join, platform
  restart mid-session now recovers); reject unusable ones silently on
  connect, with a monitor warning flag once a status proves one exists
- Re-probe rejected experiments on a RUNNING transition (user pressed
  play in the GAMA GUI)
- Roll back in_game and notify the Unity client with an explicit error
  when GAMA rejects create_player, so the player can retry later
- Gate all outgoing commands (create/remove player, expression, ask)
  behind canTalkToExperiment()

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ApEsviNMJxKePdy4gQjxag
…ntrol

Show an orange banner on the SimulationManager screen when the backend
flags foreign_experiment_detected (see #156): GAMA has an experiment
opened from its own interface that the platform cannot use. Translated
in all six languages.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ApEsviNMJxKePdy4gQjxag
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant