aboutsummaryrefslogtreecommitdiff
path: root/lib/MasterServer/Core/Util.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/MasterServer/Core/Util.pm')
-rwxr-xr-xlib/MasterServer/Core/Util.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/MasterServer/Core/Util.pm b/lib/MasterServer/Core/Util.pm
index eb4d509..af3a551 100755
--- a/lib/MasterServer/Core/Util.pm
+++ b/lib/MasterServer/Core/Util.pm
@@ -7,18 +7,26 @@ use IP::Country::Fast;
use POSIX qw/strftime/;
use Exporter 'import';
-our @EXPORT = qw| valid_address ip2country |;
+our @EXPORT = qw| ip2country countryflag valid_address |;
################################################################################
-## return the abbreviated country based on IP
+## return the abbreviated country name based on IP
################################################################################
sub ip2country {
-my ($self, $ip) = @_;
+ my ($self, $ip) = @_;
my $reg = IP::Country::Fast->new();
return $reg->inet_atocc($ip);
}
################################################################################
+## return the flag of a country
+################################################################################
+sub countryflag {
+ my ($self, $country) = @_;
+ # placeholder function to return the flag of a country
+}
+
+################################################################################
## Verify whether a given domain name or IP address and port are valid.
## returns 1/0 if valid/invalid ip + port
################################################################################