GlaireDaggers / Netcode.IO.NET

A pure managed C# implementation of the Netcode.IO spec
MIT License
255 stars 47 forks source link

Update to Netcode 1.01 #7

Closed toqueteos closed 7 years ago

toqueteos commented 7 years ago

A small change was introduced some days ago and Netcode 1.01 was born. The library needs updating.

I might send a PR for this in a few days, I've have only worked on the Go flavor of netcode.

GlaireDaggers commented 7 years ago

I can go ahead and make a quick update. Though, is the new version info string and the rearranged placement of the timeout seconds the only change that needs to be made for 1.01 (as indicated in that diff linked) or are there more changes that need to be made beyond that? EDIT: Well, re-reading the spec I guess there's other changes too. Also adding timeout seconds to private key too, as well as server's client timeout logic. As far as I can tell those are all of the changes for 1.01?

toqueteos commented 7 years ago

I think those are all the changes yes. @gafferongames can confirm though.

Overall it's a small change but it breaks compatibility with v1.00.

gafferongames commented 7 years ago

Yeah, it just adds the timeout data to the token private, plus there needs to be a pretty significant adustment to how clients timeout, and how the encryption mapping times out (different value per-client, coming from the token...). Also, the client sets its timeout value from the connect token.

cheers

gafferongames commented 7 years ago

Look at the diffs on the spec, and on the netcode.c, should be clear what changes are there. Happy to answer any questions you have.

gafferongames commented 7 years ago

Oh yeah, and negative timeout values indicate "timeout disabled". This is the hardest part.

More info on changes from 1.00 to 1.01 here:

https://github.com/networkprotocol/netcode.io/releases

GlaireDaggers commented 7 years ago

Just committed an update which brings it up to the v1.01 spec (plus a few unrelated changes and a fix to allow negative expire time to be passed to token factory).