I’m currently working on a survival game and I’m stuck on matchmaking. I want servers to keep their data even when they are shut down, so that players can start the server again and continue where they left off. My issue is mainly lobby-game communication.
The lobby first checks if the server is already running. If so, it teleports the client to the currently running server. If not, then a new server is created and the last saved data associated with it.
The data is stored using modified DataStore2 and ProfileService under a static data id. What I cannot figure out is how to send the newly created server the static id and the Developer Hub is being largely unhelpful. I’d avoid using :SetTeleportData() of TeleportOptions as I don’t trust the client. I thought of a system using MessagingService where the lobbly loops requests a few seconds after starting the server until the server responds or times out, but it seems extremely inefficient and unreliable.
I also need a way to check if the game server is still running after a crash. Once again, this will probably require MessagingService, but I don’t know how to handle this efficiently.