Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend the docs with some use cases and examples #34

Open
borzaka opened this issue Oct 21, 2023 · 10 comments
Open

Extend the docs with some use cases and examples #34

borzaka opened this issue Oct 21, 2023 · 10 comments
Labels
documentation Improvements or additions to documentation

Comments

@borzaka
Copy link
Contributor

borzaka commented Oct 21, 2023

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.
@joedwards32 joedwards32 added the documentation Improvements or additions to documentation label Oct 21, 2023
@magnushirst
Copy link

magnushirst commented Oct 22, 2023

  1. 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.
  1. 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.sfg but it resets every container restart
  1. How can I configure CSTV?
  • can't comment
  1. 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
  1. 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
  1. Minimum recommended hardware.
  • follow cs2 recommendations as it will be most up to date. A link could be added I guess
  1. Minimum needed space.
  • Same as above

@borzaka
Copy link
Contributor Author

borzaka commented Oct 23, 2023

For multi instance, at least you have to change:

  • CS2_PORT
  • CS2_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).

@joedwards32
Copy link
Owner

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.

@drogerschariot
Copy link

drogerschariot commented Oct 26, 2023

  1. For each server create an .env file with values specific to the server. In the compose file reference .env using:
version: '2'
services:
  cs2_server1:
    image: joedwards32/cs2
    env_file:
      - .env
 ...
  1. @joedwards32 If you use a volume for cs-data, then the server.sfg file should persist after rebooting container.

@joedwards32
Copy link
Owner

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

@yoyecros
Copy link

yoyecros commented Nov 2, 2023

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?

@joedwards32
Copy link
Owner

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.

@brandonaaskov
Copy link

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?

@borzaka
Copy link
Contributor Author

borzaka commented Nov 13, 2023

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.

@borzaka
Copy link
Contributor Author

borzaka commented Nov 13, 2023

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.

@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:

  • hostname
  • rcon_password
  • sv_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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

6 participants