Well, I took up Adam's suggestion, and wrote a small Windows console application for issuing rcon commands from a command prompt or .bat file. Its called ogsRcon - and if people are interested, send me a note at gearbox (at) oathill (dot) com and I will be happy to send a zip. If someone likes it and wants to host a file down load for it, let me know.
>From the readme: ogsRCon works in two modes: COMMAND LINE and interactive. In COMMAND LINE mode, you specify a single rcon action using command line arguments. This is suitable for use in a .bat file. The socket connection is not persisted and is closed after the action is complete and the console is closed. In INTERACTIVE mode, you start ogsRCon in a command prompt You must first OPEN the connection then use the SEND command to send one or more RCon commands. The socket connection is persisted until you issue a CLOSE command or OPEN a connection to another game. COMMAND LINE format is: ogsRCon address|hostname port password rcon-command-text INTERACTIVE format is: ogsRcon address|hostname port password or simply: ogsRcon (entered with no parameters) Either ALL or NO parameters must be entered. If entered, they must be in the correct sequence. Parameters: address|hostname = IP Address or hostname for game server port = Port number on which the game is running password = rcon password rcon-command-text = rcon command to be executed Commands: open address|hostname port password : open new rcon connection status : display brief status summary of game server send rcon-command-text : send the command to the game close : close the rcon connection quit : close this console application help : what it says Example ------- here is how it might be used in a .bat file that stops wrapped srcds services to ensure the current log is closed: ogsRcon localhost 27020 mypassword changelevel de_dust2 net stop myCStrikeService pause Regards, Frazer -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Adam Sando Sent: Wednesday, February 08, 2006 8:31 PM To: [email protected] Subject: RE: [hlds] Accessing srcds console remotely (for admin) Yeah, good point. Now the only problem is how to do this automated... And if you can automate RCON commands, then you could just automate a quit ;) ServerDOC is mentioned here a fair bit however I haven't had any time to myself to try this app out. Can this issue RCON commands to a machine at all? I have also seen people mention using PHP or java classes to do this sort of thing. Is anyone able to help me such that I could have a scheduled task to kick off something like this? (btw - my SRCDS server runs Windows XP WOOT!) Regards, Adam -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Frazer Sent: Thursday, 9 February 2006 10:32 AM To: [email protected] Subject: RE: [hlds] Accessing srcds console remotely (for admin) Your concern is valid; the shut down is not at all graceful and the uncommitted log buffer is not written. Log records are, therefore, lost. One way to avoid this is to do a changelevel, just before you stop the service (assuming you are not logging to a single file), to force a commit on the log. I have not been fussed by this, since I am capturing a udp feed. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Adam Sando Sent: Wednesday, February 08, 2006 6:59 PM To: [email protected] Subject: RE: [hlds] Accessing srcds console remotely (for admin) I have a question regarding the service based SRCDS setup: When you do a NET STOP or stop the services thru the MMC snap-in, does it perform a graceful shutdown of your SRCDS instance, or does it just terminate the executable. I have found that with using service based start-up, and even using ServerChecker, it does not perform a graceful shutdown which causes the log file for that active map to be deleted (never created even). I am guessing this is by design, as a terminated process doesn't know that it needs to quickly shutdown the logging... Any thoughts on this guys? Cheers, Adam -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Just Me Sent: Thursday, 9 February 2006 07:27 AM To: [email protected] Subject: RE: [hlds] Accessing srcds console remotely (for admin) So - not sure you are in a windows server environment or not - but if so... I have spent a fair amount of time working this stuff out. I have arrived at a solution that uses mostly "out of the box" Microsoft tools. I have wrapped my srcds game instances as windows services, using srvany.exe. Many folks swear by FireDaemon - but srvany is completely free, works just fine and has no restrictions in terms of the number of wrapped services. This free tool is part of the windows server toolkit and is freely downloadable from Microsoft. I have 3 games running as services (HL2DM, CSS and DOD:S). As well, I run fpspingbooster.exe and hlstatx.pl as windows services, also wrapped with srvany. I created a set of .reg registry files and .bat files that automate the whole thing. For scheduled tasks, e.g. nightly hldsupdate, hlstatx awards and just restarting the services because I am paranoid about memory leaks, I use Windows Scheduler and bat files. Works like a charm. To give you an idea of what i mean, here is my InstallAll.bat file - that creates and starts the services: ------------ d: cd "d:\Program Files\Valve\HLServer" net stop srcds_cstrike net stop srcds_hl2mp net stop srcds_dod net stop srcds_pingbooster net stop srcds_hlstatsx instsrv "srcds_cstrike" remove instsrv "srcds_hl2mp" remove instsrv "srcds_dod" remove instsrv "srcds_pingbooster" remove instsrv "srcds_hlstatsx" remove instsrv "srcds_cstrike" "D:\Program Files\Valve\HLServer\srvany.exe" instsrv "srcds_hl2mp" "D:\Program Files\Valve\HLServer\srvany.exe" instsrv "srcds_dod" "D:\Program Files\Valve\HLServer\srvany.exe" instsrv "srcds_pingbooster" "D:\Program Files\Valve\HLServer\srvany.exe" instsrv "srcds_hlstatsx" "D:\Program Files\Valve\HLServer\srvany.exe" regedit /S srcds_cstrike.reg regedit /S srcds_hl2mp.reg regedit /S srcds_dod.reg regedit /S srcds_pingbooster.reg regedit /S srcds_hlstatsx.reg net start srcds_pingbooster net start srcds_cstrike net start srcds_hl2mp net start srcds_dod net start srcds_hlstatsx pause --------- Note the use of the silent regedit to set the srvany parameters for the services. Here is an example of a .reg file: -------- Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\srcds_dod] "Type"=dword:00000110 "Start"=dword:00000003 "ErrorControl"=dword:00000001 "ImagePath"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00 ,6d,00,\ 20,00,46,00,69,00,6c,00,65,00,73,00,5c,00,57,00,69,00,6e,00,64,00,6f,00, 77,\ 00,73,00,20,00,52,00,65,00,73,00,6f,00,75,00,72,00,63,00,65,00,20,00,4b, 00,\ 69,00,74,00,73,00,5c,00,54,00,6f,00,6f,00,6c,00,73,00,5c,00,73,00,72,00, 76,\ 00,61,00,6e,00,79,00,2e,00,65,00,78,00,65,00,00,00 "DisplayName"="srcds_dod" "ObjectName"="LocalSystem" "FailureActions"=hex:00,00,00,00,00,00,00,00,00,00,00,00,03,00,00,00,53, 00,65,\ 00,01,00,00,00,60,ea,00,00,01,00,00,00,60,ea,00,00,01,00,00,00,60,ea,00, 00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\srcds_dod\Paramete rs] "AppDirectory"="D:\\Program Files\\Valve\\HLServer" "Application"="D:\\Program Files\\Valve\\HLServer\\srcds.exe" "AppParameters"=" -console -game \"dod\" -tickrate 66 +fps_max 600 +maxplayers 32 -port 27025 +map dod_kalt +rcon_password \"somesecretcrap\"" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\srcds_dod\Security ] "Security"=hex:01... .. several lines omitted for security reasons they wouldn't work on your machine anyway ... [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\srcds_dod\Enum] "0"="Root\\LEGACY_SRCDS_dod\\0000" "Count"=dword:00000001 "NextInstance"=dword:00000001 --------------------- You can create these files by manually using Regedit, then exporting the registry key and saving the file. As for robustness - in Windows server, you can specify what actions you want to take if the service fails. I find that this works only to a limited extent. I am using HLSW. My opinion about that tool is mixed - but it mostly does the job. Any questions, feel free to contact me directly at gr1955 at hotmail dot com Best of luck. Frazer >From: "Adam Sando" Reply-To: [email protected] To: Subject: >[hlds] Accessing srcds console remotely (for admin) Date: Mon, 9 Jan >2006 >11:05:11 +1030 > >Hi guys, > >I have setup a Source dedicated server and am trying to automate it and >any associated processing so that I never have to logon to the host and >perform work manually. > >At present I am using Server Checker to detect when the srcds.exe >process crashes so that it is automatically restarted, however I have >found a few problems that I would like to try find a way to get around. > >I want to take down the server at ad-hoc times and run the hlds update >tool to update any game files when an update is released. At present I >have to do this manually. I have written a vbscript that terminates the >serverchecker.exe and srcds.exe processes so that I can then run the >update, however if srcds.exe is terminated without typing 'quit' in the >console, the log files are not updated! > >Does anyone know how you would pass a 'quit' command to a remote srcds >console so that you could perform regular updates like this?? > >Any help would be appreciated :) > >p.s.- I also noticed that Server Checker simply terminates the process >too when you hit 'stop' on an active server. Makes stats processing a >pain :( > >Regards, Adam. > > > > > >_______________________________________________ To unsubscribe, edit >your list preferences, or view the list archives, please visit: >http://list.valvesoftware.com/mailman/listinfo/hlds _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlds This e-mail has been scanned for viruses by Hostworks Message Scanning Services - powered by MessageLabs. For further information contact Hostworks on 1300 30 4848. _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlds _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlds This e-mail has been scanned for viruses by Hostworks Message Scanning Services - powered by MessageLabs. For further information contact Hostworks on 1300 30 4848. _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlds _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlds

