Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO] Fail-Safe Server Restarter


The New World
 Share

Recommended Posts

All this is, is a command within your code that will execute a batch file that will restart your server, anytime it unexpectedly crashes. :)

First off, let's build the batch file! Open NotePad, or any other text editor that allows you to save in the .bat format. Next, type in the code:

```
title "Fail-Safe Server Restarter"

:begin
Server.exe
Server.exe
goto begin
```
The line:```
title "Fail-Safe Server Restarter"
```Is completely optional.

All this script does is run your server if it's not already running, or if it stops running for any reason. To make this stop, just close the command line prompt that comes with it whilst running the script.

Now save your file with the _save as_ dialog. Save the file as "anythingyouwanttonameit".bat, obviously without the " " 's. (Quotes >_>)

Now, open up the the _Server source_!

Now you have an option, either make a button, or use my tutorial on server text commands and make a case to run the fail-safe script.

Whatever you choose, include the code:
```
Call Shell(App.Path & "\failsafe.bat")
Unload me

```
Or simply, shut down your server and run the batch file itself. :)
Link to comment
Share on other sites

Yeah, but, that's your fault if there's a critical bug in your software. :) I trust at least someone understands when to use and not to use this. It's meant for random crashes or the such whilst the server's controlling user is away. As the title says, a Fail-Safe. If it goes into that infinite loop, well you shouldn't be using this with such unstable software.
Link to comment
Share on other sites

  • 2 weeks later...
Love it, going to set it up. Could someone also please direct me to the server command topic

Also heres a more clean thing for the batch (havn't tested)
```
color 0a
@echo off
title "Fail-Safe Server Restarter"
:begin
Server.exe
Server.exe
goto begin
```
Link to comment
Share on other sites

@Craselin:

> Love it, going to set it up. Could someone also please direct me to the server command topic
>
> Also heres a more clean thing for the batch (havn't tested)
> ```
> color 0a
> @echo off
> title "Fail-Safe Server Restarter"
> :begin
> Server.exe
> Server.exe
> goto begin
> ```

It's just a small batch command, whatever works. :)

[EO Server Text Commands](http://www.touchofdeathforums.com/smf/index.php/topic,69402.0.html)

Next time check the source index.
Link to comment
Share on other sites

@Yukiyo:

> It's just a small batch command, whatever works. :)
>
> [EO Server Text Commands](http://www.touchofdeathforums.com/smf/index.php/topic,69402.0.html)
>
> Next time check the source index.

Yep will do. Also my edit stops it from saying C://windows blah blah blah. and also makes the text green MUHAHAHA
Link to comment
Share on other sites

Sorry for the double post but i just wanted to show you a revised version of the batch file
```
@echo off
color 0a
title "Fail-Safe Server Restarter"

echo Welcome to the Fail safe server restarter...
echo Opening server...
echo Server was Opened at...
time /t
echo.
Server.exe
goto loop

:loop
echo The server has crashed...
echo Reopening server...
echo Server was Reopened at...
time /t
echo.
Server.exe
goto loop
```
The difference between this code and the first one is that this one tells you the time the server was reopened, it gets rid of the C:\Users\User\Documents\eo_2_0_0\server thingy, has a welcome message and has green text!
Link to comment
Share on other sites

To quickly break this down.

```
@echo off
color 0a
title "Fail-Safe Server Restarter"

echo Welcome to the Fail safe server restarter...
echo Opening server...
echo Server was Opened at...
time /t
echo.
Server.exe
goto loop

:loop
echo The server has crashed...
echo Reopening server...
echo Server was Reopened at...
time /t
echo.
Server.exe
goto loop
```
```
@echo off
```
This makes it to where it does no print a line of text saying the location of the file.

```
color 0a
```
This makes the foreground color green.

```
title "Fail-Safe Server Restarter"
```
This renames the console window.

```
echo Welcome to the Fail safe server restarter...
echo Opening server...
echo Server was Opened at...
```
These print text to the screen.

```
:loop
```
This is a starting point for all the code underneath.

```
goto loop
```
This goes back to the loop starting point.
Link to comment
Share on other sites

  • 6 months later...
@Zarkaus:

> sad dis is useless XD… and i got a server restarter program and ill share it i guess

Just because it's useless for you doesn't make it generally useless. >_>

@Kocho:

> Does it work if I have a runtime error 9 and the server has a crash?
>
> until we find a solution, I always get this error and my game is online

Because of the nature of messageboxes, no, unless if you add something that spams out enter, whilist no button on the server is focused…not sure if batch files can do that.

Simply do what I do, add a form of server-side errorhandler that adds the error to a log, sends a messagebox to the player explaining the crash, and telling them that the server will auto-reboot, and then directly end the server, and then this will promptly reboot itself.
Link to comment
Share on other sites

  • 2 weeks later...
@Kocho:

> Does it work if I have a runtime error 9 and the server has a crash?
>
> until we find a solution, I always get this error and my game is online

You might be able to find a way to stop this error from appearing and instead just closes the server and saves the error data to a txt? If I find anything I'll tell you :)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...