My server does this in onInit()
:
this.setState(new Game())
I want the Game
class to be able to call broadcast
on the room.
If I do this.state.room=this
in onInit()
, then this will be a part of the state and broadcast to the clients, which I don't want.
How can I pass a room reference to the room state without having it be a part of the serialized state?
I'm using the old serializer if it matters.
The reason I need to do this is because my state class handles all the game logic, and the room is basically a wrapper around the state.