Restart()

Archive of the older Feature Request Forum Posts

Moderator: POL Developer

Locked
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Restart()

Post by Tomi »

a Restart() function similar to Shutdown() so you can control ingame if you want to restart or shutdown the server.

I know many ways of getting the server to easily do a restart with services and such, but that breaks the shutdown.

Only thinkable way to do this atm. for a real ingame function is having AUX connection connecting to a 3rd party program and having that program start the pol.exe again.
User avatar
ELSoft
Journeyman Poster
Posts: 61
Joined: Sun Jun 18, 2006 7:45 pm

Re: Restart()

Post by ELSoft »

Great Idea !
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: Restart()

Post by Austin »

The closest you will get is ReloadConfiguration() and UnloadScripts()
For a program to exit, and restart its self - some other program or script must be in between to do the restarting.

Most Windows users run POL inside a batch file that automatically restarts POL if it ever quits. There are many examples around, such as

Code: Select all

:POL
pol.exe
goto POL
It will stop at pol.exe until that exe completes.
User avatar
itec
Novice Poster
Posts: 42
Joined: Thu Feb 09, 2006 11:48 pm
Location: Finland

Re: Restart()

Post by itec »

I would like to point out this suggestion http://forums.polserver.com/viewtopic.php?f=4&t=2165

It's probably much easier to engineer this than the suggested above. Only thing needed is to use batch errorlevels and the batch handles the restart or shutdown. And you could even control all kinds of other stuff from ingame, like using uoconvert.

Pol.bat could be something like this:

Code: Select all

:Start
Pol.exe
IF ERRORLEVEL 1 GOTO Start
IF ERRORLEVEL 2 GOTO Shutdown
IF ERRORLEVEL 3 GOTO Convert

:Convert
uoconvert.exe
Goto Start

:Shutdown
Only thing needed from Pol, is for Shutdown() to take parameter and return it to the system.
Nando
POL Developer
Posts: 282
Joined: Wed Sep 17, 2008 6:53 pm
Contact:

Re: Restart()

Post by Nando »

itec wrote:I would like to point out this suggestion http://forums.polserver.com/viewtopic.php?f=4&t=2165

It's probably much easier to engineer this than the suggested above. Only thing needed is to use batch errorlevels and the batch handles the restart or shutdown. And you could even control all kinds of other stuff from ingame, like using uoconvert.

...

Only thing needed from Pol, is for Shutdown() to take parameter and return it to the system.
Gosh, you read my mind! :)

Been thinking about this idea lately, and it'd be lot easier to implement different return values for shutdown() than making restart(). If you don't plan beforehand, a restart can be VERY difficult to implement. Many things are only cleaned when shutting down, by their destructor. With shutdown(x), you could build smart tools like this you said.
Locked