BindToClose API Improvements

wow this is a game changing update!

1 Like

this is genuinely a good update to bindToClose Function, more ways to use it!, thanks for that.

That’d be a good idea, could be included in the Player.PlayerRemoving function and could share similar reasonings to the server being shutdown.

Below is just an idea of reasonings roblox ofc can do different ones if they please.
Note; Having reasonings for a player leaving would greatly assist developers as if a user leaves we can determine what to do, ex; if it was a moderation action against a player and they leave we have a better idea on if they were avoiding moderation action or if they were actually disconnected for a different reasoning.

Leave Reason Description
Unknown The player left for unknown reason.
RobloxMaintenance The server shut down for maintenance.
DeveloperShutdown The experience developer has shut down the server, or functions bound by BindToClose() have been called inside Studio.
LostConnection The client lost connection with server
OutOfMemory The client crashed due to memory.
Kicked The client was kicked from the experience.
Banned The client was banned from the experience.
Ok The client left the experience.
3 Likes

Excellent update.
Just to report: So far, I had 2 cases when a reserved server closed with reason nil - not Enum.CloseReason.Unknown, but simply nil returned, at least that is what was produced by tostring(closeReason).

1 Like

Thanks for adding to my reply.
Btw, you did some mistakes while copy-pasting (not changing server to client)

All was intentional, “DeveloperShutdown” or “The experience developer has shut down the server, or functions bound by BindToClose() have been called inside Studio.” I intentionally left it as server due to if the server does close globally the player is already going to be gone and out of the server before it closes so it doesn’t make sense to wait upwards of 30 seconds to figure out if the server had closed due to an update for roblox maintence. So “DeveloperShutdown” and “RobloxMaintenance” were left the same intentionally

1 Like

Honestly, I support this idea. This would also be a nice analytic on the dashboard

@PageFaults It appears that, since the release of this update, RobloxMaintenance server close reasons have been falsely showing as “You have been kicked from this experience. (Error 267)” for players when our servers ‘age out’. I can provide more information via message if desired.

1 Like

Having issues with people leaving the game while HttpService is still processing the request - which is a pain when dealing with applications or developer products…do we have any known workarounds for this?

I don’t know if this was reported before, but shutting down a specific server incorrectly returns the shutdown reason RobloxMaintenance.
image

Shutting down all servers of a place also incorrectly reports as DeveloperUpdate.
image

2 Likes

This is happening to me too. Also, closing servers takes way longer than expected.