News for hackers. Stuff that matters.
Re:OpenTTD Compiled to WebAssembly by reubenmorais on Sunday March 31, 2019 @07:14PM (#19539082)
Could you use WebRTC instead, for true P2P?
Re:OpenTTD Compiled to WebAssembly by lxtx on Monday April 01, 2019 @04:05AM (#19541409)
You can. I've used WebRTC for multiplayer support in Quake 3 compiled to WebAssembly.
Re:OpenTTD Compiled to WebAssembly by fb03 on Monday April 01, 2019 @07:18AM (#19542203)
Do you have a link for that? Sounds super cool
Re:OpenTTD Compiled to WebAssembly by lxtx on Monday April 01, 2019 @11:49AM (#19544601)
The forked ioquake3 is available at https://github.com/seemk/ioq3

However it's not trivial to get it working at the moment, will hopefully soon come back to this project and finish it :D

Re:OpenTTD Compiled to WebAssembly by db48x on Sunday March 31, 2019 @07:17PM (#19539112)
You still need a proxy server, unless the OpenTTD game browser supports WebRTC connections.
Re:OpenTTD Compiled to WebAssembly by jeremija on Sunday March 31, 2019 @07:30PM (#19539170)
Yeah, you'd need a proxy server (websockets) to establish WebRTC connections. Even after a WebRTC connection is established, you'd need a STUN or a TURN (coturn supports both) server to get around NATs. Pls somebody correct me if I'm wrong!
Re:OpenTTD Compiled to WebAssembly by tim-- on Sunday March 31, 2019 @08:24PM (#19539401)
You should only need a STUN or TURN server if you are attempting to connect to a machine that is behind a NAT. OpenTTD servers are usually on public IPs (similar to HTTP servers), so a STUN or TURN server should not be required.

The biggest issue is that WebRTC connections do not allow you to send raw data over TCP or UDP[1].

That being said, it shouldn't be too difficult to just create a WebSocket server that translates between the native network protocol and HTTP WebSockets[2].

  [1] https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel
  [2] https://wiki.openttd.org/Network_Protocol
Re:OpenTTD Compiled to WebAssembly by db48x on Sunday March 31, 2019 @09:08PM (#19539598)
You're entirely correct. Here's a demo if you're interested: http://vrcade.io/win311