summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParadox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-10-11 03:46:06 +0000
committerParadox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-10-11 03:46:06 +0000
commit61ae7c610edea81a54ca2f98164cd04a9687f2c9 (patch)
tree568f568c217e2a73efe72f8f22a918030d5e82bf
parent7b076f97d6ec20013881f44a2a272f4572da2d24 (diff)
downloadhercules-61ae7c610edea81a54ca2f98164cd04a9687f2c9.tar.gz
hercules-61ae7c610edea81a54ca2f98164cd04a9687f2c9.tar.bz2
hercules-61ae7c610edea81a54ca2f98164cd04a9687f2c9.tar.xz
hercules-61ae7c610edea81a54ca2f98164cd04a9687f2c9.zip
Applied Ai4rei's patch to eliminate unnecessary and redundant castle data saving. (bugreport:4471)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14420 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt1
-rw-r--r--src/map/guild.c34
2 files changed, 1 insertions, 34 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 245268a88..f1653fecd 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2010/10/10
+ * Applied Ai4rei's patch to eliminate unnecessary and redundant castle data saving. (bugreport:4471) [Paradox924X]
* Added a missing const qualifier to a variable. (bugreport:4472) [Paradox924X]
* Rev. 14418 Follow up from r14413, should take care of the errors from bugreport:4472. [L0ne_W0lf]
* Pull `name` from character table instead of using `master` from guild table when loading guild data. [Paradox924X]
diff --git a/src/map/guild.c b/src/map/guild.c
index 73d209653..b89e1a368 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -61,13 +61,7 @@ struct{
}need[6];
} guild_skill_tree[MAX_GUILDSKILL];
-// timer for auto saving guild data during WoE
-#define GUILD_SAVE_INTERVAL 300000
-int guild_save_timer = INVALID_TIMER;
-int guild_save_timer2 = INVALID_TIMER;
-
int guild_payexp_timer(int tid, unsigned int tick, int id, intptr data);
-int guild_save_sub(int tid, unsigned int tick, int id, intptr data);
static int guild_send_xy_timer(int tid, unsigned int tick, int id, intptr data);
/*==========================================
@@ -1896,8 +1890,6 @@ int guild_agit_start(void)
{ // Run All NPC_Event[OnAgitStart]
int c = npc_event_doall("OnAgitStart");
ShowStatus("NPC_Event:[OnAgitStart] Run (%d) Events by @AgitStart.\n",c);
- // Start auto saving
- guild_save_timer = add_timer_interval (gettick() + GUILD_SAVE_INTERVAL, guild_save_sub, 0, 0, GUILD_SAVE_INTERVAL);
return 0;
}
@@ -1905,8 +1897,6 @@ int guild_agit_end(void)
{ // Run All NPC_Event[OnAgitEnd]
int c = npc_event_doall("OnAgitEnd");
ShowStatus("NPC_Event:[OnAgitEnd] Run (%d) Events by @AgitEnd.\n",c);
- // Stop auto saving
- delete_timer (guild_save_timer, guild_save_sub);
return 0;
}
@@ -1914,8 +1904,6 @@ int guild_agit2_start(void)
{ // Run All NPC_Event[OnAgitStart2]
int c = npc_event_doall("OnAgitStart2");
ShowStatus("NPC_Event:[OnAgitStart2] Run (%d) Events by @AgitStart2.\n",c);
- // Start auto saving
- guild_save_timer2 = add_timer_interval (gettick() + GUILD_SAVE_INTERVAL, guild_save_sub, 0, 0, GUILD_SAVE_INTERVAL);
return 0;
}
@@ -1923,27 +1911,6 @@ int guild_agit2_end(void)
{ // Run All NPC_Event[OnAgitEnd2]
int c = npc_event_doall("OnAgitEnd2");
ShowStatus("NPC_Event:[OnAgitEnd2] Run (%d) Events by @AgitEnd2.\n",c);
- // Stop auto saving
- delete_timer (guild_save_timer2, guild_save_sub);
- return 0;
-}
-
-int guild_save_sub(int tid, unsigned int tick, int id, intptr data)
-{
- static int Gid[MAX_GUILDCASTLE]; // previous owning guild
- struct guild_castle *gc;
- int i;
-
- for(i = 0; i < MAX_GUILDCASTLE; i++) { // [Yor]
- gc = guild_castle_search(i);
- if (!gc) continue;
- if (gc->guild_id != Gid[i]) {
- // Re-save guild id if its owner guild has changed
- guild_castledatasave(gc->castle_id, 1, gc->guild_id);
- Gid[i] = gc->guild_id;
- }
- }
-
return 0;
}
@@ -2008,7 +1975,6 @@ void do_init_guild(void)
guild_read_guildskill_tree_db(); //guild skill tree [Komurka]
add_timer_func_list(guild_payexp_timer,"guild_payexp_timer");
- add_timer_func_list(guild_save_sub, "guild_save_sub");
add_timer_func_list(guild_send_xy_timer, "guild_send_xy_timer");
add_timer_interval(gettick()+GUILD_PAYEXP_INVERVAL,guild_payexp_timer,0,0,GUILD_PAYEXP_INVERVAL);
add_timer_interval(gettick()+GUILD_SEND_XY_INVERVAL,guild_send_xy_timer,0,0,GUILD_SEND_XY_INVERVAL);