Hello
I am getting closer to finishing a turn based game that uses Moralis cloud (my sudo-server), database, and live queries.
One of the finer points I am anticipatingā¦
Currently
- If a player joins the game, it subscribes live queries.
- If that player uses the āleave gameā button, the client will request itself be unsubscribed from the live queries and the server will remove the player.
This, however, doesnāt consider if a player loses connection or just closes the browser. Is there a way to trigger cloud code if this happens?
I took a look at this part of the docs: https://docs.moralis.io/moralis-server/database/live-queries#livequeryclient but Iām not totally sure if itās related or not.
Perhaps I can request sessionToken? https://docs.moralis.io/moralis-server/database/live-queries#sessiontoken (are these shown in the database browser?)
Any point in the right direction would be appreciated!