Official Soldat Forums

Server Talk => Scripting Discussions and Help => Topic started by: -Snowy- on December 27, 2007, 10:15:55 am

Title: completely restarting server
Post by: -Snowy- on December 27, 2007, 10:15:55 am
ive looked around and ive seen that a few people get the occasional access violation spamming in their server, the scripts stop working, people dont die, etc etc. what im wanting to do is make it so the server completely restarts, scripts and all, when an error such as this occurs. so i get the onexception procedure happening, then i add a shutdown and startserver function in it, but the problem is that once you shutdown the server, you cant use the startserver function (why it exists in the first place when u can never use it, i dont know). ive searched for 'restart onexception' and 'restart scripts' but i havnt found anything. is there any way i could go about reloading the entire server, at all?

and @ enesce, make shutdown; stop the server, but not close the process so it can be started again (its the whole reason im having this problem)
Title: Re: completely restarting server
Post by: FliesLikeABrick on December 27, 2007, 10:22:26 am
I'd imagine you can do this using on exception and then making a call to the system command line to call an outside program which will make sure the server is stopped and then restart it.
Title: Re: completely restarting server
Post by: -Snowy- on December 27, 2007, 10:26:54 am
yeah, i try to sound like i know what im talkin about, but i only just started using pascal and i have no idea how to do that. it would be so much damn easier if the process didnt close
Title: Re: completely restarting server
Post by: Toumaz on December 27, 2007, 10:33:27 am
You could use OnScriptCrash=shutdown in the network section of server.ini instead and then rely on some sort of server monitor script to restart it for you.
Title: Re: completely restarting server
Post by: DorkeyDear on December 27, 2007, 11:57:08 am
Doesn't /recompile fix the server?
You could do /recompile, /nextmap or /restart, and stuff under OnException
not sure if it'll work tho..
Title: Re: completely restarting server
Post by: Toumaz on December 27, 2007, 11:59:03 am
Doesn't /recompile fix the server?
In some cases a script can lock the server up completely, disallowing any and all commands to be executed.
Title: Re: completely restarting server
Post by: FliesLikeABrick on December 27, 2007, 11:59:12 am
yeah, i try to sound like i know what im talkin about, but i only just started using pascal and i have no idea how to do that. it would be so much damn easier if the process didnt close

uh, you're talking about "completely restarting the server" therefore the process has to close
Title: Re: completely restarting server
Post by: chutem on December 27, 2007, 05:11:55 pm
could you start the server first, then shutdown?