summaryrefslogtreecommitdiff
path: root/src/char/char.h
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/char.h
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/char.h')
-rw-r--r--src/char/char.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/char/char.h b/src/char/char.h
index 499b633f7..6b081e536 100644
--- a/src/char/char.h
+++ b/src/char/char.h
@@ -139,7 +139,8 @@ struct char_interface {
void (*set_all_offline_sql) (void);
struct DBData (*create_charstatus) (union DBKey key, va_list args);
int (*mmo_char_tosql) (int char_id, struct mmo_charstatus* p);
- int (*memitemdata_to_sql) (const struct item items[], int max, int id, int tableswitch);
+ int (*getitemdata_from_sql) (struct item *items, int max, int guid, enum inventory_table_type table);
+ int (*memitemdata_to_sql) (const struct item items[], int id, enum inventory_table_type table);
int (*mmo_gender) (const struct char_session_data *sd, const struct mmo_charstatus *p, char sex);
int (*mmo_chars_fromsql) (struct char_session_data* sd, uint8* buf);
int (*mmo_char_fromsql) (int char_id, struct mmo_charstatus* p, bool load_everything);