PolRestart, which should really be called EmuRestart, but there's already a program named that (which only restarts emus based on UOX, it seems. Fascinating.)

PolRestart Readme File

polRestart and winPolRestart have been coded in VC++.

They were coded by me (Richard (Shadowlord) Dillingham), but were based on code from ilaunch.cpp (from Ignition's source), and all I did was move it around, massage it, and coerce it into taking cat-naps of less than a second in between prodding your server to make sure it's alive.

I coded this for POL, but I've also tested it with Sphere 0.55i (Which likes to actually be idle every so often, hehehe. The only time POL's idle is right when it's started. :P).

If this slows down your server, yell at me on paigelore's boards. The polRestart thread DOES sleep in between prodding the server, but I could stand to increase the amount of time it sleeps. (Assuming you all don't mind your server being down longer if it crashes.)

Installation:

Place polRestart and winPolRestart in your server folder (c:\pol094, c:\sphere\, etc).

If you're using POL, there are three ways to use this program (I recommend mode 3):

1) If you want to run this 'silently' - without a console window, run winPolRestart.exe. It will start pol.exe, and if pol crashes or you close it, it will restart it within a second. To stop winPolRestart, press ctrl-alt-del, and look for "polRestart". Click 'End Task' (You'll need to do this if you want to shut down POL temporarily). If you shut down your computer, it should exit automatically.

2) If you want a separate console window for POL and this program, run polRestart.exe. You can press ctrl-c on the polRestart console window to exit it.

3) Lastly, you can run POL in the same console window as this program. If you do this, pressing ctrl-c in POL's console window will exit both POL and polRestart, while if POL crashes, polRestart will not, and will restart it immediately. To do this, run polRestart pol.exe 1

If you're using a UO server emu other than POL which uses a console window, there are still three ways to use this program:

1) If you want to run this 'silently' - without a console window, rename your server emu to Pol.exe, and run winPolRestart.exe. It will start pol.exe (which is really Sphere, or UOX, or whatever you renamed it from), and if the server crashes or you close it, winPolRestart will restart it within a second. To stop winPolRestart, press ctrl-alt-del, and look for "polRestart". Click 'End Task' (You'll need to do this if you want to shut down your server temporarily). If you shut down your computer, it should exit automatically.

2) If you want a separate console window for your server and this program, run polRestart yourServerName.exe. You can press ctrl-c on the polRestart console window to exit it.

3) Lastly, you can run your server in the same console window as this program. If you do this, pressing ctrl-c in your server's console window will exit both your server and polRestart, while if your server crashes, polRestart will not, and will restart it immediately. To do this, run polRestart yourServerName.exe 1

If you're using Sphere:

Sphere opens its own window for output, and doesn't use a standard console window at all. With sphere, mode 3 behaves like mode 2.

License:

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA