Search code examples
javasource-engine

Displaying console feed from game server on rcon client


I'm writing an RCON client for an Insurgency (Source engine game) dedicated server. I'm using the RCON protocol defined by Valve that is used in all of the games that use the Source engine. I can successfully send commands to the server, and display the server's response to those commands. However, I have no idea how to read or request the feed displayed by the in-game console (which contains the part I'm primarily interested in: the killfeed). I have looked at querying the server for a possible request to be sent the feed, but there is no such functionality listed.

How would I go about retrieving the console feed from the server?


Solution

  • You cannot request the console feed from the server via RCON.


    Two alternative solutions come to mind:

    Save the output of the server application

    Insurgency (or most source servers for that matter) prints the information you are looking for to stdout. The most elegant solution to save this output would be to start the server via systemd and read it from the syslog via journalctl.

    As a more simple solution you can just write it to a file using a pipe:

    ./start_server.sh > output.log
    

    Or if you still want to see the output as it is printed:

    ./start_server.sh | tee output.log
    

    Use sourcemod

    You can write a sourcemod-plugin, or use an existing one that records and provides those information. The SuperLogs plugin comes to mind, but I haven't used it in a long time. This will be significantly more work.


    I have been using the first solution for a long time now. Be aware that Insurgency buffers the output and only writes it once that buffer is full, leading to delays of 20 minutes and upwards. This can be improved by setting sv_logflush 1 in the Insurgency config.