ruffle-rs / ruffle

A Flash Player emulator written in Rust
https://ruffle.rs
Other
15.44k stars 799 forks source link

About network classes #351

Open ROBERT-MCDOWELL opened 4 years ago

ROBERT-MCDOWELL commented 4 years ago

Hi folks,

does Ruffle is trying to fully support all Flash API network classes like remote SharedObject, RTMFP NetGroup and Multicast? I developed (and still) an 12 years big PhD project that involves all these classes and interact with AMS (as2/as3) and NetGroup/GroupSpeecifier/Multicast (as3)

Thanks and long life to this amazing project!

Herschel commented 4 years ago

Thank you for the kind words!

It's certainly within the scope of the project, and I hope to support these on desktop. However, I don't think it's possible to deal with a raw RTMP/RTMFP network stream using HTML5 web APIs, so that would be a non-starter on web. It could be tunneled through WebSockets, but this would require changes to the server.

We're still early in development, so this would be in the very long-term. Admittedly, many of these classes are outside of my area of expertise, so it'd be nice to have a contributor to champion these changes!

kmeisthax commented 4 years ago

The peer-to-peer stuff that RTMFP does could be tunneled through WebRTC, but I don't believe you could interop with Flash Player this way, and it wouldn't cover server communication at all.

ROBERT-MCDOWELL commented 4 years ago

There is a project called mona server and they are actually experts of rtmfp https://github.com/MonaSolutions/librtmfp also a rtmp rust here https://docs.rs/rml_rtmp/0.3.0/rml_rtmp/ I know that UDP protocols is a big challenge but webrtc can support it for sure. if at least these classes can be used with another protocol it would be great and will do my best to contribute on it, but for now rust is like chinese for me :)

Cleod9 commented 4 years ago

^ Can vouch for MonaServer, you get compatibility with that and you'll cover a tons of ground for porting fast, scalable realtime multiplayer Flash games. Super Smash Flash 2 uses MonaServer/RTMFP for low-latency multiplayer and it's frankly the only solution that was viable.

Definitely agree it's a long-term thing though, since I imagine it won't be easy. But even if you can't interop with Flash Player I think it would still be worth the preservation effort.

ROBERT-MCDOWELL commented 4 years ago

Found RTMP crates lib here https://crates.io/crates/rml_rtmp

ciaoamigoschat commented 4 years ago

This is an RTMP client written in as3, therefore easily translatable. It does not use netconnetion but uses sockets. Am I also trying to use rtmp in the browser without flash, alternatives?

ROBERT-MCDOWELL commented 4 years ago

@ciaoamigoschat This is a rust library, not as3, for RTMFP it needs more research as webSockets are tcp only. I guest webrtc will be the way to go.

ciaoamigoschat commented 4 years ago

Of course I know this, it was just to take inspiration. Bear in mind that rtmp is more used than rtmfp. The first step could be to implement rtmp, then give the possibility to:

ROBERT-MCDOWELL commented 4 years ago

Rtmfp is much better than rtmp since it's UDP based, encrypted and most of all multicast and peer to peer serverless streaming. If you'd like to have rtmp code in As3 websockets so take a look here https://github.com/lucaslorentz/AS3RtmpClient and of course remote shared objects are also managed. Btw Ruffle goal is to strictly respect the whole Flash API and you are welcome to contribute your knowledge to the project.

ROBERT-MCDOWELL commented 4 years ago

the rust class of udpsocket https://doc.rust-lang.org/std/net/struct.UdpSocket.html rtmfp protocol in c++ https://github.com/MonaSolutions/MonaServer2/tree/master/MonaCore/sources/RTMFP

chorman0773 commented 4 years ago

I had a few plans for basic RTMP with a similar project, tunneling through WebSocket. Ideally both projects would be compatible on the network side, so the WebSocket Tunnel could be used here as well. WebRTC for RTMFP also seems like a good idea. A good idea would be to figure out some sort of spec on how RTMP is tunneled through WebSocket, and how RTMFP/WebRTC would work, so that multiple projects (not just this, and the one I mentioned) can all utilise the same protocols.

ROBERT-MCDOWELL commented 4 years ago

here is other promising RTMP,RTMPS,RTMPT,RTMPTE,RTMPE classes in RUST https://github.com/valeth/javelin When I have time I will try to implement RTMFP (my favorite) in RUST, or maybe some other guys will do it.

fp07 commented 3 years ago

Any update on this? @Herschel

Herschel commented 3 years ago

No update here, still much foundational work to do before this is any sort of priority.

ROBERT-MCDOWELL commented 4 months ago

ruffle dev team, this repo might interest you https://github.com/zenomt/rtmfp-cpp