From 2c7d62f38944f61e7eafea155c6128521d16aed9 Mon Sep 17 00:00:00 2001 From: Darkelarious Date: Tue, 19 May 2015 22:00:40 +0200 Subject: Beta with support for Pg and SQLite --- lib/MasterServer/Core/Util.pm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'lib/MasterServer/Core/Util.pm') 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,17 +7,25 @@ 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 -- cgit v1.2.3