Steam-Condenser PHP poll for log entries

485 Views Asked by At

I'm looking to actively build a log file from ongoing tf2 games. Using logaddress_add rcon command, I can get a server to send log entries as they happen, but I'm a bit over my head in getting condenser to keep an active port open and retrieve the log entries as they arrive. Is something like this feasible?

 $server = new SourceServer($ip);
 $File = "MyServer.log";
 $fh = fopen($File, 'w');
 while(!$stop)
 {
    set_time_limit(0);
    $reply = $server->Socket->getReply(); //????
    fwrite($fh, $reply);
    if(parseForEnd($reply) == MATCHEND) {
       $stop = True;
    }
 }
 fclose($fh);

I was thinking of extending GameServer or SourceServer but I'm not sure if the ports stay open as long as I'd need or if I'd need to dive deeper. Any help would be great.

2

There are 2 best solutions below

1
On BEST ANSWER

Steam Condenser doesn't currently support gathering logs.

There's no way to open a listening UDP socket for incoming log packets. I already had the idea to add this feature in an upcoming version, but there isn't any code yet.

Feel free to contribute if you feel comfortable with HLDS'/SrcDS remote logging.

0
On

You should have a look to Steam HLDS Log Parser which is in Ruby, get logs from server, parses, and returns usable data.