question

Brent Batas (Lisk) avatar image
Brent Batas (Lisk) asked

Send a message to all players on a server

When I am about to deploy a new build of my game, I'd like to send a message to all players on the server that "A new patch is being deployed. You will be disconnected in 10 minutes." or something along those lines.

That way, when I disconnect them, they know it was something intentional and not just the game being unstable.

The reason I don't want to have both the new and old builds running simultaneously, is this is for the Lobby server. If there were, say, 10 people on the v1.0 and I release v1.1, and 10 people join v1.1, then we'd have the community split in two and that makes matchmaking a lot harder. Not to mention a friend on v1.0 wouldn't be able to play with a friend on v1.1.

I'd rather be able to boot everyone on v1.0 so they rejoin on v1.1 and can play with everyone else. I just want to be able to send a message so they know what is happening.

Right now, I have a Title Data that stores a "client message" that is displayed on the client on login. I use this to display things like known bugs or other events. However, this is only checked on login, so it wouldn't be pushed to people already logged in.

The only way I can think of implementing what I want is to have the client check the title data every minute or so... but that seems wasteful when 99.9% of the time it'd not be necessary.

Title Data
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

How long are the lobby sessions? Presumably you're planning your updates at least a day or so in advance, so you could just have the server check your "client message" on start, and have a timestamp in that Title Data, to schedule this in advance. If it's a requirement that you be able to do this at any time, I'd recommend adding logic to the server, to let it push the announcement to players. Then, pick a port in the 9xxx range that's higher than the max number of server instances your server host can manage (say, 9999) and make it your admin tool port. Make sure to have a solid security story around an initial handshake, so that no one can hijack the server using that connection, and then just send the command to your server using that.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.