joedwards32 / CS2

CS2 Dedicated Server Docker Image
https://hub.docker.com/r/joedwards32/cs2
MIT License
282 stars 53 forks source link

Container Environment #3

Closed kevjaN89 closed 1 year ago

kevjaN89 commented 1 year ago

Hello Again :),

unfortunately, the container environment is not working correctly either. RCON password and server password are not being taken over, as well as the number of players or CS2_MAXPLAYERS. I have already adjusted them multiple times, but the server always shows 64 slots. The RCON password and server password need to be passed into the server config. If possible, please also add an environment variable for the hostname :)

Kind Regards kevjaN

joedwards32 commented 1 year ago

Hey @kevjaN89 :)

Thanks again for the feedback.

Server password is working for me, I must admit I haven't tested RCON though.

CS2_MAXPLAYERS bug confirmed, doesn't work for me either. Will look into all of the above after work.

joedwards32 commented 1 year ago

CS2_MAXPLAYERS reports 64 in the server STDOUT but I am not able to connect more than the specified number, e.g. 10, players in practice. Possibly a CS2 bug?

Server Password is working for me. The only gotcha that may make it appear like it doesn't work is that CS2 remembers the password you used to connect to a server previously (based on IP/hostname) and offers it automagically.

RCON doesn't work for me at all though. Forget the Docker container, I cant get it to work on a regular Linux server either.

Any suggestions on what the correct configuration is beyond -usercon and +rcon_password? I've tried setting rcon_password in server.cfg too.

joedwards32 commented 1 year ago

Actually, scratch that. RCON is working, just not in game. I can see other reports of similar online, seems like a CS2 client bug.

I can access RCON with the password using an alternative client, such as: https://github.com/forewing/csgo-rcon

$ ./csgo-rcon-v1.3.0-linux-amd64 -a 192.168.0.31:27015 -p changeme status
Server:  Running [172.17.0.2:27015]
Client:  Disconnected
----- Status -----
@ Current  :  game
source   : console
hostname : cs2 private server
spawn    : 1
version  : 1.39.5.2/13952 9832 secure  public
steamid  : [A:1:3685792776:24415] (90176857859734536)
udp/ip   : 172.17.0.2:27015 (public 80.189.136.98:27015)
os/type  : Linux dedicated
players  : 0 humans, 0 bots (0 max) (hibernating) (unreserved)
---------spawngroups----
loaded spawngroup(  1)  : SV:  [1: de_inferno | main lump | mapload]
loaded spawngroup(  2)  : SV:  [2: maps/prefabs/de_inferno/inferno_skybox | main lump | mapload | point_prefab]
loaded spawngroup(  3)  : SV:  [3: prefabs/misc/counterterrorist_team_intro | main lump | mapload | point_prefab]
loaded spawngroup(  4)  : SV:  [4: prefabs/misc/terrorist_team_intro | main lump | mapload | point_prefab]
loaded spawngroup(  5)  : SV:  [5: prefabs/misc/terrorist_team_intro_variant2 | main lump | mapload | point_prefab]
loaded spawngroup(  6)  : SV:  [6: prefabs/misc/counterterrorist_team_intro_variant2 | main lump | mapload | point_prefab]
loaded spawngroup(  7)  : SV:  [7: prefabs/misc/counterterrorist_wingman_intro | main lump | mapload | point_prefab]
loaded spawngroup(  8)  : SV:  [8: prefabs/misc/terrorist_wingman_intro | main lump | mapload | point_prefab]
loaded spawngroup(  9)  : SV:  [9: prefabs/misc/end_of_match | main lump | mapload | point_prefab]
---------players--------
  id     time ping loss      state   rate adr name
#end

$ ./csgo-rcon-v1.3.0-linux-amd64 -a 192.168.0.31:27015 -p change status
bad password

$ ./csgo-rcon-v1.3.0-linux-amd64 -a 192.168.0.31:27015 status
bad password
joedwards32 commented 1 year ago

@kevjaN89 I've pushed a new version of the Docker image. Fixes:

I've validated that rcon works using an alternative client. Seems busted in CS2 proper right now.

I've validated that password is being set correctly.

CS2_MAXPLAYERS seems to have the desired effect (limiting the number of players), even though stdout reports a different value.

Please test and let me know how you get on :)

kevjaN89 commented 1 year ago

@joedwards32

But already, thank you very much for everything else :)

Kind regards kevjaN89