To do this, I used generic-type-guard package which generates both an interface AND a valid type guard from code.
With this, we are 100% sure that the messages we receive are validated at runtime!
The client cannot pass us an object that is invalid! \o/
This commit adds a '/metrics' endpoint in the API that can be exploited by Prometheus.
This endpoint returns:
- the number of connected sockets
- the number of users per room
- common NodeJS and system metrics
WARNING: this endpoint is public right now and should be protected
This is an important change.
So far, the project was labelled as licensed under the "AGPL" (improperly since no version of the AGPL was specified)
This commit changes the license to "AGPL + Commons Clause"
The [common clause](https://commonsclause.com/) is an additional restriction forbidding companies from taking WorkAdventure of the shelf, and reselling WorkAdventure.
This license does not forbid anyone from installing and using WorkAdventure, it only targets resellers (so SAAS exploitation of WorkAdventure is limited to TheCodingMachine).
This effectively makes WorkAdventure non open-source, but the source-code remains available for anyone to see and modify.
When a user connects or disconnects on the server, we log this (along the current server load).
This is only temporary, in order to assess the number of users a server can safely handle before crashing.