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\Parameters]
"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

Reply via email to