HLDS Auto-restarter for MS:C v1.35

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
hlds_restarter13.gif

This is the final version (most likely), no longer beta, although I still can't guarantee perfection. ;)

Ye download: http://www.rkszone.com/downloads/msc/hl ... ter135.zip

Instructions:
Unzip restarter.exe to the same folder containing HLDS.exe (it must be in the folder above MSC).

Put in your OWN command line - the one there is just for example. It should be saved when you close the program. Do not include the path to the hlds.exe.

Do not change the mod folder if you intend to use this with msc.

There are three methods to choose from:

AMX METHOD
hlds_restarter_amx.gif
In terms of functionality, this is the best method, however, it requires AMX, and AMX can be a pain to install, so I recommend this method only for advanced users. You can get a generic AMX setup here. There's no self installer - but if you need one, you probably shouldn't be messing with AMX anyways. The plugin is included with the hlds_restarter package, and integrated into that generic setup. MSC now recognizes this program WITHOUT AMX, and acts accordingly - this this is the ONLY restarter method you should use with MSC, and it no longer requires AMX.

CLIPBOARD METHOD
hlds_restarter_clipboard.gif
This is the older half-assed clipboard method. It works for most though... When you are away, it pastes a command to the console every few minutes to check for hard crash. This means it pulls the console up, switches window focus to it, pastes, and minimizes the console again (unless the "Don't Minimize" box is not checked). Thus, you only want to set this mode when you are away, as if you have it doing this every minute, not only can it get very annoying, but you are also likely to accidentally interfere with the process. In "I'm using the computer mode" - it does no hard crash tests, but standard crashes are still caught.

CONSOLE SCRIPT METHOD
hlds_restarter_script.gif
This method appends your server.cfg with a script that sends the writeid every 30 seconds or so, thus updating the banned.cfg which the Restarter monitors. Downside is that this script will prevent you from running commands direct from the console - although you can still use the rcon or HLSW. This script method has been known to cause some oddities in MS:C.

Kill Functioning Server Option: Since, sometimes, MSC servers develop oddities where they still function, but the game is fubarbed in some way (such as, no monsters spawning, no one can attack, etc) - this option is supplied to reset the server after X hours of operation, regardless of its responsiveness. The timer resets with each crash or change.

-= New Stuff in 1.3 =-
Thread Priority: You can now set the priority of the HLDS.EXE before you launch it. If you are running an MSC HLDS.EXE on your main PC's desktop (not recommended, but sometimes unavoidable) and find it interferes with what you are doing (lags the system), you could set the priority to "Below Normal". If you have a PC dedicated to MSC and nothing else, you could set it to "High". All the other usual settings are there. This only goes into effect when the HLDS.EXE is launched, so changing it does not affect the instance of the server that is currently active.

Max Downtime Allowed Slider: This determines how many minutes the server has to be unresponsive before the Restarter will assume it has locked and restart it. The default is 1 minute, but if you have a particularly slow CPU, it can be useful to set it a little higher to allow the server to recover from slow map changes, and the like, where it appears to be unresponsive. (Note: In clipboard mode, times are effectively doubled.)

New INI System: Once again you will lose your HLDS command line when you upgrade. However, this should be the last time that happens as I've replaced the funky sequence oriented INI, with a genuine dynamic type (can even be manually edited). Shouldn't be any more problems with the INI file.

Multi-Mod Support: If you change the mod folder and click the "Reload-Prefs" button that appears, the Restarter will remember your settings for each mod you've used it for. Multiple instances of the Restarter should also be able to run on the same computer, to monitor multiple servers. (However, MSC hates other copies of the HLDS so much, I don't recommend trying it with this particular mod.)

NEW OPTION in 1.35 - Start HLDS on Load - This option causes the restarter to start the last configured HLDS as soon as the program loads (no need to press the 'Launch HLDS' button). With this, you can add a restarter.exe shortcut to your Windows Startup folder. This way, if your computer goes down due to power outage and reboots, the restarter will load up with Windows and imediately restart the server.

All other buttons should be fairly self-explanatory. :)

OLD VERSION USERS (pre 1.3): Backup your command line by pasting it into a notepad or something, this version changes the ini file format - your old preferences will be lost.

[/instructions]

