1.1 --- a/update_tool/update_tool.cpp Thu Apr 05 17:51:23 2007 +0000
1.2 +++ b/update_tool/update_tool.cpp Thu Apr 05 17:56:06 2007 +0000
1.3 @@ -43,6 +43,15 @@
1.4 char gamedir[260];
1.5 char mmpath[260];
1.6
1.7 + enum RestartMode
1.8 + {
1.9 + Restart_Never,
1.10 + Restart_Error,
1.11 + Restart_Quit,
1.12 + };
1.13 +
1.14 + RestartMode mode = Restart_Error;
1.15 +
1.16 GetGameDir(gamedir, sizeof(gamedir));
1.17
1.18 /* Defaults */
1.19 @@ -111,10 +120,25 @@
1.20 input++;
1.21 }
1.22
1.23 + /* Ignore comments */
1.24 + if (key[0] == ';')
1.25 + {
1.26 + continue;
1.27 + }
1.28 +
1.29 /* The rest is our key */
1.30 if (strcmp(key, "mmpath") == 0)
1.31 {
1.32 UTIL_Format(mmpath, sizeof(mmpath), "%s", input);
1.33 + } else if (strcmp(key, "restart") == 0) {
1.34 + if (strcmp(input, "never") == 0)
1.35 + {
1.36 + mode = Restart_Never;
1.37 + } else if (strcmp(input, "error") == 0) {
1.38 + mode = Restart_Error;
1.39 + } else if (strcmp(input, "quit") == 0) {
1.40 + mode = Restart_Never;
1.41 + }
1.42 }
1.43 }
1.44 fclose(fpCfg);
1.45 @@ -266,7 +290,12 @@
1.46 }
1.47 RemoveFile(new_path);
1.48
1.49 - Error("Server is restarting to load Metamod:Source");
1.50 + if (mode == Restart_Error)
1.51 + {
1.52 + Error("Server is restarting to load Metamod:Source");
1.53 + } else if (mode == Restart_Quit) {
1.54 + ServerCommand("quit\n");
1.55 + }
1.56 }
1.57
1.58 bool RemoveFile(const char *file)