YappersHQ.Vip.Shared
1.0.1
dotnet add package YappersHQ.Vip.Shared --version 1.0.1
NuGet\Install-Package YappersHQ.Vip.Shared -Version 1.0.1
<PackageReference Include="YappersHQ.Vip.Shared" Version="1.0.1" />
<PackageVersion Include="YappersHQ.Vip.Shared" Version="1.0.1" />
<PackageReference Include="YappersHQ.Vip.Shared" />
paket add YappersHQ.Vip.Shared --version 1.0.1
#r "nuget: YappersHQ.Vip.Shared, 1.0.1"
#:package YappersHQ.Vip.Shared@1.0.1
#addin nuget:?package=YappersHQ.Vip.Shared&version=1.0.1
#tool nuget:?package=YappersHQ.Vip.Shared&version=1.0.1
<div align="center"> <h1><strong>Vip</strong></h1> <p>A modular VIP system for ModSharp (CS2) — group tiers, an extensible perk API, and admin grant/revoke management.</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/stars/cs2-server-plugins/cs2-vip?gitlab_url=https%3A%2F%2Fgitlab.com" alt="Stars"> </p>
Vip gives players VIP status via configurable group tiers (e.g. default / gold / diamond), each tier exposing a set of feature gates and tunable values. Perks themselves are pluggable: other plugins register their own perks against the published IVipPerkRegistry, and VIPs toggle/configure them through an in-game menu. VIP records persist through a pluggable database backend (LiteDB out of the box, or MySQL/PostgreSQL/SQLite via SqlSugar).
The repo ships two ModSharp modules:
| Module | Role |
|---|---|
Vip.Core |
The VIP system: groups, perk registry, menu, admin commands, and the public IVipShared API. |
Vip.Database |
Storage backend. Publishes IDatabaseProvider and selects LiteDB or a SQL engine from config. |
🚀 Install
Copy the build output into your ModSharp install (<sharp> = your sharp directory):
| From | To |
|---|---|
.build/modules/Vip.Core/ |
<sharp>/modules/Vip.Core/ |
.build/modules/Vip.Database/ |
<sharp>/modules/Vip.Database/ |
.build/shared/Vip.Shared/ |
<sharp>/shared/Vip.Shared/ |
.build/shared/Vip.Database.Shared/ |
<sharp>/shared/Vip.Database.Shared/ |
Restart the server (or change map) to load. Config files are written with defaults on first run.
Optional ModSharp modules enhance functionality when present (all are resolved null-safe): AdminManager (permission checks), TargetingManager (player targeting in admin commands), MenuManager (the !vip perk menu — falls back to chat list if absent), ClientPreferences (per-player perk settings), LocalizerManager, and the AdminPanel plugin (registers grant/revoke actions in its panel when installed).
⌨️ Commands
Player command:
| Command | Description |
|---|---|
vip |
Opens the VIP perk menu (VIPs only). Lists registered perks and per-perk settings; without MenuManager it prints the list to chat. |
Admin commands (each gated by a permission, configurable in vip.json):
| Command | Usage | Permission | Description |
|---|---|---|---|
vip_grant |
vip_grant <target> [days] [flags] |
vip:grant |
Grant VIP to a player. Omit days for lifetime. |
vip_revoke |
vip_revoke <target> |
vip:revoke |
Remove a player's VIP. |
vip_list |
vip_list [page] |
vip:list |
Paginated list of active VIPs (10 per page). |
vip_check |
vip_check <target> |
vip:list |
Show a player's VIP status, expiry, and flags. |
vip_setgroup |
vip_setgroup <target> <groupName> |
vip:setgroup |
Change a VIP's group tier. |
Permissions are registered with AdminManager under the Vip manifest, so * resolves them for root admins.
⚙️ Configuration
All config lives under <sharp>/configs/vip/ and is generated with defaults on first run.
vip.json — core settings:
| Setting | Default | Meaning |
|---|---|---|
hotReloadIntervalSeconds |
300 |
Interval for periodic refresh. |
defaultExpirationDays |
30 |
Default VIP duration when not specified. |
enableAdminPanelActions |
false |
Show Grant/Revoke VIP actions in the AdminPanel plugin's player menu. Off by default — granting VIP should go through the website/DB, not be one click away for any admin. |
adminPermissionGrant |
vip:grant |
Permission required for vip_grant. |
adminPermissionRevoke |
vip:revoke |
Permission required for vip_revoke. |
adminPermissionList |
vip:list |
Permission required for vip_list / vip_check. |
groups.json — VIP tiers and their feature gates/values. Ships with default, gold, and diamond examples. Each group maps feature keys (e.g. armor, health, money, speed, defuseKit, antiFlash, reservedSlotsGate) to an enabled flag plus an optional custom value that perk plugins read.
vip.database.jsonc — storage backend:
| Setting | Default | Meaning |
|---|---|---|
Database.Type |
litedb |
litedb, mysql, postgresql, or sqlite. |
Database.Host |
localhost |
SQL host (ignored for LiteDB). |
Database.Port |
3306 |
SQL port. |
Database.Database |
vip |
Database / file name. |
Database.User |
root |
SQL user. |
Database.Password |
(empty) | SQL password. |
With litedb, data is stored at <sharp>/data/<Database>.db. SQL backends use SqlSugar and persist to the vip_members table.
🔧 How it works
Vip.Database resolves its backend from vip.database.jsonc and publishes IDatabaseProvider. Vip.Core loads its groups and config, exposes IVipShared for status queries plus grant/revoke, and IVipPerkRegistry for perk registration. At load, optional managers are resolved without hard dependencies — missing ones simply disable the related feature rather than failing the plugin. A VIP's group determines which registered perks appear in their menu (only features present in the group's config are shown), and per-perk choices persist via ClientPreferences cookies.
🧩 Public API
Other plugins consume these interfaces (resolve in OnAllModulesLoaded):
IVipShared— query VIP status (IsVip,Get,HasFlag, group lookups), grant/revoke, and subscribe toOnVipGranted/OnVipRevoked/OnVipExpiredevents.IVipPerkRegistry— register a customIVipPerk(id, display name, settings, preference callback) so it shows up in the VIP menu.IDatabaseProvider(fromVip.Database.Shared) — backend-agnostic data access.
var vip = sharpModuleManager
.GetOptionalSharpModuleInterface<IVipShared>(IVipShared.Identity)?.Instance;
var perks = sharpModuleManager
.GetOptionalSharpModuleInterface<IVipPerkRegistry>(IVipPerkRegistry.Identity)?.Instance;
perks?.Register(new MyPerk());
📦 Build
dotnet build -c Release
Outputs the module DLLs to .build/modules/Vip.Core/ and .build/modules/Vip.Database/, and the shared API DLLs to .build/shared/Vip.Shared/ and .build/shared/Vip.Database.Shared/.
<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.