Skip to content

Context isolation #24

@arthuro555

Description

@arthuro555

The server and client may run on the same game instance when the server is not running as a dedicated server. This is problematic, as client events can interfere with the game state that is synced with everybody, causing all kinds of issues.

The server should:

  • Run in another context (instance of the scene) than the client, so that anything done on the client does not touch the true server state
  • Not run code for rendering
  • Run the server update loop independently from the client, so that it continues running even if the game window is not visible (an issue rn due to how the GDevelop rendering event loop is made)

To do so, we'll probably want to create a web worker, where we load the game and hot-patch it with the patches from https://github.com/arthuro555/cloud-gdjs as to not use any render code. Communication can be done through normal THNK serialisation over worker message APIs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✨ FeatureNew feature or request🐛 BugSomething isn't working📈 ImprovementFurther work to make an existing feature even better

    Projects

    Status

    🔙📋 Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions