Skip to content

Packaged Windows executable fails to forward Unity player messages to GAMA (bufferUtil$1.mask is not a function) #153

@FlorianBarbe

Description

@FlorianBarbe

Describe the bug

The newly published Windows simple.webplatform executable starts correctly and connects to GAMA Server, but it fails when forwarding Unity player messages to GAMA.

As a result, Unity connects to the webplatform and the GAMA experiment starts/resumes correctly, but the Unity player is not created in GAMA and Unity receives no runtime simulation data.

The failure happens inside the webplatform executable when it tries to send messages to GAMA:

TypeError: bufferUtil$1.mask is not a function

Build context

The failing executable appears to come from this GitHub Actions run:

https://github.com/project-SIMPLE/simple.webplatform/actions/runs/26748818349

Run details:

  • Workflow: build-ci.yaml
  • Trigger: push
  • Branch: dev
  • Commit: f2b2be9
  • Status: success
  • Artifact used: windows-compiled-archive

The issue was observed with the Windows executable produced by this CI build.

To reproduce

  1. Start GAMA Server on port 1000.
  2. Start the Windows simple.webplatform executable from the CI artifact.
  3. Open a Unity project using com.project-simple.unity-plugin.
  4. Enter Play Mode in Unity.
  5. Observe that the GAMA experiment starts/resumes.
  6. Observe that no Unity player is created in GAMA and Unity receives no runtime data.
  7. Check the webplatform console logs.

What works

The executable starts:

info core·index Starting the SIMPLE Webplatform !
info monitor·MonitorServ… Creating monitor server on: ws://0.0.0.0:8001
info multi·PlayerManager Creating monitor server on: ws://0.0.0.0:8080

Webplatform started and is accessible
http://localhost:5173

It connects to GAMA:

info sim·GamaConnector Connected to Gama Server on ws://localhost:1000

Unity is detected:

info multi·PlayerManager New connection of the player of id Player_44

The GAMA experiment starts/resumes successfully.

What fails

The player is not created in GAMA, and Unity receives no simulation data.

The webplatform logs this error when forwarding create_player to GAMA:

error sim·GamaConnector Error while sending this message to GAMA:
{
type: 'expression',
exp_id: '0',
expr: 'do create_player("Player_44");'
}
error sim·GamaConnector TypeError: bufferUtil$1.mask is not a function

In earlier tests, the same error also happened when forwarding send_init_data:

error sim·GamaConnector Error while sending this message to GAMA:
{
type: 'ask',
action: 'send_init_data',
args: '{"id":"Player_44"}',
agent: 'simulation[0].unity_linker[0]'
}
error sim·GamaConnector TypeError: bufferUtil$1.mask is not a function

The player WebSocket then closes:

error multi·PlayerManager Can't find which WebSocket been closed...
warning multi·PlayerManager WebSocket for closed mid-send, marking disconnected

Actual behavior

The webplatform executable connects to GAMA and detects Unity, but fails internally when sending WebSocket messages to GAMA.

The Unity player is never created in GAMA, and runtime communication does not start.

Environment

  • OS: Windows
  • Webplatform: Windows executable from windows-compiled-archive
  • GAMA Server: ws://localhost:1000
  • Webplatform monitor socket: ws://localhost:8001
  • Webplatform player socket: ws://localhost:8080
  • Web UI: http://localhost:5173
  • Unity package: com.project-simple.unity-plugin
  • Unity player id: Player_44

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