lucaspoffo / renet

Server/Client network library for multiplayer games with authentication and connection management made with Rust
Apache License 2.0
624 stars 67 forks source link

Use Trait for sending/receiving packets #36

Closed lucaspoffo closed 1 year ago

lucaspoffo commented 1 year ago

Another attempt to try making #10 possible.

The idea of this PR is to gather what Trait would be most suitable for WASM support and UDP at the same time. By default, renet will have the UdpTransport available in the main library. For other types like Wasm/Steam/.. it would be on a separate create.

lucaspoffo commented 1 year ago

Testing the Trait with the steamworks::NetworkingMessages and it seems to work well. Created a simple echo demo using the SteamTransport and the Steam Lobby API. It needs some fixes on the steamworks-rs side but overall seems good enough for a simple game.

FelixSelter commented 1 year ago

How can one help you with this?

zicklag commented 1 year ago

I started to test this out and ran into a minor change I needed ( https://github.com/lucaspoffo/renet/pull/50 ), but otherwise, I think this was going to work for my use case.

I ended up changing direction though and didn't end up targeting WASM or using Renet, so I don't have a concrete use of it.


tl;dr: This looked pretty much ready to use from my perspective, and might be fine to merge ( other than accounting for Sync + Send bounds with https://github.com/lucaspoffo/renet/pull/50 or an alternative ).

lucaspoffo commented 1 year ago

I went in a different implemention direction in another branch, closing this.