Syncing Object

Hey all, may anyone lend me help on syncing data of an object? I have several states in my GameManager that I use to determine which behavior to enact. The masterclient holds this information. Right now, I'm sending RPCs to my clients to progress along with me, but now I really need to make sure that they're synchronized with me.

An example would be I have an object called STATE_MAIN, and my masterclient GameManager change their state from STATE_MAIN to STATE_ROUNDEND.

My clients might lose track of this and end in STATE_BONUS instead of STATE_ROUNDEND.
How can I make sure that everyone is in STATE_ROUNDEND? I can't send that via RPC since I get a Exception: cannot serialize() error (as these states are not the basic strings or int to send).

Any help or pointers is very appreciated. Thanks!


  • AndyWasHere
    edited August 2017
    Currently my solution is using enums and checking against the masterclient's states. They send that enum via rpc and the clients decides whether or not they're in the current state based on that received enum. They switch to the corrected state if they are not. This ends up being a big if-else column. Anyone with a better, elegant solution?