Menu

#1 execute cuts results

open
nobody
None
5
2001-08-10
2001-08-10
Anonymous
No

e.g. i do with KKrcon
$rcon->execute("listid ");

the result is only 74 lines long!
bu in fact if i type while ON the server i get 211lines

Question.
What happened to the lines 75 and above?!

Sincerly

Simon Lange
lange@usrangers.net

Discussion

  • Nobody/Anonymous

    Logged In: NO

    This same thing happens when trying to retrieve a user list,
    if your server is full with 32 people. You only get 17 users
    returned.

     
  • Nobody/Anonymous

    Logged In: NO

    Changing this code in KKrcon.pm fixed this problem for me:

    sub _sendrecv
    {
    my ($self, $msg) = @_;

    my $host = $self->\{"server\_host"\};
    my $port = $self->\{"server\_port"\};
    my $ipaddr = $self->\{"\_ipaddr"\};
    my $proto  = $self->\{"\_proto"\};
    
    \# Open socket
    socket\(RCON, PF\_INET, SOCK\_DGRAM, $proto\)
        or die\("KKrcon: socket: $\!\n"\);
    
    \# bind causes problems if hostname\(\) gets wrong
    

    interface...
    # and it doesn't seem to be necessary
    #
    #my $iaddr = gethostbyname(hostname());
    #my $paddr = sockaddr_in(0, $iaddr);
    #bind(RCON, $paddr)
    # or die("KKrcon: bind: $!\n");

    my $hispaddr = sockaddr\_in\($port, $ipaddr\);
    
    unless\(defined\(send\(RCON, $msg, 0, $hispaddr\)\)\)
    \{
        die\("KKrcon: send $ip:$port : $\!"\);
    \}
    
    my $rin = "";
    vec\($rin, fileno\(RCON\), 1\) = 1;
    
    my $ans = "TIMEOUT";
    my $ret = "";
    while \(select\($rin, undef, undef, 10.0\)\)
    \{
        $ans = "";
        $hispaddr = recv\(RCON, $ans, 8192, 0\);
        $ans =~ s/\x00+$//;         \#
    

    trailing crap
    $ans =~ s/^\xFF\xFF\xFF\xFFl//; #
    HL response
    $ans =~ s/^\xFF\xFF\xFF\xFFn//; #
    QW response
    $ans =~ s/^\xFF\xFF\xFF\xFF//; #
    Q2/Q3 response
    $ans =~ s/^\xFE\xFF\xFF\xFF.....//; #
    old HL bug/feature
    $ret = $ret . $ans;
    }

    \# Close socket
    close\(RCON\);
    
    if \($ans eq "TIMEOUT"\)
    \{
        $ans = "";
        $self->\{"error"\} = "Rcon timeout";
    \}
    
    return $ret;
    

    }

     

Log in to post a comment.

MongoDB Logo MongoDB