Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add html game runner #38

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

add html game runner #38

wants to merge 6 commits into from

Conversation

hbtz-dev
Copy link

@hbtz-dev hbtz-dev commented Jan 5, 2025

Note: For the self-install to work, you must issue a Github release with tag 1.0.0

Neuro HTML Game Runner

Usage

  • Execute neuro_html_game_runner.bat next to folders containing games with .html entrypoints. Only the single script is required.
  • You can select what game to play.

What it does

  • First, it downloads static-web-server if it are not already present.
  • It writes the environment variable NEURO_SDK_WS_URL, if it exists, to a file /$ENV/NEURO_SDK_WS_URL relative to the game directory.
  • It uses static-web-server to serve the files for the selected game on localhost:8787.
  • The game can then be played safely from localhost:8787 in the browser.

Why?

  • HTML games are safe to run due to the browser sandbox. However, they require a local server to run in order serve game files.
  • Bundling a local server with the game is dangerous, as it requires executing untrusted code, subverting the security model of the browser.
  • This script can be used with any HTML game to run it locally safely.

Dependencies

neuro-html-game-runner/LICENSE.md Outdated Show resolved Hide resolved
neuro-html-game-runner/neuro_runner_deps/runner.ps1 Outdated Show resolved Hide resolved
neuro-html-game-runner/README.md Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idea: Instead of using the batch file installer and the powershell runner, would it not be a better idea to just have a single script file that does both the downloading of the dependencies and the running?

Copy link
Author

@hbtz-dev hbtz-dev Jan 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there doesn't seem to be an easy way to make double-click-to-execute work out of the box for .ps1 files.

Copy link
Member

@Alexejhero Alexejhero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@Alexejhero
Copy link
Member

I want to get this as close as possible to the python script - can we add these headers?

"Cache-Control", "no-cache, no-store, must-revalidate"
"Pragma", "no-cache"
"Expires", "0"

@Alexejhero
Copy link
Member

Since games will be cycled through often, caching should be disabled

@Alexejhero Alexejhero self-requested a review January 12, 2025 19:46
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.

2 participants