That gratitude belongs to cocomed, he did the actually difficult and time consuming part. I am just happy to be able to work with his lobby code now... ;)
Thanks for testing, nice to hear it's working so far.
---
I have a few more general questions I am sure everybody has an opinion about:
1) Since I have not recently played with any mods beside the CM-Patch but am still seeing many to me unknown ones in the modding section, I am wondering: Which ones are played currently, maybe are already known to work in LAN mode and might be of interest regarding providing online servers for them?
2a) What regions have the most active player base or the worst connection to the servers which I currently host in Germany? Where in the world would we have to put additional servers up if everything runs fine?
2b) And if we knew where to put additional servers, are there maybe community members which have server capacity with unused resources in those regions on which they maybe would want to host a few game servers in the future and could ensure their availability?
3) How would you prefer the lobby to be organized: Everything in one lobby including different countries and mods? Different lobbies by country like the original lobby had? Or split by mod? I personally would prefer to have everything in one big list, but it would be a quite long scrollable list with all possible permutations of server/mod configurations. However, assuming most people are able to communicate in English and might want to find each other and play together, splitting an already small community even further seems counterproductive to me which is why I would currently tend to just dump everything in one big list as long as the lobby server can handle it in terms of performance.
---
Besides that - only for those who want to setup their own lobby on Linux, too, not only game servers - I have added the files I am currently using for hosting to my github repo. It still requires a bit of effort to get it up and running and will hopefully be more convenient someday, but for now it should do.
precondition
- docker and docker-compose installed and ideally you already know what it is and how to use it
- all necessary ports open (see in compose files port mappings which ones are used)
configuration
- I have not uploaded the server files themselves for copyright reasons, but added a file serverfiles.txt with the lists of files you need to copy from your games installation folder and where to put them. If you want to play another modded version of Sacred2, just add the files to a new sub folder next to vanilla and cm160hf and try if it works for you
- There are two files, one to start the lobby with it's database and a separate one to start one or more game servers which will register to the lobby
- In the lobby.docker-compose.yml I have used local-persist driver (https://github.com/MatchbookLab/local-persist) volumes. You may want to replace these with "normal" docker volumes in case you don't want to install an additional docker plugin to your system.
- Configure everything in the .env file - see the comments in the file for details. With local-persist volumes, you have to create the folder you have specified for "CONTAINER_VOLUME" first, create three sub folders db for the database, gs with the game server files and lb for the lobby files there and ensure your docker user has full permissions at that location. Copy the lobby files to the lb folder and ensure that you have set the same values as in the db.cfg file which you have saved in the .env file. The db.cfg then should look like this:
172.68.0.2
3306
s2lobby
root
YOUR_MYSQL_PASSWORD
The address in the ip.cfg has to be 127.0.0.1
- If you want to have multiple game servers, in the gameserver.docker-compose.yml copy the sacred-gameserver1 service as many times as you need it with another name and add environment variables for each individual configuration in .env accordingly
usage
- First start the lobby:
docker-compose -f lobby.docker-compose.yml up -d
- Then the gameserver(s):
docker-compose -f gameserver.docker-compose.yml up -d
If a game server service keeps restarting or is listed in the lobby but cannot be joined you most likely have port configuration issues.