Github:
Platform Support
| Platform | Status |
|---|---|
| Windows | Maintenance |
| Linux | Maintenance |
Requirements
- SwiftlyS2 v1.0.0+
Installation
- Download the latest release
- Extract plugin to
addons/swiftlys2/plugins/swiftlyS2-countryflags/ - Restart the server
- Configure
config.jsonc(optional)
Note: GeoLite2-Country.mmdb is already included in the
data/folder.
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
Enabled |
bool | true |
Enable/disable the plugin |
Debug |
bool | false |
Enable debug logging |
DefaultStatus |
bool | true |
Show flag by default for new players |
EnableToggleCommand |
bool | true |
Allow players to toggle flag display |
CacheExpiryHours |
int | 168 |
Hours before refreshing country (7 days) |
AutoSaveIntervalSeconds |
int | 120 |
Auto-save cache interval (0 = disable) |
DefaultBadgeId |
int | 1079 |
Badge ID for unknown countries |
CountryBadges |
object | {...} |
Country code to badge ID mapping |
Commands
| Command | Description |
|---|---|
!flag |
Toggle country flag display |
!cf |
Alias for !flag |
Supported Languages
Country Badge Mappings
The plugin includes 70+ pre-configured country-to-badge mappings including:
Europe: NL, FR, GB, RU, DE, PL, SE, NO, FI, ES, IT, GR, TR, UA, CZ, AT, CH, BE, etc.
North America: US, CA
South America: BR, AR, CL, CO, PE, MX
Asia: CN, JP, KR, TH, ID, MY, VN, IN, KZ
Middle East: SA, AE, IL, LB
Oceania: AU
Africa: EG, TN, DZ, MA
You can customize these mappings in config.jsonc.
Building from Source
Requirements
Build
git clone https://github.com/zhw1nq/swiftlyS2-countryflags.git
cd swiftlyS2-countryflags
dotnet restore
dotnet build
Publish
dotnet publish -c Release
Output directory: build/publish/swiftlyS2-countryflags/
Credits
- zhw1nq - Author
- SwiftlyS2 - Framework
- MaxMind GeoLite2 - GeoIP Database
- swiftly-solutions/countryflags - Original SwiftlyS1 plugin
License
This project is licensed under the MIT License.
