### Starting the Server on Linux Source: https://context7.com/snwcreations/l4d2-modded-server/llms.txt Automates the entire server setup process, including SteamCMD installation, game file downloads, mod deployment, and launching the server. Ensure `server.ini` is configured before running. ```bash # Clone the repository git clone https://github.com/SNWCreations/l4d2-modded-server.git cd l4d2-modded-server # Configure server settings cp server.ini server.ini.backup nano server.ini # Edit STEAM_USER, PORT, MAXPLAYERS, etc. # Start the server (first run downloads ~10GB of game files) ./start.sh # Expected output on first run: # If you want to quit, close the Left 4 Dead 2 window and type Y followed by Enter. # SteamCMD not found, installing for Linux... # Using SteamCMD to check for updates. # Downloading Left 4 Dead 2 Dedicated Server... # Copying mod files. # Copying custom files. # Left 4 Dead 2 started. # Verify installation in server console: # > meta list # [01] SourceMod (1.12.0.7221) by AlliedModders LLC # > sm plugins list # [01] All4Dead 2 (3.9) by ... # [02] Left4DHooks (1.161) by ... # ... ``` -------------------------------- ### Verify SourceMod Installation Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/README.md Run these commands in the server console after initial setup to verify that SourceMod and its plugins are installed correctly. If content appears for both, the setup is successful. ```text meta list ``` ```text sm plugins list ``` -------------------------------- ### Script_ForceVersusStart Signature Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d1.txt Signature for forcing the start of a Versus game mode. ```text "Script_ForceVersusStart" { "library" "server" "linux" "@_ZN8Director16ForceVersusStartEv" "windows" "\x83\x2A\x2A\x53\x55\x56\x8B\x2A\x57\x89\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x8B" /* 83 ? ? 53 55 56 8B ? 57 89 ? ? ? E8 ? ? ? ? 8B */ /* Search: "Force start the versus game, so PZs can spawn". Function "CMD_ForceVersusStart" few lines below, which calls "Director::ForceVersusStart". */ } ``` -------------------------------- ### Script_ForceVersusStart Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d1.txt Forces the start of a Versus game mode. Includes signatures for Linux and Windows. ```APIDOC ## Script_ForceVersusStart ### Description Forces the start of a Versus game mode, allowing Infected to spawn. ### Method N/A (Internal game function) ### Endpoint N/A (Internal game function) ### Parameters N/A ### Request Example N/A ### Response N/A ### Signatures - **Linux**: `@_ZN8Director16ForceVersusStartEv` - **Windows**: `ƒ******535556‹*57‰******E8******8B` ### Notes Named after the L4D2 function. Search string: "Force start the versus game, so PZs can spawn". ``` -------------------------------- ### Script_ForceSurvivalStart Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d1.txt Forces the start of a Survival game mode. Includes signatures for Linux and Windows. ```APIDOC ## Script_ForceSurvivalStart ### Description Forces the start of a Survival game mode. ### Method N/A (Internal game function) ### Endpoint N/A (Internal game function) ### Parameters N/A ### Request Example N/A ### Response N/A ### Signatures - **Linux**: `@_ZN8Director16OnHoldoutStartedENS_18HoldoutTriggerTypeE` - **Windows**: `¡******D9**56ƒ******DD**68******8B*J******8B***89**¸` ### Notes Named after the L4D2 function. Search string: "%3.2f: Director::OnHoldoutStarted: Holdout started." ``` -------------------------------- ### Server Configuration Example Source: https://context7.com/snwcreations/l4d2-modded-server/llms.txt Customize server behavior using ConVars in `server.cfg`. This file should be placed in `custom_files/cfg/`. Ensure required settings for 5+ player support are enabled. ```cfg # custom_files/cfg/server.cfg # Server identification hostname "My L4D2 Modded Server" sv_tags "modded,5+players,custom" # Required for 5+ player support sm_cvar precache_all_survivors 1 sm_cvar sv_consistency 0 # Network settings sv_maxrate 0 sv_minrate 20000 sv_maxupdaterate 101 sv_minupdaterate 20 # Gameplay settings mp_friendlyfire 0 sm_cvar director_no_death_check 1 # RCON password (use custom_files_secret for sensitive data) rcon_password "your_rcon_password" echo server.cfg executed ``` -------------------------------- ### Script_ForceSurvivalStart Signature Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d1.txt Signature for forcing the start of a Survival game mode. ```text "Script_ForceSurvivalStart" { "library" "server" "linux" "@_ZN8Director16OnHoldoutStartedENS_18HoldoutTriggerTypeE" "windows" "\xA1\x2A\x2A\x2A\x2A\xD9\x2A\x2A\x56\x83\x2A\x2A\xDD\x2A\x2A\x68\x2A\x2A\x2A\x2A\x8B\x2A\xFF\x2A\x2A\x2A\x2A\x2A\x8B\x2A\x2A\x2A\x89\x2A\x2A\xB8" /* A1 ? ? ? ? D9 ? ? 56 83 ? ? DD ? ? 68 ? ? ? ? 8B ? FF ? ? ? ? ? 8B ? ? ? 89 ? ? B8 */ /* Search: "%3.2f: Director::OnHoldoutStarted: Holdout started." */ } ``` -------------------------------- ### Configure Docker Environment Variables Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/README.md Copy the example environment file and edit it to set your server configuration variables. Ensure STEAM_USER is set to a valid Steam account. ```bash cp .env.example .env ``` ```ini STEAM_USER=anonymous PORT=27015 TICKRATE=128 MAXPLAYERS=32 LAN=0 MAP=c1m1_hotel ``` -------------------------------- ### Admin Configuration Example Source: https://context7.com/snwcreations/l4d2-modded-server/llms.txt Configure server administrators in `admins_simple.ini`. This file should be copied to `custom_files/addons/sourcemod/configs/` before editing. It supports various authentication methods and permission flags. ```ini # custom_files/addons/sourcemod/configs/admins_simple.ini # Format: "identity" "permissions" "password" (optional) # Grant full admin (z flag) to a Steam ID with immunity level 99 "STEAM_0:1:12345678" "99:z" # Grant basic admin (kick, ban, chat) to a Steam ID "STEAM_0:0:87654321" "bce" # Grant admin to an IP address (prepend with !) "!192.168.1.100" "99:z" # Name-based authentication with password "MyAdminName" "abcdefgh" "SecretPassword123" # Permission flags reference: # a - Reserved slot access # b - Generic admin (required for any admin menu access) # c - Kick players # d - Ban players # e - Unban players # f - Slay/harm players # g - Change maps # h - ConVar access # i - Exec configs # z - Root access (all permissions) ``` -------------------------------- ### CTerrorWeapon::OnSwingStart Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Handles the start of a weapon swing. This function is identified by the search string "Weapon.Swing". ```APIDOC ## CTerrorWeapon::OnSwingStart ### Description Handles the start of a weapon swing. This function is identified by the search string "Weapon.Swing". ### Method Not Applicable (Internal Game Function) ### Endpoint Not Applicable (Internal Game Function) ### Parameters None ### Request Example None ### Response None ``` -------------------------------- ### CDirector::OnMobRushStart Function Signature Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Signature for the mob rush start event. Located by searching for the 'MobMinSize' string. ```text "CDirector::OnMobRushStart" { "library" "server" "linux" "@_ZN9CDirector14OnMobRushStartEv" "windows" "\x55\x8B\xEC\x83\xEC\x08\xA1\x2A\x2A\x2A\x2A\xD9\x40\x2C\x56\x57\x51" /* 55 8B EC 83 EC 08 A1 ? ? ? ? D9 40 2C 56 57 51 */ } ``` -------------------------------- ### CDirector Is Any Survivor In Start Area Signature - Linux Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Signature for CDirector::IsAnySurvivorInStartArea on Linux. Checks if any survivor is currently in the starting area. ```cpp "library" "server" "linux" "@_ZNK9CDirector24IsAnySurvivorInStartAreaEv" ``` -------------------------------- ### L4DD::CBaseBackpackItem::StartAction Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Initiates an action for a backpack item. This function can be detoured as a pre-hook to modify item use durations before an action starts, and as a post-hook to revert them afterward. ```APIDOC ## CBaseBackpackItem::StartAction ### Description Initiates an action for a backpack item. This function can be detoured as a pre-hook to modify item use durations before an action starts, and as a post-hook to revert them afterward. ### Method N/A (Function Call) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **return** (int) - Indicates the success or failure of starting the action. #### Response Example N/A ``` -------------------------------- ### SourceMod Configuration Example Source: https://context7.com/snwcreations/l4d2-modded-server/llms.txt Configure SourceMod behavior with `sourcemod.cfg`, located in `custom_files/cfg/sourcemod/`. This file is executed on every map change and controls various aspects like admin activity, voting, and chat settings. ```cfg # custom_files/cfg/sourcemod/sourcemod.cfg # Admin activity visibility (13 = show to all, names shown to admins) sm_show_activity 13 # Enable menu sounds sm_menu_sounds 1 # Delay between public votes (seconds) sm_vote_delay 30 # Date/time format for logs sm_datetime_format "%m/%d/%Y - %H:%M:%S" # Immunity mode (1 = protect from lower access admins only) sm_immunity_mode 1 # Chat flood protection (seconds between messages) sm_flood_time 0.75 # Reserved slots configuration sm_reserve_type 0 # 0=public first, 1=kick for reserved, 2=admin threshold sm_reserved_slots 0 # Number of reserved slots sm_hide_slots 0 # 0=visible, 1=hidden from server browser # Chat settings sm_chat_mode 1 # Allow @admin messages from non-admins sm_trigger_show 0 # Don't broadcast trigger responses ``` -------------------------------- ### Run Docker Compose Commands Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/README.md Commands to manage the L4D2 server using Docker Compose. Use the first command for initial setup or Steam Guard authentication, and `up -d` to run in the background. ```bash # First run (or if Steam Guard authentication is needed) docker compose run --rm l4d2 ``` ```bash # Run in background docker compose up -d ``` ```bash # View logs docker compose logs -f ``` ```bash # Stop the server docker compose down ``` -------------------------------- ### Script_ForceSurvivalStart Offset Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Offset for the Script_ForceSurvivalStart function on Windows. This function forces the start of a Survival game. ```asm Script_ForceSurvivalStart(void) * "Script_ForceSurvivalStart" { "library" "server" "linux" "@_ZL25Script_ForceSurvivalStartv" "windows" "\xE8\x2A\x2A\x2A\x2A\x84\x2A\x74\x2A\xA1\x2A\x2A\x2A\x2A\x8B\x2A\x2A\x2A\x2A\x2A\x80\x2A\x00\x75" /* E8 ? ? ? ? 84 ? 74 ? A1 ? ? ? ? 8B ? ? ? ? ? 80 ? 00 75 */ } ``` -------------------------------- ### Script_ForceVersusStart Offset Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Offset for the Script_ForceVersusStart function on Windows. This function is used to force the start of a Versus game. ```asm Script_ForceVersusStart(void) * "Script_ForceVersusStart" { "library" "server" "linux" "@_ZL23Script_ForceVersusStartv" "windows" "\xA1\x2A\x2A\x2A\x2A\x8B\x2A\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x84\x2A\x74\x2A\x8B\x2A\x2A\x2A\x2A\x2A\x8B\x2A\x2A\x2A\x2A\x2A\xE9" /* A1 ? ? ? ? 8B ? ? ? ? ? E8 ? ? ? ? 84 ? 74 ? 8B ? ? ? ? ? 8B ? ? ? ? ? E9 */ } ``` -------------------------------- ### TerrorNavMesh Get Initial Checkpoint Signature - Linux Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Signature for TerrorNavMesh::GetInitialCheckpoint on Linux. Retrieves the starting checkpoint for navigation. ```cpp "library" "server" "linux" "@_ZNK13TerrorNavMesh20GetInitialCheckpointEv" ``` -------------------------------- ### CDirector::OnFinishIntro Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Handles the completion of the introduction sequence. This function is part of the CDirector class. ```APIDOC ## CDirector::OnFinishIntro ### Description Handles the completion of the introduction sequence. This function is part of the CDirector class. ### Method N/A (Internal function) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### TerrorNavMesh Get Initial Checkpoint Signature - Windows Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Signature for TerrorNavMesh::GetInitialCheckpoint on Windows. This byte pattern helps locate the function that gets the initial navigation checkpoint. ```cpp "windows" "\x55\x8B\x2A\x83\x2A\x2A\x89\x2A\x2A\x8B\x2A\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x84\x2A\x75\x2A\x33\x2A\x8B" ``` -------------------------------- ### CDirector Is Any Survivor In Start Area Signature - Windows Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Signature for CDirector::IsAnySurvivorInStartArea on Windows. This byte pattern is used to find the function checking survivor presence in the start area. ```cpp "windows" "\x55\x8B\x2A\x83\x2A\x2A\xF3\x0F\x2A\x2A\x2A\x2A\x2A\x2A\x8D\x2A\x2A\x50\xF3" ``` -------------------------------- ### L4DD::CGasCan::ShouldStartAction Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Determines if a gas can should start an action. ```APIDOC ## CGasCan::ShouldStartAction ### Description Determines if a gas can should start an action. ### Method N/A (Function Call) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **return** (int) - Returns 1 if the action should start, 0 otherwise. #### Response Example N/A ``` -------------------------------- ### CDirector::OnFinishIntro Function Signature Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Signature for the intro finish event. Located by tracing xrefs from the 'hostfile' string. ```text "CDirector::OnFinishIntro" { "library" "server" "linux" "@_ZN9CDirector13OnFinishIntroEv" "windows" "\x55\x8B\x2A\x51\x8B\x2A\x2A\x2A\x2A\x2A\x56\x8B\x2A\x2A\x2A\x2A\x2A\x6A\x2A\xE8\x2A\x2A\x2A\x2A\x80" /* 55 8B ? 51 8B ? ? ? ? ? 56 8B ? ? ? ? ? 6A ? E8 ? ? ? ? 80 */ } ``` -------------------------------- ### IsAnySurvivorInStartArea Signature Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d1.txt Signature for CDirector::IsAnySurvivorInStartArea. Checks if any survivor is in the start area. ```Assembly "library" "server" "linux" "@_ZNK8Director24IsAnySurvivorInStartAreaEv" "windows" "\x83\x2A\x2A\xD9\x2A\x2A\x2A\x2A\x2A\x8D\x2A\x2A\x50\xD9" ``` -------------------------------- ### Define Singleton Pointers and Helper Signatures Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Signatures for locating Director, ZombieManager, and GameRules singletons. ```gamedata "TheDirector" { "library" "server" "linux" "@TheDirector" } ``` ```gamedata "CDirectorMusicBanks::OnRoundStart" { "library" "server" "windows" "\x55\x8B\xEC\x83\xEC\x2A\x56\x57\x8B\xF9\x8B\x0D\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x84\xC0\x0F" } ``` ```gamedata "TheZombieManager" { "library" "server" "linux" "@TheZombieManager" } ``` ```gamedata "StartChangeLevel" { "library" "server" "linux" "@_ZN15InfoChangelevel16StartChangeLevelEPK10Checkpoint" "windows" "\x55\x8B\xEC\xA1\x2A\x2A\x2A\x2A\x83\x78\x30\x00\x56\x8B\xF1\x74" } ``` ```gamedata "g_pGameRules" { "library" "server" "linux" "@g_pGameRules" } ``` ```gamedata "CreateGameRulesObject" { "library" "server" "windows" "\x55\x8B\xEC\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x30" } ``` -------------------------------- ### CMolotovProjectile::Create Signature Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Signature for CMolotovProjectile::Create. Linux implementation provided; Windows signature is too long and may change. ```Assembly "CMolotovProjectile::Create" { "library" "server" "linux" "@_ZN18CMolotovProjectile6CreateERK6VectorRK6QAngleS2_S2_P20CBaseCombatCharacter" /* Windows signature is extremely long to be unique without using bytes that may change in game updates. */ } ``` -------------------------------- ### CGrenadeLauncher_Projectile::Create Signature Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Signature for CGrenadeLauncher_Projectile::Create. Linux implementation provided; Windows signature is too long and may change. ```Assembly "CGrenadeLauncher_Projectile::Create" { "library" "server" "linux" "@_ZN27CGrenadeLauncher_Projectile6CreateERK6VectorRK6QAngleS2_S2_P20CBaseCombatCharacteri" /* Windows signature is extremely long to be unique without using bytes that may change in game updates. */ } ``` -------------------------------- ### Script_ForceScavengeStart Offset Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Offset for the Script_ForceScavengeStart function on Windows. This function forces the start of a Scavenge game. ```asm Script_ForceScavengeStart(void) * "Script_ForceScavengeStart" { "library" "server" "linux" "@_ZL25Script_ForceScavengeStartv" "windows" "\xE8\x2A\x2A\x2A\x2A\x84\x2A\x74\x2A\xA1\x2A\x2A\x2A\x2A\x8B\x2A\x2A\x2A\x2A\x2A\x80\x2A\x2A\x00\x75\x2A\xE8" /* E8 ? ? ? ? 84 ? 74 ? A1 ? ? ? ? 8B ? ? ? ? ? 80 ? ? 00 75 ? E8 */ } ``` -------------------------------- ### CVomitJarProjectile::Create Signature Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Signature for CVomitJarProjectile::Create. Linux implementation provided; Windows signature is too long and may change. ```Assembly "CVomitJarProjectile::Create" { "library" "server" "linux" "@_ZN19CVomitJarProjectile6CreateERK6VectorRK6QAngleS2_S2_P20CBaseCombatCharacter" /* Windows signature is extremely long to be unique without using bytes that may change in game updates. */ } ``` -------------------------------- ### CTerrorWeapon::OnSwingStart Signature Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Signature for the OnSwingStart function in CTerrorWeapon. This function is called when a weapon swing starts. ```asm "CTerrorWeapon::OnSwingStart" { "library" "server" "linux" "@_ZN13CTerrorWeapon12OnSwingStartEv" "windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\xA1\x2A\x2A\x2A\x2A\x33\x2A\x89\x2A\x2A\x56\x57\x8B\x2A\xE8\x2A\x2A\x2A\x2A\x8B\x2A\x85\x2A\x0F\x84\x2A\x2A\x2A\x2A\x8B\x2A\x8B\x2A\x2A\x2A\x2A\x2A\x8B" } ``` -------------------------------- ### L4DD::CTerrorPlayer::StartUseAction Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Initiates a use action for a Terror Player. ```APIDOC ## CTerrorPlayer::StartUseAction ### Description Initiates a use action for a Terror Player. ### Method N/A (Function Call) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **return** (int) - Indicates the success or failure of starting the action. #### Response Example N/A ``` -------------------------------- ### CDirector::TryOfferingTankBot Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Signature for the Tank bot offering logic, identified by the string 'Tank offer: Starting the lottery'. ```text "library" "server" "linux" "@_ZN9CDirector18TryOfferingTankBotEP11CBaseEntityb" "windows" "\x55\x8B\xEC\x51\x83\x7D\x08\x00\x56\x8B\xF1\x89" /* 55 8B EC 51 83 7D 08 00 56 8B F1 89 */ ``` -------------------------------- ### InfoChangelevel::StartChangeLevel Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Signature for InfoChangelevel::StartChangeLevel, used for finding ZombieManager on Windows. ```APIDOC ## InfoChangelevel::StartChangeLevel ### Description Initiates a level change, used for finding ZombieManager on Windows. ### Method N/A (Function Signature) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### CDirector::ForceNextStage Offset (Midway) Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Offset for CDirector::ForceNextStage on Windows, located midway through a call. This is an alternative to the function start offset. ```asm CDirector::ForceNextStage { "library" "server" "linux" "@_ZN9CDirector14ForceNextStageEv" // Midway through nearer target call "windows" "\x89\x2A\x2A\xC7\x2A\x2A\x2A\x2A\x2A\x2A\xC7\x2A\x2A\x2A\x2A\x2A\x2A\x89\x2A\x2A\xA1\x2A\x2A\x2A\x2A\x50\xE8\x2A\x2A\x2A\x2A\x33\x2A\x8D" /* 89 ? ? C7 ? ? ? ? ? ? C7 ? ? ? ? ? ? 89 ? ? A1 ? ? ? ? 50 E8 ? ? ? ? 33 ? 8D */ // FUnction start // "windows" "\x80\x2A\x2A\x2A\x2A\x2A\x00\x0F\x85\x2A\x2A\x2A\x2A\x53\x56\xB8\x2A\x2A\x2A\x2A\xA3" /* 80 ? ? ? ? ? 00 0F 85 ? ? ? ? 53 56 B8 ? ? ? ? A3 */ /* Search "Push the ScriptedMode to next stage" */ } ``` -------------------------------- ### Get Special Infected Dominating Me Signature - Windows Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Signature for CTerrorPlayer::GetSpecialInfectedDominatingMe on Windows. Uses a byte pattern to find the function. ```cpp "windows" "\x8B\x15\x2A\x2A\x2A\x2A\x56\x8B\xF1\x8B\x8E\x5C\x3E\x00\x00" ``` -------------------------------- ### Define Server Function Signatures Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt These configurations define the library, Linux mangled names, and Windows byte patterns for specific server functions. ```text "CGasCan::ShouldStartAction" { "library" "server" "linux" "@_ZN7CGasCan17ShouldStartActionEN17CBaseBackpackItem22BackpackItemActionTypeEP13CTerrorPlayerP11CBaseEntity" "windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x57\x8B\x2A\x85\x2A\x74\x2A\x8B\x2A\xE8\x2A\x2A\x2A\x2A\x84\x2A\x75" } ``` ```text "CGasCan::OnActionComplete" { "library" "server" "linux" "@_ZN7CGasCan16OnActionCompleteEP13CTerrorPlayerP11CBaseEntity" "windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\xA1\x2A\x2A\x2A\x2A\x33\x2A\x89\x2A\x2A\x8B\x2A\x2A\x53\x8B\x2A\x8B\x2A\x2A\x2A\x2A\x2A\x83" } ``` ```text "CBaseBackpackItem::StartAction" { "library" "server" "linux" "@_ZN17CBaseBackpackItem11StartActionENS_22BackpackItemActionTypeENS_25BackpackItemActionTriggerE" "windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x8B\x2A\xE8\x2A\x2A\x2A\x2A\x8B\x2A\x85\x2A\x75\x2A\x5F\x32\x2A\x5E\x8B" } ``` ```text "CTerrorPlayer::StartUseAction" { "library" "server" "linux" "@_ZN13CTerrorPlayer14StartUseActionE21TerrorPlayerUseActionP11CBaseEntityfb" "windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x8B\x2A\x2A\x8B\x2A\x85\x2A\x0F\x84\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x84" } ``` ```text "BossZombiePlayerBot::ChooseVictim" { "library" "server" "linux" "@_ZN19BossZombiePlayerBot12ChooseVictimEP13CTerrorPlayeriP20CBaseCombatCharacter" "windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x83\x2A\x2A\x2A\x53\x8B\x2A\x8B\x2A\x2A\x2A\x2A\x2A\x8B\x2A\x2A\x2A\x2A\x2A\x56" } ``` ```text "CServerGameDLL::ServerHibernationUpdate" { "library" "server" "linux" "@_ZN14CServerGameDLL23ServerHibernationUpdateEb" "windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x83\x2A\x2A\x53\x56\x33\x2A\x8B\x2A\x88\x2A\x2A\x3A" } ``` ```text "InfoChangelevel::SaveEntities" { "library" "server" "linux" "@_ZN15InfoChangelevel12SaveEntitiesEv" "windows" "\x55\x8B\x2A\x83\x2A\x2A\x53\x56\x8B\x2A\xB9\x2A\x2A\x2A\x2A\x89\x2A\x2A\xE8" } ``` ```text "CTerrorPlayer::TransitionRestore" { "library" "server" "linux" "@_ZN13CTerrorPlayer17TransitionRestoreEv" "windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x80\xBE\x2A\x2A\x2A\x2A\x2A\x75\x2A\x33\x2A\x5E\x8B\x2A\x5D\xC3" } ``` ```text "RestoreTransitionedSurvivorBots" { "library" "server" "linux" "@_Z31RestoreTransitionedSurvivorBotsv" "windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x83\x2A\x2A\x85\x2A\x0F\x84\x2A\x2A\x2A\x2A\x53\x56\x57\x50\x68" } ``` -------------------------------- ### Get Special Infected Dominating Me Signature - Linux Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Signature for CTerrorPlayer::GetSpecialInfectedDominatingMe on Linux. Identifies which special infected is dominating a player. ```cpp "library" "server" "linux" "@_ZN13CTerrorPlayer30GetSpecialInfectedDominatingMeEv" ``` -------------------------------- ### CVomitJarProjectile::Create Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Creates a new vomit jar projectile. ```APIDOC ## POST /api/projectiles/vomitjar ### Description Creates and spawns a vomit jar projectile in the game world. ### Method POST ### Endpoint /api/projectiles/vomitjar ### Parameters #### Request Body - **origin** (Vector) - Required - The initial position of the projectile. - **angles** (QAngle) - Required - The initial orientation of the projectile. - **velocity** (Vector) - Required - The initial velocity of the projectile. - **angularVelocity** (Vector) - Required - The initial angular velocity of the projectile. - **owner** (CBaseEntity) - Optional - The entity that owns or spawned the projectile. ### Request Example { "origin": [250, 350, 125], "angles": [0, 0, 0], "velocity": [0, 0, 180], "angularVelocity": [0, 0, 0], "owner": null } ### Response #### Success Response (200) - **projectileId** (string) - The unique identifier of the created vomit jar projectile. #### Response Example { "projectileId": "vomitjar_fghij" } ``` -------------------------------- ### CDirector::OnMobRushStart Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Called when a mob rush event starts. This function is used by boomer and natural horde functions to reset the natural horde timer. ```APIDOC ## CDirector::OnMobRushStart ### Description Called when a mob rush event starts. This function is used by boomer and natural horde functions to reset the natural horde timer. ### Method N/A (Internal function) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### Get Current Finale Stage Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/scripting/l4dd/left4dhooks_changelog.txt The 'L4D2_GetCurrentFinaleStage' native returns the current stage of the finale sequence in L4D2, providing information about the game's progression. ```sp native L4D2_GetCurrentFinaleStage(); ``` -------------------------------- ### CDirectorMusicBanks::OnRoundStart Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Signature for CDirectorMusicBanks::OnRoundStart, used for finding TheDirector offset. ```APIDOC ## CDirectorMusicBanks::OnRoundStart ### Description Called when a round starts, used for finding TheDirector offset. ### Method N/A (Function Signature) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Set Integer Weapon Attribute Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/scripting/l4dd/left4dhooks_changelog.txt This example demonstrates how to use the 'L4D2_SetIntWeaponAttribute' native to modify weapon properties, specifically setting the 'L4D2IWA_ClipSize' for a 'weapon_rifle' to 100. ```sp L4D2_SetIntWeaponAttribute("weapon_rifle", L4D2IWA_ClipSize, 100); ``` -------------------------------- ### Define Slap Sound Configuration Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/sdktools.games/engine.blade.txt Maps slap sound file paths to specific keys for the game engine. ```text "Keys" { "SlapSoundCount" "8" "SlapSound1" "player/knight/pain1.wav" "SlapSound2" "player/knight/pain2.wav" "SlapSound3" "player/phalanx/pain1.wav" "SlapSound4" "player/phalanx/pain2.wav" "SlapSound5" "player/pure/pure-pain-01.wav" "SlapSound6" "player/pure/pure-pain-02.wav" "SlapSound7" "player/ryoku/pain1.wav" "SlapSound8" "player/ryoku/pain2.wav" } ``` -------------------------------- ### CSpitterProjectile::Create Signature Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Signature for CSpitterProjectile::Create. Includes Linux and Windows implementations. ```Assembly "CSpitterProjectile::Create" { "library" "server" "linux" "@_ZN18CSpitterProjectile6CreateERK6VectorRK6QAngleS2_S2_P20CBaseCombatCharacter" "windows" "\x55\x8B\x2A\x8B\x2A\x2A\x8B\x2A\x2A\x53\x8B\x2A\x2A\x56\x57\x50\x51\x53\x68\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x8B\x2A\x2A\x2A\x2A\x2A\x83\x2A\x2A\x2A\x2A\x2A\x2A\x8B\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x68\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\xD9\x2A\x2A\x2A\x2A\x2A\x83\x2A\x2A\x8B\x2A\xD9\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x57\x8B\x2A\xE8\x2A\x2A\x2A\x2A\x57\x8B\x2A\xE8\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x57" ``` -------------------------------- ### CSpitterProjectile::Create Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/left4dhooks.l4d2.txt Creates a new spitter projectile. ```APIDOC ## POST /api/projectiles/spitter ### Description Creates and spawns a spitter projectile in the game world. ### Method POST ### Endpoint /api/projectiles/spitter ### Parameters #### Request Body - **origin** (Vector) - Required - The initial position of the projectile. - **angles** (QAngle) - Required - The initial orientation of the projectile. - **velocity** (Vector) - Required - The initial velocity of the projectile. - **angularVelocity** (Vector) - Required - The initial angular velocity of the projectile. - **owner** (CBaseCombatCharacter) - Optional - The entity that owns or spawned the projectile. ### Request Example { "origin": [150, 250, 75], "angles": [0, 0, 0], "velocity": [0, 0, 120], "angularVelocity": [0, 0, 0], "owner": null } ### Response #### Success Response (200) - **projectileId** (string) - The unique identifier of the created spitter projectile. #### Response Example { "projectileId": "spitter_67890" } ``` -------------------------------- ### Server Configuration (`server.ini`) Source: https://context7.com/snwcreations/l4d2-modded-server/llms.txt Defines core server settings such as Steam authentication, network port, tickrate, player count, and initial map. Use `anonymous` for public servers or your Steam username for private authentication. ```ini # server.ini - Main server configuration # Steam user name for SteamCMD authentication # Use 'anonymous' for public servers, or your Steam username if you own L4D2 STEAM_USER=anonymous # Server port for players to connect (UDP and TCP) PORT=27015 # Server tickrate (higher = smoother gameplay, more CPU intensive) TICKRATE=128 # Maximum players allowed (L4DToolZ enables up to 32 players) MAXPLAYERS=32 # LAN server mode: 0 = public (internet), 1 = private (LAN only) LAN=0 # Initial map when server starts (campaign format: c[campaign]m[map]_[name]) MAP=c1m1_hotel # Config file to execute after server boot (from cfg/ folder, without .cfg extension) EXEC=on_boot ``` -------------------------------- ### Define User Info and Entity Offsets Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/gamedata/sdktools.games/engine.blade.txt Maps class methods and data offsets for user information and entity manipulation. ```text "Offsets" { "SetUserCvar" { "windows" "33" "windows64" "33" "linux64" "70" "mac64" "70" } "SetClientName" { "windows" "32" "windows64" "32" "linux64" "69" "mac64" "69" } "InfoChanged" { "windows" "488" "windows64" "632" "linux64" "600" "mac64" "616" } } ``` ```text "Offsets" { "GiveNamedItem" { "windows" "444" "windows64" "444" "linux64" "445" "mac64" "445" } "RemovePlayerItem" { "windows" "291" "windows64" "291" "linux64" "292" "mac64" "292" } "Weapon_GetSlot" { "windows" "287" "windows64" "287" "linux64" "288" "mac64" "288" } "Ignite" { "windows" "223" "windows64" "223" "linux64" "224" "mac64" "224" } "Extinguish" { "windows" "226" "windows64" "226" "linux64" "227" "mac64" "227" } "Teleport" { "windows" "112" "windows64" "112" "linux64" "113" "mac64" "113" } "CommitSuicide" { "windows" "497" "windows64" "497" "linux64" "497" "mac64" "497" } "GetVelocity" { "windows" "137" "windows64" "137" "linux64" "138" "mac64" "138" } "EyeAngles" { "windows" "128" "windows64" "128" "linux64" "129" "mac64" "129" } "AcceptInput" { "windows" "39" "windows64" "39" "linux64" "40" "mac64" "40" } "SetEntityModel" { "windows" "24" "windows64" "24" "linux64" "25" "mac64" "25" } "WeaponEquip" { "windows" "280" "windows64" "280" "linux64" "281" } ``` -------------------------------- ### Get and Set VSwitch Flow Percent Source: https://github.com/snwcreations/l4d2-modded-server/blob/master/left4dead2/addons/sourcemod/scripting/l4dd/left4dhooks_changelog.txt These natives, 'L4D2Direct_GetVSWitchFlowPercent' and 'L4D2Direct_SetVSWitchFlowPercent', allow for the retrieval and modification of the VSwitch flow percentage, likely related to director or special infected behavior. ```sp native L4D2Direct_GetVSWitchFlowPercent(); native L4D2Direct_SetVSWitchFlowPercent(percent); ```