diff options
author | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-08-12 21:44:02 +0000 |
---|---|---|
committer | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-08-12 21:44:02 +0000 |
commit | 09e154b0687a2ba69d5ce6f2456c61db86bc4dec (patch) | |
tree | 6be18bd056964352e036afef8c36c860c0ff52af /src/map/map.h | |
parent | 653c88c4f1bf019f61132324fd7146ae2f858cec (diff) | |
download | hercules-09e154b0687a2ba69d5ce6f2456c61db86bc4dec.tar.gz hercules-09e154b0687a2ba69d5ce6f2456c61db86bc4dec.tar.bz2 hercules-09e154b0687a2ba69d5ce6f2456c61db86bc4dec.tar.xz hercules-09e154b0687a2ba69d5ce6f2456c61db86bc4dec.zip |
- Optimization to instance system.
* Removed the crc feature to generate instance npc names. The instance npc name will be "dup_" + instanceid + "_" + srcnpcid.
* Removed the big array under map structure and coded in a different way. It was only used to generate map names, but i just used the instance_id + "origin map name".
* Moved all instance features to separated files.
* Moved the npc duplication for instances into npc.c as Ultramage says (removed npcname_db from npc.h).
* Added recomendations for scripts commands by Saithis.
- Testing required, i will prepare Endless Tower script soon. I hope this do almost anything in bugreport 3276.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14003 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/map.h')
-rw-r--r-- | src/map/map.h | 40 |
1 files changed, 5 insertions, 35 deletions
diff --git a/src/map/map.h b/src/map/map.h index 8e02becbd..a5a9ac03d 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -45,8 +45,6 @@ struct item_data; #define MAX_IGNORE_LIST 20 // official is 14 #define MAX_VENDING 12 #define MOBID_EMPERIUM 1288 -#define MAX_MAP_PER_INSTANCE 10 -#define MAX_INSTANCE 500 //The following system marks a different job ID system used by the map server, //which makes a lot more sense than the normal one. [Skotlex] @@ -463,6 +461,7 @@ struct map_data { unsigned nochat :1; unsigned partylock :1; unsigned guildlock :1; + unsigned src4instance : 1; // To flag this map when it's used as a src map for instances } flag; struct point save; struct npc_data *npc[MAX_NPC_PER_MAP]; @@ -478,8 +477,9 @@ struct map_data { int jexp; // map experience multiplicator int bexp; // map experience multiplicator int nocommand; //Blocks @/# commands for non-gms. [Skotlex] + // Instance Variables int instance_id; - int instance_map[1000]; + int instance_src_map; }; /// Stores information about a remote map (for multi-mapserver setups). @@ -492,22 +492,6 @@ struct map_data_other_server { uint16 port; }; -// Instancing -struct map_instance { - char name[61]; - unsigned int name_id; -// int m; - unsigned int instance_id; - int party_id; - int map[MAX_MAP_PER_INSTANCE]; - int num_map; - struct linkdb_node *ivar, *svar; - time_t progress_timeout, idle_timeout; - time_t progress_timeoutval, idle_timeoutval; - int progress_timer, idle_timer; - int users; -}; - int map_getcell(int,int,int,cell_chk); int map_getcellp(struct map_data*,int,int,cell_chk); void map_setcell(int m, int x, int y, cell_t cell, bool flag); @@ -515,7 +499,6 @@ void map_setgatcell(int m, int x, int y, int gat); extern struct map_data map[]; extern int map_num; -extern int map_instance_start; extern int autosave_interval; extern int minsave_interval; @@ -637,21 +620,8 @@ int map_addmobtolist(unsigned short m, struct spawn_data *spawn); // [Wizputer] void map_spawnmobs(int); // [Wizputer] void map_removemobs(int); // [Wizputer] void do_reconnect_map(void); //Invoked on map-char reconnection [Skotlex] - -// Instancing -int map_instance_map(const char *name, int instance_id); -void map_instance_del(int m); -int map_instance_create(int party_id, int name_id, const char *name); -void map_instance_init(int instance_id); -int map_instance_mapid2imapid(int m, int instance_id); -int map_instance_map2imap(int m, struct map_session_data *sd, int type); -void map_instance_destroy(int instance_id); -void map_instance_check_idle(int instance_id); -void map_instance_check_kick(struct map_session_data *sd); -char *map_instance_npcname(char *name, int instance_id); -void map_instance_set_timeout(int instance_id, unsigned int progress_timeout, unsigned int idle_timeout); - -extern struct map_instance instance[MAX_INSTANCE]; +void map_addmap2db(struct map_data *m); +void map_removemapdb(struct map_data *m); extern char *INTER_CONF_NAME; extern char *LOG_CONF_NAME; |