aboutsummaryrefslogtreecommitdiff
path: root/lib/MasterServer/Core/Util.pm
diff options
context:
space:
mode:
authorDarkelarious <darkelarious@333networks.com>2015-02-11 21:12:44 +0100
committerDarkelarious <darkelarious@333networks.com>2015-02-11 21:12:44 +0100
commit534626943a0a5e251e5465376f3de3fb71b25e91 (patch)
treeb5b4550c1cdb69c6933aa571244881eaacc72ffe /lib/MasterServer/Core/Util.pm
parente0ada80f8582cf3b28e70b8f18de10aa505159ae (diff)
downloadMasterServer-Perl-534626943a0a5e251e5465376f3de3fb71b25e91.tar.gz
MasterServer-Perl-534626943a0a5e251e5465376f3de3fb71b25e91.zip
ability to query UCC applets (Pg only)
Diffstat (limited to 'lib/MasterServer/Core/Util.pm')
-rwxr-xr-xlib/MasterServer/Core/Util.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/MasterServer/Core/Util.pm b/lib/MasterServer/Core/Util.pm
index 001137d..eb4d509 100755
--- a/lib/MasterServer/Core/Util.pm
+++ b/lib/MasterServer/Core/Util.pm
@@ -9,15 +9,19 @@ use Exporter 'import';
our @EXPORT = qw| valid_address ip2country |;
+################################################################################
## return the abbreviated country based on IP
+################################################################################
sub ip2country {
my ($self, $ip) = @_;
my $reg = IP::Country::Fast->new();
return $reg->inet_atocc($ip);
}
+################################################################################
## Verify whether a given domain name or IP address and port are valid.
-## returns true/false if valid ip + port
+## returns 1/0 if valid/invalid ip + port
+################################################################################
sub valid_address {
my ($self, $a, $p) = @_;