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.