Skip to content

Instantly share code, notes, and snippets.

@kairusds
Last active June 7, 2025 21:06
Show Gist options
  • Save kairusds/ae098e355271e0b19e6cd317afd523cc to your computer and use it in GitHub Desktop.
Save kairusds/ae098e355271e0b19e6cd317afd523cc to your computer and use it in GitHub Desktop.
Counter Strike: Source Dedicated Server compatible with the leaked Source Engine 2017 branch

Build leaked Source Engine

# Ubuntu and Debian
sudo apt update
sudo apt upgrade
sudo dpkg --add-architecture i386
sudo apt update 
sudo apt install build-essential gcc-multilib g++-multilib libedit-dev lib32z1-dev lib64z1-dev git libsdl2-dev:i386 libfreetype6-dev:i386 libfontconfig1-dev:i386 libopenal-dev:i386 libjpeg-dev:i386 libpng-dev:i386 libcurl4-gnutls-dev:i386 libbz2-dev:i386 libedit-dev:i386 libopus-dev python3 python-is-python3 python3-venv

# Arch Linux
# Note: 32-bit will not compile on Arch, as libedit's 32-bit variant has been removed from the mirrors and archives.
yay -Syu
yay -S git python gcc gcc-multilib g++-multilib sdl2 freetype2 fontconfig zlib bzip2 libjpeg libpng curl openal opus lib32-gcc-libs lib32-sdl2 lib32-freetype2 lib32-fontconfig lib32-zlib lib32-bzip2 lib32-libjpeg lib32-libpng lib32-curl lib32-openal lib32-opus

# Build
cd ~
git clone --recursive --depth 1 https://github.com/nillerusr/source-engine
cd source-engine
# 64-bit
./waf configure -T release -d --prefix=~/srcds --build-games=cstrike --enable-opus --disable-warns
# 32-bit if you want metamod and sourcemod to work
./waf configure -T release -d --prefix=~/srcds -4 --build-games=cstrike --enable-opus --disable-warns

# Enable vprof patch for sourcemod
base64 -d <<< "ZGlmZiAtLWdpdCBhL3B1YmxpYy90aWVyMC92cHJvZi5oIGIvcHVibGljL3RpZXIwL3Zwcm9mLmgKaW5kZXggNGRiZGMzY2YuLjVjNmFiMTQzIDEwMDY0NAotLS0gYS9wdWJsaWMvdGllcjAvdnByb2YuaAorKysgYi9wdWJsaWMvdGllcjAvdnByb2YuaApAQCAtMTUsNiArMTUsMTAgQEAKICNpbmNsdWRlICJ0aWVyMC92cHJvZl90ZWxlbWV0cnkuaCIKIAogLy8gVlByb2YgaXMgZW5hYmxlZCBieSBkZWZhdWx0IGluIGFsbCBjb25maWd1cmF0aW9ucyAtZXhjZXB0LSBYMzYwIFJldGFpbC4KKyNpZiAhKCBkZWZpbmVkKCBfWDM2MCApICYmIGRlZmluZWQoIF9DRVJUICkgKQorI2RlZmluZSBWUFJPRl9FTkFCTEVECisjZW5kaWYKKy8vIFRPRE8obmlsbGVydXNyKTogbWFrZSBzdHViYmVkIHZwcm9maWxlCiAKICNpZiBkZWZpbmVkKF9YMzYwKSAmJiBkZWZpbmVkKFZQUk9GX0VOQUJMRUQpCiAjaW5jbHVkZSAidGllcjAvcG1jMzYwLmgiCg==" > vprof.patch
git apply vprof.patch

./waf build
./waf install --strip

Setup Counter Strike: Source Dedicated Server

# Download CSSDS
# Setup instructions for SteamCMD are on Valve's wiki: https://developer.valvesoftware.com/wiki/SteamCMD
steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir ~/cssds +login anonymous +app_update 232330 validate +quit
cd ~/cssds

