Countries limits, blocks, or allows players connecting from certain countries. This is useful for keeping your playerbase somewhat localized.
Note: Eventually this plugin will have its API handling split to the Geo IP plugin for general use. This plugin will continue the country handling usage though, just requiring the Geo IP plugin as well.
Permissions
countries.admin-- Allows player to use thecountriescommandcountries.exclude-- Allows player to bypass country checks
Commands
This plugin offers both chat and console commands. When using a command chat, prefix with a forward slash: /.
countries add <XX>-- Add the specified two-digit country code to the country listcountries remove <XX>-- Remove the specified two-digit country code from the country listcountries check <player name or ID>-- Check if specificed player is from a listed countrycountries list-- List all countries currently on the country list
Configuration
Example Configuration
{
"API key for paid IP lookup service (if applicable)": "YOUR_API_KEY",
"Ban player if country is blacklisted (true/false)": false,
"Only allow players from server's country (true/false)": false,
"Cache responses from IP lookup service provider (true/false)": true,
"Number of retries on IP lookup fail (0 to disable)": 3,
"Log connections from players (true/false)": false,
"Use country code list as a whitelist (true/false)": false,
"List of two-digit countries codes to check": [
"CN",
"JP",
"HK",
"KR",
"RU",
"VN"
]
}
Localization
Providers
While I've added support for over 20 different IP lookup service providers, I've not tested them all yet; so, the providers currently enabled are the ones shown below.
Free Providers
- dp-ip.com - No known request limit
- freegeoip.app - Limit of 15,000 free requests per hour
- geolocation-db.com - No known request limit
- ipgeolocationapi.com - No known request limit
- ipwhois.io - Limit of 10,000 free requests per month
Paid Providers
Coming soon...
MIT License, with distribution exclusivity for uMod.org
Copyright (c) 2020 Wulf
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

