From 7a2447204644b53e64a730c9c8428cc5b33f5aa2 Mon Sep 17 00:00:00 2001 From: smokexyz Date: Sat, 3 Jun 2017 16:39:34 +0800 Subject: 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. --- src/char/char.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/char/char.h') 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); -- cgit v1.2.3-60-g2f50