|
nanoMMO 0.97.8
Building an MMO: The Engineering Series
|
The game has one version, for the client and all the servers, set by project(nanommo VERSION ...) in the top CMakeLists.txt. CMake writes it into protocol/version.h, in the build folder, from protocol/version.h.in, as it configures the build, so the code has it as nanommo::kVersion.
A version is MAJOR.MINOR.PATCH, after Semantic Versioning. While the major version is 0, each episode's code is a minor version, 0.59.0 for episode 59's, and a patch fixes a minor version without changing what the client and the servers say to each other.
The client sends its version with each login (LoginRequest.version), and the login server lets it in when its major and minor version match the servers' (Compatible). It turns any other away, with an error that names the version to get, and a client from before versions, which sends none, is told it's too old. The error is English, in LoginReply's error, as every client reads it there, and from 0.96.0 it's a sentence too, in why, which a client of 0.96.0 or later says in its player's language. So a deploy that changes the minor version turns away the clients built before it, at their next login.
A release changes the version in CMakeLists.txt, adds it to CHANGELOG.md, with its date and what changed, and tags its commit v and the version, such as v0.59.0.
Each dependency is pinned, so that a build is the same from one day to the next. The C++ libraries are pinned to a release, a tag or a commit, each with the SHA-256 of what CMake downloads (URL_HASH), the images to their tags, the actions to their versions, and the website's and the storyteller's packages in composer.lock and requirements-server.txt.
scripts/dependencies.py lists the libraries CMakeLists.txt fetches from GitHub, the version each is pinned to, and the newest, which is the latest release, or the newest tag that's a version, for a library without releases, or the newest commit, for one pinned to a commit. With --update, it writes the newest into CMakeLists.txt, with its hash. It reads GITHUB_TOKEN, when it's set, for GitHub's higher limit on requests.
These run once a week, in the public repository.
CI checks each pull request like any other. The updates that pass go into the game in the next episode, as a commit of their own, and the pull request is closed.