CS2
CS2 copied to clipboard
Extend the docs with some use cases and examples
I would like to see some solutions in the docs for the following topics:
- How can I run multiple instances of the same server? With same/different settings (config files).
- How can I access the server console? Not the Docker console, but the game console.
- How can I configure CSTV?
- How can I configure the container restarts? Every 3am for example.
- Are there any recommended 3rd party softwares, to extend/make the CS2 server/Docker image configuration easy? Remote RCON, remote Docker, etc.
- Minimum recommended hardware.
- Minimum needed space.
- How can I run multiple instances of the same server? With same/different settings (config files).
- This would likely be done by just having multiple docker containers. Maybe a docker compose example could be given but I think this is becoming more of a guide to docker than this container.
- How can I access the server console? Not the Docker console, but the game console.
- I too would like to know this or how to turn on cheats as i'm currently trying to figure this out. At the moment i'm modifying the
steam/cs2/game/csgo/cfg/server.sfgbut it resets every container restart
- How can I configure CSTV?
- can't comment
- How can I configure the container restarts? Every 3am for example.
- this would be around a cron job to docker stop, docker start and depends on your OS. This is a bit more of a generic, "how do I schedule docker containers for X" question
- Are there any recommended 3rd party softwares, to extend/make the CS2 server/Docker image configuration easy? Remote RCON, remote Docker, etc.
- can't comment
- Minimum recommended hardware.
- follow cs2 recommendations as it will be most up to date. A link could be added I guess
- Minimum needed space.
- Same as above
For multi instance, at least you have to change:
CS2_PORTCS2_RCON_PORT- and probably other options as well:
CS2_RCONPW,CS2_PW,+clientport,+tv_port,+servercfgfile - so almost every existing env variables, and non existings yet as well
Use case: I would like to run 3 dedicated servers in competitive game mode from the same server for a LAN tournament (matches are running simultaneously).
Thanks for the comments. I run my CS2 servers under AWS Fargate, I can add some examples explaining that too.
Will put some effort into deployment examples this weekend if I find some time.
- For each server create an
.envfile with values specific to the server. In the compose file reference.envusing:
version: '2'
services:
cs2_server1:
image: joedwards32/cs2
env_file:
- .env
...
- @joedwards32 If you use a volume for cs-data, then the server.sfg file should persist after rebooting container.
If you use a volume for cs-data, then the server.sfg file should persist after rebooting container.
Currently this isn't the case because the container templates this file on launch: https://github.com/joedwards32/CS2/blob/main/bullseye/etc/entry.sh#L16
If you use a volume for cs-data, then the server.sfg file should persist after rebooting container.
Currently this isn't the case because the container templates this file on launch: https://github.com/joedwards32/CS2/blob/main/bullseye/etc/entry.sh#L16
What if you change the file permission to avoid the file to be re-writed?
What if you change the file permission to avoid the file to be re-writed?
I think it would be better to create a new config file, e.g. my.cfg, and then use CS2_ADDITIONAL_ARGS to pass in +exec my.cfg.
I will test and document this properly in a PR if someone can save me some time by pointing me in the right direction. I'm using the env vars in the docker-compose.yml file to get this running, and it works. But do I need to modify and restart the server each time I want to change something like the map or number of bots? Is there an easier way to do that without having to restart the docker containers?
I will test and document this properly in a PR if someone can save me some time by pointing me in the right direction. I'm using the env vars in the docker-compose.yml file to get this running, and it works. But do I need to modify and restart the server each time I want to change something like the map or number of bots? Is there an easier way to do that without having to restart the docker containers?
Most of the time it's enough if you just change to another map. I mean for the game server settings, not the container or other env variables.
What if you change the file permission to avoid the file to be re-writed?
I think it would be better to create a new config file, e.g.
my.cfg, and then useCS2_ADDITIONAL_ARGSto pass in+exec my.cfg.
@joedwards32 This is manual way of running a multi instance game server. Maybe it helps to implement this feature, or understand it better.
After the game is installed;
- Starting the first game server instance:
./cs2-ds/game/bin/linuxsteamrt64/cs2 -dedicated -ip 0.0.0.0 -port 27015 +tv_port 27020 +servercfgfile server-1.cfg -maxplayers 12 +map de_dust2 - Starting the second game server instance:
./cs2-ds/game/bin/linuxsteamrt64/cs2 -dedicated -ip 0.0.0.0 -port 27016 +tv_port 27021 +servercfgfile server-2.cfg -maxplayers 12 +map de_inferno
It won't execute the server.cfg because of the +servercfgfile.
In the server-[x].cfg file I configure settings which should be different (and the same as well) on the servers:
hostnamercon_passwordsv_password- other
sv_settings - logging
- CSTV ports
- etc.
Other way can be: use the server.cfg for the common settings, and create server-custom-1.cfg and exec it: +exec server-custom-1.cfg. But I haven't tested this method. I have tested the first method and it works nicely.