Skip to content

a2Labs-cc/SW2-SteamGroupRestrict

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[SwiftlyS2] SteamGroupRestrict


Made by aga

Overview

SwiftlyS2-SteamRestrict is a plugin for SwiftlyS2 that restricts player access to the server based on their Steam profile information.

It automatically checks players' Steam profiles using the Steam Web API and enforces restrictions such as:

  • Minimum CS2 Level
  • Minimum Hours Played
  • Minimum Steam Level
  • Minimum Account Age
  • Block Private Profiles
  • Block Banned Accounts (VAC, Trade, Game bans)
  • Require Steam Group Membership

Players who do not meet the criteria are warned and eventually kicked from the server.

Support

Need help or have questions? Join our Discord server:

Discord

Download Shortcuts

  • 📦  Download Latest Plugin VersionClick Here
  • ⚙️  Download Latest SwiftlyS2 VersionClick Here

Installation

  1. Download/build the plugin.
  2. Copy the published plugin folder to your server:
.../game/csgo/addons/swiftlys2/plugins/SteamRestrict/
  1. Ensure the plugin has its resources/ folder alongside the DLL (translations, gamedata).
  2. Start/restart the server.

Configuration

The plugin uses SwiftlyS2's JSON config system.

  • File name: config.json
  • Section: swiftlys2/configs/plugins/SteamRestrict

On first run the config will be created automatically. The exact resolved path is logged on startup:

Key Configuration Options

  • LogProfileInformations: Enable/disable informational logs (default: true)
  • ChatPrefix: Prefix for chat messages (default: "[SteamRestrict]")
  • ChatPrefixColor: Color for the chat prefix (default: "[red]")
  • SteamWebAPI: Your Steam Web API key (required for functionality). You can obtain an API key from https://steamcommunity.com/dev/apikey
  • MinimumCS2Level: Minimum CS2 level required (default: -1, disabled)
  • MinimumHour: Minimum hours played required (default: -1, disabled)
  • MinimumSteamLevel: Minimum Steam level required (default: -1, disabled)
  • MinimumSteamAccountAgeInDays: Minimum account age in days (default: -1, disabled)
  • BlockPrivateProfile: Block players with private profiles (default: false)
  • BlockTradeBanned: Block trade banned accounts (default: false)
  • BlockVACBanned: Block VAC banned accounts (default: false)
  • SteamGroupID: Require membership in this Steam group (leave empty to disable)
  • BlockGameBanned: Block game banned accounts (default: false)
  • PrivateProfileWarningTime: Time in seconds to warn private profile users before kick (default: 20)
  • PrivateProfileWarningPrintSeconds: Interval for warning messages (default: 3)
  • DatabaseConnectionString: Database connection string name/key used by SwiftlyS2 (default: "default")
  • CacheExpirationDays: How long cached profiles stay in the database before cleanup deletes them (default: 30)

How It Works

Steam Profile Checking

The plugin uses the Steam Web API to fetch detailed player profile information when they connect to the server.

Database Cache

If database caching is available, the plugin stores the fetched profile data in a database table and reuses it on future joins.

  • If a player is found in the database cache, the plugin uses the cached data and does not call the Steam Web API for that join.
  • If no cached entry exists (or database is unavailable), the plugin calls the Steam Web API and then writes the result to the database.
  • Old cache entries are deleted by periodic cleanup after CacheExpirationDays.

Logging

Most Information logs are only printed when LogProfileInformations is true. Warnings and errors are always logged.

Restrictions Enforcement

Players are evaluated against the configured restrictions:

  • Level and Hours: Minimum requirements for CS2 level, hours played, and Steam level
  • Account Age: Ensures accounts are old enough to prevent new/alternative accounts
  • Bans: Blocks players with VAC, trade, or game bans
  • Privacy: Can block or warn players with private profiles
  • Group Membership: Requires players to be members of a specific Steam group

Players who fail to meet the criteria receive warnings in chat and are eventually kicked from the server.

Building

dotnet build

Credits

About

Restricts player access to the server based on their Steam profile information.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages