summaryrefslogtreecommitdiff
path: root/src/char/int_storage.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-05-31 02:28:06 +0200
committerHaru <haru@dotalux.com>2017-05-31 02:34:10 +0200
commit4b208e41d1d5cc995c2816e8f34c1ad8b0a7327d (patch)
tree5359f1cef645f89bfdd7d783b8e4d1176e192c5d /src/char/int_storage.h
parentb950a589e59e2bf074f67c75aaacf3f82424d4fe (diff)
downloadhercules-4b208e41d1d5cc995c2816e8f34c1ad8b0a7327d.tar.gz
hercules-4b208e41d1d5cc995c2816e8f34c1ad8b0a7327d.tar.bz2
hercules-4b208e41d1d5cc995c2816e8f34c1ad8b0a7327d.tar.xz
hercules-4b208e41d1d5cc995c2816e8f34c1ad8b0a7327d.zip
Fix a race condition when saving the storage on logout
The storage data is no longer cached in the char server. This removal doesn't cause any performance loss, since the cached data was refreshed (loaded from the database) after every save operation. This commit moves the load at the beginning of the save rather than at the end, and discars the cached copy after the save is completed. Related to #1754 Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/char/int_storage.h')
-rw-r--r--src/char/int_storage.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/char/int_storage.h b/src/char/int_storage.h
index 746629421..46bb6910f 100644
--- a/src/char/int_storage.h
+++ b/src/char/int_storage.h
@@ -31,20 +31,13 @@ struct guild_storage;
* inter_storage interface
**/
struct inter_storage_interface {
- /* */
- struct DBMap *account_storage;
- /* */
- /* */
- struct DBData (*ensure_account_storage) (union DBKey key, va_list args);
- int (*clear_account_storage) (union DBKey key, struct DBData *data, va_list args);
- int (*tosql) (int account_id, struct storage_data *cp, const struct storage_data *p);
+ int (*tosql) (int account_id, const struct storage_data *p);
int (*fromsql) (int account_id, struct storage_data *p);
int (*guild_storage_tosql) (int guild_id, const struct guild_storage *p);
int (*guild_storage_fromsql) (int guild_id, struct guild_storage* p);
int (*sql_init) (void);
void (*sql_final) (void);
int (*delete_) (int account_id);
- void (*delete_account_storage) (int account_id);
int (*guild_storage_delete) (int guild_id);
int (*parse_frommap) (int fd);
};