Skip to content

Commit

Permalink
experimental support for workshop maps
Browse files Browse the repository at this point in the history
  • Loading branch information
joedwards32 committed Aug 30, 2024
1 parent 4bfd461 commit 0ac69e9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,22 @@ CS2_LOG_DETAIL=0 (Combat damage logging: 0=disabled, 1=enemy, 2=frien
CS2_LOG_ITEMS=0 (Turns item logging on/off: 0=off, 1=on)
```

### Steam Workshop

Support for Steam Workshop is experimental!

```dockerfile
CS2_HOST_WORKSHOP_MAP="" (Steam Workshop Map ID to load on server start)
CS2_HOST_WORKSHOP_COLLECTION="" (Steam Workshop Collection ID to download)
```

If a Workshop Collection is set, maps can be selected via rcon. E.g:

```
ds_workshop_listmaps
ds_workshop_changelevel $map_name
```

# Customizing this Container

## Validating Game Files
Expand Down
21 changes: 20 additions & 1 deletion bullseye/etc/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,22 @@ if [[ ! -z $SRCDS_TOKEN ]]; then
SV_SETSTEAMACCOUNT_ARGS="+sv_setsteamaccount ${SRCDS_TOKEN}"
fi

if [[ ! -z $CS2_HOST_WORKSHOP_COLLECTION ]] || [[ ! -z $CS2_HOST_WORKSHOP_MAP ]]; then
CS2_MP_MATCH_END_CHANGELEVEL="+mp_match_end_changelevel true" # https://github.com/joedwards32/CS2/issues/57#issuecomment-2245595368
CS2_STARTMAP="\<empty\>" # https://github.com/joedwards32/CS2/issues/57#issuecomment-2245595368
CS2_MAPGROUP_ARGS=
else
CS2_MAPGROUP_ARGS="+mapgroup ${CS2_MAPGROUP}"
fi

if [[ ! -z $CS2_HOST_WORKSHOP_COLLECTION ]]; then
CS2_HOST_WORKSHOP_COLLECTION_ARGS="+host_workshop_collection ${CS2_HOST_WORKSHOP_COLLECTION}"
fi

if [[ ! -z $CS2_HOST_WORKSHOP_MAP ]]; then
CS2_HOST_WORKSHOP_MAP_ARGS="+host_workshop_map ${CS2_HOST_WORKSHOP_MAP}"
fi

# Start Server

if [[ ! -z $CS2_RCON_PORT ]]; then
Expand All @@ -107,8 +123,11 @@ eval "./cs2" -dedicated \
-usercon \
-maxplayers "${CS2_MAXPLAYERS}" \
"${CS2_GAME_MODE_ARGS}" \
+mapgroup "${CS2_MAPGROUP}" \
"${CS2_MAPGROUP_ARGS}" \
+map "${CS2_STARTMAP}" \
"${CS2_HOST_WORKSHOP_COLLECTION_ARGS}" \
"${CS2_HOST_WORKSHOP_MAP_ARGS}" \
"${CS2_MP_MATCH_END_CHANGELEVEL}" \
+rcon_password "${CS2_RCONPW}" \
"${SV_SETSTEAMACCOUNT_ARGS}" \
+sv_password "${CS2_PW}" \
Expand Down
1 change: 0 additions & 1 deletion examples/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.7'
services:
cs2-server:
image: joedwards32/cs2
Expand Down

0 comments on commit 0ac69e9

Please sign in to comment.