logoalt Hacker News

adrian17yesterday at 12:21 PM1 replyview on HN

Hi, one of Ruffle maintainers here. AFAIK, we do have most of NetConnection API implemented; but direct socket connections are just impossible in browsers. The games should (hopefully) work and connect when run via the desktop player. We also implemented socket emulation in the browser via WebSockets, so they should also start working there if you put a WebSockify proxy on your server (no need to touch the game server code).


Replies

noduermeyesterday at 5:32 PM

Hi! You have done amazing work, and I'm ever grateful to your team for keeping AS3 alive!

I used sockets in some of my multiplayer games, but that's not where I ran into problems with Ruffle. Since those games only upgraded to sockets after an initial HTTPS connection, I haven't even gotten to the point of trying sockets yet. I mainly just used NetConnection.connect() for routine API calls, not to open a socket. AFAIK .connect() didn't open a socket, although I guess it had some two-way capabilities with Flash Media Server, but that's not how I used it. I just used it to initialize the NetConnection instance with the URI of a server endpoint that could receive AMF messages (usually translated on the backend with AMFPHP). I don't think it really left any sort of connection open. After that, you'd just make RESTful calls over that connection using netconnection.call(...args), and could send complex objects - even SQL result sets - back and forth without going through JSON or XML. But it was just a bunch of HTTP calls sending that data in Flash's own serialized format. You'd listen for NetStatusEvent or SecurityEvent to handle the results or errors. No sockets were involved. In conjunction with AMFPHP it was basically like a URLRequest without any structuring or destructuring needed to parse the results into AS3-friendly data types.

It would be amazing if only the RESTful kinds of NC connections and calls could work again through Ruffle, I think it might be all that's stopping my old games from running!

show 1 reply