diff options
author | shennetsind <ind@henn.et> | 2014-01-06 15:26:00 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2014-01-08 11:22:00 -0200 |
commit | b79a9d7efa9213e3c791ec356bf21b712878d1aa (patch) | |
tree | 043173233a97e805a49089a5ced25f213a86217f /src/map/pc.h | |
parent | 85327cde8e451b8b1bacd1f5a98c034a6f42e5ea (diff) | |
download | hercules-b79a9d7efa9213e3c791ec356bf21b712878d1aa.tar.gz hercules-b79a9d7efa9213e3c791ec356bf21b712878d1aa.tar.bz2 hercules-b79a9d7efa9213e3c791ec356bf21b712878d1aa.tar.xz hercules-b79a9d7efa9213e3c791ec356bf21b712878d1aa.zip |
Introducing Hercules Autotrade Persistency
Aka autotrading merchants survive server restarts.
Originally sekai's (aka me).
Special Thanks to Haruna, Michieru.
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/pc.h')
-rw-r--r-- | src/map/pc.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/map/pc.h b/src/map/pc.h index 5264fa557..2f143f15c 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -180,6 +180,7 @@ struct map_session_data { unsigned int snovice_call_flag : 3; //Summon Angel (stage 1~3) unsigned int hpmeter_visible : 1; unsigned int itemcheck : 1; + unsigned int standalone : 1;/* [Ind/Hercules <3] */ } state; struct { unsigned char no_weapon_damage, no_magic_damage, no_misc_damage; @@ -724,6 +725,21 @@ struct item_cd { short nameid[MAX_ITEMDELAYS];//skill id }; +enum e_pc_autotrade_update_action { + PAUC_START, + PAUC_REFRESH, + PAUC_REMOVE, +}; + +/** + * Used to temporarily remember vending data + **/ +struct autotrade_vending { + struct item list[MAX_VENDING]; + struct s_vending vending[MAX_VENDING]; + unsigned char vend_num; +}; + /*===================================== * Interface : pc.h * Generated by HerculesInterfaceMaker @@ -732,6 +748,8 @@ struct item_cd { struct pc_interface { /* */ + DBMap *at_db;/* char id -> struct autotrade_vending */ + /* */ DBMap* itemcd_db; /* */ int day_timer_tid; @@ -1000,6 +1018,15 @@ struct pc_interface { int (*expiration_timer) (int tid, int64 tick, int id, intptr_t data); int (*global_expiration_timer) (int tid, int64 tick, int id, intptr_t data); void (*expire_check) (struct map_session_data *sd); + + /** + * Autotrade persistency [Ind/Hercules <3] + **/ + void (*autotrade_load) (void); + void (*autotrade_update) (struct map_session_data *sd, enum e_pc_autotrade_update_action action); + void (*autotrade_start) (struct map_session_data *sd); + void (*autotrade_prepare) (struct map_session_data *sd); + void (*autotrade_populate) (struct map_session_data *sd); }; struct pc_interface *pc; |