From: TTimo Date: Sun, 4 Nov 2007 04:08:17 +0000 (+0000) Subject: ... X-Git-Tag: xonotic-v0.7.0~16^2~12^2~69^2~1 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=commitdiff_plain;h=d77fee7551132c642bf2b12e562133936845160c;ds=sidebyside ... git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/branches/ZeroRadiant.ab@189 8a3a26a2-13c4-0310-b231-cf6edde360e5 --- diff --git a/tools/quake3/q3map2/listen.pl b/tools/quake3/q3map2/listen.pl index 20001360..6101a767 100644 --- a/tools/quake3/q3map2/listen.pl +++ b/tools/quake3/q3map2/listen.pl @@ -1,46 +1,46 @@ -#!/usr/bin/perl -w - -use IO::Socket; -use Net::hostent; - -my $port = shift || 13131; - -my $server = IO::Socket::INET->new( - Proto => 'tcp', - LocalPort => $port, - Listen => SOMAXCONN, - Reuse => 1 ) - || die "can't setup server"; -print "[Q3Map2 listener $0 is now active on port $port]\n"; - -while( $client = $server->accept() ) -{ - - $client->autoflush( 1 ); - - $hostinfo = gethostbyaddr( $client->peeraddr ); - printf "[Connect from %s]\n\n", $hostinfo ? $hostinfo->name : $client->peerhost; - - #ask the client for a command - print $client "[server]\$"; - my $text = ""; - while( <$client> ) - { - $text .= $_; - while( $text =~ s|]*>([^<]+)|| ) - { - my $msg = $1; - - # fix xml ents - $msg =~ s|<|<|g; - $msg =~ s|>|>|g; - $msg =~ s|"|"|g;#" - $msg =~ s|'|'|g;#' - - print $msg; - } - } - - printf "\n[Disconnected: %s]\n\n", $hostinfo ? $hostinfo->name : $client->peerhost; - close $client; -} +#!/usr/bin/perl -w + +use IO::Socket; +use Net::hostent; + +my $port = shift || 13131; + +my $server = IO::Socket::INET->new( + Proto => 'tcp', + LocalPort => $port, + Listen => SOMAXCONN, + Reuse => 1 ) + || die "can't setup server"; +print "[Q3Map2 listener $0 is now active on port $port]\n"; + +while( $client = $server->accept() ) +{ + + $client->autoflush( 1 ); + + $hostinfo = gethostbyaddr( $client->peeraddr ); + printf "[Connect from %s]\n\n", $hostinfo ? $hostinfo->name : $client->peerhost; + + #ask the client for a command + print $client "[server]\$"; + my $text = ""; + while( <$client> ) + { + $text .= $_; + while( $text =~ s|]*>([^<]+)|| ) + { + my $msg = $1; + + # fix xml ents + $msg =~ s|<|<|g; + $msg =~ s|>|>|g; + $msg =~ s|"|"|g;#" + $msg =~ s|'|'|g;#' + + print $msg; + } + } + + printf "\n[Disconnected: %s]\n\n", $hostinfo ? $hostinfo->name : $client->peerhost; + close $client; +}