PretendoNetwork / nex-go

Barebones PRUDP/NEX server library written in Go
GNU Affero General Public License v3.0
74 stars 16 forks source link

KickAll command + "graceful" kick #23

Closed shutterbug2000 closed 1 year ago

shutterbug2000 commented 1 year ago

This PR adds support for kicking all connected clients, which (combined with the next change) allows for a "graceful" disconnect that does not require waiting for the clients to timeout.

The second change adds code to send a DISCONNECT PRUDP packet that will instantly kick a given client.

Combined with code on the game server itself (or perhaps even added here?) this means that e.g. catching CTRL+C and kicking all clients is possible (useful for testing!)

jonbarrow commented 1 year ago

Looks good! Only thing is that you're setting the PRUDP version to 1 for those packets regardless of the actual version

jonbarrow commented 1 year ago

I love you