UkoeHB / renet2

Server/Client network library for multiplayer games with authentication and connection management made with Rust. Forked from renet.
Apache License 2.0
18 stars 3 forks source link

Add support for web server URLs #14

Closed UkoeHB closed 5 months ago

UkoeHB commented 5 months ago

Reference. @jwric can you test these changes?

Closes #12.

UkoeHB commented 5 months ago

I should probably get rid of WebServerDestinationSerializable and just implement Serialize/Deserialize manually. Let's see if the changes are worthwhile first.

jwric commented 5 months ago

Hey, thanks for the followup, it's late for me so I don't have time to look too much, I'll review and test the changes tomorrow and I'll also respond to #12 tomorrow.

Quickly though, one thing I noticed is that you could use the serde feature on rust_url directly instead of using the serializable dest struct, it would save you having to implement the serialization: url = { version = "2.4", optional = true, features = ["serde"] }

UkoeHB commented 5 months ago

Quickly though, one thing I noticed is that you could use the serde feature on rust_url directly instead of using the serializable dest struct, it would save you having to implement the serialization: url = { version = "2.4", optional = true, features = ["serde"] }

Thanks for pointing this out. One additional problem is Serialize/Deserialize aren't implemented for SocketAddr.

jwric commented 5 months ago

Quickly though, one thing I noticed is that you could use the serde feature on rust_url directly instead of using the serializable dest struct, it would save you having to implement the serialization: url = { version = "2.4", optional = true, features = ["serde"] }

Thanks for pointing this out. One additional problem is Serialize/Deserialize aren't implemented for SocketAddr.

Yes they are I believe, SocketAddr is one of the types listed in the docs of serde::ser