Hi,
Since this software is on MIT license, I'm sharing with you the quick add I made to allow me to kick users originating from specified countries. I'm using IPStack API for this (since this is included in the free plan) and IPHub for VPN filtering.
Line 21 add :
Maybe you wish to comment line 257
This require IPStack API key (even the free one !)
Regards,
(this is of course under MIT License)
Since this software is on MIT license, I'm sharing with you the quick add I made to allow me to kick users originating from specified countries. I'm using IPStack API for this (since this is included in the free plan) and IPHub for VPN filtering.
Line 21 add :
string[] deniedCountries = {"CN","AU"};Where you specify the countrie(s) you whish to kick, here in my example China and Australia, don't take it the wrong way it's an example.
Maybe this needs to be appened to the configuration file some day ;)
Line 220 add :
if (json ["country_code"] != null) {
string playerCountry = json ["country_code"].ToString().ToUpper();
foreach (string deniedCountry in deniedCountries) {
if (playerCountry.Contains(deniedCountry)) {
Puts($" Country {playerCountry} denied");
player.Kick ("Ping too high");
LogWarning (GetMsg ("Is Banned"), $"{player.Name} ({player.Id}/{ip})", playerCountry);
}
}
}
Maybe you wish to comment line 257
//LogWarning ("IPStack response does not include security information");
This require IPStack API key (even the free one !)
Regards,
(this is of course under MIT License)