ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/init.C
(Generate patch)

Comparing deliantra/server/server/init.C (file contents):
Revision 1.16 by pippijn, Mon Dec 11 19:46:47 2006 UTC vs.
Revision 1.21 by root, Wed Dec 20 09:14:22 2006 UTC

760 else 760 else
761 { 761 {
762 LOG (llevError, "load_settings: Unknown value for " "real_wiz: %s\n", cp); 762 LOG (llevError, "load_settings: Unknown value for " "real_wiz: %s\n", cp);
763 } 763 }
764 } 764 }
765 else if (!strcasecmp (buf, "recycle_tmp_maps"))
766 {
767 if (!strcasecmp (cp, "on") || !strcasecmp (cp, "true"))
768 {
769 settings.recycle_tmp_maps = TRUE;
770 }
771 else if (!strcasecmp (cp, "off") || !strcasecmp (cp, "false"))
772 {
773 settings.recycle_tmp_maps = FALSE;
774 }
775 else
776 {
777 LOG (llevError, "load_settings: Unknown value for " "recycle_tmp_maps: %s\n", cp);
778 }
779 }
780 else if (!strcasecmp (buf, "explore_mode")) 765 else if (!strcasecmp (buf, "explore_mode"))
781 { 766 {
782 if (!strcasecmp (cp, "on") || !strcasecmp (cp, "true")) 767 if (!strcasecmp (cp, "on") || !strcasecmp (cp, "true"))
783 { 768 {
784 settings.explore_mode = TRUE; 769 settings.explore_mode = TRUE;
789 } 774 }
790 else 775 else
791 { 776 {
792 LOG (llevError, "load_settings: Unknown value for " "explore_mode: %s\n", cp); 777 LOG (llevError, "load_settings: Unknown value for " "explore_mode: %s\n", cp);
793 } 778 }
794 }
795 else if (!strcasecmp (buf, "who_format"))
796 {
797 if (has_val)
798 strcpy (settings.who_format, cp);
799 }
800 else if (!strcasecmp (buf, "who_wiz_format"))
801 {
802 if (has_val)
803 strcpy (settings.who_wiz_format, cp);
804 } 779 }
805 else if (!strcasecmp (buf, "spellpoint_level_depend")) 780 else if (!strcasecmp (buf, "spellpoint_level_depend"))
806 { 781 {
807 if (!strcasecmp (cp, "on") || !strcasecmp (cp, "true")) 782 if (!strcasecmp (cp, "on") || !strcasecmp (cp, "true"))
808 { 783 {
1019 else 994 else
1020 { 995 {
1021 LOG (llevError, "Unknown value in settings file: %s\n", buf); 996 LOG (llevError, "Unknown value in settings file: %s\n", buf);
1022 } 997 }
1023 } 998 }
999
1024 close_and_delete (fp, comp); 1000 close_and_delete (fp, comp);
1025} 1001}
1026 1002
1027 1003
1028/* 1004/*
1262/* Signal handlers: */ 1238/* Signal handlers: */
1263 1239
1264void 1240void
1265rec_sigsegv (int i) 1241rec_sigsegv (int i)
1266{ 1242{
1267 LOG (llevError, "\nSIGSEGV received.\n"); 1243 LOG (llevError, "SIGSEGV received.\n");
1268 fatal_signal (1, 1); 1244 fatal_signal (1, 1);
1269} 1245}
1270 1246
1271void 1247void
1272rec_sigint (int i) 1248rec_sigint (int i)
1273{ 1249{
1274 LOG (llevInfo, "\nSIGINT received.\n"); 1250 LOG (llevInfo, "SIGINT received.\n");
1275 fatal_signal (0, 1); 1251 fatal_signal (0, 1);
1276} 1252}
1277 1253
1278void 1254void
1279rec_sighup (int i) 1255rec_sighup (int i)
1280{ 1256{
1281 LOG (llevInfo, "\nSIGHUP received\n"); 1257 LOG (llevInfo, "SIGHUP received\n");
1258
1282 if (init_done) 1259 if (init_done)
1283 {
1284 emergency_save (0);
1285 cleanup (); 1260 cleanup ();
1286 } 1261
1287 exit (0); 1262 exit (0);
1288} 1263}
1289 1264
1290void 1265void
1291rec_sigquit (int i) 1266rec_sigquit (int i)
1292{ 1267{
1293 LOG (llevInfo, "\nSIGQUIT received\n"); 1268 LOG (llevInfo, "SIGQUIT received\n");
1294 fatal_signal (1, 1); 1269 fatal_signal (1, 1);
1295} 1270}
1296 1271
1297void 1272void
1298rec_sigbus (int i) 1273rec_sigbus (int i)
1299{ 1274{
1300#ifdef SIGBUS 1275#ifdef SIGBUS
1301 LOG (llevError, "\nSIGBUS received\n"); 1276 LOG (llevError, "SIGBUS received\n");
1302 fatal_signal (1, 1); 1277 fatal_signal (1, 1);
1303#endif 1278#endif
1304} 1279}
1305 1280
1306void 1281void
1307rec_sigterm (int i) 1282rec_sigterm (int i)
1308{ 1283{
1309 LOG (llevInfo, "\nSIGTERM received\n"); 1284 LOG (llevInfo, "SIGTERM received\n");
1310 fatal_signal (0, 1); 1285 fatal_signal (0, 1);
1311} 1286}
1312 1287
1313void 1288void
1314fatal_signal (int make_core, int close_sockets) 1289fatal_signal (int make_core, int close_sockets)
1315{ 1290{
1316 if (init_done) 1291 cleanup (make_core);
1317 {
1318 emergency_save (0);
1319 clean_tmp_files ();
1320 }
1321 if (make_core)
1322 abort ();
1323 exit (0);
1324} 1292}
1325 1293
1326void 1294void
1327init_signals (void) 1295init_signals (void)
1328{ 1296{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines