YappersHQ.Poop.Shared
1.0.1
dotnet add package YappersHQ.Poop.Shared --version 1.0.1
NuGet\Install-Package YappersHQ.Poop.Shared -Version 1.0.1
<PackageReference Include="YappersHQ.Poop.Shared" Version="1.0.1" />
<PackageVersion Include="YappersHQ.Poop.Shared" Version="1.0.1" />
<PackageReference Include="YappersHQ.Poop.Shared" />
paket add YappersHQ.Poop.Shared --version 1.0.1
#r "nuget: YappersHQ.Poop.Shared, 1.0.1"
#:package YappersHQ.Poop.Shared@1.0.1
#addin nuget:?package=YappersHQ.Poop.Shared&version=1.0.1
#tool nuget:?package=YappersHQ.Poop.Shared&version=1.0.1
<div align="center"> <h1>💩 <strong>Poop</strong></h1> <p>Spawn poops on dead players, climb the leaderboards, customize colors & sounds — a goofy showcase plugin for <a href="https://github.com/Kxnrl/modsharp-public">ModSharp</a>.</p> </div>
<p align="center"> <a href="https://github.com/Kxnrl/modsharp-public"><img src="https://img.shields.io/badge/framework-ModSharp-5865F2?logo=github" alt="ModSharp"></a> <img src="https://img.shields.io/badge/game-CS2-orange" alt="CS2"> <img src="https://img.shields.io/gitlab/license/cs2-server-plugins/cs2-poop?gitlab_url=https%3A%2F%2Fgitlab.com" alt="License"> <img src="https://img.shields.io/gitlab/stars/cs2-server-plugins/cs2-poop?gitlab_url=https%3A%2F%2Fgitlab.com" alt="Stars"> </p>
Poop drops a poop on the nearest dead player (or at your own feet), tracks who poops most and who gets pooped on most, and lets each player pick a color. It doubles as a reference for laying out a multi-project ModSharp plugin: a public IPoopShared API, a swappable database module (IDatabaseProvider), and an example consumer plugin.
🚀 Install
Copy the build output into your ModSharp install (<sharp> = your sharp directory):
| From | To |
|---|---|
.build/modules/Poop.Core/ |
<sharp>/modules/Poop.Core/ |
.build/modules/Poop.Database/ |
<sharp>/modules/Poop.Database/ |
.build/modules/Poop.Example/ (optional) |
<sharp>/modules/Poop.Example/ |
.build/shared/Poop.Shared/ |
<sharp>/shared/Poop.Shared/ |
.build/shared/Poop.Database.Shared/ |
<sharp>/shared/Poop.Database.Shared/ |
.build/configs/poop.json |
<sharp>/configs/poop.json |
.build/configs/poop.database.json |
<sharp>/configs/poop.database.json |
.build/locales/poop.json |
<sharp>/locales/poop.json |
Restart the server (or change map) to load. If the config files are missing on first load, Poop.Core and Poop.Database write the bundled defaults — but shipping them up front keeps your edits sticky.
Game assets (model, textures, sounds) live under
.assets/assets/and are referenced frompoop.jsonasmodels/yappershq/fun/poop.vmdl+ sound events. Compile those into your VPK / workshop addon separately.
⌨️ Commands
Aliases below are the defaults; all are configurable in poop.json under commands.*.
| Command | Aliases | Description |
|---|---|---|
!poop |
!shit |
Spawn on the nearest dead player, else at your feet |
!poopcolor |
!poop_color, !colorpoop |
Open the color preference menu |
!toppoopers |
!pooperstop |
Leaderboard — most poops placed |
!toppoop |
!pooptop |
Leaderboard — most pooped-on |
!poopmute |
!mutepoop, !nopoop |
Toggle poop sounds off/on for yourself |
When the optional AdminPanel plugin is installed, Poop registers a Force poop per-player action (permission admin:slap). It degrades silently if AdminPanel is absent.
⚙️ Configuration
configs/poop.json — gameplay
Tunes spawning, size tiers, colors, sounds, commands, and the chat prefix. See Poop.Core/Config/PoopConfig.cs for the full schema; highlights:
| Key | Meaning |
|---|---|
size.generationTiers[] |
Weighted size-tier table (sub-tiers like Massive / Legendary nest under Rare) |
color.availableColors[] |
Palette shown in the !poopcolor menu (set isRainbow / isRandom for special entries) |
sound.poopSounds[] / tauntSounds[] |
Sound event names + optional per-event volume |
commands.*.aliases[] |
Rename any command without code changes |
commands.*.cooldownSeconds |
Per-command cooldown |
gameplay.maxPoopsPerRound |
Cap per round (0 = unlimited) |
gameplay.poopLifetimeSeconds |
Auto-cleanup age |
configs/poop.database.json — persistence
| Setting | Default | Meaning |
|---|---|---|
Database.Type |
litedb |
litedb (writes sharp/data/poop.db), mysql, or postgres |
Database.Host / Port / Database / User / Password |
localhost / 3306 / poop / root / (empty) |
Connection details — ignored under LiteDB |
🌍 Localization
locales/poop.json ships en-US and zh-CN. Format is key-first then per-culture (ModSharp LocalizerManager requirement). Color tokens are double-braced in JSON ({{green}}); culture codes must match Internationalization.SteamLanguageToI18N (en-US, zh-CN, …). Add a culture by adding its inner key to each string; unmatched Steam languages fall back to en-US.
🔧 How it works
Poop.Core drives the IModSharpModule lifecycle over a DI container of IModule services. The spawner picks a weighted size tier, resolves the player's color preference, spawns the prop, plays sound events, and records the placement to the database. Poop.Database publishes an IDatabaseProvider so the storage backend (LiteDB / MySQL / PostgreSQL via SqlSugar) is swappable behind one interface. Publishers register their shared interfaces in PostInit; consumers resolve in OnAllModulesLoaded (ModSharp guarantees all PostInits finish first).
🧩 Public API
Other plugins consume IPoopShared without referencing Poop.Core — resolve it in OnAllModulesLoaded:
var poop = sharedSystem.GetSharpModuleManager()
.GetRequiredSharpModuleInterface<IPoopShared>(IPoopShared.Identity)?.Instance;
poop.ForcePlayerPoop(client, size: 2.5f);
var stats = await poop.GetPlayerStatsAsync(client.SteamId);
poop.OnPoopSpawned += e => Log($"{e.Player?.Name} dropped a {e.Size:F2} poop");
poop.OnPoopCommand += e => { if (!e.Player.IsAdmin) e.Cancel = true; }; // gate usage
See Poop.Example/PoopExample.cs for a complete consumer (force-spawn, stats lookup, command gating).
📦 Build
Requires the .NET 10 SDK and the ModSharp NuGet feed (configured in Directory.Build.props).
dotnet build -c Release
Outputs under .build/:
| Project | Output |
|---|---|
Poop.Core |
modules/Poop.Core/Poop.dll |
Poop.Database |
modules/Poop.Database/Poop.Database.dll |
Poop.Example |
modules/Poop.Example/PoopExample.dll |
Poop.Shared |
shared/Poop.Shared/… |
Poop.Database.Shared |
shared/Poop.Database.Shared/… |
The CopyAssets target mirrors .assets/* into .build/ after each build, so default configs / locales ship alongside the DLLs.
🙏 Credits
- ModSharp — Kxnrl & co. — the framework this builds on.
- yappershq team — assets and ideas.
<div align="center"> <p>Made with ❤️ by <a href="https://gitlab.com/cs2-server-plugins">yappershq</a></p> <p>⭐ Star this repo if you find it useful!</p> </div>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.