Kenny2github / scratch-vm

Virtual Machine used to represent, run, and maintain the state of programs for Scratch 3.0
http://llk.github.io/scratch-vm
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Dexter extension: Add modal asking for Dexter's IP #2

Open Kenny2github opened 5 years ago

Kenny2github commented 5 years ago

Dexter now has a WS server running on its own, which means that the extension will need to get the IP to use and save it somehow.

JamesNewton commented 4 years ago

I found that this._ws = new WebSocket('ws://'+window.location.hostname+':3000'); works nicely. This always returns the host for wherever the web page came from, so it's gets Dexters IP address if scratch was served from Dexter and it gets localhost if it's served from the PC

The problem is it gets your url if it's served from there. Still... better than a hard coded IP address. We probably need block that allows the user to set Dexters IP?

Kenny2github commented 4 years ago

That works when you're running Scratch on your own, but the problem is that that doesn't work when you're using the built version on https://kenny2github.github.io/scratch-gui/ - there's no WS server running on ws://kenny2github.github.io:3000

JamesNewton commented 4 years ago

Sorry, I wrote that before I found the compiled version we downloaded onto the robot. That's the version that should be changed, not this version. On this version, the block to change the IP address is the way to go.

JamesNewton commented 4 years ago

Is there a way to raise issues on that version? https://github.com/Kenny2github/scratch-gui/tree/gh-pages The only outstanding problem is we can't load projects after we save them. I started trying to troubleshoot that today, but it's complex code and I'm quite lost.