Does shutting down a server cause all the players in that server to fire the Players.Removing event?

I have a small number of players in my game right now, and the way their data (by the way they have a lot of data) is saved is when the player is removed from the game. I have a huge update this friday with new content, and I wish to shut down the servers so that the old servers are phased out. I’m just concerned as I’ve heard somewhere that their data will not save as player removing is not fired.

I’m not sure if the event is fired, however, you can use game:BindToClose() to save all data if the server were to shutdown.

Iterate through the players and save their data before the game shuts down completely.

3 Likes

Perfect, I will look into this!

1 Like

This is a very interesting question, also yeah I recommend using game:BindToClose()

1 Like

Actually just a second thought, my devs mentioned that there could be a bigger number of players, around 1k to 5k players. Wouldn’t doing this bindtoclose() reach the data store queue limits?

You won’t have to worry about this. Limits are per server;

In each server, the limit for Datastore’s SetAsync is 60 + numPlayers × 10 source

You won’t have to worry about hitting limits, unless you’re saving over 10 times per player.

2 Likes