SRCDS windows output redirection
4 Attachment(s)
SRCDS output redirection on windows
Redirecting the server output to a file or other monitoring program wasn't easily possible, because the SRCDS allocated a new console on windows and didn't use the stdout/stdin. Over at Facepunch, Megalan posted something about "-HFILE -HPARENT -HCHILD" command line options for srcds.exe to redirect the output. After some searching, I've only found references to a long-dead server management tool for Quake 1 called "QHost", for which those parameters were initially added. Luckily they persisted in the engine code until now. Sadly those parameters aren't exactly for redirecting output, but rather give the possibility to request the last X lines of output and enter some commands from a different program. I wasn't able to really produce a tool that outputs new lines as they appear in the server commandline reliably. The attached program does output it correctly, but might get confused when the process window gets resized. QHost apparently expected the server console window to always be of 80 width in size and didn't provide an API call to get the current actual size of the window. You might be able to get the size from the process window itself, but my windows-fu isn't strong enough for that (+ lack of interest). To use this tool, place the SrcdsConRedirect.exe next to the srcds.exe and just call it in place of that - but redirect the output somewhere if you want ;) Code:
C:\path\to\srcdsserver\SrcdsConRedirect.exe -game cstrike -port 27015 -console +map de_dust2 > console.output The provided methods in the dedicated conproc API are wrapped like Code:
int GetScreenBufferSize(); |
Re: SRCDS windows output redirection
I'm getting the error "Invalid String Position" when trying to run this.
If my understanding is correct, this would allow me to output the text from the SRCDS console window to a text file, right? I've tried the following... Code:
C:\servers\server>SrcdsConRedirect.exe -console -game tf +maxplayers 24 +map achievement_botfarm_v8 -port 27010 > C:\console.txt |
Re: SRCDS windows output redirection
Hm, I can't reproduce that, but I've tried to fix it. Have a go again ;)
|
Re: SRCDS windows output redirection
hi, thank you for writing this tool.
How can I write to the stdin of srcds using c# language? Sorry for the question but I'm new in this kind of stuff. |
Re: SRCDS windows output redirection
If anyone finds this in current year,
Alien Swarm: Reactive Drop server includes srcds_console.exe which doesn't spawn another window and can be freely used across all Sourceš games. Source: https://github.com/Facepunch/garrysm...ent-1507467323 |
Re: SRCDS windows output redirection
Add this parm to your servers start up command line.
It will log all console output into the console.log text file. -condebug https://developer.valvesoftware.com/...d_line_options -condebug // Logs all console output into the console.log text file. The file will be here ..\<game>\console.log ?? |
Re: SRCDS windows output redirection
Here's a snippet of my srcds_launch.bat, please read the comments and feel free to point out any incorrect information
Spoiler
|
All times are GMT -4. The time now is 18:14. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.