diff options
author | shennetsind <ind@henn.et> | 2013-06-20 16:32:47 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-06-20 16:32:47 -0300 |
commit | 0f7c29113d7d898150108d66d1358f15bb018e0a (patch) | |
tree | 7860de32323fcad0dc9519e0cd7b877d2172aac8 /src/map/storage.h | |
parent | c461dc00be5182be312b04b0e0cb87b37874e02c (diff) | |
download | hercules-0f7c29113d7d898150108d66d1358f15bb018e0a.tar.gz hercules-0f7c29113d7d898150108d66d1358f15bb018e0a.tar.bz2 hercules-0f7c29113d7d898150108d66d1358f15bb018e0a.tar.xz hercules-0f7c29113d7d898150108d66d1358f15bb018e0a.zip |
Hercules Renewal Phase One: storage.c
2 new interfaces:
- storage
- gstorage
http://hercules.ws/board/topic/237-hercules-renewal/
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/storage.h')
-rw-r--r-- | src/map/storage.h | 69 |
1 files changed, 40 insertions, 29 deletions
diff --git a/src/map/storage.h b/src/map/storage.h index c08ec81cb..058b980b1 100644 --- a/src/map/storage.h +++ b/src/map/storage.h @@ -1,41 +1,52 @@ -// Copyright (c) Athena Dev Teams - Licensed under GNU GPL -// For more information, see LICENCE in the main folder +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. +// See the LICENSE file +// Portions Copyright (c) Athena Dev Teams #ifndef _STORAGE_H_ #define _STORAGE_H_ -//#include "../common/mmo.h" struct storage_data; struct guild_storage; struct item; -//#include "map.h" struct map_session_data; -int storage_delitem(struct map_session_data* sd, int n, int amount); -int storage_storageopen(struct map_session_data *sd); -int storage_storageadd(struct map_session_data *sd,int index,int amount); -int storage_storageget(struct map_session_data *sd,int index,int amount); -int storage_storageaddfromcart(struct map_session_data *sd,int index,int amount); -int storage_storagegettocart(struct map_session_data *sd,int index,int amount); -void storage_storageclose(struct map_session_data *sd); -int do_init_storage(void); -void do_final_storage(void); -void do_reconnect_storage(void); -void storage_storage_quit(struct map_session_data *sd, int flag); +struct storage_interface { + int (*init) (void); + void (*final) (void); + /* */ + void (*reconnect) (void); + /* */ + 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 (*addfromcart) (struct map_session_data *sd,int index,int amount); + int (*gettocart) (struct map_session_data *sd,int index,int amount); + void (*close) (struct map_session_data *sd); + void (*pc_quit) (struct map_session_data *sd, int flag); +} storage_s; +struct storage_interface *storage; -struct guild_storage* guild2storage(int guild_id); -struct guild_storage *guild2storage2(int guild_id); -int guild_storage_delete(int guild_id); -int storage_guild_storageopen(struct map_session_data *sd); -int guild_storage_additem(struct map_session_data *sd,struct guild_storage *stor,struct item *item_data,int amount); -int guild_storage_delitem(struct map_session_data *sd,struct guild_storage *stor,int n,int amount); -int storage_guild_storageadd(struct map_session_data *sd,int index,int amount); -int storage_guild_storageget(struct map_session_data *sd,int index,int amount); -int storage_guild_storageaddfromcart(struct map_session_data *sd,int index,int amount); -int storage_guild_storagegettocart(struct map_session_data *sd,int index,int amount); -int storage_guild_storageclose(struct map_session_data *sd); -int storage_guild_storage_quit(struct map_session_data *sd,int flag); -int storage_guild_storagesave(int account_id, int guild_id, int flag); -int storage_guild_storagesaved(int guild_id); //Ack from char server that guild store was saved. +struct guild_storage_interface { + struct guild_storage *(*id2storage) (int guild_id); + struct guild_storage *(*id2storage2) (int guild_id); + int (*delete) (int guild_id); + int (*open) (struct map_session_data *sd); + int (*additem) (struct map_session_data *sd,struct guild_storage *stor,struct item *item_data,int amount); + int (*delitem) (struct map_session_data *sd,struct guild_storage *stor,int n,int amount); + int (*add) (struct map_session_data *sd,int index,int amount); + int (*get) (struct map_session_data *sd,int index,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 (*close) (struct map_session_data *sd); + int (*pc_quit) (struct map_session_data *sd,int flag); + int (*save) (int account_id, int guild_id, int flag); + int (*saved) (int guild_id); //Ack from char server that guild store was saved. +} gstorage_s; + +struct guild_storage_interface *gstorage; + +void storage_defaults(void); +void gstorage_defaults(void); #endif /* _STORAGE_H_ */ |