The classic Jail gamemode for Counter-Strike 2 — Terrorists are prisoners, CT is Warden + guards. A from-scratch ModSharp build, ported from edgegamers/Jailbreak.
Jailbreak is a from-scratch ModSharp (Source2/CS2) port of the classic Jail gamemode: warden selection, freedays, rebel detection, last-request minigames, special-day rounds, CT-ban queue management, and a pile of quality-of-life modules — 47 projects in total, built around one Core plugin plus ~35 independently droppable feature modules. It targets the CS2/ModSharp stack and is licensed GPL-3.0 as a derivative of the upstream project (see Credits).
This repo builds one required Core plugin plus many optional feature modules, each its own DLL:
| From | To |
|---|---|
.build/modules/JB.Core/ |
<sharp>/modules/JB.Core/ (required) |
.build/modules/<Module>/ |
<sharp>/modules/<Module>/ (any other module — most live under jailbreak/modules/, JB.Database sits at repo root — each is independent) |
.build/shared/*/ |
<sharp>/shared/ (JB.Shared, JB.Database.Shared, JB.Donate.Shared, and each module's own .Shared, e.g. JB.CTBan.Shared) |
.assets/locales/*.json |
<sharp>/locales/ |
jailbreak/.assets/gamedata/jailbreak.games.jsonc |
<sharp>/gamedata/ |
Config .cfg files are not shipped — every module generates its own under <sharp>/configs/jailbreak/ on first map load (see Configuration). Restart the server (or change map) to load.
Some modules persist data (CT-ban history, playtime stats, warden rating leaderboard) via JB.Database / JB.Database.Shared — install those too if you want that data to survive restarts; without them those specific features either no-op or stay in-memory only.
Uses the ModSharp first-party modules (ship with ModSharp), all resolved optionally at OnAllModulesLoaded and each degrading gracefully with a log warning if absent: AdminManager (required in practice for every admin-gated command — permissions are registered via MountAdminManifest; without it those commands never register), LocalizerManager (chat/HUD text from .assets/locales/*.json; falls back to raw locale keys if missing), MenuManager (LR type-pick menus, Coinflip/RockPaperScissors, the Donate menu), TargetingManager (@all/@ct/etc. target selectors on admin commands like !forcect, !ctban, !c4, !paint), InputManager (keybind capture for Binoculars zoom and Warden Paint), ClientPreferences (persisted per-player settings — loadout memory, Binoculars F-key toggle, Donate menu prefs).
Bundled inside each module's own build output (local DLL references, not separate installs): Sharp.Extensions.CommandManager (the !command dispatch this whole suite is built on), Sharp.Extensions.EntityHookManager, Sharp.Extensions.GameEventManager.
External plugins (separate installs, not part of ModSharp core or this repo):
| Plugin | Required? | Why |
|---|---|---|
AdminPanel (IAdminPanelShared) |
⚪ Optional | JB.AdminPanel surfaces warden/freeday/LR/special-day actions inside AdminPanel's in-game UI. Without it, JB.AdminPanel is a documented no-op — Jailbreak itself is unaffected. |
VIP (IVipShared) |
⚪ Optional | JB.Donate checks VIP tier for cosmetic gating. Without it, everyone is treated as VIP by default. |
A few of this repo's own modules also opportunistically link to each other via optional shared interfaces (e.g. JB.AutoRTD looks for JB.RTD and JB.Donate; JB.RTD looks for JB.C4) — install only what you need, the rest degrade gracefully.
All commands are plain chat/console commands (!cmd in chat or cmd in console) unless marked Admin.
| Command | Aliases | Description | Permission |
|---|---|---|---|
warden |
w |
Show current warden | |
pass |
uw |
Warden gives up the role | |
roll |
Roll for warden queue tickets | ||
peace |
Warden calls a peace/ceasefire | ||
chicken |
Warden spawns a chicken | ||
soccer |
spawnball |
Warden spawns a soccer ball | |
sd |
specialday |
Warden starts a special day vote | |
upvote |
up |
Rate the current/last warden up | |
downvote |
down |
Rate the current/last warden down | |
topwardens |
tw, top, wardenleaderboard |
Show the warden rating leaderboard | |
wardenrating |
wr, rating |
Show a player's warden rating | |
count |
Warden Markers: count alive prisoners near the last marker | ||
paint |
Warden Paint: draw beam lines (hold USE) | ||
open |
o |
Open cells (after jb_cells_open_cooldown) |
|
forceopen |
Force-open cells early | jb:cells (in-handler) |
|
rebel |
rebelrequest |
Rebel prisoner requests a Last Request from a guard | |
lr |
lastrequest |
Prisoner initiates a Last Request | |
allowlr |
Warden grants LR permission during Warden-Approval mode | jb:allowlr (admin variant) |
|
endrace |
JB.LR.Race: end the current race LR | ||
dw |
deathwish |
Last prisoner requests Death Wish | |
adw |
allowdw |
Warden approves Death Wish | |
lg |
lastguard |
Last CT activates Last Guard mode | |
binoculars |
bino |
Cycle zoom (90→40→10→90) | |
bino_f |
fbino |
Toggle F-key zoom mode | |
loadout |
Open loadout menu | ||
guns |
Open weapon selection | ||
mute_sounds_toggle |
Toggle warden hurt/kill sounds for self | ||
check_mute_sounds |
Check current mute-sounds state | ||
kill |
slay |
Suicide with a random themed sound | |
funkill |
Suicide with a random gimmick | ||
killsounds |
suicidesounds |
List available themed suicide sounds/commands | |
<themed name> (e.g. oof, johncena, spaghetti, …) |
Suicide with that specific themed sound | ||
wp |
warningpistol |
Request a Warning Pistol (CT only) | |
playtime |
Show your (or a target's) role playtime stats | ||
rtd |
Roll The Dice for a random reward next spawn | ||
rtdstats |
Show RTD roll stats | ||
donate |
Open the Donate cosmetics menu | ||
warmup |
start, s |
Vote to start/end warmup | |
delay |
d |
Set C4 detonation delay (Terrorist holding C4) | |
defuse |
Defuse your own planted C4 | ||
collision |
noblock |
Toggle player collision for self | |
stuck |
Un-stuck yourself | ||
ct |
guard |
Join the CT queue | |
t |
Leave CT queue (stay/return to T) | ||
noct |
Opt out of the CT queue | ||
lq |
leavequeue |
Leave the CT queue | |
vq |
viewqueue, queue |
View the CT queue | |
Admin forcect |
Force a player to CT | jb:forcect |
|
Admin revive |
Revive a dead player | jb:revive |
|
Admin ff |
Toggle friendly fire | jb:ff |
|
Admin fire |
Set a player on fire | jb:fire |
|
Admin adminarrow |
aa |
Draw a beam arrow at your crosshair | jb:adminarrow |
Admin dcp |
List players who disconnected this map | jb:dcp |
|
Admin slaynr |
Slay self/target on next spawn | jb:slaynr |
|
Admin collision |
Reset a stuck target's collision (distinct from the player collision toggle above) |
jb:collision |
|
Admin fd |
freeday |
Grant freeday | jb:freeday |
Admin fdnr |
Grant freeday next round | jb:freeday |
|
Admin lrfd |
Grant LR-triggered freeday | jb:freeday |
|
Admin zfd |
Grant zombie freeday | jb:freeday |
|
Admin rfd |
revokefd |
Revoke all freedays | jb:freeday.revoke |
Admin speak |
Grant/revoke voice | jb:speak |
|
Admin mutedead |
shush |
Toggle dead-can-talk-to-living | jb:mutedead |
Admin forcewarmup |
fs |
Force warmup start/end | jb:forcewarmup |
Admin zones |
zonemenu |
Open the zone-editor admin menu | jb:zones |
Admin logs |
View/query action logs | jb:logs |
|
Admin c4 |
Give C4 to a Terrorist | jb:c4 |
|
Admin ctban |
teamlock |
CT-ban a player for N rounds | jb:ctban |
Admin ctunban |
Remove a CT-ban | jb:ctunban |
|
Admin ctbaninfo |
Show a player's CT-ban status | jb:ctbaninfo |
|
Admin ctkick |
Kick a player from the CT queue | jb:ctkick |
|
Admin forcectbalance |
Force a CT/T balance pass | jb:forcectbalance |
|
Admin removequeue |
Remove a player from the CT queue | jb:removequeue |
JB.KnifeMute, JB.RemovePingCooldown, JB.AutoRTD, JB.Warden.Icon, and most JB.SD.* special-day modules run entirely passively (hooks/timers) and expose no commands.
Every module — Core's own config modules and each standalone plugin — auto-generates its own .cfg under <sharp>/configs/jailbreak/jb_<module>.cfg on first map load (ConVars, not JSON; see ConfigAutoExec in JB.Shared). Standalone modules also get a jb_<prefix>_enabled ConVar for free. Selected Core keys:
| ConVar | Default | File | Meaning |
|---|---|---|---|
jb_cells_open_cooldown |
25 |
jb_cells.cfg |
Seconds after round start before !open is allowed |
jb_warden_base_tickets |
2 |
jb_wardenselection.cfg |
Starting warden-queue raffle tickets per player |
jb_warden_pick_delay |
7.0 |
jb_wardenselection.cfg |
Seconds before picking a warden from the queue |
jb_freeday_auto_delay |
20.0 |
jb_freeday.cfg |
Seconds after warden removal before auto-freeday |
jb_freeday_prisoner_unlock_ratio |
0.30 |
jb_freeday.cfg |
Fraction of Ts that must die before freedays auto-revoke (0 = disabled) |
jb_lr_prisoner_threshold |
2 |
jb_lastrequest.cfg |
Minimum alive prisoners to allow Last Request |
jb_rebel_duration |
10.0 |
jb_rebel.cfg |
Default rebel mark duration (seconds) |
jb_peace_max_guard_duration |
10.0 |
jb_peace.cfg |
Maximum guard-invoked peace duration (seconds) |
jb_warmup_min_players |
12 |
jb_warmup.cfg |
Player threshold to block the warmup-end vote |
jb_warden_max_chickens |
5 |
jb_wardencommands.cfg |
Max chickens the warden can spawn per round |
jb_warden_rating_ewma_alpha |
0.1 |
jb_wardenrating.cfg |
EWMA weight of new votes vs. history for warden ratings |
jb_icon_height_offset |
36 |
jb_icon.cfg |
Overhead icon height above player head |
jb_admin_arrow_radius |
15 |
jb_admin.cfg |
Admin beam-arrow circle radius |
jb_sound_hurt_cooldown |
1.5 |
jb_sound.cfg |
Cooldown between warden hurt sounds |
Each Core .cfg above has a handful of sibling keys (full list in the generated file). Every standalone module under modules/ (e.g. JB.SD.Custom, JB.LR.Race, JB.Donate) ships its own config the same way, prefixed by its own name (jb_custom.cfg, jb_race.cfg, jb_donate.cfg, …) — check the generated file for that module's full key list.
Each round, WardenSelectionModule opens a weighted-raffle queue and picks a warden a few seconds in; WardenModule then buffs CTs/warden and hands out warden tools (peace, chicken, soccer, special-day vote) via WardenCommandsModule. Prisoners without a warden's freeday grant are tracked by RebelModule/FreedayModule — picking up a weapon, leaving cells early, or other rule breaks marks a prisoner rebel (killable on sight), while FreedayModule auto-grants freedays after a warden-less delay or a death-ratio threshold. Once enough prisoners are alive, LastRequestModule opens the Last Request flow: a prisoner (or an approved rebel) picks an LR type from the modules/lr/JB.LR.* plugins — some fully automatic (KnifeFight, GunToss, NoScope, ShotForShot, BulletForBullet, TeleportingRequest), others menu-driven (Coinflip, RockPaperScissors) or command-driven (Race). SpecialDayModule runs the modules/sd/JB.SD.* day types (FFA, Infection, Hide and Seek, GunGame, Speedrun, Warday, …) as warden-triggered round variants. GameStateModule gates all of the above behind warmup so nothing fires before the match starts.
Other plugins consume IJailbreakShared (resolve in OnAllModulesLoaded) to subscribe/publish Jailbreak's internal MessagePipe events or pull any registered service out of its DI container:
var jailbreak = sharpModuleManager
.GetOptionalSharpModuleInterface<IJailbreakShared>(IJailbreakShared.Identity)?.Instance;
using var sub = jailbreak?.Subscribe<WardenClaimedEvent>(e => { /* ... */ });Several feature modules also publish their own narrower .Shared contracts for other Jailbreak modules to consume optionally (e.g. IRTDService, IDonatorService, IDeathWishService, ILastGuardService, ICTBanService) — see each module's <Module>.Shared project.
dotnet build Jailbreak.slnx -c ReleaseOutputs each project to .build/modules/<Project>/<Project>.dll (or .build/shared/<Project>/ for .Shared projects), per jailbreak/Directory.Build.props.
Port of edgegamers/Jailbreak (GPL-3.0) — the classic Jail gamemode for Counter-Strike 2. This repository is a from-scratch reimplementation of that gamemode on the ModSharp framework, and is distributed under the same GPL-3.0 license as required by the upstream project.
Made with ❤️ by yappershq
⭐ Star this repo if you find it useful!