[6830] Implement custom exit codes on server shutdown/restart
commit1b056e9b63cc789a0b7757f395a44d94ef7a82e9
authorfreghar <compmancz@gmail.com>
Wed, 12 Nov 2008 20:09:56 +0000 (12 21:09 +0100)
committerVladimirMangos <vladimir@getmangos.com>
Sun, 16 Nov 2008 12:00:30 +0000 (16 15:00 +0300)
tree59b53af7a0c7a4784bc7998f67d3d812f96bc4a6
parent93519a34be107b1bd36f2d2fe8af3c03f42bf1f9
[6830] Implement custom exit codes on server shutdown/restart

Added the possibility to use custom process return values
instead of hardcoded 0 (shutdown) or 2 (restart) to allow using them
for various custom external features / better handling.

This can be used through 4 commands in ".server" family:
 - shutdown
 - restart
 - idleshutdown
 - idlerestart

Those have from now on 2 arguments, where the second (return value)
is optional:

.server <command> <time> [return_value]

If return_value is not specified, default value (0 or 2) is used.

Signed-off-by: freghar <compmancz@gmail.com>
Set restart exist code for SIGINT singnal case.
Some code simplifications for original patch.
Related code cleanups.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
src/game/Level3.cpp
src/game/ObjectMgr.cpp
src/game/World.cpp
src/game/World.h
src/mangosd/CliRunnable.cpp
src/mangosd/Master.cpp
src/mangosd/WorldRunnable.cpp
src/shared/revision_nr.h