BindToClose API Improvements

What are the main advantages of doing this specifically; instead of just using your own?


Also, how do you provide either of these, to determine the shutdown type?

10 Likes

Better server shut down handling i assume, you’d be able to run different functions depending on the close reason

10 Likes

The DeveloperUpdate one can be quite useful as a signal to teleport players to a new server

25 Likes

This sounds like a great change! I can imagine devs could make use of this to track unexpected server shutdowns, which might be very useful for finding memory leaks.

8 Likes

so unkown but absolute W update :sunglasses::sunglasses::sunglasses:

7 Likes

Will this become integrated as an analytics stat?

19 Likes

how would we know when the game is shutting down exactly? like after the task.wait in the function?

5 Likes

The documentation of BindToClose states that “Multiple functions can be bound using BindToClose if it is called repeatedly. The game will wait a maximum of 30 seconds for all bound functions to complete running before shutting down. After 30 seconds, the game will shut down regardless if all bound functions have completed or not.”

8 Likes

It would be awesome if this could be added to our analytics as well. Would love to see a chart of average server lifetimes, as well as a display of which of these close reasons happens more often. It could be an actionable signal if we were to see high numbers of OutOfMemory, for example.

15 Likes

currently looking for the “omg i’ve waited for soooo many years, finally my life is fulfilled!” ahh comment

8 Likes

It is, Someone posted this helpful image in another thread.

20 Likes

There’s a Memory Limit? What’s the Memory Limit even?

5 Likes

Just to clarify, When you now bind a function using BindToClose, The game server itself will pass the enum to your bound function as the first parameter. It’s not necessary for you to pass anything in your own code.

Previously creators didn’t have direct information as to why the server was closing.

17 Likes

Memory limit for most servers is 6.5GB, whilst for larger (600?+) servers it’s 12GB.

12 Likes

Thanks!

We’re hoping creators find this useful for a variety of scenarios! Some experience developers who tested this feature have also found this helpful for tracking down memory leaks by collecting information for servers that shutdown due to the OutOfMemory reason.

10 Likes

It’s not part of this update but it is something we want to consider for the future!

8 Likes

W update. This will help track why my servers keep crashing

6 Likes

This announcement also provides some information around game servers and memory limits: Increasing Server Memory Experiments

8 Likes

Thanks a lot! This is such a good change! Our game had a problem in the early days where memory leaks caused server crashes. Everyone in the server would lose their hard-earned winstreaks if they were mid-game during a server crash.

Now, this seems to never happen, but if it ever does, I can be confident that they won’t be recognized as having “left the game during a match” and losing their winstreak, because BindToClose automatically removes the mid-game status in our game.

6 Likes

This helps improve the migration feature, it allows us to trigger migration teleports when necessary.

It helps, but not 100%, and I appreciate that this was added. It’s very useful.

8 Likes