diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-07-13 17:05:48 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-07-13 17:05:48 +0000 |
commit | 0318763bacdcd0f521ef61f837f50ddb9483a434 (patch) | |
tree | 9c9b2605b677093a3363da602f4fd392c4fa68bb /src/map/pc.c | |
parent | 81fe0ffc594681ce2fe497b6e23bcc9005ec87b9 (diff) | |
download | hercules-0318763bacdcd0f521ef61f837f50ddb9483a434.tar.gz hercules-0318763bacdcd0f521ef61f837f50ddb9483a434.tar.bz2 hercules-0318763bacdcd0f521ef61f837f50ddb9483a434.tar.xz hercules-0318763bacdcd0f521ef61f837f50ddb9483a434.zip |
- 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
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index ebe80b90c..edd95ae8a 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -7095,6 +7095,9 @@ int pc_autosave(int tid,unsigned int tick,int id,int data) if(save_flag==0) last_save_fd=0; + if (autosave_interval < 0) + return 0; //Fixed interval for saving. [Skotlex] + interval = autosave_interval/(clif_countusers()+1); if(interval <= 0) interval = 1; @@ -7510,7 +7513,11 @@ int do_init_pc(void) { add_timer_func_list(pc_follow_timer, "pc_follow_timer"); natural_heal_prev_tick = gettick(); add_timer_interval(natural_heal_prev_tick + NATURAL_HEAL_INTERVAL, pc_natural_heal, 0, 0, NATURAL_HEAL_INTERVAL); - add_timer(gettick() + autosave_interval, pc_autosave, 0, 0); + + if (autosave_interval > 0) //Normal saving. + add_timer(gettick() + autosave_interval, pc_autosave, 0, 0); + else //Constant save interval. + add_timer_interval(gettick() -autosave_interval, pc_autosave, 0, 0, -autosave_interval); if (battle_config.day_duration > 0 && battle_config.night_duration > 0) { int day_duration = battle_config.day_duration; |