# Copy files from CSSDS with the compiled files from earlier
# This overwrites some existing CSSDS files, though it won't break anything.
cp ~/srcds/cstrike/bin/libserver.so cstrike/bin/libserver.so
cp ~/srcds/bin/*.so bin/
cp ~/srcds/dedicated_launcher .

# Create run script
echo "LD_LIBRARY_PATH=bin ./dedicated_launcher -game cstrike -console -insecure -nomaster +map de_dust" > start.sh
chmod +x start.sh

(Optional) Build 32-bit metamod:source

cd ~

# Use venv since installing python pip packages system-wide is discouraged now
python3 -m venv env
source ~/venv/bin/activate

# Install ambuild2
git clone --depth 1 https://github.com/alliedmodders/ambuild
pip install ./ambuild

# Clone Metamod:Source repo and get dependencies for CS:S
git clone --recursive --depth 1 https://github.com/alliedmodders/metamod-source
cd ~
bash metamod-source/support/checkout-deps.sh -s css

# Build Metamod:Source
cd metamod-source
mkdir build
cd build
python ../configure.py -s css --targets x86 --enable-optimize
ambuild

# Move compiled addons folder into CSSDS and deactivate venv
mv package/addons/ ~/cssds/cstrike/
deactivate
cd ~
# Metamod should now load properl, you can run the "meta" command on the console when you join the server to check.

(Optional) Build sourcemod 32-bit

# Use venv for ambuild
python3 -m venv env
source ~/venv/bin/activate

# Setup sourcemod repo
mkdir ~/alliedmodders
cd ~/alliedmodders
git clone --recursive --depth 1 https://github.com/alliedmodders/sourcemod
bash sourcemod/tools/checkout-deps.sh -s css
cd sourcemod
mkdir build
cd build
python ../configure.py -s css --targets x86 --enable-optimize
# Build
ambuild

# Copy built files into ~/cssds
cp -r package/addons/ ~/cssds/cstrike/
cp -r package/cfg/ ~/cssds/

# Deactivate venv
deactivate
cd ~

Configure server

Slightly modified server.cfg template from https://steamcommunity.com/sharedfiles/filedetails/?id=397365275

Download the server.cfg from below and move it into ~/cssds/cstrike/cfg/

Hacky solution to allow players from older or newer versions of CS:S to join the server. Replace the PatchVersion, ClientVersion and ServerVersion values of ~/cssds/cstrike/steam.inf with 6630498.

steam.inf's contents should look like this:

PatchVersion=6630498
ClientVersion=6630498
ServerVersion=6630498
ProductName=cstrike
appID=240
ServerAppID=232330

Start the server

./start.sh
//Located in: \SteamCMD\css_ds\cstrike\cfg
//CSS English Config
//Advertising: Visit https://steamcommunity.com/groups/ServerTool
sv_lan 0 // 1=Lanserver 0=Internetserver
sv_region 255 // Region Servers. 0=US East, 1=US West, 2= Suedamerika, 3=Europa, 4=Asien, 5=Australien, 6=Mittlerer Osten, 7=Afrika und 255=World
hostname "CS:S Server" // Servername
sv_password "" // Server Password. (""=No password)
sv_consistency 0 // 1=Players with custom skins aren´t allowed to connect
//bot_join_team ct // Bots only join team... "ct" or "t"
//mp_humanteam t // Human can only join team... "ct" or "t"
//FastDL ;
//sv_allowupload "0" //"0" to denied, to upload player custom sprays etc. Not recommended to enable unless you're confident in your server's security
//sv_allowdownload "1" //"0" denied the direct download from the server
//sv_loadingurl "http://yourdomain.com/"
//net_maxfilesize 128
//rcon_password "TEST" // RCON password
sv_rcon_maxfailures 10 //
sv_rcon_minfailures 10 //
sv_rcon_minfailuretime 30 //
mp_buytime 1.5 // Buytime
mp_startmoney 800 // Start money
mp_c4timer 45 // C4 (Bomb) Timer (Min.=10 Max.=90)
mp_flashlight 1 // Flashlight (1=Allowed 0=No)
mp_decals "200" //
mp_playerid 0 // Show name, if u aim on them. (0=all 1=Just Teammates 2=None)
mp_footsteps 1 // Possible to hear Footsteps (1=on 0=off)
mp_falldamage 1 //
mp_hostagepenalty 0 // After how many hostage kills the player get kicked. 0=No kick
decalfrequency 7 // After how many secounds u can spray again. (20=Default)
mp_timelimit 30 // Maptime - Currently set to 30 minutes.
mp_winlimit 0 // After X wins the map will change.
mp_round_restart_delay 3 //
mp_maxrounds 25 // How many rounds will be played per map.
mp_roundtime 3.5 // Roundtime Currently: 3:30 min
mp_freezetime 2 // Freezetime
mp_autoteambalance 0 // Teambalance
mp_limitteams 0 // How many players a team can more have then the other.
mp_friendlyfire 1 // Friendlyfire.
mp_tkpunish 0 // Teamkiller will automatic killed in the next round. (0=off 1=on)
mp_spawnprotectiontime 5 // In this team, you will be kicked, if u attack a teammate.
mp_autokick 1 // Kicking AFK player.
sv_timeout 60 // After how many secounds you will be kicked.
mp_forcecamera 1 // Cam Settings (0=You can watch everyone/ 1=Teamonly - First person / 2=Camera is forced at deathpoint.)
mp_fadetoblack 0 // If this is set to 1, it became black if u die. (1=on 0=off)
mp_allowspectators 1 // Team Spectaor is chooseable. (1=ja 0=nein)
sv_specaccelerate 5 // It´s fine this way.
sv_specspeed 3 // It´s fine this way.
sv_specnoclip 1 // Spectator can look through Doors etc.
sv_voiceenable 1 // Voicechat. (1=on 0=off)
sv_alltalk 1 // 1=Voicechat with both teams. 0=Voicechat Team only.
sv_voicequality 5 // Fine
sv_voicecodec "voice_speex" // Avalible codex: "vaudio_miles" und "voice_speex"
mp_chattime 10 // Chattime, while the game has ended. (1=min 120=max)
mp_restartgame 0 // Restart in X secounds (The map will be restarted!)
mp_forcerespawn 1
mp_teamplay 1 // 1=CTvs.T 2=Deathmatch (Free for all.)
//--=::[ Physik ]:=--
// Just don´t change anything, unless you know, what you do. :)
sv_gravity 800 // Does change the gravity. (800=Standart)
phys_pushscale 1 // Does change the strengh of the physical objects. (1=original)
phys_timescale 1 // Does change the speed of the physical objects. (1=original)
phys_impactforcescale 1 // Impact of the shoots.
sv_pushaway_clientside 0 // Clientsided pushing. (0=off 1=Only local players 2=all players)
sv_pushaway_clientside_size 15 // Minimale Groesse der Objekte die zurueckgestossen werden sollen. (15=default)
sv_pushaway_force 30000 // The strenght with that a player gets pushed away. (30000=default)
sv_pushaway_max_force 1000 // Maximum power, that a player is giving to an objects. (1000=default)
sv_pushaway_min_player_speed 75 // Minimale speed, that a player needs to have to push an object. (Does allow the hiding behind objects.) (75=default)
sv_turbophysics 0 // With that options, player are able to stand on physical objects. (1=on 0=off/default)
mp_solidplayers 0 // 1=Set player solid in multiplayer mode, no pushback !! Untested !!
//Launching from external configs vv
exec banned_user.cfg
exec banned_ip.cfg
exec mani_server.cfg
mapchangecfgfile "server.cfg"
servercfgfile "server.cfg"
//--=::[ Please change the following lines only if the server does lag and you know, what you´re doing.]::=--
sv_unlag 1 // Fine
sv_unlag_debug 0
sv_unlag_fixstuck 0
sv_maxrate 20000 // Fine
sv_minrate 2500 // Fine
sv_maxupdaterate 66 // Fine
sv_minupdaterate 30 // Fine
fps_max 600 // Fine
host_framerate 0
writeid // Banned players will be loggeg in: "banned_user.cfg".
writeip // Banned IPs will be loggeg in: "banned_ip.cfg".
log on // Log. (on=an off=aus)
sv_aim 0 // Auto aim. (1=on 0=off)
sv_cheats 0 // Disable cheats
sv_pausable 0 // Prevent players from pausing the server
sv_accelerate 5 // Player speed
sv_airaccelerate 10 // Player speed - Fly
sv_wateraccelerate 10 // Player speed water
sv_waterfriction 1
sv_friction 4
sv_maxspeed 320 // Max speed
sv_stepsize 18 // Step size
//--=::[ Source TV ]:=--
tv_enable 0 // Source TV. (1=on 0=off)
tv_port 27020 // Port SourceTV
tv_autorecord 0 // Record everyone?
tv_debug 0 // SrcTV debug info.
tv_delay 10 // SrcTV Livestream Delay
tv_dispatchmode 1 // ??? Dispatch clients to relay proxies: 0=never, 1=if appropriate, 2=always
tv_maxclients 128 // Max Spectator
tv_maxrate 3500 // Max bandweight
tv_name "Source TV" // Name of your SourceTV
tv_overrideroot 0 // Changes the SrcTV master root adress.
tv_password "" // SrcTV Password ( "" = Aus)
tv_relaypassword "" // SrcTV relaypassword ( "" = Aus)
tv_snapshotrate 20 // Every "X" Servertick, create a snapshot. (Only works if SrcTV is on.
//--=::[ BOTS ]::=--
bot_quota 32 // How many Bots?
bot_quota_mode fill // (fill=If a player joins the game the Bot will be kicked. normal=If a player join, the Bot won´t be kicked.)
bot_join_after_player 1 //
bot_difficulty 3 // (0=easy 1=normal 2=hard 3=extrem)
bot_prefix "<Bot>" // "Clantag" - Bot prefix
bot_defer_to_human 0 // Bot do things like defuse the bomb etc... (1=Humans has to to that - 0=Bots also defuse the bomb etc.)
bot_auto_vacate 32 // How many slots should be left for players.
bot_chatter normal // (on, off, radio, minimal, normal)
bot_allow_grenades 1 // Allow Bot nates
bot_allow_pistols 1 // Pistoles
bot_allow_rifles 1 // Rifles.
bot_allow_rogues 1 //
bot_allow_shotguns 1 // Shotgun.
bot_allow_snipers 1 // Sniper
bot_allow_machine_guns 1 // Maschine Gun
bot_allow_sub_machine_guns 1 // SMG´s
// Here are the RCON Commands for bots.
// bot_about // Bot Informations
// bot_add // Add a Bot
// bot_add_t // Add a Bot for T
// bot_add_ct // Add a Bot fot CT
// bot_kill // Kill Bot X
// bot_kick // Kick Bot X
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment