… | |
… | |
854 | |
854 | |
855 | # hack to make SURE we find the IP address all right |
855 | # hack to make SURE we find the IP address all right |
856 | # can be removed once AnyEvent::DNS is proven stable. |
856 | # can be removed once AnyEvent::DNS is proven stable. |
857 | if ($host eq "gameserver.deliantra.net") { |
857 | if ($host eq "gameserver.deliantra.net") { |
858 | AnyEvent::DNS::a "dnstest.deliantra.net", sub { |
858 | AnyEvent::DNS::a "dnstest.deliantra.net", sub { |
859 | if ($_[0] ne "80.101.114.108") { # Perl |
859 | if ($_[0] ne "80.101.114.108") { # P-e-r-l |
860 | status "dns failure, trying differently"; |
860 | status "dns failure, trying differently"; |
861 | $host = eval { Socket::inet_ntoa Socket::inet_aton "gameserver.deliantra.net" }; |
861 | $host = eval { Socket::inet_ntoa Socket::inet_aton "gameserver.deliantra.net" }; |
862 | unless (defined $host) { |
862 | unless (defined $host) { |
863 | status "dns failure, using hardcoded address"; |
863 | status "dns failure, using hardcoded address"; |
864 | $host = "129.13.162.95"; |
864 | $host = "194.126.175.154"; |
865 | } |
865 | } |
866 | } |
866 | } |
867 | |
867 | |
868 | dc_connect $host, $port; |
868 | dc_connect $host, $port; |
869 | }; |
869 | }; |
… | |
… | |
1342 | $DELIANTRA_DEBUG ^= $_[0]; |
1342 | $DELIANTRA_DEBUG ^= $_[0]; |
1343 | |
1343 | |
1344 | if ($DELIANTRA_DEBUG & 16) { |
1344 | if ($DELIANTRA_DEBUG & 16) { |
1345 | $BW_WATCHER = EV::periodic 0, 1, 0, sub { |
1345 | $BW_WATCHER = EV::periodic 0, 1, 0, sub { |
1346 | return unless $CONN; |
1346 | return unless $CONN; |
1347 | debug sprintf "%.2gKB/s", $CONN->{octets_in} / 1e3; |
1347 | debug sprintf "%8.2gKB/s", $CONN->{octets_in} / 1e3; |
1348 | $CONN->{octets_in} = 0; |
1348 | $CONN->{octets_in} = 0; |
1349 | }; |
1349 | }; |
1350 | } else { |
1350 | } else { |
1351 | undef $BW_WATCHER; |
1351 | undef $BW_WATCHER; |
1352 | } |
1352 | } |