… | |
… | |
431 | void |
431 | void |
432 | emergency_save () |
432 | emergency_save () |
433 | { |
433 | { |
434 | LOG (llevDebug, "emergency save begin.\n"); |
434 | LOG (llevDebug, "emergency save begin.\n"); |
435 | |
435 | |
436 | maptile::emergency_save (); |
436 | cfperl_emergency_save (); |
437 | |
437 | |
438 | LOG (llevDebug, "saving book archive.\n"); |
438 | LOG (llevDebug, "saving book archive.\n"); |
439 | write_book_archive (); |
439 | write_book_archive (); |
440 | |
440 | |
441 | LOG (llevDebug, "emergency save done.\n"); |
441 | LOG (llevDebug, "emergency save done.\n"); |
… | |
… | |
443 | |
443 | |
444 | // send all clients some informational text |
444 | // send all clients some informational text |
445 | static void |
445 | static void |
446 | cleanup_inform (const char *cause, bool make_core) |
446 | cleanup_inform (const char *cause, bool make_core) |
447 | { |
447 | { |
|
|
448 | int flags = NDI_UNIQUE | NDI_ALL | (make_core ? NDI_RED : NDI_GREEN); |
|
|
449 | |
448 | new_draw_info_format (NDI_UNIQUE | NDI_ALL | NDI_RED, 0, 0, "The server will now shutdown.\n"); |
450 | new_draw_info_format (flags, 0, 0, "The server will now shutdown.\n"); |
449 | new_draw_info_format (NDI_UNIQUE | NDI_ALL | NDI_RED, 0, 0, "Cause for this shtudown: %s\n", cause); |
451 | new_draw_info_format (flags, 0, 0, "Cause for this shtudown: %s\n", cause); |
450 | |
452 | |
451 | if (make_core) |
453 | if (make_core) |
452 | new_draw_info_format (NDI_UNIQUE | NDI_ALL | NDI_RED, 0, 0, "This is considered a crash.\n"); |
454 | new_draw_info_format (flags, 0, 0, "This is considered a crash.\n"); |
453 | else |
455 | else |
454 | new_draw_info_format (NDI_UNIQUE | NDI_ALL | NDI_RED, 0, 0, "This is considered to be a clean shutdown.\n"); |
456 | new_draw_info_format (flags, 0, 0, "This is considered to be a clean shutdown.\n"); |
455 | |
457 | |
456 | new_draw_info_format (NDI_UNIQUE | NDI_ALL | NDI_RED, 0, 0, "%s\n", CLEANUP_MESSAGE); |
458 | new_draw_info_format (flags, 0, 0, "%s\n", CLEANUP_MESSAGE); |
457 | |
459 | |
458 | flush_sockets (); |
460 | flush_sockets (); |
459 | } |
461 | } |
460 | |
462 | |
461 | /* clean up everything before exiting */ |
463 | /* clean up everything before exiting */ |