How it works: The problem with ServerDoc is that it only checks to see if the server is responsive, and the server can remain responsive for quite some time during some of these memory lock ups (even if it can't operate). The batch file auto-restart method too, is insufficient, as the error windows prevent it from auto-closing the server. Sometimes it'll lock up with no error window at all, which tends to stump both methods.

This Restarter, checks to see if the console is still updating a file every so often (it forces the console to update this file through a few different methods). If the server fails to update this file, after a short leeway time (now defined by the Max Downtime Slider), the Restarter kills and restarts it.

In addition, it monitors for any clean crashes or closing of the program every second, and restarts as needed.

Windows 2003 Server and Windows Vista users may need VB5.0 run-time libraries.

HLDS restarter only saves preferences on a successful close.

Source: http://www.thothie.com/ms/hldsrestart.frm.txt
Previous Releases (case an older one worked better for ya):
Beta1
Beta2
Release 1.3

(Stickied for usefulness -K)
 

Vomica7

New Adventurer
Joined
Oct 16, 2005
Messages
1,078
Reaction score
0
:O
thothie... i cant express how much i love you right now... :oops:
 

DocMombo

New Adventurer
Joined
Jan 2, 2006
Messages
221
Reaction score
0
all it does is says
"[1/6/2006 9:51:40 PM] Launching HLDS...
[1/6/2006 9:51:41 PM] HLDS closed. Restarting.
[1/6/2006 9:51:42 PM] HLDS closed. Restarting.
[1/6/2006 9:51:43 PM] HLDS closed. Restarting.
[1/6/2006 9:51:44 PM] HLDS closed. Restarting.
[1/6/2006 9:51:45 PM] HLDS closed. Restarting."

edit: these are my parameters

hlds.exe -game msc -port 27015 -map edana +maxplayers 4 -console +ms_pklevel 0
 
  • Thread starter
  • Admin
  • #5

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Hmmmmm....

Hmmmmmmmmmmmmm....

I'm trying to think what could possibly cause that... It works for J-M and me... so far. I to intend to do an alternate meathod of testing for console responses - but it looks like yours cant even start the HLDS.EXE

Are you running on Windows 98? It may very well be the method I used to grab threads requires XP.
__________
"It takes less mental effort to condemn than to think." -Emma Goldman
Thothie
 

Iselore

New Adventurer
Joined
Dec 3, 2005
Messages
138
Reaction score
0
grrr, it gives me a run-time error 76 path not found...I can't even edit the command line to my hlds
 
  • Thread starter
  • Admin
  • #7

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
It has to go in the same folder as the HLDS (the folder above msc) - don't include the path to the HLDS in the command line (read the text in the window when it launches - instructions there).

Sorry for the lack of error handling - tis beta.
__________
"Too much time has passed by
to lament the fact that we were deeply in love.
The wind keeps blowing,
while my heart cannot heal all the tears in it.
Someone, cry for me with parched eyes.
I only want to know what true sadness is.
Sitting in muddy water isn't such a bad life
if it ends after the first time..."
- The Real Folk Blues, Cowboy Bebop End-Theme

Thothie
 

Iselore

New Adventurer
Joined
Dec 3, 2005
Messages
138
Reaction score
0
I was wondering if u could actually change the way the program checks whether the server is responding. Haha, cos I'm playing on the same I'm hosting...
 
  • Thread starter
  • Admin
  • #9

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Yeah, that's my top priority, as it is a pain in the ass. I may have something by this evening, as I've got a few ideas.

Meanwhile, when you are working on the computer - set the Time Interval slider to something rediculously high. It wont recover from hard crashes this way - but it also wont screw with you while you are working. (You're very likely to notice a hard crash while you are on the computer in anycase.)

Then, when yer not using the computer, set the Time Interval to 1, and it'll do its thing every minute.

You CAN change the Timer Interval at any time, the effect is immediate.

So far these are the alternate meathods I'm looking at:
- Console Script (downside: locks access to console, although you can still contact through HLSW and Rcon)
- HLSW Monitor (watches the HLSW log response, downside: third party software req)
- AMX Plugin (Already have plugin..., downside: third party software req)
- Log Monitor (This may not work, as log doesn't update enough)
- Rcon via Winsock (Downside: I dunno how and it'll take me quite some time to learn)

In all likelyhood, I'll be giving options to use some of these methods in the next release, in addition to the current half-assed clipboard meathod.

Bit of warning with the current version: It will NOT work if you have a Clipboard Monitoring program running. (J-M Discovered this the hard way - think its working for him now though.) ;)
__________
"Words, we did use. Listen, you did not. Now, screwed, we all are." - Yoda
Thothie
 

Iselore

New Adventurer
Joined
Dec 3, 2005
Messages
138
Reaction score
0
You could take a look at this one http://www.dumbclan.co.uk/downloads/serverchecker/ It's quite a good server restarter that monitors the server in the background but it won't eliminate those debug windows or memory errors so it's just as useless but the way it monitors the servers it quite convienient.
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
I've a new ver of this that will handle those and has the option to use a console script, amx plugin, or the old clipboard method (although somewhat improved) - but I'll need to give it at least a few hours of real world testing before I release it. I'll likely have it up tomorrow.
__________
"Default, n.: De line west of which CA will drift to sea at de next major quake."
Thothie
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Bump for aformentioned version boost. (See first post)

I should point out, for those of you who can't get this working, and don't already know, there is the alternative BATCH auto restarter method:

Example:
Code:
@echo off 
title MS HLDS Restart 
echo (%date% %time%) hlds started. 
:hlds 
start /min /wait /ABOVENORMAL hlds.exe -insecure -game msc +maxplayers 6 -port 27017 -noipx -console +ms_pklevel 0 +exec crashed.cfg
echo (%date% %time%) WARNING: hlds closed or crashed, restarting. 
goto hlds

The primary downside to the batch method is that it cannot detect lock ups or crashes that generate error windows - which is what the restarter program is designed to do.
 

Slayer

New Adventurer
Joined
Jan 11, 2006
Messages
2
Reaction score
0
Location
Banned
I know why...

I have been watching this forum for about three years now and I have seen so many harasing comments and I can't take it anymore. Why would you even say that.

I will never play MS again, and I hate you all.

p.s. Hate the new game, why couldn't you have made it for HL 2 you lazy @5s3S.

p.p.s. The magic??? Why???

p.p.p.s. I hate you all.
 

Tradion

New Adventurer
The True Followers of the Lost
Joined
Jul 18, 2004
Messages
304
Reaction score
0
Age
38
Location
Your Basement
cough 3 years my ass you 4 post joined today banned dumass haha
 

J-M v2.5.5

BANNED
BANNED
Joined
Feb 26, 2005
Messages
5,675
Reaction score
1
Age
35
Location
Nijmegen, the Netherlands.
However, you can watch the forums as a guest for three years.

And then you decide to register, spam the board with eight identical piece of **** posts only to get banned... Ah well, it happens. :mrgreen:
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Doesn't for me, or I wouldn't have bothered making this. It sees the exec is still there, and active, so it thinks the server is fine.

Iseore's Server Checker had a bit more promise, and is simpler to use. However, it seems to have it's limitations too. When the memory leak gets real bad it seems it can't kill the program (it generates an error in the attempt). Seems also, sometimes, not to bother to even try. Still, better than the batch file or server doc, if this thing don't work for ya.
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Don't think this is worth a bump - but's stickied anyways... I've updated the AMX Heartbeat plugin to trigger when it first loads ando when the plugin exits, in addition to the standard 30 second interval. This will help prevent the HLDS Restarter from thinking the server has locked during paticularly the long map changes that sometimes occur on Central Servers.

This version of the plugin and its source are now integrated with the HLDS Beta2 restarter. You can download the plugin individually from this link:
http://www.thothie.com/ms/heartbeat.zip

Goes into your msc\addons\amx\plugins folder and must be enabled in your msc\addons\config\plugins.ini

I'll eventually modify it with a cvar that gives the option to see feedback from the plugin in console.

The SMA source is included - you may open it with notepad, if you are curious. It is not required for operation.

If you do not run AMX or do not use the plugin, you need download nothing.
 

LukeW

New Adventurer
Joined
Feb 24, 2005
Messages
56
Reaction score
0
You might want to point out that you need to use stand-alone HLDS, and not steam-integrated.
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Bah, doubt I can do much about that - tis either that server 2003 deals with handles differently (which I doubt) or it doesn't support VB5 apps.

Again, Server Checker is your next best bet, without the limitations or pain of use of Serverdoc.
 

HellsCook

New Adventurer
Joined
Jan 12, 2006
Messages
10
Reaction score
0
So, its written in VB5? I have VB6, maybe it'll work after a compile under that.

And it does! yay!
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Blah, I have VB6, I just dun like to use it, as whenever I use the in-program reference, it wants to launch the whole effing MSDNL. ><
 
Top