2.7 - System Updates: 'support server' & NGINX obsoletes 'triplea_maps.yml' and 'lobby_server.yaml'
-
Current 2.5 production environment:
How things will look with 2.7
The following files will are obsolete in 2.7:
- (1) https://github.com/triplea-game/triplea/blob/master/lobby_server.yaml
- (2) https://github.com/triplea-game/triplea/blob/master/triplea_maps.yaml
File (1) contains the data for a client to know which lobby it should connect to. Keep in mind there can be multiple lobbies running at the same time (eg: 2.4 & 2.5). Each lobby exists at a different URL, the client needs to know which URL to use for the lobby.
In 2.7; we will solve this by adding routing rules to NGINX. The client simply sends a request to the lobby at a known URL:
prod.triple-game.org
. The client also sends a header with its version number. From there, NGINX will route the request to the correct lobby server for that version number.File (2) contains all the information in the 'download maps' window. The full list of all maps, their descriptions and more. To solve this, we will make the support server keep a database of all the maps in github maps. We can ask github for a list of repositories, from there assume there will be a "map.yml" and a "description.html" file in the repository, the server reads those files and puts it all into database.
With that setup, instead of the TripleA game client requesting map information by downloading a file (triplea_maps.yml) from github, instead the game client sends a request to our server. Our server now has a database of all maps, we can give the exact same data back to the client.
Notice how 'triplea_maps.yml' is no longer needed. The 'yml' file contains 5 pieces of information about each map:
(1) Map URI. We can instead get this from github when we ask for a list of all repositories. Each repository is a map, therefore the URI of all repositories is the list of all maps.
(2) Map Name. If we assume there will be a 'map.yml' file at the top level folder of each repository, then we can download that file & read the 'map_name' attribute to now know the map name. We read the map name from a file that is checked in with the repository now.
(3) Preview image location: if we assume a preview image is called 'preview.png' or similar then we know the preview location based on the URI of the map alone.
(4) description: instead of finding this information from 'triplea_maps.yml', if we assume there is a 'description.html' file in each map repository, we can read the description data from there.
(5) version: before there was a version number in triplea-maps that simply notified clients to install a new version of the map. Keep in mind, this version number is only used to notify game clients to out of date maps. The core game engine assume that any map will always have exactly one version, the game engine does not actually support the true concept of map versions (beyond showing the value to users, it's totally unused and [to the best of my knowledge] has always been otherwise unused)...
So, to replace version number, we mandate a new rule. Whenever the repository changes, we automatically increment the version number. So, whenever a map repo changes, automatically game clients will be notified that the map is out of date. Instead of storing the 'version' of a map, we can get the timestamp of the last change to the repository. The support server can read this timestamp and automatically manage the version number. In this manner, the version number works exactly in the same way as before (as far as the TripleA client is concerned). Except, the version number is entirely managed by our servers and is automatically incremented whenever a map repository on github is updated.
-
- What happens if a file with the same file name and/or game name is used in multiple map.yml?
- What if a map.yml file has multiple xml files referenced (a common situation)?
- What if the description.html file is missing?
- What if the preview.png is missing?
- What if the creator does not want the mod to be downloadable (a work in progress)?
- Will the download screen look the same as now?
-
@rogercooper Good questions
What happens if a file with the same file name and/or game name is used in multiple map.yml?
I believe there would be a duplicate listing of the game in the 'select game screens'. I'm pretty sure the game engine won't be confused, but there will be two listings potential.
What if a map.yml file has multiple xml files referenced (a common situation)?
This is where the 'map name' vs 'game name' distinction comes in. The 'map name' is only used for map download purposes. The download screen shows one item per 'map name', the 'select game' screen is what shows the multiple games.
What if the description.html file is missing?
When selecting the map for download, there will be no description.
What if the preview.png is missing?
When selecting the map for download, there will be no preview image.
What if the creator does not want the mod to be downloadable (a work in progress)?
This is a bit atypical. Usually the update to 'triplea_maps.yml' and the repository transfer ase the last steps. We can implement solutions like adding a touch file to repositories like "do-not-download". Though, moving repositories around is pretty simple.. So copying the repository into a personal space and deleting it from the triplea-maps organization is pretty easy.
Will the download screen look the same as now?
Yes. The way categories are displayed changes. mapCategory is being made more generic. So we can have multiple ways to tag a map. Currently there are zero though, so the download map list appears as just a single list of map names.
-
@lafayette This sounds good.
I did like the old category system, and the codes are still there in triplemap.yml if we want to use it.
-
I agree with Roger. Looks good. Nice work.
What is the process to add a new map ? How does one add a personal repo to the triplea-maps repo ?
-
@RogerCooper - I don't think I had thought as far as seeding the tags data with the existing category info. It's do-able. There is still some work remaining for how map tags are managed.
@beelee : The process is pretty similar. People should use the github 'transfer' repository capability to transfer their personal repositories to the github organization 'triplea-maps' (https://github.com/triplea-maps/)
That is now the final step in the map publishing process.
This is the link with instructions on how to transfer a repository are here:
https://docs.github.com/en/repositories/creating-and-managing-repositories/transferring-a-repositorySo, someone creates a repository under their own name, when they are ready to publish, they transfer the repo. In theory, all of this is existing process.
The thing that really changes is the data that was previously found in
triplea_maps.yml
is still needed, but either we automatically compute the data (eg: version number), or we need to fetch it from a special location from within the map.So, the step of "update triplea_maps.yml" is not completely gone. A map maker now needs to create the
description.html
andmap.yml
files in their repository (which is a new thing), but at least that can be done without a PR totriplea-game
. -
ok so it would be this step to transfer then.
I thought that had changed. I'll read up on your above link and try to add a updated one once this is all up and running.
Unless someone else does it first
-
The duplicative 'map' naming is indeed a new issue. (cc: @RogerCooper )
Previously the name of the zip file had to align with the name of the map. The name of the zip file came from the map repository's URL. URLs are unique, so the map name had to be unique as well.
If we keep the convention for repository and map name to be aligned, duplicate map names won't be an issue.
-
@lafayette Is the new system in effect now? Can I stop updates to Triplea_maps.yaml?
-
@rogercooper Not yet. I'm thinking to bump the version number to '2.8' when all of these updates are ready. The '2.8' release announcement will be when it is ready. These backend changes are most of what we are waiting for.