#!/usr/bin/perl # you might have to adjust this to your perl path # try `which perl' or `type perl' # args: [-2] [-a] [-b] [-q] [-t] [-1] [-d] [-h] # -h: a help # metas are migrating at the moment....! # shows running xpilotservers # original metaserver info is stored in $tmp_file . # by default meta.xpilot.org is asked. # yet todo: switch between meta/meta2 automatically # weird, those timeouts # if entries show up twice, this is a problem of those hosts, # by default they are skipped # never reached a host with numerical ip entry # (they usually won't have a good connection - skip them) # hosts in .edu .jp etc.. are not listed by default (see @too_far_away). # many domains are 'usually' too far for me (net, org..) .. # some special hosts are never listed (see @bad_hosts) # Sun Jun 7 18:09:47 MET DST 1998 # Thu Feb 4 15:08:42 MET 1999 # sven mascheck (sven.mascheck@student.uni-ulm.de) require 5.002; use strict; use Socket; use FileHandle; use Getopt::Std; #store the arriving stuff in a file my $name = getpwuid($<); #adjust here!: my $tmp_file = "/tmp/meta"; my $program = $0; $program =~ s#.*/##; my @too_far_away = qw( jp com org net ca nz mil edu cz ru us gov foo kr au); #my @bad_hosts = qw( absaroka.obgyn.ks.se polaris.tele.nokia.fi # padre.dev.milohedge.com 2cust83.tnt14.dfw5.da.uu.net # css262.cc.els.att.com obelix.premium.com.au taogii.bit.co.kr # ugrad.unbc.ca t0.tecco.at hp00.haulpak.com laplace.numeca.be # dsr8.konkuk.ac.kr tte2142.tte.vtt.fi c414b1.cs.hku.hk # polux.univ-reunion.fr DarkStar.astro.unibas.ch sapc42.estec.esa.nl # bogey.neurologie.uni-tuebingen.de user.bavaria-film.de # ); my @bad_hosts = qw( burana.teuto.de ); my $default_sleep = 120; my $first_meta = 'lgserv1.cs.uit.no'; my $second_meta = 'meta2.xpilot.org'; my $meta_port = 4401; my %opts; #comandline arguments my %info_lines; #complete hostinfo lines my %counter; #for domain.port. see below my @splitted_line; #the fields of one hostinfo line my @full_names; #player names on a server my @splitted_name; #nick, real, host of one player my @splitted_host; #host A.B.C.D # flags: my $bad = 0; #skip that host, bad one my $several = 0; #skip that host, several entries on meta my $far = 0; #skip that host, too far my $just_double = 0; #skip that host, just a double my ($host, $iaddr, $paddr, $proto); #for asking meta server #get program name from absloute path name my $program = $0; $program =~ s#.*/##; if ( ! getopts('a23qbd1fht:', \%opts) || $opts{"h"} ){ die <<" EOF"; usage: ${program} [-2] [-3] [-a] [-b] [-q] [-t] [-d] [-h] no args show visited xpilot servers, assumed to be near -2 ask meta2.xpilot.org instead of meta.xpilot.org -3 ask u2.isy.liu.se instead of meta.xpilot.org -a show far servers also -b show only known bad servers (overrides a) -q show only unvisited servers -t