Is there a way to delete rooms that I created while testing? Or do the rooms have a lifetime?
And is there a way to know if the room code i entered already exists?
Hi Saad Baig,
To address your questions:
-
Deleting Rooms: The existing code implies that there’s a mechanism to manage the lifetime of rooms, as indicated by the notes on a “room lifetime store”. A proper implementation would be needed to control room states and deletions at the backend level. To delete rooms you created, you might want to implement functionality to directly destroy or dispose of rooms via command, ensuring that users are appropriately disconnected.
-
Room Lifetime: Rooms generally do not persist indefinitely and have a predefined lifetime depending on server settings or user activity. You’ll need to handle room cleanup when users leave or based on a timeout.
-
Checking Room Code Existence: To know if a room code already exists when trying to create or join, you should implement a checking mechanism on your backend. This could involve querying the active rooms to see if the provided name matches any existing ones before proceeding.
For further development, ensure that your backend handles these functionalities, including managing room states and providing APIs for room creation, deletion, and checking.
You may want to explore the relevant networking sections in the attached code for specifics on how these processes work, particularly around the room handling classes (see the documentation) (see the documentation).
If you require more specific implementation tips, please provide additional context or code snippets relevant to your current setup!
3 replies left
thread_dlb87aOaYjkrNPjAVzU9Elku
Reply to this message to continue the conversation
how long after no activity the room deletes itself? I’m using the default glitch server to host the room.
Hi Saad Baig,
The default timeout for user inactivity, which can result in disconnection and deletion from a room, is typically set to 30 seconds. This is the period after which a user will be kicked from the room if no ping is received (see networking).
However, for the overall room deletion, it’s essential to ensure that your backend has the correct implementation to manage and clean up rooms based on your application’s requirements, as the server does not automatically delete them after a certain time without specific configurations.
If you have further specific use cases or configurations you’d like help with, please provide more details!
2 replies left
thread_dlb87aOaYjkrNPjAVzU9Elku
Reply to this message to continue the conversation
i dont mean disconnection from the room. For example if i created a room 1234. when it is possible that I try to enter the room 1234 and see nothing saved in it?
Hi Saad Baig,
When you create a room, it will generally remain until either you explicitly delete it or the room server decides to clean it up.
For rooms hosted on a default Glitch server or similar setups, while there isn’t a strict “expiration time” outlined in the general behavior, the persistence of a room highly depends on user activity and server settings. If no users are present, rooms that are idle for a certain period (could be minutes or longer) might get cleaned up or exist until the server resets. Unfortunately, specific details regarding the exact duration for room emptiness or idle state causing deletion may vary or need to be configured on the backend.
If you observe an empty room when trying to reconnect, it could either mean that it has been deleted due to inactivity, or it might still exist but is just currently empty (see networking).
For a more precise behavior on room persistence or expiration settings, checking your network backend settings or documentation related to the server in use might provide more details. If further customization or checking on this behavior is needed, you’ll likely have to look into the configuration of the networking backend you’re working with.
If you have more specific configurations or setups in mind, feel free to share!
1 replies left
thread_dlb87aOaYjkrNPjAVzU9Elku
Reply to this message to continue the conversation