Thread Socket, Rcon-Kontroll geht nicht!: Ich brauche Hilfe ;) (6 answers)
Opened by Gast at 2006-08-16 22:20

Gast Gast
 2006-08-16 22:20
#68982 #68982
Hallo liebe Perl-Community,

Hier ist erstmal mein code:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Including
use IO::Socket::INET;

## Scriptoptions
$| = 1; # disable output buffering

## Config
%config = (
SERVER => "193.192.58.21",
PORT => 27000,
PASSWORD => "cordon",
VERSION => "v0.1a",
);

## Baue Socketverbindung auf

$Sock = IO::Socket::INET->new(
Proto => "udp",
PeerAddr => $config{"SERVER"},
PeerPort => $config{"PORT"},
) or die("Konnte keine Verbindung zum Server aufbaun.");

$line= $Sock->send("\xff\xff\xff\xffchallenge rcon\n");

if ($line =~ /challenge +rcon +(\d+)/)
{
$command="changelevel de_dust2";
$msg = "\xFF\xFF\xFF\xFFrcon $1 \"$config('PASSWORD')\" $command\0\n";
$line = $Sock->send($msg);
}


Das Problem ist es Passiert nix obwohl ich das mir ganz gut zusammengewurschtelt habe. So machen es die anderen auch ~ bis auf die SocketVerbindung, aber an der wirds ja wohl nit liegen.

So mien Problem ist aktuell es passiert das :

Quote
srv17f16-41:/home/phantom # perl -W PGRconBot.pl
srv17f16-41:/home/phantom #


Ich weiß echt nicht was ich aktuell flasch machen :/

Wär lieb wenn mir jemand helfen könnte.

Mfg Fuchs

View full thread Socket, Rcon-Kontroll geht nicht!: Ich brauche Hilfe ;)