diff options
author | Trojal <trojal@gmail.com> | 2013-01-10 20:09:39 -0800 |
---|---|---|
committer | Trojal <trojal@gmail.com> | 2013-01-10 20:32:02 -0800 |
commit | 83e7a4954437c13aec639b0b512252cc20a8f36c (patch) | |
tree | b7f6d11b2058248d026f2d9944e8f4b6ac288d50 /src/map/instance.h | |
parent | 51bfeb38eb139e97e0e1c096c85c15fba234f35b (diff) | |
parent | 38e583df21eccd9e4f31d38acaae32579c6f0d27 (diff) | |
download | hercules-83e7a4954437c13aec639b0b512252cc20a8f36c.tar.gz hercules-83e7a4954437c13aec639b0b512252cc20a8f36c.tar.bz2 hercules-83e7a4954437c13aec639b0b512252cc20a8f36c.tar.xz hercules-83e7a4954437c13aec639b0b512252cc20a8f36c.zip |
Merge rathena repository to form Hercules initial commit.
Diffstat (limited to 'src/map/instance.h')
-rw-r--r-- | src/map/instance.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/map/instance.h b/src/map/instance.h new file mode 100644 index 000000000..03b0d0898 --- /dev/null +++ b/src/map/instance.h @@ -0,0 +1,51 @@ +// Copyright (c) Athena Dev Teams - Licensed under GNU GPL +// For more information, see LICENCE in the main folder + +#ifndef _INSTANCE_H_ +#define _INSTANCE_H_ + +#define MAX_MAP_PER_INSTANCE 10 +#define MAX_INSTANCE 500 + +#define INSTANCE_NAME_LENGTH (60+1) + +typedef enum instance_state { INSTANCE_FREE, INSTANCE_IDLE, INSTANCE_BUSY } instance_state; + +struct s_instance { + char name[INSTANCE_NAME_LENGTH]; // Instance Name - required for clif functions. + instance_state state; + short instance_id; + int party_id; + + int map[MAX_MAP_PER_INSTANCE]; + int num_map; + int users; + + struct DBMap* vars; // Instance Variable for scripts + + int progress_timer; + time_t progress_timeout; + + int idle_timer; + time_t idle_timeout, idle_timeoutval; +}; + +extern int instance_start; +extern struct s_instance instance[MAX_INSTANCE]; + +int instance_create(int party_id, const char *name); +int instance_add_map(const char *name, int instance_id, bool usebasename); +void instance_del_map(int16 m); +int instance_map2imap(int16 m, int instance_id); +int instance_mapid2imapid(int16 m, int instance_id); +void instance_destroy(int instance_id); +void instance_init(int instance_id); + +void instance_check_idle(int instance_id); +void instance_check_kick(struct map_session_data *sd); +void instance_set_timeout(int instance_id, unsigned int progress_timeout, unsigned int idle_timeout); + +void do_final_instance(void); +void do_init_instance(void); + +#endif |