wirepair/netcode

Why do both Server.Send methods have server time as parameter?

Closed this issue ยท 6 comments

I'm looking at the C implementation as reference and neither netcode_server_send_packet or netcode_client_send_packet send the time.

What's going on with Go's implementation?

Oh I get it, so you mean the golang implementation is passing time but not using it, but the C implementation doesn't pass time. Is that it?

Yes, exactly that. If there's already Server.UpdateTime why does Send also need it? Felt weird.

I think Go implementation should be as close as possible to the C one which already quite clean. Then users can build whatever they need on top of that. That's why we use UDP right? To have close to zero handholding.

Yeah, I agree, honestly this was a first pass of C translation trying to somewhat fit it into Go but it just ended up getting stuck in the middle. I'd love to take some time and rewrite it, but I have other projects on my plate. Not to say I won't get to it, but if you want to take a stab at translating it more closely to the original API I'm all for it.

I think Go implementation should be as close as possible to the C one which already quite clean. Then users can build whatever they need on top of that. That's why we use UDP right? To have close to zero handholding.

Works for me!

Fixed by @yome