Hi guys!
Im building an idle MMORPG made in Unity with the Firebase enviroment, i have a question regarding the combat side of it, let me be as brief as possible:
At the moment all the tasks i have setup (non-combat) are very well structured i believe, the Client does all the logic, every 60s it triggers a cloud function that validates if the info in it as been tampered with or not and reports back to the Client and the Realtime DB. This if the user is online, if the user is offline its a much simple process of a cloud function that gets triggered at sign in to check how long as been and what the user gained meanwhile.
Now for the actual side that is troubling me, the multiplayer combat, given that each attack takes 3s, using cloud functions for it would be impractical since they are one-off connections and for every 3s would trigger a new invocation. Inside Firebase enviroment, how could i create such a system that i can loop an event on the server-side (to avoid player tampering and/or works while all players in lobby are offline)? Is that possible? Or is websocket the only solution for this? I really wanted to keep the whole game inside the Firebase enviroment.
Thank you in advance!!