Skip to content

Clean up d_net.c and push back missed acks to acktosend (Chatbug attempt 3)

Hanicef requested to merge Hanicef/SRB2:push-back-acktosend into next

Well, they do say "third time's the charm", and honestly, this feels right to me.

When you end up staring at the same code for days, you start to notice a bunch of ways of improving and, and there was quite a bit of code there that was just flat out unused. However, what only struck me this morning is that !2238 (merged) might've just been a partial fix, since Net_SendAcks only sends acks that is registered in acktosend, but what I realized is that it might've missed an ack entirely. So, as another attempt, this change actually pushes back old acks in case they're missed, even if they're already queued up.

Here's where this feels right, though: with an unreasonably high amount of packet loss, excess reliable packets aren't being mass-delayed anymore. What I mean is that when spamming Lua commands to try to reproduce the bug, it doesn't delay inputs for many seconds, sometimes up to a minute with enough spam but rather flushes them all at once upon the next successful ack. The result is that it feels more responsive, which is how networking should feel like in my experience.

Even if this attempt fails, though, I will still keep the cleanup to make the the code at least a bit more tidy. For now, I will be hosting on next/2.2.14pre4 the following days with this patch applied while awake to make sure it's fixed - if you want to help out, don't hesitate to join.

Edited by Hanicef

Merge request reports

Loading