Search code examples
phploggingsteam-condenser

Steam-Condenser PHP poll for log entries


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.


Solution

  • 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.