This describes how generally the server, client and database comunicate.
Because of the complexity of the game and resource loading, this should give both general and in depth overview on
following:
What server application does when it starts
What client application does when it starts
How the data is taken from database
How and when is data transferred to client
Note: Client reffers to application, not human behind computer
The following diagram tries to map the most important events that occur on server
and the communication between server and database.
Moreover, there is outlined what happens when, for example, client connects to server, or when client requests to
log in.
2 Server startup
Server does following upon startup:
Loads data from database
All game items
All game monsters
All equipped items for monsters
For items, only IDs need to be loaded, as items are already loaded (see above)
Load map from .json file on server
Runs server loop
3 Client startup
Note: startup reffers to opening browser and letting socket.io connect