summaryrefslogtreecommitdiff
path: root/src/char/int_storage.c
diff options
context:
space:
mode:
authorsmokexyz <sagunkho@hotmail.com>2017-06-03 16:39:34 +0800
committerSmokexyz <sagunkho@hotmail.com>2017-07-05 23:00:58 +0530
commit7a2447204644b53e64a730c9c8428cc5b33f5aa2 (patch)
tree284e042b6b0bc3f819301fd47281a411f2670a1a /src/char/int_storage.c
parentd2af893049845c4be0710f8939d09ba87485dddc (diff)
downloadhercules-7a2447204644b53e64a730c9c8428cc5b33f5aa2.tar.gz
hercules-7a2447204644b53e64a730c9c8428cc5b33f5aa2.tar.bz2
hercules-7a2447204644b53e64a730c9c8428cc5b33f5aa2.tar.xz
hercules-7a2447204644b53e64a730c9c8428cc5b33f5aa2.zip
Optimisation of char_memitemdata_to_sql()
Implements the storage saving algorithm for inventory, cart and guild storage tables. Total queries to a table in any call would be no more than 4 per call, replacing the original algorithm that could make a lot more through single update queries per call. This significantly reduces the run time speed for saving/loading of item data from the game server.
Diffstat (limited to 'src/char/int_storage.c')
-rw-r--r--src/char/int_storage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/char/int_storage.c b/src/char/int_storage.c
index 65301127f..aafba8520 100644
--- a/src/char/int_storage.c
+++ b/src/char/int_storage.c
@@ -238,7 +238,7 @@ int inter_storage_fromsql(int account_id, struct storage_data *p)
int inter_storage_guild_storage_tosql(int guild_id, const struct guild_storage *p)
{
nullpo_ret(p);
- chr->memitemdata_to_sql(p->items, MAX_GUILD_STORAGE, guild_id, TABLE_GUILD_STORAGE);
+ chr->memitemdata_to_sql(p->items, guild_id, TABLE_GUILD_STORAGE);
ShowInfo ("guild storage save to DB - guild: %d\n", guild_id);
return 0;
}