The server-client infrastructure in Ophelia now looks like this: The server, an express application, manages connections from different client. Each client can choose to host a game on the server or join an already hosted game. Once a game is in progress, it’s logic will be executed on the server. Whenever something happens that needs to be displayed on the client, such as an object being created, the server sends a message to the clients who update their state to match. The only thing sent to the server by the clients is user input.
The game logic on the server is written in the form of triggers; callbacks to events. All user scripts will start their execution on an event. See the previous post on Events for more information about this.