PacketLimiter icon indicating copy to clipboard operation
PacketLimiter copied to clipboard

This is not packets per second

Open SOF3 opened this issue 4 years ago • 3 comments

This is packets per 20 ticks. And 20 ticks can take really long if the server is lagging. Please consider using a better algorithm and better data structure for storing packet count. What about an array deque?

SOF3 avatar Sep 03 '21 10:09 SOF3

https://github.com/AkmalFairuz/PacketLimiter/commit/5419ffb0f5bca25b522481805256572b5d1168fd How about this?

What about an array deque?

I never use php-ds

AkmalFairuz avatar Sep 03 '21 13:09 AkmalFairuz

you don't really need php-ds to create a deque though. You could as well just reinvent one yourself on an array :)

SOF3 avatar Sep 04 '21 02:09 SOF3

May it be a better idea to count the moment you receive a packet? Otherwise it might be too late.

SOF3 avatar Sep 04 '21 02:09 SOF3