aboutsummaryrefslogtreecommitdiff
path: root/lib/MasterServer/Core/Util.pm
diff options
context:
space:
mode:
authorDarkelarious <darkelarious@333networks.com>2015-05-19 22:00:40 +0200
committerDarkelarious <darkelarious@333networks.com>2015-05-19 22:00:40 +0200
commit2c7d62f38944f61e7eafea155c6128521d16aed9 (patch)
treebd473e6fb9dbbf8e0fdc67b87f0a4ac251fada7b /lib/MasterServer/Core/Util.pm
parent534626943a0a5e251e5465376f3de3fb71b25e91 (diff)
downloadMasterServer-Perl-2c7d62f38944f61e7eafea155c6128521d16aed9.tar.gz
MasterServer-Perl-2c7d62f38944f61e7eafea155c6128521d16aed9.zip
Beta with support for Pg and SQLite
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
################################################################################