SRCDS Steam group


SRCDS Crash catcher
#1
Ok so I've messing around with my server last few weeks and discovered after installing Garrysmod that I got a lot of srcds.exe memory errors, that would stop my batch scripts from restarting the server untill you clicked ok.

An example of the error is shown below.

[img=http://img410.imageshack.us/img410/8454/exampleob3.th.jpg]

So I wrote this little program with AutoIt and thought I would post here as it maybe of some use to someone having the same problems as me.

*NOTE* Unfortunatly for this to work you must disable the server from locking itself (ctrl-alt-del screen)as if this is up then the program will not get rid of the error. If I figure a way around this I shall post the updated script here.

*Source Code*

$var1=1
While $var1=1
WinWait ("srcds.exe - Application Error")
WinActivate("srcds.exe - Application Error")
ControlClick("srcds.exe - Application Error","","Button1")
send("{ENTER}")
WEnd

*End Source Code*

Compile this with auto it and run the .exe produced, and now everytime a Windows Memory error appears the program will close that window, allowing the source server to restart.

To compile with autoit simple place the above code in a txt file, and save it as scrip.au3. Then right click and press Compile.

Hope this is of some use to people
Reply
#2
That's pretty nice!

Hope to get some comments on this from people that used it Smile
Maybe you can .zip the exe and attach it as a file in your post so people don't have to compile it for their own.
Join the Source Dedicated Server Support Group on Steam Community!
Source Dedicated Server (SRCDS)
Free to join, Live support! (When available)

http://forums.srcds.com/viewtopic/5114
Reply
#3
Sure np's m8

The last line isn't necessarly reuqired, its there just incase it misses the button click (very unlikely)

Be good to know if people find this usefull in operating their servers.


Attached Files
.zip   srcdsCrashCatcher.zip (Size: 190.61 KB / Downloads: 451)
Reply
#4
ya thst very nice !!Toungue
my server crash sometimes wen im awy and back look at my comp and is the big sing omfg i hve to restart server manualy thxxxxBig Grin
Reply
#5
THANK YOU SO FRIGGIN MUCH!!!!!! THANK YOU THANK YOU THANK YOU!!!!!
I'm good at not overreacting.
THAAAAAAAAAAAAAANK YOOOOOOOOOOOOOOOU!!!!!!
Reply
#6
Hello, im running a GMod Server and it crashs very often, too. So i searched and found this tool.
But i dont understand this part:

"*NOTE* Unfortunatly for this to work you must disable the server from locking itself (ctrl-alt-del screen)as if this is up then the program will not get rid of the error."

What do i have to do here?

Sorry for my bad english and sorry for posting in this old thread :p

Greetz Evo
Reply
#7
How can i use it without dling this exe, it takes 5-15% of my CPU!! And i didn't understand same thing which Evostar posted Sad
Btw i don't have Garrysmod but get same error nearly once a day.
Reply
#8
http://forums.srcds.com/viewpost/1853#pid1853

Create restart.txt, add the posted code from the post linked above. Then rename the .txt to .bat

Now, run your srcds, then double click restart.bat to run it. That's it.

The .bat file will auto-detect crashes and restart the server with the given parameters.

This was all included in the Windows srcds walkthrough right at the bottom. LINK
Reply
#9
Evostar Wrote:Hello, im running a GMod Server and it crashs very often, too. So i searched and found this tool.
But i dont understand this part:

"*NOTE* Unfortunatly for this to work you must disable the server from locking itself (ctrl-alt-del screen)as if this is up then the program will not get rid of the error."

What do i have to do here?

Sorry for my bad english and sorry for posting in this old thread :p

Greetz Evo

Hi Evo

Basically what this means is, you know when you leave Windows Server after a certain amount of time it locks the computer, and you have to login again by pressing CTRL-ALT-DEL then entering your password. You need to stop the computer locking itsself like this as it stops the script from working. To do this goto the screen save options, and untick the option that says "on Resume, password protect" then you should be ok


Muppet Wrote:http://forums.srcds.com/viewpost/1853#pid1853

Create restart.txt, add the posted code from the post linked above. Then rename the .txt to .bat

Now, run your srcds, then double click restart.bat to run it. That's it.

The .bat file will auto-detect crashes and restart the server with the given parameters.

This was all included in the Windows srcds walkthrough right at the bottom. LINK

Muppet although I can see you are trying to help, my initial post is not about using the script you mention, the script you are on about works if srcds.exe exits cleanly. This little autoit script I have written will close the srcds. memory leak dialog box if people get it and then the other script (which you mentioned) can take over and restart the server for you.


As for the other person saying it takes 5-15% CPU, I haven't seen that here mine is currently sitting on 0% with 4MB of memory usage.
Reply
#10
Hi FoRcEFiRe

i'm using Windows Xp Prof. SP2 (Server machine is in my basement :X) and i disabled Screensaver and "on Resume, password protect" is disabled, too. But the Crash Catcher wont work. The Server is disabled from locking itself ...

What now?
Reply
#11
Evostar Wrote:Hi FoRcEFiRe

i'm using Windows Xp Prof. SP2 (Server machine is in my basement :X) and i disabled Screensaver and "on Resume, password protect" is disabled, too. But the Crash Catcher wont work. The Server is disabled from locking itself ...

What now?

Are you sure you are getting the same crash window as shown in the first post? I have noticeda new one recently which I am currently coding a fix for, something about "message before end user call" if thats the error box you are getting then this script wont pick it up yet as I havent coded it in. It defo works catching the memory errors though.
Reply
#12
Dang! I'm not getting the crash window as shown in your post. Its the new one you mentioned.

I wait for your new version. =)
Reply
#13
GREAT TOOL!

As far as Not being able to have this run with the machine locked You might want to try Registering the EXE as a service using FireDaemon, that way it can start up at system boot without user input.

I Set it up on my server, I'll let you all know how it goes.
Reply
#14
http://www.pctools.com/guides/registry/detail/816/

Does this registry edit keep the error box from appearing? If so you wouldn't need to run another app on your game server. I used this regedit when theshiponline was first released to allow the batch to restart the server when it crashed.
Manage your redirects/fast downloads with one click! SourceRSC and HL1RSC
Need a free web based game server hosting panel? Check out UGCC.
Reply
#15
OooOOoo me likey!

Although (If anyone was curious) the AutoIt EXE file and FireDaemon Service combination works as well, at the cost of a little CPU.

My server locks up, the window doesnt show up, and the SRCDS service (firedaemon again) restarts my SRCDS server Service without a hitch (It even does it when the system is locked down)

The registry route seems to make a lot more sense though, so for sure I'll be using that instead.

Thanks!

Here is the run down for those too lazy to click the link Smile
-----------
System Key: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows]
Value Name: ErrorMode
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = all errors, 1 = application errors, 2 = no popups)
-----------

Masher Wrote:http://www.pctools.com/guides/registry/detail/816/

Does this registry edit keep the error box from appearing? If so you wouldn't need to run another app on your game server. I used this regedit when theshiponline was first released to allow the batch to restart the server when it crashed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)