From 0318763bacdcd0f521ef61f837f50ddb9483a434 Mon Sep 17 00:00:00 2001 From: skotlex Date: Thu, 13 Jul 2006 17:05:48 +0000 Subject: - Changed the default save interval to 5 minutes. Added support for specifying fixed save-intervals by using negative values. EG: - Save interval set to 300 (5 minutes): all characters will be saved in equal time-slots, so that everyone is saved every 5 minutes regardless of number of players online. - Save interval set to -1000 (1000 ms): One character will be saved every second, regardless of amount of characters online. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7657 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/map.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/map/map.c') diff --git a/src/map/map.c b/src/map/map.c index 253ffe9bf..15a41f4c1 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -3292,9 +3292,13 @@ int map_config_read(char *cfgName) { } else if (strcmpi(w1, "delnpc") == 0) { npc_delsrcfile(w2); } else if (strcmpi(w1, "autosave_time") == 0) { - autosave_interval = atoi(w2) * 1000; - if (autosave_interval <= 0) + autosave_interval = atoi(w2); + if (!autosave_interval) //Revert to default saving. autosave_interval = DEFAULT_AUTOSAVE_INTERVAL; + else if (autosave_interval > 0) //Pass from MS to seconds + autosave_interval *= 1000; + else if (autosave_interval > -100) //Use lower cap of 100ms + autosave_interval = -100; } else if (strcmpi(w1, "save_settings") == 0) { save_settings = atoi(w2); } else if (strcmpi(w1, "motd_txt") == 0) { -- cgit v1.2.3-60-g2f50