diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-03-08 11:45:01 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-03-08 11:45:01 -0300 |
commit | 05c1c0552fe6c94d8835a58f4608d0402614ce39 (patch) | |
tree | 25c6cddf9cd1767835266171d26d86d04882fdee /src/map/storage.h | |
parent | 36b0aad136e42687ed5f5383f8d93128d73c398b (diff) | |
download | hercules-05c1c0552fe6c94d8835a58f4608d0402614ce39.tar.gz hercules-05c1c0552fe6c94d8835a58f4608d0402614ce39.tar.bz2 hercules-05c1c0552fe6c94d8835a58f4608d0402614ce39.tar.xz hercules-05c1c0552fe6c94d8835a58f4608d0402614ce39.zip |
[TMW2] Hercules Ultimate Storage System
Diffstat (limited to 'src/map/storage.h')
-rw-r--r-- | src/map/storage.h | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/src/map/storage.h b/src/map/storage.h index 5c6152894..ec1ce4fe5 100644 --- a/src/map/storage.h +++ b/src/map/storage.h @@ -24,9 +24,12 @@ #include "common/hercules.h" #include "common/db.h" +struct config_setting_t; struct guild_storage; struct item; struct map_session_data; +struct storage_settings; +struct storage_data; /** * Acceptable values for map_session_data.state.storage_flag @@ -37,21 +40,37 @@ enum storage_flag { STORAGE_FLAG_GUILD = 2, // Guild Storage open }; +// Storage Access Modes [Smokexyz/Hercules] +enum storage_access_modes { + STORAGE_ACCESS_VIEW = 0x0, + STORAGE_ACCESS_GET = 0x1, + STORAGE_ACCESS_PUT = 0x2, + STORAGE_ACCESS_ALL = STORAGE_ACCESS_VIEW | STORAGE_ACCESS_GET | STORAGE_ACCESS_PUT +}; + struct storage_interface { + VECTOR_DECL(struct storage_settings) configuration; + void (*init) (bool minimal); + void (*final) (void); /* */ void (*reconnect) (void); + bool (*config_read) (const char *filename, bool imported); + void (*config_read_additional_fields) (struct config_setting_t *t, struct storage_settings *s_conf, const char *filename); /* */ - int (*delitem) (struct map_session_data* sd, int n, int amount); - int (*open) (struct map_session_data *sd); - int (*add) (struct map_session_data *sd,int index,int amount); - int (*get) (struct map_session_data *sd,int index,int amount); - int (*additem) (struct map_session_data* sd, struct item* item_data, int amount); - int (*addfromcart) (struct map_session_data *sd,int index,int amount); - int (*gettocart) (struct map_session_data *sd,int index,int amount); + int (*get_id_by_name) (const char *storage_name); + struct storage_data *(*ensure) (struct map_session_data *sd, int storage_id); + const struct storage_settings *(*get_settings) (int storage_id); + int (*delitem) (struct map_session_data *sd, struct storage_data *stor, int n, int amount); + int (*open) (struct map_session_data *sd, struct storage_data *stor); + int (*add) (struct map_session_data *sd, struct storage_data *stor, int index, int amount); + int (*get) (struct map_session_data *sd, struct storage_data *stor, int index, int amount); + int (*additem) (struct map_session_data *sd, struct storage_data *stor, struct item* item_data, int amount); + int (*addfromcart) (struct map_session_data *sd, struct storage_data *stor, int index,int amount); + int (*gettocart) (struct map_session_data *sd, struct storage_data *stor, int index,int amount); void (*close) (struct map_session_data *sd); void (*pc_quit) (struct map_session_data *sd, int flag); int (*comp_item) (const void *i1_, const void *i2_); - void (*sortitem) (struct item* items, unsigned int size); + void (*sortitem) (struct item *items, unsigned int size); int (*reconnect_sub) (union DBKey key, struct DBData *data, va_list ap); }; |