Is there a way to disconnect all connected players from Nakama? Or iterate all connected sockets? Invalidate all auth tokens? We’d like to create a kind of ‘down for maintenance’ in our game. We can enable this in the authentication system, and can ‘reboot’ the container to disconnect all players, but I’m wondering if its possible to disconnect all players without killing the container.
You can iterate over the notification stream, and get the user IDs and force logout/disconnect each connected session. This won’t affect non-realtime conn ofc.
My suggestion - create a public RPC that returns a bool “in-maintenance” - set this to true when you want to go for maintenance, and in the load balancer firewall, block all traffic apart from this RPC function. At game start, always check this RPC function before you continue to make requests to the server.