diff options
Diffstat (limited to 'src')
184 files changed, 2485 insertions, 2022 deletions
diff --git a/src/char/HPMchar.c b/src/char/HPMchar.c index 4b153b244..2d4c570d7 100644 --- a/src/char/HPMchar.c +++ b/src/char/HPMchar.c @@ -5,26 +5,49 @@ #include "HPMchar.h" -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> - -#include "../common/HPM.h" -#include "../common/cbasetypes.h" -#include "../common/conf.h" -#include "../common/db.h" -#include "../common/des.h" -#include "../common/ers.h" -#include "../common/malloc.h" -#include "../common/mapindex.h" -#include "../common/mmo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/sysinfo.h" - -#include "../common/HPMDataCheck.h" +#include "common/HPM.h" +#include "common/cbasetypes.h" + +#if 0 // TODO (HPMDataCheck is disabled for the time being) +#include "char/char.h" +#include "char/geoip.h" +#include "char/inter.h" +#include "char/int_auction.h" +#include "char/int_elemental.h" +#include "char/int_guild.h" +#include "char/int_homun.h" +#include "char/int_mail.h" +#include "char/int_mercenary.h" +#include "char/int_party.h" +#include "char/int_pet.h" +#include "char/int_quest.h" +#include "char/int_storage.h" +#include "char/loginif.h" +#include "char/mapif.h" +#include "char/pincode.h" +#include "common/HPMi.h" +#include "common/conf.h" +#include "common/console.h" +#include "common/core.h" +#include "common/db.h" +#include "common/des.h" +#include "common/ers.h" +#include "common/malloc.h" +#include "common/mapindex.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/spinlock.h" +#include "common/sql.h" +#include "common/strlib.h" +#include "common/sysinfo.h" +#include "common/timer.h" +#include "common/utils.h" + +// HPMDataCheck comes after all the other includes +#include "common/HPMDataCheck.h" +#endif bool HPM_char_grabHPData(struct HPDataOperationStorage *ret, enum HPluginDataTypes type, void *ptr) { /* record address */ diff --git a/src/char/HPMchar.h b/src/char/HPMchar.h index aa266f1de..594bb7f00 100644 --- a/src/char/HPMchar.h +++ b/src/char/HPMchar.h @@ -8,8 +8,8 @@ #error You should never include HPMchar.h from a plugin. #endif -#include "../common/cbasetypes.h" -#include "../common/HPM.h" +#include "common/cbasetypes.h" +#include "common/HPM.h" struct hplugin; diff --git a/src/char/Makefile.in b/src/char/Makefile.in index 20d19966e..035dbf711 100644 --- a/src/char/Makefile.in +++ b/src/char/Makefile.in @@ -9,18 +9,20 @@ CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h) COMMON_D = ../common COMMON_H = $(wildcard $(COMMON_D)/*.h) SYSINFO_INC = $(COMMON_D)/sysinfo.inc +COMMON_INCLUDE = -I.. -LIBCONFIG_D = ../../3rdparty/libconfig +THIRDPARTY_D = ../../3rdparty +THIRDPARTY_INCLUDE = -I$(THIRDPARTY_D) + +LIBCONFIG_D = $(THIRDPARTY_D)/libconfig LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \ scanner.o strbuf.o) LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \ scanctx.h scanner.h strbuf.h wincompat.h) -LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D) -MT19937AR_D = ../../3rdparty/mt19937ar +MT19937AR_D = $(THIRDPARTY_D)/mt19937ar MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o MT19937AR_H = $(MT19937AR_D)/mt19937ar.h -MT19937AR_INCLUDE = -I$(MT19937AR_D) CHAR_C = char.c HPMchar.c loginif.c mapif.c geoip.c inter.c int_auction.c int_elemental.c int_guild.c \ int_homun.c int_mail.c int_mercenary.c int_party.c int_pet.c \ @@ -98,7 +100,7 @@ char-server: ../../char-server@EXEEXT@ obj_sql/%.o: %.c $(CHAR_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql @echo " CC $<" - @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< + @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< # missing object files $(COMMON_D)/obj_all/common.a: diff --git a/src/char/char.c b/src/char/char.c index 2b8f70969..5e3c34684 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -4,50 +4,49 @@ #define HERCULES_CORE -#include "../config/core.h" // CONSOLE_INPUT +#include "config/core.h" // CONSOLE_INPUT #include "char.h" +#include "char/HPMchar.h" +#include "char/geoip.h" +#include "char/int_auction.h" +#include "char/int_elemental.h" +#include "char/int_guild.h" +#include "char/int_homun.h" +#include "char/int_mail.h" +#include "char/int_mercenary.h" +#include "char/int_party.h" +#include "char/int_pet.h" +#include "char/int_quest.h" +#include "char/int_storage.h" +#include "char/inter.h" +#include "char/loginif.h" +#include "char/mapif.h" +#include "char/pincode.h" + +#include "common/HPM.h" +#include "common/cbasetypes.h" +#include "common/console.h" +#include "common/core.h" +#include "common/db.h" +#include "common/malloc.h" +#include "common/mapindex.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "common/sql.h" +#include "common/timer.h" +#include "common/utils.h" + #include <signal.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> -#include <string.h> #include <sys/types.h> -#include <time.h> - -#include "HPMchar.h" -#include "geoip.h" -#include "int_auction.h" -#include "int_elemental.h" -#include "int_guild.h" -#include "int_homun.h" -#include "int_mail.h" -#include "int_mercenary.h" -#include "int_party.h" -#include "int_pet.h" -#include "int_quest.h" -#include "int_storage.h" -#include "inter.h" -#include "loginif.h" -#include "mapif.h" -#include "pincode.h" -#include "../common/HPM.h" -#include "../common/cbasetypes.h" -#include "../common/console.h" -#include "../common/core.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/mapindex.h" -#include "../common/mmo.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/timer.h" -#include "../common/utils.h" - #ifndef WIN32 - #include <unistd.h> +# include <unistd.h> #endif // private declarations diff --git a/src/char/char.h b/src/char/char.h index 516598fbe..0f351ca8c 100644 --- a/src/char/char.h +++ b/src/char/char.h @@ -5,9 +5,10 @@ #ifndef COMMON_CHAR_H #define COMMON_CHAR_H -#include "../common/cbasetypes.h" -#include "../common/core.h" // CORE_ST_LAST -#include "../common/db.h" +#include "common/cbasetypes.h" +#include "common/core.h" // CORE_ST_LAST +#include "common/db.h" +#include "common/mmo.h" enum E_CHARSERVER_ST { CHARSERVER_ST_RUNNING = CORE_ST_LAST, diff --git a/src/char/geoip.c b/src/char/geoip.c index 5d3324ab2..8c415b6bf 100644 --- a/src/char/geoip.c +++ b/src/char/geoip.c @@ -6,14 +6,14 @@ #include "geoip.h" +#include "common/cbasetypes.h" +#include "common/malloc.h" +#include "common/showmsg.h" + #include <errno.h> #include <stdio.h> #include <sys/stat.h> // for stat/lstat/fstat - [Dekamaster/Ultimate GM Tool] -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" - struct s_geoip geoip_data; struct geoip_interface geoip_s; diff --git a/src/char/geoip.h b/src/char/geoip.h index a7ab6b9a4..4d39011aa 100644 --- a/src/char/geoip.h +++ b/src/char/geoip.h @@ -5,7 +5,7 @@ #ifndef CHAR_GEOIP_H #define CHAR_GEOIP_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" /** * GeoIP information @@ -15,6 +15,7 @@ struct s_geoip { bool active; }; + /** * geoip interface **/ diff --git a/src/char/int_auction.c b/src/char/int_auction.c index f2ec347cd..8d51777fb 100644 --- a/src/char/int_auction.c +++ b/src/char/int_auction.c @@ -6,23 +6,23 @@ #include "int_auction.h" +#include "char/char.h" +#include "char/int_mail.h" +#include "char/inter.h" +#include "char/mapif.h" +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/sql.h" +#include "common/strlib.h" +#include "common/timer.h" + #include <stdio.h> #include <stdlib.h> -#include <string.h> - -#include "char.h" -#include "int_mail.h" -#include "inter.h" -#include "mapif.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/sql.h" -#include "../common/strlib.h" -#include "../common/timer.h" struct inter_auction_interface inter_auction_s; diff --git a/src/char/int_auction.h b/src/char/int_auction.h index c27ecd6c3..610042b9a 100644 --- a/src/char/int_auction.h +++ b/src/char/int_auction.h @@ -4,7 +4,8 @@ #ifndef CHAR_INT_AUCTION_H #define CHAR_INT_AUCTION_H -#include "../common/mmo.h" +#include "common/db.h" +#include "common/mmo.h" #ifdef HERCULES_CORE void inter_auction_defaults(void); diff --git a/src/char/int_elemental.c b/src/char/int_elemental.c index 3a5022fe4..eff84c57d 100644 --- a/src/char/int_elemental.c +++ b/src/char/int_elemental.c @@ -6,21 +6,20 @@ #include "int_elemental.h" +#include "char/char.h" +#include "char/inter.h" +#include "char/mapif.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/sql.h" +#include "common/strlib.h" +#include "common/utils.h" + #include <stdio.h> #include <stdlib.h> -#include <string.h> - -#include "char.h" -#include "inter.h" -#include "mapif.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/sql.h" -#include "../common/strlib.h" -#include "../common/utils.h" struct inter_elemental_interface inter_elemental_s; diff --git a/src/char/int_elemental.h b/src/char/int_elemental.h index 7aa379ebb..7385fc496 100644 --- a/src/char/int_elemental.h +++ b/src/char/int_elemental.h @@ -4,7 +4,7 @@ #ifndef CHAR_INT_ELEMENTAL_H #define CHAR_INT_ELEMENTAL_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" #ifdef HERCULES_CORE void inter_elemental_defaults(void); diff --git a/src/char/int_guild.c b/src/char/int_guild.c index 2753964e8..96a78203f 100644 --- a/src/char/int_guild.c +++ b/src/char/int_guild.c @@ -4,25 +4,24 @@ #define HERCULES_CORE -#include "../config/core.h" // DBPATH +#include "config/core.h" // DBPATH #include "int_guild.h" +#include "char/char.h" +#include "char/inter.h" +#include "char/mapif.h" +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "common/timer.h" + #include <stdio.h> #include <stdlib.h> -#include <string.h> - -#include "char.h" -#include "inter.h" -#include "mapif.h" -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/timer.h" #define GS_MEMBER_UNMODIFIED 0x00 #define GS_MEMBER_MODIFIED 0x01 diff --git a/src/char/int_guild.h b/src/char/int_guild.h index e7d089943..eb4c930fc 100644 --- a/src/char/int_guild.h +++ b/src/char/int_guild.h @@ -4,7 +4,8 @@ #ifndef CHAR_INT_GUILD_H #define CHAR_INT_GUILD_H -#include "../common/mmo.h" +#include "common/db.h" +#include "common/mmo.h" enum { GS_BASIC = 0x0001, diff --git a/src/char/int_homun.c b/src/char/int_homun.c index 9f91de252..2ec589eaf 100644 --- a/src/char/int_homun.c +++ b/src/char/int_homun.c @@ -6,21 +6,20 @@ #include "int_homun.h" +#include "char/char.h" +#include "char/inter.h" +#include "char/mapif.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/sql.h" +#include "common/strlib.h" +#include "common/utils.h" + #include <stdio.h> #include <stdlib.h> -#include <string.h> - -#include "char.h" -#include "inter.h" -#include "mapif.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/sql.h" -#include "../common/strlib.h" -#include "../common/utils.h" struct inter_homunculus_interface inter_homunculus_s; diff --git a/src/char/int_homun.h b/src/char/int_homun.h index 0212da150..113c6d340 100644 --- a/src/char/int_homun.h +++ b/src/char/int_homun.h @@ -4,7 +4,7 @@ #ifndef CHAR_INT_HOMUN_H #define CHAR_INT_HOMUN_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" struct s_homunculus; diff --git a/src/char/int_mail.c b/src/char/int_mail.c index cd2fa0deb..0d46339e0 100644 --- a/src/char/int_mail.c +++ b/src/char/int_mail.c @@ -6,21 +6,20 @@ #include "int_mail.h" +#include "char/char.h" +#include "char/inter.h" +#include "char/mapif.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/sql.h" +#include "common/strlib.h" +#include "common/timer.h" + #include <stdio.h> #include <stdlib.h> -#include <string.h> - -#include "char.h" -#include "inter.h" -#include "mapif.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/sql.h" -#include "../common/strlib.h" -#include "../common/timer.h" struct inter_mail_interface inter_mail_s; diff --git a/src/char/int_mail.h b/src/char/int_mail.h index 02f640ae2..8e6acf846 100644 --- a/src/char/int_mail.h +++ b/src/char/int_mail.h @@ -4,7 +4,7 @@ #ifndef CHAR_INT_MAIL_H #define CHAR_INT_MAIL_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" struct item; struct mail_data; diff --git a/src/char/int_mercenary.c b/src/char/int_mercenary.c index 3321627c0..02082aa13 100644 --- a/src/char/int_mercenary.c +++ b/src/char/int_mercenary.c @@ -6,21 +6,21 @@ #include "int_mercenary.h" +#include "char/char.h" +#include "char/inter.h" +#include "char/mapif.h" +#include "common/cbasetypes.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/sql.h" +#include "common/strlib.h" +#include "common/utils.h" + #include <stdio.h> #include <stdlib.h> -#include <string.h> - -#include "char.h" -#include "inter.h" -#include "mapif.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/sql.h" -#include "../common/strlib.h" -#include "../common/utils.h" struct inter_mercenary_interface inter_mercenary_s; diff --git a/src/char/int_mercenary.h b/src/char/int_mercenary.h index 049429e1d..632a9ab37 100644 --- a/src/char/int_mercenary.h +++ b/src/char/int_mercenary.h @@ -4,7 +4,7 @@ #ifndef CHAR_INT_MERCENARY_H #define CHAR_INT_MERCENARY_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" struct mmo_charstatus; diff --git a/src/char/int_party.c b/src/char/int_party.c index 8d50c45fa..3b857318c 100644 --- a/src/char/int_party.c +++ b/src/char/int_party.c @@ -6,23 +6,22 @@ #include "int_party.h" +#include "char/char.h" +#include "char/inter.h" +#include "char/mapif.h" +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/malloc.h" +#include "common/mapindex.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/sql.h" +#include "common/strlib.h" + #include <stdio.h> #include <stdlib.h> -#include <string.h> - -#include "char.h" -#include "inter.h" -#include "mapif.h" -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/mapindex.h" -#include "../common/mmo.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/sql.h" -#include "../common/strlib.h" struct inter_party_interface inter_party_s; @@ -324,7 +323,6 @@ int inter_party_check_empty(struct party_data *p) // Create a party whether or not int mapif_party_created(int fd, int account_id, int char_id, struct party *p) { - nullpo_ret(p); WFIFOHEAD(fd, 39); WFIFOW(fd,0)=0x3820; WFIFOL(fd,2)=account_id; diff --git a/src/char/int_party.h b/src/char/int_party.h index 61d828bc0..99ee5b13e 100644 --- a/src/char/int_party.h +++ b/src/char/int_party.h @@ -4,7 +4,8 @@ #ifndef CHAR_INT_PARTY_H #define CHAR_INT_PARTY_H -#include "../common/mmo.h" +#include "common/db.h" +#include "common/mmo.h" //Party Flags on what to save/delete. enum { diff --git a/src/char/int_pet.c b/src/char/int_pet.c index b01777771..22fe2dcc2 100644 --- a/src/char/int_pet.c +++ b/src/char/int_pet.c @@ -6,21 +6,20 @@ #include "int_pet.h" +#include "char/char.h" +#include "char/inter.h" +#include "char/mapif.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/sql.h" +#include "common/strlib.h" +#include "common/utils.h" + #include <stdio.h> #include <stdlib.h> -#include <string.h> - -#include "char.h" -#include "inter.h" -#include "mapif.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/sql.h" -#include "../common/strlib.h" -#include "../common/utils.h" struct inter_pet_interface inter_pet_s; diff --git a/src/char/int_quest.c b/src/char/int_quest.c index 036229edd..cf9b9c172 100644 --- a/src/char/int_quest.c +++ b/src/char/int_quest.c @@ -6,22 +6,20 @@ #include "int_quest.h" +#include "char/char.h" +#include "char/inter.h" +#include "char/mapif.h" +#include "common/cbasetypes.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/sql.h" +#include "common/strlib.h" + #include <stdio.h> #include <stdlib.h> -#include <string.h> - -#include "char.h" -#include "inter.h" -#include "mapif.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/sql.h" -#include "../common/strlib.h" -#include "../common/timer.h" struct inter_quest_interface inter_quest_s; diff --git a/src/char/int_storage.c b/src/char/int_storage.c index 2584be0cf..a12d9fe17 100644 --- a/src/char/int_storage.c +++ b/src/char/int_storage.c @@ -4,23 +4,22 @@ #define HERCULES_CORE -#include "../config/core.h" // GP_BOUND_ITEMS +#include "config/core.h" // GP_BOUND_ITEMS #include "int_storage.h" +#include "char/char.h" +#include "char/inter.h" +#include "char/mapif.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/sql.h" +#include "common/strlib.h" // StringBuf + #include <stdio.h> #include <stdlib.h> -#include <string.h> - -#include "char.h" -#include "inter.h" -#include "mapif.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/sql.h" -#include "../common/strlib.h" // StringBuf #define STORAGE_MEMINC 16 diff --git a/src/char/inter.c b/src/char/inter.c index 3571a3e2e..ca041d581 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -6,32 +6,31 @@ #include "inter.h" +#include "char/char.h" +#include "char/geoip.h" +#include "char/int_auction.h" +#include "char/int_elemental.h" +#include "char/int_guild.h" +#include "char/int_homun.h" +#include "char/int_mail.h" +#include "char/int_mercenary.h" +#include "char/int_party.h" +#include "char/int_pet.h" +#include "char/int_quest.h" +#include "char/int_storage.h" +#include "char/mapif.h" +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "common/timer.h" + #include <stdio.h> #include <stdlib.h> -#include <string.h> - -#include "char.h" -#include "geoip.h" -#include "int_auction.h" -#include "int_elemental.h" -#include "int_guild.h" -#include "int_homun.h" -#include "int_mail.h" -#include "int_mercenary.h" -#include "int_party.h" -#include "int_pet.h" -#include "int_quest.h" -#include "int_storage.h" -#include "mapif.h" -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/timer.h" #define WISDATA_TTL (60*1000) // Wis data Time To Live (60 seconds) #define WISDELLIST_MAX 256 // Number of elements in the list Delete data Wis diff --git a/src/char/inter.h b/src/char/inter.h index a58d3b3a9..2e89a685b 100644 --- a/src/char/inter.h +++ b/src/char/inter.h @@ -5,9 +5,11 @@ #ifndef CHAR_INTER_H #define CHAR_INTER_H -#include "char.h" -#include "../common/cbasetypes.h" -#include "../common/sql.h" +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/sql.h" + +#include <stdarg.h> struct accreg; diff --git a/src/char/loginif.c b/src/char/loginif.c index f53d9bb71..881c8f2ac 100644 --- a/src/char/loginif.c +++ b/src/char/loginif.c @@ -6,19 +6,19 @@ #include "loginif.h" +#include "char/char.h" +#include "char/mapif.h" +#include "common/cbasetypes.h" +#include "common/core.h" +#include "common/db.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/timer.h" + #include <stdlib.h> #include <string.h> -#include "char.h" -#include "mapif.h" - -#include "../common/cbasetypes.h" -#include "../common/core.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/timer.h" - struct loginif_interface loginif_s; /// Resets all the data. diff --git a/src/char/loginif.h b/src/char/loginif.h index 634bd4b8b..548eaff02 100644 --- a/src/char/loginif.h +++ b/src/char/loginif.h @@ -5,7 +5,9 @@ #ifndef CHAR_LOGINIF_H #define CHAR_LOGINIF_H -#include "char.h" +#include "common/cbasetypes.h" + +struct char_session_data; /** * loginif interface diff --git a/src/char/mapif.c b/src/char/mapif.c index 65f2984fd..92506cd49 100644 --- a/src/char/mapif.c +++ b/src/char/mapif.c @@ -6,18 +6,18 @@ #include "mapif.h" -#include <stdlib.h> +#include "char/char.h" +#include "char/int_auction.h" +#include "char/int_guild.h" +#include "char/int_homun.h" +#include "common/cbasetypes.h" +#include "common/mmo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" -#include "char.h" -#include "int_auction.h" -#include "int_homun.h" -#include "int_guild.h" -#include "../common/cbasetypes.h" -#include "../common/mmo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" +#include <stdlib.h> void mapif_ban(int id, unsigned int flag, int status); void mapif_server_init(int id); diff --git a/src/char/mapif.h b/src/char/mapif.h index 528522d1e..6b015d155 100644 --- a/src/char/mapif.h +++ b/src/char/mapif.h @@ -5,16 +5,9 @@ #ifndef CHAR_MAPIF_H #define CHAR_MAPIF_H -#include "char.h" +#include "common/cbasetypes.h" +#include "common/mmo.h" -struct s_elemental; -struct s_homunculus; -struct s_mercenary; -struct s_pet; -struct guild_storage; -struct storage_data; -struct quest; -struct mail_message; struct WisData; /** diff --git a/src/char/pincode.c b/src/char/pincode.c index c3d2b2298..43958af8a 100644 --- a/src/char/pincode.c +++ b/src/char/pincode.c @@ -6,16 +6,17 @@ #include "pincode.h" -#include <stdlib.h> +#include "char/char.h" +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" -#include "char.h" -#include "../common/cbasetypes.h" -#include "../common/mmo.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" +#include <stdlib.h> struct pincode_interface pincode_s; diff --git a/src/char/pincode.h b/src/char/pincode.h index 178d7e427..01f6c7bf9 100644 --- a/src/char/pincode.h +++ b/src/char/pincode.h @@ -5,7 +5,9 @@ #ifndef CHAR_PINCODE_H #define CHAR_PINCODE_H -#include "char.h" +#include "common/cbasetypes.h" + +struct char_session_data; enum PincodeResponseCode { PINCODE_OK = 0, diff --git a/src/common/HPM.c b/src/common/HPM.c index 346748cfe..cdd9bb769 100644 --- a/src/common/HPM.c +++ b/src/common/HPM.c @@ -3,28 +3,29 @@ #define HERCULES_CORE -#include "../config/core.h" // CONSOLE_INPUT +#include "config/core.h" // CONSOLE_INPUT #include "HPM.h" +#include "common/cbasetypes.h" +#include "common/conf.h" +#include "common/console.h" +#include "common/core.h" +#include "common/db.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/sql.h" +#include "common/strlib.h" +#include "common/sysinfo.h" +#include "common/timer.h" +#include "common/utils.h" +#include "common/nullpo.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "../common/cbasetypes.h" -#include "../common/conf.h" -#include "../common/console.h" -#include "../common/core.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/sql.h" -#include "../common/strlib.h" -#include "../common/sysinfo.h" -#include "../common/timer.h" -#include "../common/utils.h" -#include "../common/nullpo.h" - #ifndef WIN32 # include <unistd.h> #endif @@ -251,6 +252,8 @@ struct hplugin *hplugin_load(const char* filename) { if( HPM->load_sub ) HPM->load_sub(plugin); + ShowStatus("HPM: Loaded plugin '"CL_WHITE"%s"CL_RESET"' (%s).\n", plugin->info->name, plugin->info->version); + return plugin; } @@ -338,11 +341,14 @@ void hplugins_config_read(void) { struct hplugin *plugin; snprintf(filename, 60, "plugins/%s%s", hooking_plugin_name, DLL_EXT); if ((plugin = HPM->load(filename))) { - bool (*func)(bool *fr); + const char * (*func)(bool *fr); bool (*addhook_sub) (enum HPluginHookType type, const char *target, void *hook, unsigned int pID); - if ((func = plugin_import(plugin->dll, "Hooked",bool (*)(bool *))) + if ((func = plugin_import(plugin->dll, "Hooked",const char * (*)(bool *))) && (addhook_sub = plugin_import(plugin->dll, "HPM_Plugin_AddHook",bool (*)(enum HPluginHookType, const char *, void *, unsigned int)))) { - if (func(&HPM->force_return)) { + const char *failed = func(&HPM->force_return); + if (failed) { + ShowError("HPM: failed to retrieve '%s' for '"CL_WHITE"%s"CL_RESET"'!\n", failed, plugin_name); + } else { HPM->hooking = true; HPM->addhook_sub = addhook_sub; } diff --git a/src/common/HPM.h b/src/common/HPM.h index e99b0f2ae..1358f19dc 100644 --- a/src/common/HPM.h +++ b/src/common/HPM.h @@ -8,8 +8,8 @@ #error You should never include HPM.h from a plugin. #endif -#include "../common/HPMi.h" -#include "../common/cbasetypes.h" +#include "common/HPMi.h" +#include "common/cbasetypes.h" #ifdef WIN32 #ifndef WIN32_LEAN_AND_MEAN diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index 970e2449d..43dc9ee5c 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -9,7 +9,11 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { #ifdef CHAR_CHAR_H + { "char_auth_node", sizeof(struct char_auth_node), SERVER_TYPE_CHAR }, { "char_interface", sizeof(struct char_interface), SERVER_TYPE_CHAR }, + { "char_session_data", sizeof(struct char_session_data), SERVER_TYPE_CHAR }, + { "mmo_map_server", sizeof(struct mmo_map_server), SERVER_TYPE_CHAR }, + { "online_char_data", sizeof(struct online_char_data), SERVER_TYPE_CHAR }, #else #define CHAR_CHAR_H #endif // CHAR_CHAR_H @@ -94,10 +98,24 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { #else #define COMMON_CONF_H #endif // COMMON_CONF_H + #ifdef COMMON_CONSOLE_H + { "CParseEntry", sizeof(struct CParseEntry), SERVER_TYPE_ALL }, + { "console_interface", sizeof(struct console_interface), SERVER_TYPE_ALL }, + #else + #define COMMON_CONSOLE_H + #endif // COMMON_CONSOLE_H + #ifdef COMMON_CORE_H + { "CmdlineArgData", sizeof(struct CmdlineArgData), SERVER_TYPE_ALL }, + { "cmdline_interface", sizeof(struct cmdline_interface), SERVER_TYPE_ALL }, + #else + #define COMMON_CORE_H + #endif // COMMON_CORE_H #ifdef COMMON_DB_H { "DBData", sizeof(struct DBData), SERVER_TYPE_ALL }, { "DBIterator", sizeof(struct DBIterator), SERVER_TYPE_ALL }, { "DBMap", sizeof(struct DBMap), SERVER_TYPE_ALL }, + { "db_interface", sizeof(struct db_interface), SERVER_TYPE_ALL }, + { "linkdb_node", sizeof(struct linkdb_node), SERVER_TYPE_ALL }, #else #define COMMON_DB_H #endif // COMMON_DB_H @@ -111,24 +129,85 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { #else #define COMMON_ERS_H #endif // COMMON_ERS_H + #ifdef COMMON_HPMI_H + { "HPMi_interface", sizeof(struct HPMi_interface), SERVER_TYPE_ALL }, + { "hplugin_info", sizeof(struct hplugin_info), SERVER_TYPE_ALL }, + { "s_HPMDataCheck", sizeof(struct s_HPMDataCheck), SERVER_TYPE_ALL }, + #else + #define COMMON_HPMI_H + #endif // COMMON_HPMI_H + #ifdef COMMON_MALLOC_H + { "malloc_interface", sizeof(struct malloc_interface), SERVER_TYPE_ALL }, + #else + #define COMMON_MALLOC_H + #endif // COMMON_MALLOC_H #ifdef COMMON_MAPINDEX_H { "mapindex_interface", sizeof(struct mapindex_interface), SERVER_TYPE_ALL }, #else #define COMMON_MAPINDEX_H #endif // COMMON_MAPINDEX_H #ifdef COMMON_MMO_H + { "auction_data", sizeof(struct auction_data), SERVER_TYPE_ALL }, + { "fame_list", sizeof(struct fame_list), SERVER_TYPE_ALL }, + { "guild", sizeof(struct guild), SERVER_TYPE_ALL }, + { "guild_alliance", sizeof(struct guild_alliance), SERVER_TYPE_ALL }, + { "guild_castle", sizeof(struct guild_castle), SERVER_TYPE_ALL }, + { "guild_expulsion", sizeof(struct guild_expulsion), SERVER_TYPE_ALL }, + { "guild_member", sizeof(struct guild_member), SERVER_TYPE_ALL }, + { "guild_position", sizeof(struct guild_position), SERVER_TYPE_ALL }, + { "guild_skill", sizeof(struct guild_skill), SERVER_TYPE_ALL }, + { "guild_storage", sizeof(struct guild_storage), SERVER_TYPE_ALL }, + { "hotkey", sizeof(struct hotkey), SERVER_TYPE_ALL }, + { "item", sizeof(struct item), SERVER_TYPE_ALL }, + { "mail_data", sizeof(struct mail_data), SERVER_TYPE_ALL }, + { "mail_message", sizeof(struct mail_message), SERVER_TYPE_ALL }, + { "mmo_charstatus", sizeof(struct mmo_charstatus), SERVER_TYPE_ALL }, + { "party", sizeof(struct party), SERVER_TYPE_ALL }, + { "party_member", sizeof(struct party_member), SERVER_TYPE_ALL }, + { "point", sizeof(struct point), SERVER_TYPE_ALL }, { "quest", sizeof(struct quest), SERVER_TYPE_ALL }, + { "s_elemental", sizeof(struct s_elemental), SERVER_TYPE_ALL }, + { "s_friend", sizeof(struct s_friend), SERVER_TYPE_ALL }, + { "s_homunculus", sizeof(struct s_homunculus), SERVER_TYPE_ALL }, + { "s_mercenary", sizeof(struct s_mercenary), SERVER_TYPE_ALL }, + { "s_pet", sizeof(struct s_pet), SERVER_TYPE_ALL }, + { "s_skill", sizeof(struct s_skill), SERVER_TYPE_ALL }, + { "script_reg_num", sizeof(struct script_reg_num), SERVER_TYPE_ALL }, + { "script_reg_state", sizeof(struct script_reg_state), SERVER_TYPE_ALL }, + { "script_reg_str", sizeof(struct script_reg_str), SERVER_TYPE_ALL }, + { "status_change_data", sizeof(struct status_change_data), SERVER_TYPE_ALL }, + { "storage_data", sizeof(struct storage_data), SERVER_TYPE_ALL }, #else #define COMMON_MMO_H #endif // COMMON_MMO_H + #ifdef COMMON_NULLPO_H + { "nullpo_interface", sizeof(struct nullpo_interface), SERVER_TYPE_ALL }, + #else + #define COMMON_NULLPO_H + #endif // COMMON_NULLPO_H #ifdef COMMON_SOCKET_H + { "hSockOpt", sizeof(struct hSockOpt), SERVER_TYPE_ALL }, + { "socket_data", sizeof(struct socket_data), SERVER_TYPE_ALL }, { "socket_interface", sizeof(struct socket_interface), SERVER_TYPE_ALL }, #else #define COMMON_SOCKET_H #endif // COMMON_SOCKET_H + #ifdef COMMON_SPINLOCK_H + { "SPIN_LOCK", sizeof(struct SPIN_LOCK), SERVER_TYPE_ALL }, + #else + #define COMMON_SPINLOCK_H + #endif // COMMON_SPINLOCK_H + #ifdef COMMON_SQL_H + { "sql_interface", sizeof(struct sql_interface), SERVER_TYPE_ALL }, + #else + #define COMMON_SQL_H + #endif // COMMON_SQL_H #ifdef COMMON_STRLIB_H { "StringBuf", sizeof(struct StringBuf), SERVER_TYPE_ALL }, { "s_svstate", sizeof(struct s_svstate), SERVER_TYPE_ALL }, + { "stringbuf_interface", sizeof(struct stringbuf_interface), SERVER_TYPE_ALL }, + { "strlib_interface", sizeof(struct strlib_interface), SERVER_TYPE_ALL }, + { "sv_interface", sizeof(struct sv_interface), SERVER_TYPE_ALL }, #else #define COMMON_STRLIB_H #endif // COMMON_STRLIB_H @@ -137,97 +216,442 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { #else #define COMMON_SYSINFO_H #endif // COMMON_SYSINFO_H + #ifdef COMMON_TIMER_H + { "TimerData", sizeof(struct TimerData), SERVER_TYPE_ALL }, + { "timer_interface", sizeof(struct timer_interface), SERVER_TYPE_ALL }, + #else + #define COMMON_TIMER_H + #endif // COMMON_TIMER_H + #ifdef COMMON_UTILS_H + { "HCache_interface", sizeof(struct HCache_interface), SERVER_TYPE_ALL }, + #else + #define COMMON_UTILS_H + #endif // COMMON_UTILS_H + #ifdef LOGIN_ACCOUNT_H + { "Account_engine", sizeof(struct Account_engine), SERVER_TYPE_LOGIN }, + { "AccountDB", sizeof(struct AccountDB), SERVER_TYPE_LOGIN }, + { "AccountDBIterator", sizeof(struct AccountDBIterator), SERVER_TYPE_LOGIN }, + { "mmo_account", sizeof(struct mmo_account), SERVER_TYPE_LOGIN }, + #else + #define LOGIN_ACCOUNT_H + #endif // LOGIN_ACCOUNT_H #ifdef LOGIN_LOGIN_H + { "Login_Config", sizeof(struct Login_Config), SERVER_TYPE_LOGIN }, + { "client_hash_node", sizeof(struct client_hash_node), SERVER_TYPE_LOGIN }, + { "login_auth_node", sizeof(struct login_auth_node), SERVER_TYPE_LOGIN }, { "login_interface", sizeof(struct login_interface), SERVER_TYPE_LOGIN }, + { "login_session_data", sizeof(struct login_session_data), SERVER_TYPE_LOGIN }, + { "mmo_char_server", sizeof(struct mmo_char_server), SERVER_TYPE_LOGIN }, + { "online_login_data", sizeof(struct online_login_data), SERVER_TYPE_LOGIN }, #else #define LOGIN_LOGIN_H #endif // LOGIN_LOGIN_H #ifdef MAP_ATCOMMAND_H { "AliasInfo", sizeof(struct AliasInfo), SERVER_TYPE_MAP }, + { "AtCommandInfo", sizeof(struct AtCommandInfo), SERVER_TYPE_MAP }, + { "atcmd_binding_data", sizeof(struct atcmd_binding_data), SERVER_TYPE_MAP }, { "atcommand_interface", sizeof(struct atcommand_interface), SERVER_TYPE_MAP }, #else #define MAP_ATCOMMAND_H #endif // MAP_ATCOMMAND_H + #ifdef MAP_BATTLEGROUND_H + { "battleground_data", sizeof(struct battleground_data), SERVER_TYPE_MAP }, + { "battleground_interface", sizeof(struct battleground_interface), SERVER_TYPE_MAP }, + { "battleground_member_data", sizeof(struct battleground_member_data), SERVER_TYPE_MAP }, + { "bg_arena", sizeof(struct bg_arena), SERVER_TYPE_MAP }, + #else + #define MAP_BATTLEGROUND_H + #endif // MAP_BATTLEGROUND_H #ifdef MAP_BATTLE_H + { "Battle_Config", sizeof(struct Battle_Config), SERVER_TYPE_MAP }, { "Damage", sizeof(struct Damage), SERVER_TYPE_MAP }, { "battle_interface", sizeof(struct battle_interface), SERVER_TYPE_MAP }, + { "delay_damage", sizeof(struct delay_damage), SERVER_TYPE_MAP }, #else #define MAP_BATTLE_H #endif // MAP_BATTLE_H #ifdef MAP_BUYINGSTORE_H { "buyingstore_interface", sizeof(struct buyingstore_interface), SERVER_TYPE_MAP }, + { "s_buyingstore", sizeof(struct s_buyingstore), SERVER_TYPE_MAP }, { "s_buyingstore_item", sizeof(struct s_buyingstore_item), SERVER_TYPE_MAP }, #else #define MAP_BUYINGSTORE_H #endif // MAP_BUYINGSTORE_H #ifdef MAP_CHANNEL_H { "Channel_Config", sizeof(struct Channel_Config), SERVER_TYPE_MAP }, + { "channel_ban_entry", sizeof(struct channel_ban_entry), SERVER_TYPE_MAP }, + { "channel_data", sizeof(struct channel_data), SERVER_TYPE_MAP }, + { "channel_interface", sizeof(struct channel_interface), SERVER_TYPE_MAP }, #else #define MAP_CHANNEL_H #endif // MAP_CHANNEL_H + #ifdef MAP_CHAT_H + { "chat_data", sizeof(struct chat_data), SERVER_TYPE_MAP }, + { "chat_interface", sizeof(struct chat_interface), SERVER_TYPE_MAP }, + #else + #define MAP_CHAT_H + #endif // MAP_CHAT_H #ifdef MAP_CHRIF_H { "auth_node", sizeof(struct auth_node), SERVER_TYPE_MAP }, + { "chrif_interface", sizeof(struct chrif_interface), SERVER_TYPE_MAP }, #else #define MAP_CHRIF_H #endif // MAP_CHRIF_H #ifdef MAP_CLIF_H + { "cdelayed_damage", sizeof(struct cdelayed_damage), SERVER_TYPE_MAP }, { "clif_interface", sizeof(struct clif_interface), SERVER_TYPE_MAP }, + { "hCSData", sizeof(struct hCSData), SERVER_TYPE_MAP }, + { "s_packet_db", sizeof(struct s_packet_db), SERVER_TYPE_MAP }, #else #define MAP_CLIF_H #endif // MAP_CLIF_H + #ifdef MAP_DUEL_H + { "duel", sizeof(struct duel), SERVER_TYPE_MAP }, + { "duel_interface", sizeof(struct duel_interface), SERVER_TYPE_MAP }, + #else + #define MAP_DUEL_H + #endif // MAP_DUEL_H #ifdef MAP_ELEMENTAL_H + { "elemental_data", sizeof(struct elemental_data), SERVER_TYPE_MAP }, + { "elemental_interface", sizeof(struct elemental_interface), SERVER_TYPE_MAP }, { "elemental_skill", sizeof(struct elemental_skill), SERVER_TYPE_MAP }, + { "s_elemental_db", sizeof(struct s_elemental_db), SERVER_TYPE_MAP }, #else #define MAP_ELEMENTAL_H #endif // MAP_ELEMENTAL_H #ifdef MAP_GUILD_H { "eventlist", sizeof(struct eventlist), SERVER_TYPE_MAP }, { "guardian_data", sizeof(struct guardian_data), SERVER_TYPE_MAP }, + { "guild_expcache", sizeof(struct guild_expcache), SERVER_TYPE_MAP }, + { "guild_interface", sizeof(struct guild_interface), SERVER_TYPE_MAP }, + { "s_guild_skill_tree", sizeof(struct s_guild_skill_tree), SERVER_TYPE_MAP }, #else #define MAP_GUILD_H #endif // MAP_GUILD_H + #ifdef MAP_HOMUNCULUS_H + { "h_stats", sizeof(struct h_stats), SERVER_TYPE_MAP }, + { "homun_data", sizeof(struct homun_data), SERVER_TYPE_MAP }, + { "homun_skill_tree_entry", sizeof(struct homun_skill_tree_entry), SERVER_TYPE_MAP }, + { "homunculus_interface", sizeof(struct homunculus_interface), SERVER_TYPE_MAP }, + { "s_homunculus_db", sizeof(struct s_homunculus_db), SERVER_TYPE_MAP }, + #else + #define MAP_HOMUNCULUS_H + #endif // MAP_HOMUNCULUS_H + #ifdef MAP_INSTANCE_H + { "instance_data", sizeof(struct instance_data), SERVER_TYPE_MAP }, + { "instance_interface", sizeof(struct instance_interface), SERVER_TYPE_MAP }, + #else + #define MAP_INSTANCE_H + #endif // MAP_INSTANCE_H + #ifdef MAP_INTIF_H + { "intif_interface", sizeof(struct intif_interface), SERVER_TYPE_MAP }, + #else + #define MAP_INTIF_H + #endif // MAP_INTIF_H + #ifdef MAP_IRC_BOT_H + { "irc_bot_interface", sizeof(struct irc_bot_interface), SERVER_TYPE_MAP }, + { "irc_func", sizeof(struct irc_func), SERVER_TYPE_MAP }, + #else + #define MAP_IRC_BOT_H + #endif // MAP_IRC_BOT_H + #ifdef MAP_ITEMDB_H + { "item_chain", sizeof(struct item_chain), SERVER_TYPE_MAP }, + { "item_chain_entry", sizeof(struct item_chain_entry), SERVER_TYPE_MAP }, + { "item_combo", sizeof(struct item_combo), SERVER_TYPE_MAP }, + { "item_data", sizeof(struct item_data), SERVER_TYPE_MAP }, + { "item_group", sizeof(struct item_group), SERVER_TYPE_MAP }, + { "item_package", sizeof(struct item_package), SERVER_TYPE_MAP }, + { "item_package_must_entry", sizeof(struct item_package_must_entry), SERVER_TYPE_MAP }, + { "item_package_rand_entry", sizeof(struct item_package_rand_entry), SERVER_TYPE_MAP }, + { "item_package_rand_group", sizeof(struct item_package_rand_group), SERVER_TYPE_MAP }, + { "itemdb_interface", sizeof(struct itemdb_interface), SERVER_TYPE_MAP }, + #else + #define MAP_ITEMDB_H + #endif // MAP_ITEMDB_H + #ifdef MAP_LOG_H + { "log_interface", sizeof(struct log_interface), SERVER_TYPE_MAP }, + #else + #define MAP_LOG_H + #endif // MAP_LOG_H + #ifdef MAP_MAIL_H + { "mail_interface", sizeof(struct mail_interface), SERVER_TYPE_MAP }, + #else + #define MAP_MAIL_H + #endif // MAP_MAIL_H #ifdef MAP_MAPREG_H + { "mapreg_interface", sizeof(struct mapreg_interface), SERVER_TYPE_MAP }, { "mapreg_save", sizeof(struct mapreg_save), SERVER_TYPE_MAP }, #else #define MAP_MAPREG_H #endif // MAP_MAPREG_H #ifdef MAP_MAP_H + { "block_list", sizeof(struct block_list), SERVER_TYPE_MAP }, + { "charid2nick", sizeof(struct charid2nick), SERVER_TYPE_MAP }, + { "charid_request", sizeof(struct charid_request), SERVER_TYPE_MAP }, + { "flooritem_data", sizeof(struct flooritem_data), SERVER_TYPE_MAP }, + { "iwall_data", sizeof(struct iwall_data), SERVER_TYPE_MAP }, + { "map_cache_main_header", sizeof(struct map_cache_main_header), SERVER_TYPE_MAP }, + { "map_cache_map_info", sizeof(struct map_cache_map_info), SERVER_TYPE_MAP }, + { "map_data", sizeof(struct map_data), SERVER_TYPE_MAP }, { "map_data_other_server", sizeof(struct map_data_other_server), SERVER_TYPE_MAP }, + { "map_drop_list", sizeof(struct map_drop_list), SERVER_TYPE_MAP }, + { "map_interface", sizeof(struct map_interface), SERVER_TYPE_MAP }, + { "map_zone_data", sizeof(struct map_zone_data), SERVER_TYPE_MAP }, + { "map_zone_disabled_command_entry", sizeof(struct map_zone_disabled_command_entry), SERVER_TYPE_MAP }, + { "map_zone_disabled_skill_entry", sizeof(struct map_zone_disabled_skill_entry), SERVER_TYPE_MAP }, + { "map_zone_skill_damage_cap_entry", sizeof(struct map_zone_skill_damage_cap_entry), SERVER_TYPE_MAP }, + { "mapcell", sizeof(struct mapcell), SERVER_TYPE_MAP }, + { "mapflag_skill_adjust", sizeof(struct mapflag_skill_adjust), SERVER_TYPE_MAP }, + { "mapit_interface", sizeof(struct mapit_interface), SERVER_TYPE_MAP }, + { "questinfo", sizeof(struct questinfo), SERVER_TYPE_MAP }, + { "spawn_data", sizeof(struct spawn_data), SERVER_TYPE_MAP }, #else #define MAP_MAP_H #endif // MAP_MAP_H + #ifdef MAP_MERCENARY_H + { "mercenary_data", sizeof(struct mercenary_data), SERVER_TYPE_MAP }, + { "mercenary_interface", sizeof(struct mercenary_interface), SERVER_TYPE_MAP }, + { "s_mercenary_db", sizeof(struct s_mercenary_db), SERVER_TYPE_MAP }, + #else + #define MAP_MERCENARY_H + #endif // MAP_MERCENARY_H + #ifdef MAP_MOB_H + { "item_drop", sizeof(struct item_drop), SERVER_TYPE_MAP }, + { "item_drop_list", sizeof(struct item_drop_list), SERVER_TYPE_MAP }, + { "mob_chat", sizeof(struct mob_chat), SERVER_TYPE_MAP }, + { "mob_data", sizeof(struct mob_data), SERVER_TYPE_MAP }, + { "mob_db", sizeof(struct mob_db), SERVER_TYPE_MAP }, + { "mob_interface", sizeof(struct mob_interface), SERVER_TYPE_MAP }, + { "mob_skill", sizeof(struct mob_skill), SERVER_TYPE_MAP }, + { "spawn_info", sizeof(struct spawn_info), SERVER_TYPE_MAP }, + #else + #define MAP_MOB_H + #endif // MAP_MOB_H + #ifdef MAP_NPC_H + { "event_data", sizeof(struct event_data), SERVER_TYPE_MAP }, + { "npc_data", sizeof(struct npc_data), SERVER_TYPE_MAP }, + { "npc_interface", sizeof(struct npc_interface), SERVER_TYPE_MAP }, + { "npc_item_list", sizeof(struct npc_item_list), SERVER_TYPE_MAP }, + { "npc_label_list", sizeof(struct npc_label_list), SERVER_TYPE_MAP }, + { "npc_path_data", sizeof(struct npc_path_data), SERVER_TYPE_MAP }, + { "npc_shop_data", sizeof(struct npc_shop_data), SERVER_TYPE_MAP }, + { "npc_src_list", sizeof(struct npc_src_list), SERVER_TYPE_MAP }, + { "npc_timerevent_list", sizeof(struct npc_timerevent_list), SERVER_TYPE_MAP }, + #else + #define MAP_NPC_H + #endif // MAP_NPC_H #ifdef MAP_PACKETS_STRUCT_H + { "EQUIPITEM_INFO", sizeof(struct EQUIPITEM_INFO), SERVER_TYPE_MAP }, { "EQUIPSLOTINFO", sizeof(struct EQUIPSLOTINFO), SERVER_TYPE_MAP }, + { "NORMALITEM_INFO", sizeof(struct NORMALITEM_INFO), SERVER_TYPE_MAP }, + { "packet_additem", sizeof(struct packet_additem), SERVER_TYPE_MAP }, + { "packet_authok", sizeof(struct packet_authok), SERVER_TYPE_MAP }, + { "packet_banking_check", sizeof(struct packet_banking_check), SERVER_TYPE_MAP }, + { "packet_banking_deposit_ack", sizeof(struct packet_banking_deposit_ack), SERVER_TYPE_MAP }, + { "packet_banking_deposit_req", sizeof(struct packet_banking_deposit_req), SERVER_TYPE_MAP }, + { "packet_banking_withdraw_ack", sizeof(struct packet_banking_withdraw_ack), SERVER_TYPE_MAP }, + { "packet_banking_withdraw_req", sizeof(struct packet_banking_withdraw_req), SERVER_TYPE_MAP }, + { "packet_bgqueue_ack", sizeof(struct packet_bgqueue_ack), SERVER_TYPE_MAP }, + { "packet_bgqueue_battlebegin_ack", sizeof(struct packet_bgqueue_battlebegin_ack), SERVER_TYPE_MAP }, + { "packet_bgqueue_battlebegins", sizeof(struct packet_bgqueue_battlebegins), SERVER_TYPE_MAP }, + { "packet_bgqueue_checkstate", sizeof(struct packet_bgqueue_checkstate), SERVER_TYPE_MAP }, + { "packet_bgqueue_notice_delete", sizeof(struct packet_bgqueue_notice_delete), SERVER_TYPE_MAP }, + { "packet_bgqueue_notify_entry", sizeof(struct packet_bgqueue_notify_entry), SERVER_TYPE_MAP }, + { "packet_bgqueue_register", sizeof(struct packet_bgqueue_register), SERVER_TYPE_MAP }, + { "packet_bgqueue_revoke_req", sizeof(struct packet_bgqueue_revoke_req), SERVER_TYPE_MAP }, + { "packet_bgqueue_update_info", sizeof(struct packet_bgqueue_update_info), SERVER_TYPE_MAP }, + { "packet_cart_additem_ack", sizeof(struct packet_cart_additem_ack), SERVER_TYPE_MAP }, + { "packet_damage", sizeof(struct packet_damage), SERVER_TYPE_MAP }, + { "packet_dropflooritem", sizeof(struct packet_dropflooritem), SERVER_TYPE_MAP }, + { "packet_equip_item", sizeof(struct packet_equip_item), SERVER_TYPE_MAP }, + { "packet_equipitem_ack", sizeof(struct packet_equipitem_ack), SERVER_TYPE_MAP }, + { "packet_gm_monster_item", sizeof(struct packet_gm_monster_item), SERVER_TYPE_MAP }, + { "packet_graffiti_entry", sizeof(struct packet_graffiti_entry), SERVER_TYPE_MAP }, + { "packet_idle_unit", sizeof(struct packet_idle_unit), SERVER_TYPE_MAP }, + { "packet_idle_unit2", sizeof(struct packet_idle_unit2), SERVER_TYPE_MAP }, + { "packet_item_drop_announce", sizeof(struct packet_item_drop_announce), SERVER_TYPE_MAP }, + { "packet_itemlist_equip", sizeof(struct packet_itemlist_equip), SERVER_TYPE_MAP }, + { "packet_itemlist_normal", sizeof(struct packet_itemlist_normal), SERVER_TYPE_MAP }, + { "packet_maptypeproperty2", sizeof(struct packet_maptypeproperty2), SERVER_TYPE_MAP }, + { "packet_monster_hp", sizeof(struct packet_monster_hp), SERVER_TYPE_MAP }, + { "packet_notify_bounditem", sizeof(struct packet_notify_bounditem), SERVER_TYPE_MAP }, + { "packet_npc_market_open", sizeof(struct packet_npc_market_open), SERVER_TYPE_MAP }, + { "packet_npc_market_purchase", sizeof(struct packet_npc_market_purchase), SERVER_TYPE_MAP }, + { "packet_npc_market_result_ack", sizeof(struct packet_npc_market_result_ack), SERVER_TYPE_MAP }, + { "packet_package_item_announce", sizeof(struct packet_package_item_announce), SERVER_TYPE_MAP }, + { "packet_party_leader_changed", sizeof(struct packet_party_leader_changed), SERVER_TYPE_MAP }, + { "packet_roulette_close_ack", sizeof(struct packet_roulette_close_ack), SERVER_TYPE_MAP }, + { "packet_roulette_generate_ack", sizeof(struct packet_roulette_generate_ack), SERVER_TYPE_MAP }, + { "packet_roulette_info_ack", sizeof(struct packet_roulette_info_ack), SERVER_TYPE_MAP }, + { "packet_roulette_itemrecv_ack", sizeof(struct packet_roulette_itemrecv_ack), SERVER_TYPE_MAP }, + { "packet_roulette_itemrecv_req", sizeof(struct packet_roulette_itemrecv_req), SERVER_TYPE_MAP }, + { "packet_roulette_open_ack", sizeof(struct packet_roulette_open_ack), SERVER_TYPE_MAP }, + { "packet_sc_notick", sizeof(struct packet_sc_notick), SERVER_TYPE_MAP }, + { "packet_script_clear", sizeof(struct packet_script_clear), SERVER_TYPE_MAP }, + { "packet_skill_entry", sizeof(struct packet_skill_entry), SERVER_TYPE_MAP }, + { "packet_spawn_unit", sizeof(struct packet_spawn_unit), SERVER_TYPE_MAP }, + { "packet_spawn_unit2", sizeof(struct packet_spawn_unit2), SERVER_TYPE_MAP }, + { "packet_status_change", sizeof(struct packet_status_change), SERVER_TYPE_MAP }, + { "packet_status_change2", sizeof(struct packet_status_change2), SERVER_TYPE_MAP }, + { "packet_status_change_end", sizeof(struct packet_status_change_end), SERVER_TYPE_MAP }, + { "packet_storelist_equip", sizeof(struct packet_storelist_equip), SERVER_TYPE_MAP }, + { "packet_storelist_normal", sizeof(struct packet_storelist_normal), SERVER_TYPE_MAP }, + { "packet_unequipitem_ack", sizeof(struct packet_unequipitem_ack), SERVER_TYPE_MAP }, + { "packet_unit_walking", sizeof(struct packet_unit_walking), SERVER_TYPE_MAP }, + { "packet_viewequip_ack", sizeof(struct packet_viewequip_ack), SERVER_TYPE_MAP }, + { "packet_wis_end", sizeof(struct packet_wis_end), SERVER_TYPE_MAP }, #else #define MAP_PACKETS_STRUCT_H #endif // MAP_PACKETS_STRUCT_H + #ifdef MAP_PARTY_H + { "party_booking_ad_info", sizeof(struct party_booking_ad_info), SERVER_TYPE_MAP }, + { "party_booking_detail", sizeof(struct party_booking_detail), SERVER_TYPE_MAP }, + { "party_data", sizeof(struct party_data), SERVER_TYPE_MAP }, + { "party_interface", sizeof(struct party_interface), SERVER_TYPE_MAP }, + { "party_member_data", sizeof(struct party_member_data), SERVER_TYPE_MAP }, + #else + #define MAP_PARTY_H + #endif // MAP_PARTY_H + #ifdef MAP_PATH_H + { "path_interface", sizeof(struct path_interface), SERVER_TYPE_MAP }, + { "shootpath_data", sizeof(struct shootpath_data), SERVER_TYPE_MAP }, + { "walkpath_data", sizeof(struct walkpath_data), SERVER_TYPE_MAP }, + #else + #define MAP_PATH_H + #endif // MAP_PATH_H + #ifdef MAP_PC_GROUPS_H + { "GroupSettings", sizeof(struct GroupSettings), SERVER_TYPE_MAP }, + { "pc_groups_interface", sizeof(struct pc_groups_interface), SERVER_TYPE_MAP }, + { "pc_groups_new_permission", sizeof(struct pc_groups_new_permission), SERVER_TYPE_MAP }, + { "pc_groups_permission_table", sizeof(struct pc_groups_permission_table), SERVER_TYPE_MAP }, + #else + #define MAP_PC_GROUPS_H + #endif // MAP_PC_GROUPS_H #ifdef MAP_PC_H { "autotrade_vending", sizeof(struct autotrade_vending), SERVER_TYPE_MAP }, { "item_cd", sizeof(struct item_cd), SERVER_TYPE_MAP }, + { "map_session_data", sizeof(struct map_session_data), SERVER_TYPE_MAP }, + { "pc_combos", sizeof(struct pc_combos), SERVER_TYPE_MAP }, + { "pc_interface", sizeof(struct pc_interface), SERVER_TYPE_MAP }, + { "s_add_drop", sizeof(struct s_add_drop), SERVER_TYPE_MAP }, { "s_addeffect", sizeof(struct s_addeffect), SERVER_TYPE_MAP }, + { "s_addeffectonskill", sizeof(struct s_addeffectonskill), SERVER_TYPE_MAP }, + { "s_autobonus", sizeof(struct s_autobonus), SERVER_TYPE_MAP }, + { "s_autospell", sizeof(struct s_autospell), SERVER_TYPE_MAP }, + { "sg_data", sizeof(struct sg_data), SERVER_TYPE_MAP }, + { "skill_tree_entry", sizeof(struct skill_tree_entry), SERVER_TYPE_MAP }, + { "weapon_data", sizeof(struct weapon_data), SERVER_TYPE_MAP }, #else #define MAP_PC_H #endif // MAP_PC_H + #ifdef MAP_PET_H + { "pet_bonus", sizeof(struct pet_bonus), SERVER_TYPE_MAP }, + { "pet_data", sizeof(struct pet_data), SERVER_TYPE_MAP }, + { "pet_interface", sizeof(struct pet_interface), SERVER_TYPE_MAP }, + { "pet_loot", sizeof(struct pet_loot), SERVER_TYPE_MAP }, + { "pet_recovery", sizeof(struct pet_recovery), SERVER_TYPE_MAP }, + { "pet_skill_attack", sizeof(struct pet_skill_attack), SERVER_TYPE_MAP }, + { "pet_skill_support", sizeof(struct pet_skill_support), SERVER_TYPE_MAP }, + { "s_pet_db", sizeof(struct s_pet_db), SERVER_TYPE_MAP }, + #else + #define MAP_PET_H + #endif // MAP_PET_H + #ifdef MAP_QUEST_H + { "quest_db", sizeof(struct quest_db), SERVER_TYPE_MAP }, + { "quest_dropitem", sizeof(struct quest_dropitem), SERVER_TYPE_MAP }, + { "quest_interface", sizeof(struct quest_interface), SERVER_TYPE_MAP }, + { "quest_objective", sizeof(struct quest_objective), SERVER_TYPE_MAP }, + #else + #define MAP_QUEST_H + #endif // MAP_QUEST_H #ifdef MAP_SCRIPT_H { "Script_Config", sizeof(struct Script_Config), SERVER_TYPE_MAP }, + { "casecheck_data", sizeof(struct casecheck_data), SERVER_TYPE_MAP }, + { "hQueue", sizeof(struct hQueue), SERVER_TYPE_MAP }, + { "hQueueIterator", sizeof(struct hQueueIterator), SERVER_TYPE_MAP }, { "reg_db", sizeof(struct reg_db), SERVER_TYPE_MAP }, + { "script_array", sizeof(struct script_array), SERVER_TYPE_MAP }, + { "script_code", sizeof(struct script_code), SERVER_TYPE_MAP }, + { "script_data", sizeof(struct script_data), SERVER_TYPE_MAP }, + { "script_function", sizeof(struct script_function), SERVER_TYPE_MAP }, { "script_interface", sizeof(struct script_interface), SERVER_TYPE_MAP }, + { "script_label_entry", sizeof(struct script_label_entry), SERVER_TYPE_MAP }, + { "script_retinfo", sizeof(struct script_retinfo), SERVER_TYPE_MAP }, + { "script_stack", sizeof(struct script_stack), SERVER_TYPE_MAP }, + { "script_state", sizeof(struct script_state), SERVER_TYPE_MAP }, + { "script_string_buf", sizeof(struct script_string_buf), SERVER_TYPE_MAP }, + { "script_syntax_data", sizeof(struct script_syntax_data), SERVER_TYPE_MAP }, + { "str_data_struct", sizeof(struct str_data_struct), SERVER_TYPE_MAP }, + { "string_translation", sizeof(struct string_translation), SERVER_TYPE_MAP }, #else #define MAP_SCRIPT_H #endif // MAP_SCRIPT_H #ifdef MAP_SEARCHSTORE_H + { "s_search_store_info", sizeof(struct s_search_store_info), SERVER_TYPE_MAP }, + { "s_search_store_info_item", sizeof(struct s_search_store_info_item), SERVER_TYPE_MAP }, { "searchstore_interface", sizeof(struct searchstore_interface), SERVER_TYPE_MAP }, #else #define MAP_SEARCHSTORE_H #endif // MAP_SEARCHSTORE_H #ifdef MAP_SKILL_H + { "s_skill_abra_db", sizeof(struct s_skill_abra_db), SERVER_TYPE_MAP }, + { "s_skill_arrow_db", sizeof(struct s_skill_arrow_db), SERVER_TYPE_MAP }, + { "s_skill_changematerial_db", sizeof(struct s_skill_changematerial_db), SERVER_TYPE_MAP }, + { "s_skill_db", sizeof(struct s_skill_db), SERVER_TYPE_MAP }, + { "s_skill_improvise_db", sizeof(struct s_skill_improvise_db), SERVER_TYPE_MAP }, + { "s_skill_magicmushroom_db", sizeof(struct s_skill_magicmushroom_db), SERVER_TYPE_MAP }, + { "s_skill_produce_db", sizeof(struct s_skill_produce_db), SERVER_TYPE_MAP }, + { "s_skill_spellbook_db", sizeof(struct s_skill_spellbook_db), SERVER_TYPE_MAP }, + { "s_skill_unit_layout", sizeof(struct s_skill_unit_layout), SERVER_TYPE_MAP }, { "skill_cd", sizeof(struct skill_cd), SERVER_TYPE_MAP }, + { "skill_cd_entry", sizeof(struct skill_cd_entry), SERVER_TYPE_MAP }, { "skill_condition", sizeof(struct skill_condition), SERVER_TYPE_MAP }, { "skill_interface", sizeof(struct skill_interface), SERVER_TYPE_MAP }, + { "skill_timerskill", sizeof(struct skill_timerskill), SERVER_TYPE_MAP }, + { "skill_unit", sizeof(struct skill_unit), SERVER_TYPE_MAP }, + { "skill_unit_group", sizeof(struct skill_unit_group), SERVER_TYPE_MAP }, + { "skill_unit_group_tickset", sizeof(struct skill_unit_group_tickset), SERVER_TYPE_MAP }, { "skill_unit_save", sizeof(struct skill_unit_save), SERVER_TYPE_MAP }, #else #define MAP_SKILL_H #endif // MAP_SKILL_H + #ifdef MAP_STATUS_H + { "regen_data", sizeof(struct regen_data), SERVER_TYPE_MAP }, + { "regen_data_sub", sizeof(struct regen_data_sub), SERVER_TYPE_MAP }, + { "s_refine_info", sizeof(struct s_refine_info), SERVER_TYPE_MAP }, + { "sc_display_entry", sizeof(struct sc_display_entry), SERVER_TYPE_MAP }, + { "status_change", sizeof(struct status_change), SERVER_TYPE_MAP }, + { "status_change_entry", sizeof(struct status_change_entry), SERVER_TYPE_MAP }, + { "status_data", sizeof(struct status_data), SERVER_TYPE_MAP }, + { "status_interface", sizeof(struct status_interface), SERVER_TYPE_MAP }, + { "weapon_atk", sizeof(struct weapon_atk), SERVER_TYPE_MAP }, + #else + #define MAP_STATUS_H + #endif // MAP_STATUS_H + #ifdef MAP_STORAGE_H + { "guild_storage_interface", sizeof(struct guild_storage_interface), SERVER_TYPE_MAP }, + { "storage_interface", sizeof(struct storage_interface), SERVER_TYPE_MAP }, + #else + #define MAP_STORAGE_H + #endif // MAP_STORAGE_H + #ifdef MAP_TRADE_H + { "trade_interface", sizeof(struct trade_interface), SERVER_TYPE_MAP }, + #else + #define MAP_TRADE_H + #endif // MAP_TRADE_H + #ifdef MAP_UNIT_H + { "unit_data", sizeof(struct unit_data), SERVER_TYPE_MAP }, + { "unit_interface", sizeof(struct unit_interface), SERVER_TYPE_MAP }, + { "view_data", sizeof(struct view_data), SERVER_TYPE_MAP }, + #else + #define MAP_UNIT_H + #endif // MAP_UNIT_H + #ifdef MAP_VENDING_H + { "s_vending", sizeof(struct s_vending), SERVER_TYPE_MAP }, + { "vending_interface", sizeof(struct vending_interface), SERVER_TYPE_MAP }, + #else + #define MAP_VENDING_H + #endif // MAP_VENDING_H }; HPExport unsigned int HPMDataCheckLen = ARRAYLENGTH(HPMDataCheck); HPExport int HPMDataCheckVer = 1; diff --git a/src/common/HPMi.h b/src/common/HPMi.h index 10cf4fd9f..b700c1b73 100644 --- a/src/common/HPMi.h +++ b/src/common/HPMi.h @@ -4,10 +4,10 @@ #ifndef COMMON_HPMI_H #define COMMON_HPMI_H -#include "../common/cbasetypes.h" -#include "../common/console.h" -#include "../common/core.h" -#include "../common/sql.h" +#include "common/cbasetypes.h" +#include "common/console.h" +#include "common/core.h" +#include "common/sql.h" struct script_state; struct AtCommandInfo; @@ -21,7 +21,7 @@ struct map_session_data; #endif /* after */ -#include "../common/showmsg.h" +#include "common/showmsg.h" #define HPM_VERSION "1.0" #define HPM_ADDCONF_LENGTH 40 diff --git a/src/common/Makefile.in b/src/common/Makefile.in index 5dfdd35bd..f6f993165 100644 --- a/src/common/Makefile.in +++ b/src/common/Makefile.in @@ -6,17 +6,20 @@ CONFIG_D = ../config CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h) -LIBCONFIG_D = ../../3rdparty/libconfig +COMMON_INCLUDE = -I.. + +THIRDPARTY_D = ../../3rdparty +THIRDPARTY_INCLUDE = -I$(THIRDPARTY_D) + +LIBCONFIG_D = $(THIRDPARTY_D)/libconfig LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \ scanner.o strbuf.o) LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \ scanctx.h scanner.h strbuf.h wincompat.h) -LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D) -MT19937AR_D = ../../3rdparty/mt19937ar +MT19937AR_D = $(THIRDPARTY_D)/mt19937ar MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o MT19937AR_H = $(MT19937AR_D)/mt19937ar.h -MT19937AR_INCLUDE = -I$(MT19937AR_D) COMMON_SHARED_C = conf.c db.c des.c ers.c grfio.c HPM.c mapindex.c md5calc.c \ mutex.c nullpo.c random.c showmsg.c strlib.c sysinfo.c \ @@ -116,15 +119,15 @@ obj_all/sysinfo.o: sysinfo.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_ obj_all/%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all @echo " CC $<" - @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $< + @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $< obj_all/mini%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all @echo " CC $<" - @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) -DMINICORE @CPPFLAGS@ -c $(OUTPUT_OPTION) $< + @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) -DMINICORE @CPPFLAGS@ -c $(OUTPUT_OPTION) $< obj_sql/%.o: %.c $(COMMON_H) $(COMMON_SQL_H) $(CONFIG_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_sql @echo " CC $<" - @$(CC) @CFLAGS@ @DEFS@ $(LIBCONFIG_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< + @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< # missing object files $(MT19937AR_OBJ): diff --git a/src/common/atomic.h b/src/common/atomic.h index a42dfad1c..c1ea2aa48 100644 --- a/src/common/atomic.h +++ b/src/common/atomic.h @@ -14,10 +14,10 @@ // // our Abstraction is fully API-Compatible to Microsoft's implementation @ NT5.0+ // -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" #if defined(_MSC_VER) -#include "../common/winapi.h" +#include "common/winapi.h" // This checks if C/C++ Compiler Version is 18.00 #if _MSC_VER < 1800 diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h index a0fa77fb5..ce8fc6bcf 100644 --- a/src/common/cbasetypes.h +++ b/src/common/cbasetypes.h @@ -97,6 +97,7 @@ #include <inttypes.h> #include <stdint.h> #include <limits.h> +#include <time.h> // temporary fix for bugreport:4961 (unintended conversion from signed to unsigned) // (-20 >= UCHAR_MAX) returns true diff --git a/src/common/conf.c b/src/common/conf.c index c974decf9..cb0194c3a 100644 --- a/src/common/conf.c +++ b/src/common/conf.c @@ -6,9 +6,9 @@ #include "conf.h" -#include "../../3rdparty/libconfig/libconfig.h" +#include "common/showmsg.h" // ShowError -#include "../common/showmsg.h" // ShowError +#include <libconfig/libconfig.h> /* interface source */ struct libconfig_interface libconfig_s; diff --git a/src/common/conf.h b/src/common/conf.h index bd97d5c1e..1889aeb3a 100644 --- a/src/common/conf.h +++ b/src/common/conf.h @@ -5,9 +5,9 @@ #ifndef COMMON_CONF_H #define COMMON_CONF_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" -#include "../../3rdparty/libconfig/libconfig.h" +#include <libconfig/libconfig.h> /** * The libconfig interface -- specially for plugins, but we enforce it throughout the core to be consistent diff --git a/src/common/console.c b/src/common/console.c index 1eba48fa2..95d1e69fe 100644 --- a/src/common/console.c +++ b/src/common/console.c @@ -4,34 +4,33 @@ #define HERCULES_CORE -#include "../config/core.h" // CONSOLE_INPUT, MAX_CONSOLE_INPUT +#include "config/core.h" // CONSOLE_INPUT, MAX_CONSOLE_INPUT #include "console.h" -#include <stdio.h> -#include <stdlib.h> - -#include "../common/cbasetypes.h" -#include "../common/core.h" -#include "../common/showmsg.h" -#include "../common/sysinfo.h" +#include "common/cbasetypes.h" +#include "common/core.h" +#include "common/showmsg.h" +#include "common/sysinfo.h" #ifndef MINICORE -# include "../common/atomic.h" -# include "../common/ers.h" -# include "../common/malloc.h" -# include "../common/mutex.h" -# include "../common/spinlock.h" -# include "../common/sql.h" -# include "../common/strlib.h" -# include "../common/thread.h" -# include "../common/timer.h" +# include "common/atomic.h" +# include "common/ers.h" +# include "common/malloc.h" +# include "common/mutex.h" +# include "common/spinlock.h" +# include "common/sql.h" +# include "common/strlib.h" +# include "common/thread.h" +# include "common/timer.h" #endif +#include <stdio.h> +#include <stdlib.h> #if !defined(WIN32) # include <sys/time.h> # include <unistd.h> #else -# include "../common/winapi.h" // Console close event handling +# include "common/winapi.h" // Console close event handling # ifdef CONSOLE_INPUT # include <conio.h> /* _kbhit() */ # endif diff --git a/src/common/console.h b/src/common/console.h index 3d3c8e9dd..643edc3d9 100644 --- a/src/common/console.h +++ b/src/common/console.h @@ -4,13 +4,13 @@ #ifndef COMMON_CONSOLE_H #define COMMON_CONSOLE_H -#include "../config/core.h" // MAX_CONSOLE_INPUT +#include "config/core.h" // MAX_CONSOLE_INPUT -#include "../common/cbasetypes.h" -#include "../common/mutex.h" -#include "../common/spinlock.h" -#include "../common/sql.h" -#include "../common/thread.h" +#include "common/cbasetypes.h" +#include "common/mutex.h" +#include "common/spinlock.h" +#include "common/sql.h" +#include "common/thread.h" /** * Queue Max diff --git a/src/common/core.c b/src/common/core.c index ea028002a..e663c4e4c 100644 --- a/src/common/core.c +++ b/src/common/core.c @@ -4,41 +4,39 @@ #define HERCULES_CORE -#include "../config/core.h" +#include "config/core.h" #include "core.h" -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "../common/cbasetypes.h" -#include "../common/console.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/sysinfo.h" -#include "../common/nullpo.h" +#include "common/cbasetypes.h" +#include "common/console.h" +#include "common/db.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/strlib.h" +#include "common/sysinfo.h" +#include "common/nullpo.h" #ifndef MINICORE -# include "../common/HPM.h" -# include "../common/conf.h" -# include "../common/db.h" -# include "../common/ers.h" -# include "../common/socket.h" -# include "../common/sql.h" -# include "../common/thread.h" -# include "../common/timer.h" -# include "../common/utils.h" +# include "common/HPM.h" +# include "common/conf.h" +# include "common/ers.h" +# include "common/socket.h" +# include "common/sql.h" +# include "common/thread.h" +# include "common/timer.h" +# include "common/utils.h" #endif #ifndef _WIN32 # include <unistd.h> #else -# include "../common/winapi.h" // Console close event handling +# include "common/winapi.h" // Console close event handling #endif +#include <signal.h> +#include <stdio.h> +#include <stdlib.h> /// Called when a terminate signal is received. void (*shutdown_callback)(void) = NULL; diff --git a/src/common/core.h b/src/common/core.h index 827d345ba..c2a8d9e58 100644 --- a/src/common/core.h +++ b/src/common/core.h @@ -5,9 +5,7 @@ #ifndef COMMON_CORE_H #define COMMON_CORE_H -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/mmo.h" +#include "common/cbasetypes.h" /* so that developers with --enable-debug can raise signals from any section of the code they'd like */ #ifdef DEBUG diff --git a/src/common/db.c b/src/common/db.c index 69e2333a9..5063425e6 100644 --- a/src/common/db.c +++ b/src/common/db.c @@ -72,15 +72,15 @@ #include "db.h" +#include "common/ers.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/showmsg.h" +#include "common/strlib.h" + #include <stdio.h> #include <stdlib.h> -#include "../common/ers.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" - struct db_interface DB_s; /*****************************************************************************\ diff --git a/src/common/db.h b/src/common/db.h index 4883489d7..f75cbd8dc 100644 --- a/src/common/db.h +++ b/src/common/db.h @@ -42,9 +42,9 @@ #ifndef COMMON_DB_H #define COMMON_DB_H -#include <stdarg.h> +#include "common/cbasetypes.h" -#include "../common/cbasetypes.h" +#include <stdarg.h> /*****************************************************************************\ * (1) Section with public typedefs, enums, unions, structures and defines. * diff --git a/src/common/des.c b/src/common/des.c index 89a920bc9..0a702bfdf 100644 --- a/src/common/des.c +++ b/src/common/des.c @@ -5,7 +5,7 @@ #include "des.h" -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" /// DES (Data Encryption Standard) algorithm, modified version. /// @see http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=5099. diff --git a/src/common/des.h b/src/common/des.h index 9e6aec4fd..6f54b36f2 100644 --- a/src/common/des.h +++ b/src/common/des.h @@ -3,7 +3,7 @@ #ifndef COMMON_DES_H #define COMMON_DES_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" /// One 64-bit block. typedef struct BIT64 { uint8_t b[8]; } BIT64; diff --git a/src/common/ers.c b/src/common/ers.c index 52cba0fe5..91fc6ccfb 100644 --- a/src/common/ers.c +++ b/src/common/ers.c @@ -44,14 +44,14 @@ #include "ers.h" +#include "common/cbasetypes.h" +#include "common/malloc.h" // CREATE, RECREATE, aMalloc, aFree +#include "common/nullpo.h" +#include "common/showmsg.h" // ShowMessage, ShowError, ShowFatalError, CL_BOLD, CL_NORMAL + #include <stdlib.h> #include <string.h> -#include "../common/cbasetypes.h" -#include "../common/malloc.h" // CREATE, RECREATE, aMalloc, aFree -#include "../common/nullpo.h" -#include "../common/showmsg.h" // ShowMessage, ShowError, ShowFatalError, CL_BOLD, CL_NORMAL - #ifndef DISABLE_ERS #define ERS_BLOCK_ENTRIES 2048 diff --git a/src/common/ers.h b/src/common/ers.h index 0117237d7..09290186e 100644 --- a/src/common/ers.h +++ b/src/common/ers.h @@ -40,7 +40,7 @@ #ifndef COMMON_ERS_H #define COMMON_ERS_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" /*****************************************************************************\ * (1) All public parts of the Entry Reusage System. * diff --git a/src/common/grfio.c b/src/common/grfio.c index 41a888267..614678da8 100644 --- a/src/common/grfio.c +++ b/src/common/grfio.c @@ -6,20 +6,19 @@ #include "grfio.h" +#include "common/cbasetypes.h" +#include "common/des.h" +#include "common/malloc.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/strlib.h" +#include "common/utils.h" + #include <stdio.h> #include <stdlib.h> -#include <string.h> #include <sys/stat.h> #include <zlib.h> -#include "../common/cbasetypes.h" -#include "../common/des.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/utils.h" - //---------------------------- // file entry table struct //---------------------------- diff --git a/src/common/malloc.c b/src/common/malloc.c index c647dc18f..ec0467495 100644 --- a/src/common/malloc.c +++ b/src/common/malloc.c @@ -6,14 +6,14 @@ #include "malloc.h" +#include "common/cbasetypes.h" +#include "common/core.h" +#include "common/showmsg.h" +#include "common/sysinfo.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <time.h> - -#include "../common/core.h" -#include "../common/showmsg.h" -#include "../common/sysinfo.h" struct malloc_interface iMalloc_s; @@ -22,7 +22,7 @@ struct malloc_interface iMalloc_s; #if defined(MEMWATCH) # include <string.h> -# include "memwatch.h" +# include <memwatch.h> # define MALLOC(n,file,line,func) mwMalloc((n),(file),(line)) # define CALLOC(m,n,file,line,func) mwCalloc((m),(n),(file),(line)) # define REALLOC(p,n,file,line,func) mwRealloc((p),(n),(file),(line)) @@ -36,7 +36,7 @@ struct malloc_interface iMalloc_s; # include <string.h> # include <stdlib.h> -# include "dmalloc.h" +# include <dmalloc.h> # define MALLOC(n,file,line,func) dmalloc_malloc((file),(line),(n),DMALLOC_FUNC_MALLOC,0,0) # define CALLOC(m,n,file,line,func) dmalloc_malloc((file),(line),(m)*(n),DMALLOC_FUNC_CALLOC,0,0) # define REALLOC(p,n,file,line,func) dmalloc_realloc((file),(line),(p),(n),DMALLOC_FUNC_REALLOC,0) @@ -48,7 +48,7 @@ struct malloc_interface iMalloc_s; #elif defined(GCOLLECT) -# include "gc.h" +# include <gc.h> # ifdef GC_ADD_CALLER # define RETURN_ADDR 0, # else diff --git a/src/common/malloc.h b/src/common/malloc.h index 7ed2fb19c..20260de84 100644 --- a/src/common/malloc.h +++ b/src/common/malloc.h @@ -4,7 +4,7 @@ #ifndef COMMON_MALLOC_H #define COMMON_MALLOC_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" #define ALC_MARK __FILE__, __LINE__, __func__ diff --git a/src/common/mapindex.c b/src/common/mapindex.c index e07ccd679..18aa413cc 100644 --- a/src/common/mapindex.c +++ b/src/common/mapindex.c @@ -6,15 +6,14 @@ #include "mapindex.h" +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/mmo.h" +#include "common/showmsg.h" +#include "common/strlib.h" + #include <stdio.h> #include <stdlib.h> -#include <string.h> - -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" /* mapindex.c interface source */ struct mapindex_interface mapindex_s; diff --git a/src/common/mapindex.h b/src/common/mapindex.h index 87a275f57..c334e7cca 100644 --- a/src/common/mapindex.h +++ b/src/common/mapindex.h @@ -5,8 +5,9 @@ #ifndef COMMON_MAPINDEX_H #define COMMON_MAPINDEX_H -#include "../common/db.h" -#include "../common/mmo.h" +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/mmo.h" #define MAX_MAPINDEX 2000 diff --git a/src/common/md5calc.c b/src/common/md5calc.c index 7b31a38d6..e594c364f 100644 --- a/src/common/md5calc.c +++ b/src/common/md5calc.c @@ -10,16 +10,13 @@ #include "md5calc.h" +#include "common/cbasetypes.h" +#include "common/random.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "../common/random.h" - -#ifndef UINT_MAX -#define UINT_MAX 4294967295U -#endif - // Global variable static unsigned int *pX; diff --git a/src/common/mmo.h b/src/common/mmo.h index 766ccf182..3e497c667 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -5,11 +5,8 @@ #ifndef COMMON_MMO_H #define COMMON_MMO_H -#include <time.h> - -#include "../config/core.h" -#include "../common/cbasetypes.h" -#include "../common/db.h" +#include "config/core.h" +#include "common/cbasetypes.h" // server->client protocol version // 0 - pre-? diff --git a/src/common/mutex.c b/src/common/mutex.c index 7307f5f15..5dfb3d01c 100644 --- a/src/common/mutex.c +++ b/src/common/mutex.c @@ -5,20 +5,18 @@ #include "mutex.h" -#include "../common/cbasetypes.h" // for WIN32 +#include "common/cbasetypes.h" // for WIN32 +#include "common/malloc.h" +#include "common/showmsg.h" +#include "common/timer.h" #ifdef WIN32 -#include "../common/winapi.h" +#include "common/winapi.h" #else #include <pthread.h> -#include <time.h> #include <sys/time.h> #endif -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/timer.h" - struct ramutex{ #ifdef WIN32 CRITICAL_SECTION hMutex; diff --git a/src/common/mutex.h b/src/common/mutex.h index fa8170c98..a70f0e8fd 100644 --- a/src/common/mutex.h +++ b/src/common/mutex.h @@ -4,7 +4,7 @@ #ifndef COMMON_MUTEX_H #define COMMON_MUTEX_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" typedef struct ramutex ramutex; // Mutex typedef struct racond racond; // Condition Var diff --git a/src/common/nullpo.c b/src/common/nullpo.c index 97b206835..a8980885f 100644 --- a/src/common/nullpo.c +++ b/src/common/nullpo.c @@ -6,6 +6,8 @@ #include "nullpo.h" +#include "common/showmsg.h" + #include <stdio.h> #include <stdarg.h> #include <stdlib.h> @@ -14,8 +16,6 @@ #include <execinfo.h> #endif -#include "../common/showmsg.h" - struct nullpo_interface nullpo_s; /** @@ -43,11 +43,11 @@ void assert_report(const char *file, int line, const char *func, const char *tar ShowError("--- %s --------------------------------------------\n", title); ShowError("%s:%d: '%s' in function `%s'\n", file, line, targetname, func); #ifdef __GNUC__ - size = backtrace (array, 10); - strings = backtrace_symbols (array, size); + size = (int)backtrace(array, 10); + strings = backtrace_symbols(array, size); for (i = 0; i < size; i++) ShowError("%s\n", strings[i]); - free (strings); + free(strings); #endif ShowError("--- end %s ----------------------------------------\n", title); } diff --git a/src/common/nullpo.h b/src/common/nullpo.h index 573e351e0..a59c2ac2b 100644 --- a/src/common/nullpo.h +++ b/src/common/nullpo.h @@ -5,7 +5,7 @@ #ifndef COMMON_NULLPO_H #define COMMON_NULLPO_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" // enabled by default on debug builds #if defined(DEBUG) && !defined(NULLPO_CHECK) diff --git a/src/common/random.c b/src/common/random.c index 88d5748cf..a4d7c5d34 100644 --- a/src/common/random.c +++ b/src/common/random.c @@ -5,16 +5,14 @@ #include "random.h" -#include <time.h> // time +#include "common/cbasetypes.h" // for WIN32 +#include "common/showmsg.h" +#include "common/timer.h" // gettick -#include <mt19937ar.h> // init_genrand, genrand_int32, genrand_res53 - -#include "../common/cbasetypes.h" // for WIN32 -#include "../common/showmsg.h" -#include "../common/timer.h" // gettick +#include <mt19937ar/mt19937ar.h> // init_genrand, genrand_int32, genrand_res53 #if defined(WIN32) -# include "../common/winapi.h" +# include "common/winapi.h" #elif defined(HAVE_GETPID) || defined(HAVE_GETTID) # include <sys/types.h> # include <unistd.h> diff --git a/src/common/random.h b/src/common/random.h index 0ca375d28..379e675b2 100644 --- a/src/common/random.h +++ b/src/common/random.h @@ -4,7 +4,7 @@ #ifndef COMMON_RANDOM_H #define COMMON_RANDOM_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" #ifdef HERCULES_CORE void rnd_init(void); diff --git a/src/common/showmsg.c b/src/common/showmsg.c index 0dd645eeb..01dc0b01a 100644 --- a/src/common/showmsg.c +++ b/src/common/showmsg.c @@ -6,20 +6,18 @@ #include "showmsg.h" +#include "common/cbasetypes.h" +#include "common/core.h" //[Ind] - For SERVER_TYPE +#include "common/strlib.h" // StringBuf + +#include <libconfig/libconfig.h> + #include <stdarg.h> #include <stdio.h> #include <stdlib.h> // atexit -#include <string.h> -#include <time.h> - -#include "../../3rdparty/libconfig/libconfig.h" - -#include "../common/cbasetypes.h" -#include "../common/core.h" //[Ind] - For SERVER_TYPE -#include "../common/strlib.h" // StringBuf #ifdef WIN32 -# include "../common/winapi.h" +# include "common/winapi.h" #else // not WIN32 # include <unistd.h> #endif // WIN32 diff --git a/src/common/showmsg.h b/src/common/showmsg.h index 0624f1786..63e42ab57 100644 --- a/src/common/showmsg.h +++ b/src/common/showmsg.h @@ -5,16 +5,16 @@ #ifndef COMMON_SHOWMSG_H #define COMMON_SHOWMSG_H -#include <stdarg.h> - -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" #ifdef HERCULES_CORE -# include "../../3rdparty/libconfig/libconfig.h" +# include <libconfig/libconfig.h> #else -# include "../common/HPMi.h" +# include "common/HPMi.h" #endif +#include <stdarg.h> + // for help with the console colors look here: // http://www.edoceo.com/liberum/?doc=printf-with-color // some code explanation (used here): diff --git a/src/common/socket.c b/src/common/socket.c index 1b7f36f8b..17c31db50 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -4,26 +4,26 @@ #define HERCULES_CORE -#include "../config/core.h" // SHOW_SERVER_STATS +#include "config/core.h" // SHOW_SERVER_STATS #define H_SOCKET_C #include "socket.h" #undef H_SOCKET_C +#include "common/HPM.h" +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/showmsg.h" +#include "common/strlib.h" +#include "common/timer.h" + #include <stdio.h> #include <stdlib.h> -#include <string.h> #include <sys/types.h> -#include "../common/HPM.h" -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/timer.h" - #ifdef WIN32 -# include "../common/winapi.h" +# include "common/winapi.h" #else # include <arpa/inet.h> # include <errno.h> diff --git a/src/common/socket.h b/src/common/socket.h index 6323a6862..bd5d9baa2 100644 --- a/src/common/socket.h +++ b/src/common/socket.h @@ -5,12 +5,10 @@ #ifndef COMMON_SOCKET_H #define COMMON_SOCKET_H -#include <time.h> - -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" #ifdef WIN32 -# include "../common/winapi.h" +# include "common/winapi.h" typedef long in_addr_t; #else # include <netinet/in.h> diff --git a/src/common/spinlock.h b/src/common/spinlock.h index 413067b68..811b239df 100644 --- a/src/common/spinlock.h +++ b/src/common/spinlock.h @@ -14,12 +14,12 @@ // // -#include "../common/atomic.h" -#include "../common/cbasetypes.h" -#include "../common/thread.h" +#include "common/atomic.h" +#include "common/cbasetypes.h" +#include "common/thread.h" #ifdef WIN32 -#include "../common/winapi.h" +#include "common/winapi.h" #endif #ifdef WIN32 diff --git a/src/common/sql.c b/src/common/sql.c index 4ca14d43b..a93092533 100644 --- a/src/common/sql.c +++ b/src/common/sql.c @@ -6,19 +6,17 @@ #include "sql.h" -#include <stdlib.h> // strtoul -#include <string.h> // strlen/strnlen/memcpy/memset - -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/timer.h" +#include "common/cbasetypes.h" +#include "common/malloc.h" +#include "common/showmsg.h" +#include "common/strlib.h" +#include "common/timer.h" #ifdef WIN32 -# include "../common/winapi.h" // Needed before mysql.h +# include "common/winapi.h" // Needed before mysql.h #endif #include <mysql.h> +#include <stdlib.h> // strtoul void hercules_mysql_error_handler(unsigned int ecode); diff --git a/src/common/sql.h b/src/common/sql.h index c3598273e..d76b4f9d4 100644 --- a/src/common/sql.h +++ b/src/common/sql.h @@ -5,9 +5,9 @@ #ifndef COMMON_SQL_H #define COMMON_SQL_H -#include <stdarg.h>// va_list +#include "common/cbasetypes.h" -#include "../common/cbasetypes.h" +#include <stdarg.h>// va_list // Return codes #define SQL_ERROR (-1) diff --git a/src/common/strlib.c b/src/common/strlib.c index b5fcff576..555f591e6 100644 --- a/src/common/strlib.c +++ b/src/common/strlib.c @@ -8,14 +8,14 @@ #include "strlib.h" #undef H_STRLIB_C +#include "common/cbasetypes.h" +#include "common/malloc.h" +#include "common/showmsg.h" + #include <errno.h> #include <stdio.h> #include <stdlib.h> -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" - #define J_MAX_MALLOC_SIZE 65535 struct strlib_interface strlib_s; diff --git a/src/common/strlib.h b/src/common/strlib.h index c687d9e17..a768ebff5 100644 --- a/src/common/strlib.h +++ b/src/common/strlib.h @@ -5,11 +5,11 @@ #ifndef COMMON_STRLIB_H #define COMMON_STRLIB_H +#include "common/cbasetypes.h" + #include <stdarg.h> #include <string.h> -#include "../common/cbasetypes.h" - #ifdef WIN32 #define HAVE_STRTOK_R #define strtok_r(s,delim,save_ptr) strtok_r_((s),(delim),(save_ptr)) diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index 7edc5c72e..a27357e7e 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -8,16 +8,14 @@ #include "sysinfo.h" +#include "common/cbasetypes.h" +#include "common/core.h" +#include "common/malloc.h" +#include "common/strlib.h" + #include <stdio.h> // fopen #include <stdlib.h> // atoi - -#include "../common/cbasetypes.h" -#include "../common/core.h" -#include "../common/malloc.h" -#include "../common/strlib.h" - #ifdef WIN32 -# include <string.h> // strlen # include <windows.h> #else # include <unistd.h> diff --git a/src/common/sysinfo.h b/src/common/sysinfo.h index 8c8f6dbe6..3c0d01ca1 100644 --- a/src/common/sysinfo.h +++ b/src/common/sysinfo.h @@ -11,7 +11,7 @@ * cached at compile time) */ -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" struct sysinfo_private; diff --git a/src/common/thread.c b/src/common/thread.c index 95212b4b0..9b9308d06 100644 --- a/src/common/thread.c +++ b/src/common/thread.c @@ -10,10 +10,13 @@ #include "thread.h" -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" +#include "common/malloc.h" +#include "common/showmsg.h" +#include "common/sysinfo.h" // sysinfo->getpagesize() #ifdef WIN32 -# include "../common/winapi.h" +# include "common/winapi.h" # define __thread __declspec( thread ) #else # include <pthread.h> @@ -24,10 +27,6 @@ # include <unistd.h> #endif -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/sysinfo.h" // sysinfo->getpagesize() - // When Compiling using MSC (on win32..) we know we have support in any case! #ifdef _MSC_VER #define HAS_TLS diff --git a/src/common/thread.h b/src/common/thread.h index f79eb77f9..36ea006b3 100644 --- a/src/common/thread.h +++ b/src/common/thread.h @@ -4,7 +4,7 @@ #ifndef COMMON_THREAD_H #define COMMON_THREAD_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" typedef struct rAthread rAthread; typedef void* (*rAthreadProc)(void*); diff --git a/src/common/timer.c b/src/common/timer.c index 45dbb9f50..06309642e 100644 --- a/src/common/timer.c +++ b/src/common/timer.c @@ -6,24 +6,23 @@ #include "timer.h" -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> - -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/utils.h" +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/malloc.h" +#include "common/showmsg.h" +#include "common/utils.h" #ifdef WIN32 -# include "../common/winapi.h" // GetTickCount() +# include "common/winapi.h" // GetTickCount() #else # include <sys/time.h> // struct timeval, gettimeofday() # include <unistd.h> #endif +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + struct timer_interface timer_s; // If the server can't handle processing thousands of monsters diff --git a/src/common/timer.h b/src/common/timer.h index 6e8a72389..46a036ec7 100644 --- a/src/common/timer.h +++ b/src/common/timer.h @@ -5,7 +5,7 @@ #ifndef COMMON_TIMER_H #define COMMON_TIMER_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" #define DIFF_TICK(a,b) ((a)-(b)) #define DIFF_TICK32(a,b) ((int32)((a)-(b))) diff --git a/src/common/utils.c b/src/common/utils.c index ad68706ca..07e2e9fdf 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -6,32 +6,28 @@ #include "utils.h" -#include <math.h> // floor() -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sys/stat.h> // cache purposes [Ind/Hercules] - -#include "../common/cbasetypes.h" -#include "../common/core.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" +#include "common/cbasetypes.h" +#include "common/core.h" +#include "common/mmo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" #ifdef WIN32 -# include "../common/winapi.h" +# include "common/winapi.h" # ifndef F_OK # define F_OK 0x0 # endif /* F_OK */ #else # include <dirent.h> -# include <sys/stat.h> # include <unistd.h> #endif +#include <math.h> // floor() +#include <stdio.h> +#include <stdlib.h> +#include <sys/stat.h> // cache purposes [Ind/Hercules] + struct HCache_interface HCache_s; /// Dumps given buffer into file pointed to by a handle. diff --git a/src/common/utils.h b/src/common/utils.h index e6102f184..0ac818468 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -5,10 +5,9 @@ #ifndef COMMON_UTILS_H #define COMMON_UTILS_H -#include <stdio.h> // FILE* -#include <time.h> +#include "common/cbasetypes.h" -#include "../common/cbasetypes.h" +#include <stdio.h> // FILE* /* [HCache] 1-byte key to ensure our method is the latest, we can modify to ensure the method matches */ #define HCACHE_KEY 'k' diff --git a/src/login/HPMlogin.c b/src/login/HPMlogin.c index 6b223d249..129f88c38 100644 --- a/src/login/HPMlogin.c +++ b/src/login/HPMlogin.c @@ -5,26 +5,34 @@ #include "HPMlogin.h" -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> - -#include "../common/HPM.h" -#include "../common/cbasetypes.h" -#include "../common/conf.h" -#include "../common/db.h" -#include "../common/des.h" -#include "../common/ers.h" -#include "../common/malloc.h" -#include "../common/mapindex.h" -#include "../common/mmo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/sysinfo.h" - -#include "../common/HPMDataCheck.h" +#include "common/HPM.h" +#include "common/cbasetypes.h" + +#if 0 // TODO (HPMDataCheck is disabled for the time being) +#include "login/account.h" +#include "login/login.h" +#include "common/HPMi.h" +#include "common/conf.h" +#include "common/console.h" +#include "common/core.h" +#include "common/db.h" +#include "common/des.h" +#include "common/ers.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/spinlock.h" +#include "common/sql.h" +#include "common/strlib.h" +#include "common/sysinfo.h" +#include "common/timer.h" +#include "common/utils.h" + +// HPMDataCheck comes after all the other includes +#include "common/HPMDataCheck.h" +#endif bool HPM_login_grabHPData(struct HPDataOperationStorage *ret, enum HPluginDataTypes type, void *ptr) { /* record address */ diff --git a/src/login/HPMlogin.h b/src/login/HPMlogin.h index 6e01eae01..2a4d5c538 100644 --- a/src/login/HPMlogin.h +++ b/src/login/HPMlogin.h @@ -8,8 +8,8 @@ #error You should never include HPMlogin.h from a plugin. #endif -#include "../common/cbasetypes.h" -#include "../common/HPM.h" +#include "common/cbasetypes.h" +#include "common/HPM.h" struct hplugin; diff --git a/src/login/Makefile.in b/src/login/Makefile.in index 9b1db69c2..60382dc87 100644 --- a/src/login/Makefile.in +++ b/src/login/Makefile.in @@ -9,18 +9,20 @@ CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h) COMMON_D = ../common COMMON_H = $(wildcard $(COMMON_D)/*.h) SYSINFO_INC = $(COMMON_D)/sysinfo.inc +COMMON_INCLUDE = -I.. -LIBCONFIG_D = ../../3rdparty/libconfig +THIRDPARTY_D = ../../3rdparty +THIRDPARTY_INCLUDE = -I$(THIRDPARTY_D) + +LIBCONFIG_D = $(THIRDPARTY_D)/libconfig LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \ scanner.o strbuf.o) LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \ scanctx.h scanner.h strbuf.h wincompat.h) -LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D) -MT19937AR_D = ../../3rdparty/mt19937ar +MT19937AR_D = $(THIRDPARTY_D)/mt19937ar MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o MT19937AR_H = $(MT19937AR_D)/mt19937ar.h -MT19937AR_INCLUDE = -I$(MT19937AR_D) LOGIN_C = account_sql.c HPMlogin.c ipban_sql.c login.c loginlog_sql.c LOGIN_OBJ = $(addprefix obj_sql/, $(patsubst %.c,%.o,$(LOGIN_C))) @@ -94,7 +96,7 @@ login-server: ../../login-server@EXEEXT@ obj_sql/%.o: %.c $(LOGIN_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql @echo " CC $<" - @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< + @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< # missing object files $(COMMON_D)/obj_all/common.a: diff --git a/src/login/account.h b/src/login/account.h index 82ae28bbb..1e95c19de 100644 --- a/src/login/account.h +++ b/src/login/account.h @@ -5,9 +5,9 @@ #ifndef LOGIN_ACCOUNT_H #define LOGIN_ACCOUNT_H -#include "../common/cbasetypes.h" -#include "../common/mmo.h" // ACCOUNT_REG2_NUM -#include "../common/sql.h" // Sql +#include "common/cbasetypes.h" +#include "common/mmo.h" // ACCOUNT_REG2_NUM +#include "common/sql.h" // Sql typedef struct AccountDB AccountDB; typedef struct AccountDBIterator AccountDBIterator; diff --git a/src/login/account_sql.c b/src/login/account_sql.c index 8975250b8..3f72e6867 100644 --- a/src/login/account_sql.c +++ b/src/login/account_sql.c @@ -4,21 +4,20 @@ #define HERCULES_CORE -#include "../config/core.h" // CONSOLE_INPUT +#include "config/core.h" // CONSOLE_INPUT #include "account.h" +#include "common/cbasetypes.h" +#include "common/console.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/sql.h" +#include "common/strlib.h" + #include <stdlib.h> -#include <string.h> - -#include "../common/console.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/sql.h" -#include "../common/strlib.h" -#include "../common/timer.h" /// global defines #define ACCOUNT_SQL_DB_VERSION 20110114 diff --git a/src/login/ipban.h b/src/login/ipban.h index c6535ec10..8f3cac16c 100644 --- a/src/login/ipban.h +++ b/src/login/ipban.h @@ -4,7 +4,7 @@ #ifndef LOGIN_IPBAN_H #define LOGIN_IPBAN_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" #ifdef HERCULES_CORE // TODO: Interface diff --git a/src/login/ipban_sql.c b/src/login/ipban_sql.c index f995450ce..b4fce009d 100644 --- a/src/login/ipban_sql.c +++ b/src/login/ipban_sql.c @@ -6,19 +6,15 @@ #include "ipban.h" +#include "login/login.h" +#include "login/loginlog.h" +#include "common/cbasetypes.h" +#include "common/nullpo.h" +#include "common/sql.h" +#include "common/strlib.h" +#include "common/timer.h" + #include <stdlib.h> -#include <string.h> - -#include "login.h" -#include "loginlog.h" -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/sql.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/timer.h" // global sql settings static char global_db_hostname[32] = "127.0.0.1"; diff --git a/src/login/login.c b/src/login/login.c index 9c01c3956..1fdf2d198 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -6,26 +6,26 @@ #include "login.h" +#include "login/HPMlogin.h" +#include "login/account.h" +#include "login/ipban.h" +#include "login/loginlog.h" +#include "common/HPM.h" +#include "common/cbasetypes.h" +#include "common/core.h" +#include "common/db.h" +#include "common/malloc.h" +#include "common/md5calc.h" +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "common/timer.h" +#include "common/utils.h" + #include <stdio.h> #include <stdlib.h> -#include <string.h> - -#include "HPMlogin.h" -#include "account.h" -#include "ipban.h" -#include "loginlog.h" -#include "../common/HPM.h" -#include "../common/core.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/md5calc.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/timer.h" -#include "../common/utils.h" struct login_interface login_s; struct Login_Config login_config; diff --git a/src/login/login.h b/src/login/login.h index 22bae50e0..f05ff6d0f 100644 --- a/src/login/login.h +++ b/src/login/login.h @@ -5,8 +5,10 @@ #ifndef LOGIN_LOGIN_H #define LOGIN_LOGIN_H -#include "../common/core.h" // CORE_ST_LAST -#include "../common/mmo.h" // NAME_LENGTH,SEX_* +#include "common/cbasetypes.h" +#include "common/core.h" // CORE_ST_LAST +#include "common/db.h" +#include "common/mmo.h" // NAME_LENGTH,SEX_* struct mmo_account; struct AccountDB; diff --git a/src/login/loginlog.h b/src/login/loginlog.h index 2104ff277..f4327764a 100644 --- a/src/login/loginlog.h +++ b/src/login/loginlog.h @@ -4,7 +4,7 @@ #ifndef LOGIN_LOGINLOG_H #define LOGIN_LOGINLOG_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" #ifdef HERCULES_CORE // TODO: Interface diff --git a/src/login/loginlog_sql.c b/src/login/loginlog_sql.c index 2c6f76e38..da698e187 100644 --- a/src/login/loginlog_sql.c +++ b/src/login/loginlog_sql.c @@ -6,15 +6,14 @@ #include "loginlog.h" -#include <string.h> -#include <stdlib.h> // exit +#include "common/cbasetypes.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/socket.h" +#include "common/sql.h" +#include "common/strlib.h" -#include "../common/cbasetypes.h" -#include "../common/mmo.h" -#include "../common/nullpo.h" -#include "../common/socket.h" -#include "../common/sql.h" -#include "../common/strlib.h" +#include <stdlib.h> // exit // global sql settings (in ipban_sql.c) static char global_db_hostname[32] = "127.0.0.1"; diff --git a/src/map/HPMmap.c b/src/map/HPMmap.c index d6a1bd8ef..7600d3d0c 100644 --- a/src/map/HPMmap.c +++ b/src/map/HPMmap.c @@ -5,63 +5,73 @@ #include "HPMmap.h" -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> +#include "common/HPM.h" +#include "common/cbasetypes.h" + +#include "common/HPMi.h" +#include "common/conf.h" +#include "common/console.h" +#include "common/core.h" +#include "common/db.h" +#include "common/des.h" +#include "common/ers.h" +#include "common/malloc.h" +#include "common/mapindex.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/spinlock.h" +#include "common/sql.h" +#include "common/strlib.h" +#include "common/sysinfo.h" +#include "common/timer.h" +#include "common/utils.h" +#include "map/atcommand.h" +#include "map/battle.h" +#include "map/battleground.h" +#include "map/buyingstore.h" +#include "map/channel.h" +#include "map/chat.h" +#include "map/chrif.h" +#include "map/clif.h" +#include "map/date.h" +#include "map/duel.h" +#include "map/elemental.h" +#include "map/guild.h" +#include "map/homunculus.h" +#include "map/instance.h" +#include "map/intif.h" +#include "map/irc-bot.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/mail.h" +#include "map/map.h" +#include "map/mapreg.h" +#include "map/mercenary.h" +#include "map/mob.h" +#include "map/npc.h" +#include "map/packets_struct.h" +#include "map/party.h" +#include "map/path.h" +#include "map/pc.h" +#include "map/pc_groups.h" +#include "map/pet.h" +#include "map/quest.h" +#include "map/script.h" +#include "map/searchstore.h" +#include "map/skill.h" +#include "map/status.h" +#include "map/storage.h" +#include "map/trade.h" +#include "map/unit.h" +#include "map/vending.h" -#include "atcommand.h" -#include "battle.h" -#include "battleground.h" -#include "channel.h" -#include "chat.h" -#include "chrif.h" -#include "clif.h" -#include "date.h" -#include "duel.h" -#include "elemental.h" -#include "guild.h" -#include "homunculus.h" -#include "instance.h" -#include "intif.h" -#include "irc-bot.h" -#include "itemdb.h" -#include "log.h" -#include "mail.h" -#include "map.h" -#include "mapreg.h" -#include "mercenary.h" -#include "mob.h" -#include "npc.h" -#include "party.h" -#include "path.h" -#include "pc.h" -#include "pc_groups.h" -#include "pet.h" -#include "quest.h" -#include "script.h" -#include "searchstore.h" -#include "skill.h" -#include "status.h" -#include "storage.h" -#include "trade.h" -#include "unit.h" -#include "vending.h" -#include "../common/HPM.h" -#include "../common/cbasetypes.h" -#include "../common/conf.h" -#include "../common/db.h" -#include "../common/des.h" -#include "../common/ers.h" -#include "../common/malloc.h" -#include "../common/mapindex.h" -#include "../common/mmo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/sysinfo.h" +// HPMDataCheck comes after all the other includes +#include "common/HPMDataCheck.h" -#include "../common/HPMDataCheck.h" +#include <stdio.h> +#include <stdlib.h> struct HPM_atcommand_list { //tracking currently not enabled diff --git a/src/map/HPMmap.h b/src/map/HPMmap.h index 0c727d017..00a8f43c3 100644 --- a/src/map/HPMmap.h +++ b/src/map/HPMmap.h @@ -8,9 +8,9 @@ #error You should never include HPMmap.h from a plugin. #endif -#include "../common/cbasetypes.h" -#include "../map/atcommand.h" -#include "../common/HPM.h" +#include "map/atcommand.h" +#include "common/cbasetypes.h" +#include "common/HPM.h" struct hplugin; struct map_session_data; diff --git a/src/map/Makefile.in b/src/map/Makefile.in index 90bb55694..ac1b4d837 100644 --- a/src/map/Makefile.in +++ b/src/map/Makefile.in @@ -9,18 +9,20 @@ CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h) COMMON_D = ../common COMMON_H = $(wildcard $(COMMON_D)/*.h) SYSINFO_INC = $(COMMON_D)/sysinfo.inc +COMMON_INCLUDE = -I.. -LIBCONFIG_D = ../../3rdparty/libconfig +THIRDPARTY_D = ../../3rdparty +THIRDPARTY_INCLUDE = -I$(THIRDPARTY_D) + +LIBCONFIG_D = $(THIRDPARTY_D)/libconfig LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \ scanner.o strbuf.o) LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \ scanctx.h scanner.h strbuf.h wincompat.h) -LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D) -MT19937AR_D = ../../3rdparty/mt19937ar +MT19937AR_D = $(THIRDPARTY_D)/mt19937ar MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o MT19937AR_H = $(MT19937AR_D)/mt19937ar.h -MT19937AR_INCLUDE = -I$(MT19937AR_D) MAP_C = atcommand.c battle.c battleground.c buyingstore.c channel.c chat.c \ chrif.c clif.c date.c duel.c elemental.c guild.c homunculus.c HPMmap.c \ @@ -111,7 +113,7 @@ map-server: ../../map-server@EXEEXT@ obj_sql/%.o: %.c $(MAP_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql @echo " CC $<" - @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) $(PCRE_CFLAGS) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< + @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) $(PCRE_CFLAGS) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< # missing object files $(COMMON_D)/obj_all/common.a: diff --git a/src/map/atcommand.c b/src/map/atcommand.c index f3ee84197..1e915de3d 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -4,59 +4,59 @@ #define HERCULES_CORE -#include "../config/core.h" // AUTOLOOTITEM_SIZE, AUTOTRADE_PERSISTENCY, MAX_SUGGESTIONS, MOB_FLEE(), MOB_HIT(), RENEWAL, RENEWAL_DROP, RENEWAL_EXP +#include "config/core.h" // AUTOLOOTITEM_SIZE, AUTOTRADE_PERSISTENCY, MAX_SUGGESTIONS, MOB_FLEE(), MOB_HIT(), RENEWAL, RENEWAL_DROP, RENEWAL_EXP #include "atcommand.h" +#include "map/HPMmap.h" +#include "map/battle.h" +#include "map/channel.h" +#include "map/chat.h" +#include "map/chrif.h" +#include "map/clif.h" +#include "map/duel.h" +#include "map/elemental.h" +#include "map/guild.h" +#include "map/homunculus.h" +#include "map/intif.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/mail.h" +#include "map/map.h" +#include "map/mapreg.h" +#include "map/mercenary.h" +#include "map/mob.h" +#include "map/npc.h" +#include "map/party.h" +#include "map/pc.h" +#include "map/pc_groups.h" // groupid2name +#include "map/pet.h" +#include "map/quest.h" +#include "map/script.h" +#include "map/searchstore.h" +#include "map/skill.h" +#include "map/status.h" +#include "map/storage.h" +#include "map/trade.h" +#include "map/unit.h" +#include "common/cbasetypes.h" +#include "common/conf.h" +#include "common/core.h" +#include "common/malloc.h" +#include "common/mmo.h" // MAX_CARTS +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "common/sysinfo.h" +#include "common/timer.h" +#include "common/utils.h" + #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "HPMmap.h" -#include "battle.h" -#include "channel.h" -#include "chat.h" -#include "chrif.h" -#include "clif.h" -#include "duel.h" -#include "elemental.h" -#include "guild.h" -#include "homunculus.h" -#include "intif.h" -#include "itemdb.h" -#include "log.h" -#include "mail.h" -#include "map.h" -#include "mapreg.h" -#include "mercenary.h" -#include "mob.h" -#include "npc.h" -#include "party.h" -#include "pc.h" -#include "pc_groups.h" // groupid2name -#include "pet.h" -#include "quest.h" -#include "script.h" -#include "searchstore.h" -#include "skill.h" -#include "status.h" -#include "storage.h" -#include "trade.h" -#include "unit.h" -#include "../common/cbasetypes.h" -#include "../common/conf.h" -#include "../common/core.h" -#include "../common/malloc.h" -#include "../common/mmo.h" // MAX_CARTS -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/sysinfo.h" -#include "../common/timer.h" -#include "../common/utils.h" - struct atcommand_interface atcommand_s; static char atcmd_output[CHAT_SIZE_MAX]; diff --git a/src/map/atcommand.h b/src/map/atcommand.h index c1f451ad3..88ddde8c2 100644 --- a/src/map/atcommand.h +++ b/src/map/atcommand.h @@ -5,9 +5,12 @@ #ifndef MAP_ATCOMMAND_H #define MAP_ATCOMMAND_H -#include "pc_groups.h" -#include "../common/conf.h" -#include "../common/db.h" +#include "map/pc_groups.h" +#include "common/cbasetypes.h" +#include "common/conf.h" +#include "common/db.h" + +#include <stdarg.h> /** * Declarations diff --git a/src/map/battle.c b/src/map/battle.c index b7ee23d09..8a834574b 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -4,43 +4,43 @@ #define HERCULES_CORE -#include "../config/core.h" // CELL_NOSTACK, CIRCULAR_AREA, CONSOLE_INPUT, HMAP_ZONE_DAMAGE_CAP_TYPE, OFFICIAL_WALKPATH, RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EDP, RENEWAL_EXP, RENEWAL_LVDMG, RE_LVL_DMOD(), RE_LVL_MDMOD(), RE_LVL_TMDMOD(), RE_SKILL_REDUCTION(), SCRIPT_CALLFUNC_CHECK, SECURE_NPCTIMEOUT, STATS_OPT_OUT +#include "config/core.h" // CELL_NOSTACK, CIRCULAR_AREA, CONSOLE_INPUT, HMAP_ZONE_DAMAGE_CAP_TYPE, OFFICIAL_WALKPATH, RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EDP, RENEWAL_EXP, RENEWAL_LVDMG, RE_LVL_DMOD(), RE_LVL_MDMOD(), RE_LVL_TMDMOD(), RE_SKILL_REDUCTION(), SCRIPT_CALLFUNC_CHECK, SECURE_NPCTIMEOUT, STATS_OPT_OUT #include "battle.h" +#include "map/battleground.h" +#include "map/chrif.h" +#include "map/clif.h" +#include "map/elemental.h" +#include "map/guild.h" +#include "map/homunculus.h" +#include "map/itemdb.h" +#include "map/map.h" +#include "map/mercenary.h" +#include "map/mob.h" +#include "map/party.h" +#include "map/path.h" +#include "map/pc.h" +#include "map/pet.h" +#include "map/skill.h" +#include "map/status.h" +#include "common/HPM.h" +#include "common/cbasetypes.h" +#include "common/ers.h" +#include "common/malloc.h" +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "common/sysinfo.h" +#include "common/timer.h" +#include "common/utils.h" + #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "battleground.h" -#include "chrif.h" -#include "clif.h" -#include "elemental.h" -#include "guild.h" -#include "homunculus.h" -#include "itemdb.h" -#include "map.h" -#include "mercenary.h" -#include "mob.h" -#include "party.h" -#include "path.h" -#include "pc.h" -#include "pet.h" -#include "skill.h" -#include "status.h" -#include "../common/HPM.h" -#include "../common/cbasetypes.h" -#include "../common/ers.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/sysinfo.h" -#include "../common/timer.h" -#include "../common/utils.h" - struct Battle_Config battle_config; struct battle_interface battle_s; diff --git a/src/map/battle.h b/src/map/battle.h index 58490e869..6bc2659b9 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -5,8 +5,8 @@ #ifndef MAP_BATTLE_H #define MAP_BATTLE_H -#include "map.h" //ELE_MAX -#include "../common/cbasetypes.h" +#include "map/map.h" //ELE_MAX +#include "common/cbasetypes.h" /** * Declarations diff --git a/src/map/battleground.c b/src/map/battleground.c index 3c7c1db43..0fe42110f 100644 --- a/src/map/battleground.c +++ b/src/map/battleground.c @@ -6,30 +6,31 @@ #include "battleground.h" +#include "map/battle.h" +#include "map/clif.h" +#include "map/guild.h" +#include "map/homunculus.h" +#include "map/map.h" +#include "map/mapreg.h" +#include "map/mercenary.h" +#include "map/mob.h" // struct mob_data +#include "map/npc.h" +#include "map/party.h" +#include "map/pc.h" +#include "map/pet.h" +#include "common/cbasetypes.h" +#include "common/conf.h" +#include "common/HPM.h" +#include "common/malloc.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "common/timer.h" + #include <stdio.h> #include <string.h> -#include "battle.h" -#include "clif.h" -#include "homunculus.h" -#include "map.h" -#include "mapreg.h" -#include "mercenary.h" -#include "mob.h" // struct mob_data -#include "npc.h" -#include "party.h" -#include "pc.h" -#include "pet.h" -#include "../common/cbasetypes.h" -#include "../common/conf.h" -#include "../common/HPM.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/timer.h" - struct battleground_interface bg_s; /// Search a BG Team using bg_id diff --git a/src/map/battleground.h b/src/map/battleground.h index 87d56516a..a67deb722 100644 --- a/src/map/battleground.h +++ b/src/map/battleground.h @@ -5,9 +5,14 @@ #ifndef MAP_BATTLEGROUND_H #define MAP_BATTLEGROUND_H -#include "clif.h" -#include "guild.h" -#include "../common/mmo.h" // struct party +#include "map/map.h" // EVENT_NAME_LENGTH +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/mmo.h" // struct party + +struct HPluginData; +struct block_list; +struct map_session_data; /** * Defines diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c index 531a55e71..d1ce4ba0d 100644 --- a/src/map/buyingstore.c +++ b/src/map/buyingstore.c @@ -4,19 +4,19 @@ #define HERCULES_CORE -#include "buyingstore.h" // struct s_buyingstore - -#include "atcommand.h" // msg_txt -#include "battle.h" // battle_config.* -#include "chrif.h" -#include "clif.h" // clif->buyingstore_* -#include "log.h" // log_pick_pc, log_zeny -#include "pc.h" // struct map_session_data -#include "../common/cbasetypes.h" -#include "../common/db.h" // ARR_FIND -#include "../common/showmsg.h" // ShowWarning -#include "../common/socket.h" // RBUF* -#include "../common/strlib.h" // safestrncpy +#include "buyingstore.h" // struct s_buyingstore + +#include "map/atcommand.h" // msg_txt +#include "map/battle.h" // battle_config.* +#include "map/chrif.h" +#include "map/clif.h" // clif-"buyingstore_* +#include "map/log.h" // log_pick_pc, log_zeny +#include "map/pc.h" // struct map_session_data +#include "common/cbasetypes.h" +#include "common/db.h" // ARR_FIND +#include "common/showmsg.h" // ShowWarning +#include "common/socket.h" // RBUF* +#include "common/strlib.h" // safestrncpy struct buyingstore_interface buyingstore_s; diff --git a/src/map/buyingstore.h b/src/map/buyingstore.h index 7b8e369d2..f23790459 100644 --- a/src/map/buyingstore.h +++ b/src/map/buyingstore.h @@ -5,8 +5,8 @@ #ifndef MAP_BUYINGSTORE_H #define MAP_BUYINGSTORE_H -#include "../common/cbasetypes.h" -#include "../common/mmo.h" // MAX_SLOTS +#include "common/cbasetypes.h" +#include "common/mmo.h" // MAX_SLOTS struct map_session_data; diff --git a/src/map/channel.c b/src/map/channel.c index f7ab978a6..69f7ab872 100644 --- a/src/map/channel.c +++ b/src/map/channel.c @@ -5,28 +5,28 @@ #include "channel.h" +#include "map/atcommand.h" +#include "map/guild.h" +#include "map/instance.h" +#include "map/irc-bot.h" +#include "map/map.h" +#include "map/pc.h" +#include "common/cbasetypes.h" +#include "common/conf.h" +#include "common/db.h" +#include "common/malloc.h" +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "common/timer.h" +#include "common/utils.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "atcommand.h" -#include "guild.h" -#include "instance.h" -#include "irc-bot.h" -#include "map.h" -#include "pc.h" -#include "../common/cbasetypes.h" -#include "../common/conf.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/timer.h" -#include "../common/utils.h" - struct channel_interface channel_s; static struct Channel_Config channel_config; diff --git a/src/map/channel.h b/src/map/channel.h index 8fbf08d42..de1779d96 100644 --- a/src/map/channel.h +++ b/src/map/channel.h @@ -4,11 +4,9 @@ #ifndef MAP_CHANNEL_H #define MAP_CHANNEL_H -#include <stdarg.h> - -#include "map.h" -#include "../common/cbasetypes.h" -#include "../common/db.h" +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/mmo.h" /** * Declarations diff --git a/src/map/chat.c b/src/map/chat.c index e296fddec..08c904290 100644 --- a/src/map/chat.c +++ b/src/map/chat.c @@ -6,23 +6,23 @@ #include "chat.h" +#include "map/atcommand.h" // msg_sd(sd,) +#include "map/battle.h" // struct battle_config +#include "map/clif.h" +#include "map/map.h" +#include "map/npc.h" // npc_event_do() +#include "map/pc.h" +#include "map/skill.h" // ext_skill_unit_onplace() +#include "common/cbasetypes.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/strlib.h" + #include <stdio.h> #include <string.h> -#include "atcommand.h" // msg_sd(sd,) -#include "battle.h" // struct battle_config -#include "clif.h" -#include "map.h" -#include "npc.h" // npc_event_do() -#include "pc.h" -#include "skill.h" // ext_skill_unit_onplace() -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" - struct chat_interface chat_s; /// Initializes a chatroom object (common functionality for both pc and npc chatrooms). diff --git a/src/map/chat.h b/src/map/chat.h index ced216b41..31048d5dd 100644 --- a/src/map/chat.h +++ b/src/map/chat.h @@ -5,9 +5,9 @@ #ifndef MAP_CHAT_H #define MAP_CHAT_H -#include "map.h" // struct block_list, CHATROOM_TITLE_SIZE -#include "../common/cbasetypes.h" -#include "../common/db.h" +#include "map/map.h" // struct block_list, CHATROOM_TITLE_SIZE +#include "common/cbasetypes.h" +#include "common/db.h" struct chat_data; struct map_session_data; diff --git a/src/map/chrif.c b/src/map/chrif.c index d3d0aa10c..41485d222 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -4,39 +4,38 @@ #define HERCULES_CORE -#include "../config/core.h" // AUTOTRADE_PERSISTENCY, STATS_OPT_OUT +#include "config/core.h" // AUTOTRADE_PERSISTENCY, STATS_OPT_OUT #include "chrif.h" +#include "map/battle.h" +#include "map/clif.h" +#include "map/elemental.h" +#include "map/guild.h" +#include "map/homunculus.h" +#include "map/instance.h" +#include "map/intif.h" +#include "map/map.h" +#include "map/mercenary.h" +#include "map/npc.h" +#include "map/pc.h" +#include "map/pet.h" +#include "map/quest.h" +#include "map/skill.h" +#include "map/status.h" +#include "map/storage.h" +#include "common/HPM.h" +#include "common/cbasetypes.h" +#include "common/ers.h" +#include "common/malloc.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "common/timer.h" + #include <stdio.h> #include <stdlib.h> -#include <string.h> #include <sys/types.h> -#include <time.h> - -#include "map.h" -#include "battle.h" -#include "clif.h" -#include "intif.h" -#include "npc.h" -#include "pc.h" -#include "pet.h" -#include "skill.h" -#include "status.h" -#include "homunculus.h" -#include "instance.h" -#include "mercenary.h" -#include "elemental.h" -#include "quest.h" -#include "storage.h" -#include "../common/HPM.h" -#include "../common/cbasetypes.h" -#include "../common/ers.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/timer.h" struct chrif_interface chrif_s; diff --git a/src/map/chrif.h b/src/map/chrif.h index c90d00ef5..cac965f74 100644 --- a/src/map/chrif.h +++ b/src/map/chrif.h @@ -5,12 +5,12 @@ #ifndef MAP_CHRIF_H #define MAP_CHRIF_H -#include <time.h> - -#include "map.h" //TBL_stuff -#include "../common/cbasetypes.h" -#include "../common/db.h" +#include "map/map.h" //TBL_PC +#include "common/cbasetypes.h" +#include "common/db.h" +struct eri; +struct map_session_data; struct status_change_entry; /** diff --git a/src/map/clif.c b/src/map/clif.c index a8fa2e6e7..d9b20e570 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -4,60 +4,60 @@ #define HERCULES_CORE -#include "../config/core.h" // ANTI_MAYAP_CHEAT, RENEWAL, SECURE_NPCTIMEOUT +#include "config/core.h" // ANTI_MAYAP_CHEAT, RENEWAL, SECURE_NPCTIMEOUT #include "clif.h" +#include "map/atcommand.h" +#include "map/battle.h" +#include "map/battleground.h" +#include "map/channel.h" +#include "map/chat.h" +#include "map/chrif.h" +#include "map/elemental.h" +#include "map/guild.h" +#include "map/homunculus.h" +#include "map/instance.h" +#include "map/intif.h" +#include "map/irc-bot.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/mail.h" +#include "map/map.h" +#include "map/mercenary.h" +#include "map/mob.h" +#include "map/npc.h" +#include "map/party.h" +#include "map/pc.h" +#include "map/pet.h" +#include "map/quest.h" +#include "map/script.h" +#include "map/skill.h" +#include "map/status.h" +#include "map/storage.h" +#include "map/trade.h" +#include "map/unit.h" +#include "map/vending.h" +#include "common/HPM.h" +#include "common/cbasetypes.h" +#include "common/conf.h" +#include "common/ers.h" +#include "common/grfio.h" +#include "common/malloc.h" +#include "common/mmo.h" // NEW_CARTS +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "common/timer.h" +#include "common/utils.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #include <time.h> -#include "atcommand.h" -#include "battle.h" -#include "battleground.h" -#include "channel.h" -#include "chat.h" -#include "chrif.h" -#include "elemental.h" -#include "guild.h" -#include "homunculus.h" -#include "instance.h" -#include "intif.h" -#include "irc-bot.h" -#include "itemdb.h" -#include "log.h" -#include "mail.h" -#include "map.h" -#include "mercenary.h" -#include "mob.h" -#include "npc.h" -#include "party.h" -#include "pc.h" -#include "pet.h" -#include "quest.h" -#include "script.h" -#include "skill.h" -#include "status.h" -#include "storage.h" -#include "trade.h" -#include "unit.h" -#include "vending.h" -#include "../common/HPM.h" -#include "../common/cbasetypes.h" -#include "../common/conf.h" -#include "../common/ers.h" -#include "../common/grfio.h" -#include "../common/malloc.h" -#include "../common/mmo.h" // NEW_CARTS -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/timer.h" -#include "../common/utils.h" - struct clif_interface clif_s; /* re-usable */ diff --git a/src/map/clif.h b/src/map/clif.h index f4402bdf7..66dd13304 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -5,40 +5,38 @@ #ifndef MAP_CLIF_H #define MAP_CLIF_H -#include <stdarg.h> +#include "map/map.h" +#include "map/packets_struct.h" +#include "common/cbasetypes.h" +#include "common/mmo.h" -#include "map.h" -#include "packets_struct.h" -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/mmo.h" +#include <stdarg.h> /** * Declarations **/ +struct battleground_data; +struct channel_data; +struct chat_data; +struct eri; +struct flooritem_data; +struct guild; +struct homun_data; struct item; struct item_data; -struct unit_data; struct map_session_data; -struct homun_data; struct mercenary_data; -struct pet_data; struct mob_data; struct npc_data; -struct chat_data; -struct flooritem_data; -struct skill_unit; -struct s_vending; -struct party; +struct party_booking_ad_info; struct party_data; -struct guild; -struct battleground_data; +struct pet_data; struct quest; -struct party_booking_ad_info; -struct view_data; -struct eri; +struct s_vending; struct skill_cd; -struct channel_data; +struct skill_unit; +struct unit_data; +struct view_data; /** * Defines diff --git a/src/map/date.c b/src/map/date.c index 975a00c50..e2ad2b179 100644 --- a/src/map/date.c +++ b/src/map/date.c @@ -5,9 +5,9 @@ #include "date.h" -#include <time.h> +#include "common/cbasetypes.h" -#include "../common/cbasetypes.h" +#include <time.h> int date_get_year(void) { diff --git a/src/map/date.h b/src/map/date.h index a57d8132c..e7d06f29d 100644 --- a/src/map/date.h +++ b/src/map/date.h @@ -4,7 +4,7 @@ #ifndef MAP_DATE_H #define MAP_DATE_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" #ifdef HERCULES_CORE // TODO: Interface diff --git a/src/map/duel.c b/src/map/duel.c index 2dae0ae0e..4cd2e276f 100644 --- a/src/map/duel.c +++ b/src/map/duel.c @@ -6,16 +6,16 @@ #include "duel.h" +#include "map/atcommand.h" // msg_txt +#include "map/clif.h" +#include "map/pc.h" +#include "common/cbasetypes.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> -#include "atcommand.h" // msg_txt -#include "clif.h" -#include "pc.h" -#include "../common/cbasetypes.h" - struct duel_interface duel_s; /*========================================== diff --git a/src/map/duel.h b/src/map/duel.h index fa12a4032..0c55c1266 100644 --- a/src/map/duel.h +++ b/src/map/duel.h @@ -5,7 +5,7 @@ #ifndef MAP_DUEL_H #define MAP_DUEL_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" struct map_session_data; diff --git a/src/map/elemental.c b/src/map/elemental.c index 92915d168..bf0d42ce9 100644 --- a/src/map/elemental.c +++ b/src/map/elemental.c @@ -6,41 +6,41 @@ #include "elemental.h" +#include "map/atcommand.h" +#include "map/battle.h" +#include "map/chrif.h" +#include "map/clif.h" +#include "map/guild.h" +#include "map/intif.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/map.h" +#include "map/mob.h" +#include "map/npc.h" +#include "map/party.h" +#include "map/pc.h" +#include "map/pet.h" +#include "map/script.h" +#include "map/skill.h" +#include "map/status.h" +#include "map/trade.h" +#include "map/unit.h" +#include "common/cbasetypes.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "common/timer.h" +#include "common/utils.h" + #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "atcommand.h" -#include "battle.h" -#include "chrif.h" -#include "clif.h" -#include "guild.h" -#include "intif.h" -#include "itemdb.h" -#include "log.h" -#include "map.h" -#include "mob.h" -#include "npc.h" -#include "party.h" -#include "pc.h" -#include "pet.h" -#include "script.h" -#include "skill.h" -#include "status.h" -#include "trade.h" -#include "unit.h" -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/timer.h" -#include "../common/utils.h" - struct elemental_interface elemental_s; int elemental_search_index(int class_) { diff --git a/src/map/elemental.h b/src/map/elemental.h index 8015f84c0..582e1059c 100644 --- a/src/map/elemental.h +++ b/src/map/elemental.h @@ -5,9 +5,12 @@ #ifndef MAP_ELEMENTAL_H #define MAP_ELEMENTAL_H -#include "status.h" // struct status_data, struct status_change -#include "unit.h" // struct unit_data -#include "../common/mmo.h" // NAME_LENGTH +#include "map/status.h" // struct status_data, struct status_change +#include "map/unit.h" // struct unit_data +#include "common/cbasetypes.h" +#include "common/mmo.h" // NAME_LENGTH + +#include <stdarg.h> /** * Defines diff --git a/src/map/guild.c b/src/map/guild.c index b9c0c8267..5f6ce83c6 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -4,37 +4,37 @@ #define HERCULES_CORE -#include "../config/core.h" // GP_BOUND_ITEMS +#include "config/core.h" // GP_BOUND_ITEMS #include "guild.h" +#include "map/battle.h" +#include "map/channel.h" +#include "map/clif.h" +#include "map/instance.h" +#include "map/intif.h" +#include "map/log.h" +#include "map/map.h" +#include "map/mob.h" +#include "map/npc.h" +#include "map/pc.h" +#include "map/skill.h" +#include "map/status.h" +#include "map/storage.h" +#include "common/HPM.h" +#include "common/cbasetypes.h" +#include "common/ers.h" +#include "common/malloc.h" +#include "common/mapindex.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/strlib.h" +#include "common/timer.h" +#include "common/utils.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "battle.h" -#include "channel.h" -#include "clif.h" -#include "instance.h" -#include "intif.h" -#include "log.h" -#include "map.h" -#include "mob.h" -#include "npc.h" -#include "pc.h" -#include "skill.h" -#include "status.h" -#include "storage.h" -#include "../common/HPM.h" -#include "../common/cbasetypes.h" -#include "../common/ers.h" -#include "../common/malloc.h" -#include "../common/mapindex.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/timer.h" -#include "../common/utils.h" - struct guild_interface guild_s; /*========================================== diff --git a/src/map/guild.h b/src/map/guild.h index a75b8a7a5..18a25af58 100644 --- a/src/map/guild.h +++ b/src/map/guild.h @@ -5,10 +5,10 @@ #ifndef MAP_GUILD_H #define MAP_GUILD_H -#include "map.h" // EVENT_NAME_LENGTH, TBL_PC -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/mmo.h" +#include "map/map.h" // EVENT_NAME_LENGTH, TBL_PC +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/mmo.h" /** * Defines diff --git a/src/map/homunculus.c b/src/map/homunculus.c index ee88bf3dc..dd158fc5d 100644 --- a/src/map/homunculus.c +++ b/src/map/homunculus.c @@ -4,44 +4,44 @@ #define HERCULES_CORE -#include "../config/core.h" // DBPATH +#include "config/core.h" // DBPATH #include "homunculus.h" +#include "map/atcommand.h" +#include "map/battle.h" +#include "map/chrif.h" +#include "map/clif.h" +#include "map/guild.h" +#include "map/intif.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/map.h" +#include "map/mob.h" +#include "map/npc.h" +#include "map/party.h" +#include "map/pc.h" +#include "map/pet.h" +#include "map/script.h" +#include "map/skill.h" +#include "map/status.h" +#include "map/trade.h" +#include "map/unit.h" +#include "common/cbasetypes.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "common/timer.h" +#include "common/utils.h" + #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "atcommand.h" -#include "battle.h" -#include "chrif.h" -#include "clif.h" -#include "guild.h" -#include "intif.h" -#include "itemdb.h" -#include "log.h" -#include "map.h" -#include "mob.h" -#include "npc.h" -#include "party.h" -#include "pc.h" -#include "pet.h" -#include "script.h" -#include "skill.h" -#include "status.h" -#include "trade.h" -#include "unit.h" -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/timer.h" -#include "../common/utils.h" - struct homunculus_interface homunculus_s; //Returns the viewdata for homunculus diff --git a/src/map/homunculus.h b/src/map/homunculus.h index 18f8728d3..32e48b1e9 100644 --- a/src/map/homunculus.h +++ b/src/map/homunculus.h @@ -5,10 +5,11 @@ #ifndef MAP_HOMUNCULUS_H #define MAP_HOMUNCULUS_H -#include "pc.h" -#include "status.h" // struct status_data, struct status_change -#include "unit.h" // struct unit_data -#include "../common/mmo.h" +#include "map/status.h" // struct status_data, struct status_change +#include "map/unit.h" // struct unit_data +#include "common/mmo.h" + +struct map_session_data; #define MAX_HOM_SKILL_REQUIRE 5 #define homdb_checkid(id) ((id) >= HM_CLASS_BASE && (id) <= HM_CLASS_MAX) diff --git a/src/map/instance.c b/src/map/instance.c index dd5709452..f5688d02c 100644 --- a/src/map/instance.c +++ b/src/map/instance.c @@ -4,32 +4,33 @@ #define HERCULES_CORE +#include "config/core.h" // CELL_NOSTACK #include "instance.h" +#include "map/channel.h" +#include "map/clif.h" +#include "map/guild.h" +#include "map/map.h" +#include "map/npc.h" +#include "map/party.h" +#include "map/pc.h" +#include "common/HPM.h" +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/malloc.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "common/timer.h" +#include "common/utils.h" + #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> -#include "../config/core.h" // CELL_NOSTACK -#include "channel.h" -#include "clif.h" -#include "map.h" -#include "npc.h" -#include "party.h" -#include "pc.h" -#include "../common/HPM.h" -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/timer.h" -#include "../common/utils.h" - struct instance_interface instance_s; /// Checks whether given instance id is valid or not. diff --git a/src/map/instance.h b/src/map/instance.h index 80bd1f012..e17d6866f 100644 --- a/src/map/instance.h +++ b/src/map/instance.h @@ -5,10 +5,11 @@ #ifndef MAP_INSTANCE_H #define MAP_INSTANCE_H -#include "script.h" // struct reg_db -#include "../common/cbasetypes.h" -#include "../common/mmo.h" // struct point +#include "map/script.h" // struct reg_db +#include "common/cbasetypes.h" +#include "common/mmo.h" // struct point +struct HPluginData; struct block_list; struct map_session_data; diff --git a/src/map/intif.c b/src/map/intif.c index 7a860049a..6c40d5109 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -3,9 +3,32 @@ #define HERCULES_CORE -#include "../config/core.h" // GP_BOUND_ITEMS +#include "config/core.h" // GP_BOUND_ITEMS #include "intif.h" +#include "map/atcommand.h" +#include "map/battle.h" +#include "map/chrif.h" +#include "map/clif.h" +#include "map/elemental.h" +#include "map/guild.h" +#include "map/homunculus.h" +#include "map/log.h" +#include "map/mail.h" +#include "map/map.h" +#include "map/mercenary.h" +#include "map/party.h" +#include "map/pc.h" +#include "map/pet.h" +#include "map/quest.h" +#include "map/storage.h" +#include "common/malloc.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "common/timer.h" + #include <fcntl.h> #include <signal.h> #include <stdio.h> @@ -13,29 +36,6 @@ #include <string.h> #include <sys/types.h> -#include "atcommand.h" -#include "battle.h" -#include "chrif.h" -#include "clif.h" -#include "elemental.h" -#include "guild.h" -#include "homunculus.h" -#include "log.h" -#include "mail.h" -#include "map.h" -#include "mercenary.h" -#include "party.h" -#include "pc.h" -#include "pet.h" -#include "quest.h" -#include "storage.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/timer.h" - struct intif_interface intif_s; #define inter_fd (chrif->fd) // alias diff --git a/src/map/intif.h b/src/map/intif.h index 52aa32259..3303feb6e 100644 --- a/src/map/intif.h +++ b/src/map/intif.h @@ -5,7 +5,7 @@ #ifndef MAP_INTIF_H #define MAP_INTIF_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" /** * Declarations diff --git a/src/map/irc-bot.c b/src/map/irc-bot.c index f7e693191..b0f687c0d 100644 --- a/src/map/irc-bot.c +++ b/src/map/irc-bot.c @@ -6,21 +6,21 @@ #include "irc-bot.h" +#include "map/channel.h" +#include "map/map.h" +#include "map/pc.h" +#include "common/cbasetypes.h" +#include "common/malloc.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "common/timer.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "channel.h" -#include "map.h" -#include "pc.h" -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/timer.h" - //#define IRCBOT_DEBUG struct irc_bot_interface irc_bot_s; diff --git a/src/map/irc-bot.h b/src/map/irc-bot.h index acd014e71..b0bfd72f8 100644 --- a/src/map/irc-bot.h +++ b/src/map/irc-bot.h @@ -6,7 +6,7 @@ #ifndef MAP_IRC_BOT_H #define MAP_IRC_BOT_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" #define IRC_NICK_LENGTH 40 #define IRC_IDENT_LENGTH 40 diff --git a/src/map/itemdb.c b/src/map/itemdb.c index fb6bcc730..b02da1e0d 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -4,27 +4,27 @@ #define HERCULES_CORE -#include "../config/core.h" // DBPATH, RENEWAL +#include "config/core.h" // DBPATH, RENEWAL #include "itemdb.h" +#include "map/battle.h" // struct battle_config +#include "map/map.h" +#include "map/mob.h" // MAX_MOB_DB +#include "map/pc.h" // W_MUSICAL, W_WHIP +#include "map/script.h" // item script processing +#include "common/HPM.h" +#include "common/conf.h" +#include "common/malloc.h" +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/strlib.h" +#include "common/utils.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "battle.h" // struct battle_config -#include "map.h" -#include "mob.h" // MAX_MOB_DB -#include "pc.h" // W_MUSICAL, W_WHIP -#include "script.h" // item script processing -#include "../common/HPM.h" -#include "../common/conf.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/utils.h" - struct itemdb_interface itemdb_s; /** diff --git a/src/map/itemdb.h b/src/map/itemdb.h index 1d811e3cb..624080c3a 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -5,18 +5,14 @@ #ifndef MAP_ITEMDB_H #define MAP_ITEMDB_H -#include "map.h" -#include "../common/cbasetypes.h" -#include "../common/conf.h" -#include "../common/db.h" -#include "../common/mmo.h" // ITEM_NAME_LENGTH -#include "../common/sql.h" +/* #include "map/map.h" */ +#include "common/cbasetypes.h" +#include "common/conf.h" +#include "common/db.h" +#include "common/mmo.h" // ITEM_NAME_LENGTH +#include "common/sql.h" -/** - * Declarations - **/ -struct item_group; -struct item_package; +struct script_code; /** * Defines @@ -371,6 +367,61 @@ enum ItemNouseRestrictions { INR_ALL = 0x1 ///< Sum of all the above values }; +struct item_combo { + struct script_code *script; + unsigned short nameid[MAX_ITEMS_PER_COMBO];/* nameid array */ + unsigned char count; + unsigned short id;/* id of this combo */ +}; + +struct item_group { + unsigned short id; + unsigned short *nameid; + unsigned short qty; +}; + +struct item_chain_entry { + unsigned short id; + unsigned short rate; + struct item_chain_entry *next; +}; + +struct item_chain { + struct item_chain_entry *items; + unsigned short qty; +}; + +struct item_package_rand_entry { + unsigned short id; + unsigned short qty; + unsigned short rate; + unsigned short hours; + unsigned int announce : 1; + unsigned int named : 1; + struct item_package_rand_entry *next; +}; + +struct item_package_must_entry { + unsigned short id; + unsigned short qty; + unsigned short hours; + unsigned int announce : 1; + unsigned int named : 1; +}; + +struct item_package_rand_group { + struct item_package_rand_entry *random_list; + unsigned short random_qty; +}; + +struct item_package { + unsigned short id; + struct item_package_rand_group *random_groups; + struct item_package_must_entry *must_items; + unsigned short random_qty; + unsigned short must_qty; +}; + struct item_data { uint16 nameid; char name[ITEM_NAME_LENGTH],jname[ITEM_NAME_LENGTH]; @@ -440,61 +491,6 @@ struct item_data { unsigned int hdatac; }; -struct item_combo { - struct script_code *script; - unsigned short nameid[MAX_ITEMS_PER_COMBO];/* nameid array */ - unsigned char count; - unsigned short id;/* id of this combo */ -}; - -struct item_group { - unsigned short id; - unsigned short *nameid; - unsigned short qty; -}; - -struct item_chain_entry { - unsigned short id; - unsigned short rate; - struct item_chain_entry *next; -}; - -struct item_chain { - struct item_chain_entry *items; - unsigned short qty; -}; - -struct item_package_rand_entry { - unsigned short id; - unsigned short qty; - unsigned short rate; - unsigned short hours; - unsigned int announce : 1; - unsigned int named : 1; - struct item_package_rand_entry *next; -}; - -struct item_package_must_entry { - unsigned short id; - unsigned short qty; - unsigned short hours; - unsigned int announce : 1; - unsigned int named : 1; -}; - -struct item_package_rand_group { - struct item_package_rand_entry *random_list; - unsigned short random_qty; -}; - -struct item_package { - unsigned short id; - struct item_package_rand_group *random_groups; - struct item_package_must_entry *must_items; - unsigned short random_qty; - unsigned short must_qty; -}; - #define itemdb_name(n) (itemdb->search(n)->name) #define itemdb_jname(n) (itemdb->search(n)->jname) #define itemdb_type(n) (itemdb->search(n)->type) diff --git a/src/map/log.c b/src/map/log.c index f18efbfb7..0a9b16418 100644 --- a/src/map/log.c +++ b/src/map/log.c @@ -6,22 +6,22 @@ #include "log.h" +#include "map/battle.h" +#include "map/itemdb.h" +#include "map/map.h" +#include "map/mob.h" +#include "map/pc.h" +#include "common/cbasetypes.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/sql.h" // SQL_INNODB +#include "common/strlib.h" +#include "common/HPM.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "battle.h" -#include "itemdb.h" -#include "map.h" -#include "mob.h" -#include "pc.h" -#include "../common/cbasetypes.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/sql.h" // SQL_INNODB -#include "../common/strlib.h" -#include "../common/HPM.h" - struct log_interface log_s; /// obtain log type character for item/zeny logs diff --git a/src/map/log.h b/src/map/log.h index b4b8b84f4..ef654149c 100644 --- a/src/map/log.h +++ b/src/map/log.h @@ -5,8 +5,8 @@ #ifndef MAP_LOG_H #define MAP_LOG_H -#include "../common/cbasetypes.h" -#include "../common/sql.h" +#include "common/cbasetypes.h" +#include "common/sql.h" /** * Declarations diff --git a/src/map/mail.c b/src/map/mail.c index d7ce9c830..184e2be8d 100644 --- a/src/map/mail.c +++ b/src/map/mail.c @@ -6,18 +6,18 @@ #include "mail.h" +#include "map/atcommand.h" +#include "map/clif.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/pc.h" +#include "map/storage.h" +#include "common/nullpo.h" +#include "common/showmsg.h" + #include <time.h> #include <string.h> -#include "atcommand.h" -#include "clif.h" -#include "itemdb.h" -#include "log.h" -#include "pc.h" -#include "storage.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" - struct mail_interface mail_s; void mail_clear(struct map_session_data *sd) diff --git a/src/map/mail.h b/src/map/mail.h index db49ca39e..4f325067d 100644 --- a/src/map/mail.h +++ b/src/map/mail.h @@ -5,7 +5,7 @@ #ifndef MAP_MAIL_H #define MAP_MAIL_H -#include "../common/cbasetypes.h" +#include "common/cbasetypes.h" struct item; struct mail_message; diff --git a/src/map/map.c b/src/map/map.c index f8c9e7c01..dc935079a 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -4,65 +4,64 @@ #define HERCULES_CORE -#include "../config/core.h" // CELL_NOSTACK, CIRCULAR_AREA, CONSOLE_INPUT, DBPATH, RENEWAL +#include "config/core.h" // CELL_NOSTACK, CIRCULAR_AREA, CONSOLE_INPUT, DBPATH, RENEWAL #include "map.h" +#include "map/HPMmap.h" +#include "map/atcommand.h" +#include "map/battle.h" +#include "map/battleground.h" +#include "map/channel.h" +#include "map/chat.h" +#include "map/chrif.h" +#include "map/clif.h" +#include "map/duel.h" +#include "map/elemental.h" +#include "map/guild.h" +#include "map/homunculus.h" +#include "map/instance.h" +#include "map/intif.h" +#include "map/irc-bot.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/mail.h" +#include "map/mapreg.h" +#include "map/mercenary.h" +#include "map/mob.h" +#include "map/npc.h" +#include "map/npc.h" // npc_setcells(), npc_unsetcells() +#include "map/party.h" +#include "map/path.h" +#include "map/pc.h" +#include "map/pet.h" +#include "map/quest.h" +#include "map/script.h" +#include "map/skill.h" +#include "map/status.h" +#include "map/storage.h" +#include "map/trade.h" +#include "map/unit.h" +#include "common/HPM.h" +#include "common/cbasetypes.h" +#include "common/conf.h" +#include "common/console.h" +#include "common/core.h" +#include "common/ers.h" +#include "common/grfio.h" +#include "common/malloc.h" +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/socket.h" // WFIFO*() +#include "common/strlib.h" +#include "common/timer.h" +#include "common/utils.h" + #include <math.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> - -#include "HPMmap.h" -#include "atcommand.h" -#include "battle.h" -#include "battleground.h" -#include "channel.h" -#include "chat.h" -#include "chrif.h" -#include "clif.h" -#include "duel.h" -#include "elemental.h" -#include "guild.h" -#include "homunculus.h" -#include "instance.h" -#include "intif.h" -#include "irc-bot.h" -#include "itemdb.h" -#include "log.h" -#include "mail.h" -#include "mapreg.h" -#include "mercenary.h" -#include "mob.h" -#include "npc.h" -#include "npc.h" // npc_setcells(), npc_unsetcells() -#include "party.h" -#include "path.h" -#include "pc.h" -#include "pet.h" -#include "quest.h" -#include "script.h" -#include "skill.h" -#include "status.h" -#include "storage.h" -#include "trade.h" -#include "unit.h" -#include "../common/HPM.h" -#include "../common/cbasetypes.h" -#include "../common/conf.h" -#include "../common/console.h" -#include "../common/core.h" -#include "../common/ers.h" -#include "../common/grfio.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" // WFIFO*() -#include "../common/strlib.h" -#include "../common/timer.h" -#include "../common/utils.h" - #ifndef _WIN32 #include <unistd.h> #endif diff --git a/src/map/map.h b/src/map/map.h index ab2274d78..8d879cd56 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -5,17 +5,18 @@ #ifndef MAP_MAP_H #define MAP_MAP_H -#include "../config/core.h" +#include "config/core.h" -#include <stdarg.h> +#include "map/atcommand.h" +#include "common/cbasetypes.h" +#include "common/core.h" // CORE_ST_LAST +#include "common/db.h" +#include "common/mapindex.h" +#include "common/mmo.h" +#include "common/sql.h" -#include "atcommand.h" -#include "../common/cbasetypes.h" -#include "../common/core.h" // CORE_ST_LAST -#include "../common/db.h" -#include "../common/mapindex.h" -#include "../common/mmo.h" -#include "../common/sql.h" +#include <stdio.h> +#include <stdarg.h> struct mob_data; struct npc_data; diff --git a/src/map/mapreg.h b/src/map/mapreg.h index 9c9a1acee..cafd25b64 100644 --- a/src/map/mapreg.h +++ b/src/map/mapreg.h @@ -5,9 +5,11 @@ #ifndef MAP_MAPREG_H #define MAP_MAPREG_H -#include "script.h" // struct reg_db -#include "../common/cbasetypes.h" -#include "../common/db.h" +#include "map/script.h" // struct reg_db +#include "common/cbasetypes.h" +#include "common/db.h" + +struct eri; /** Container for a mapreg value */ struct mapreg_save { diff --git a/src/map/mapreg_sql.c b/src/map/mapreg_sql.c index 0092a6c61..bed40e295 100644 --- a/src/map/mapreg_sql.c +++ b/src/map/mapreg_sql.c @@ -6,20 +6,20 @@ #include "mapreg.h" +#include "map/map.h" // map-"mysql_handle +#include "map/script.h" +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/ers.h" +#include "common/malloc.h" +#include "common/showmsg.h" +#include "common/sql.h" +#include "common/strlib.h" +#include "common/timer.h" + #include <stdlib.h> #include <string.h> -#include "map.h" // map->mysql_handle -#include "script.h" -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/ers.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/sql.h" -#include "../common/strlib.h" -#include "../common/timer.h" - struct mapreg_interface mapreg_s; #define MAPREG_AUTOSAVE_INTERVAL (300*1000) diff --git a/src/map/mercenary.c b/src/map/mercenary.c index 84f6a3c41..ffcb26629 100644 --- a/src/map/mercenary.c +++ b/src/map/mercenary.c @@ -6,41 +6,41 @@ #include "mercenary.h" +#include "map/atcommand.h" +#include "map/battle.h" +#include "map/chrif.h" +#include "map/clif.h" +#include "map/guild.h" +#include "map/intif.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/map.h" +#include "map/mob.h" +#include "map/npc.h" +#include "map/party.h" +#include "map/pc.h" +#include "map/pet.h" +#include "map/script.h" +#include "map/skill.h" +#include "map/status.h" +#include "map/trade.h" +#include "map/unit.h" +#include "common/cbasetypes.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "common/timer.h" +#include "common/utils.h" + #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "atcommand.h" -#include "battle.h" -#include "chrif.h" -#include "clif.h" -#include "guild.h" -#include "intif.h" -#include "itemdb.h" -#include "log.h" -#include "map.h" -#include "mob.h" -#include "npc.h" -#include "party.h" -#include "pc.h" -#include "pet.h" -#include "script.h" -#include "skill.h" -#include "status.h" -#include "trade.h" -#include "unit.h" -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/timer.h" -#include "../common/utils.h" - struct mercenary_interface mercenary_s; int merc_search_index(int class_) diff --git a/src/map/mercenary.h b/src/map/mercenary.h index fbf3603f6..29a2c6ba0 100644 --- a/src/map/mercenary.h +++ b/src/map/mercenary.h @@ -4,9 +4,11 @@ #ifndef MAP_MERCENARY_H #define MAP_MERCENARY_H -#include "status.h" // struct status_data, struct status_change -#include "unit.h" // struct unit_data -#include "../common/cbasetypes.h" +#include "map/status.h" // struct status_data, struct status_change +#include "map/unit.h" // struct unit_data +#include "common/cbasetypes.h" + +struct map_session_data; // number of cells that a mercenary can walk to from it's master before being warped #define MAX_MER_DISTANCE 15 diff --git a/src/map/mob.c b/src/map/mob.c index d3aec6e46..493e30049 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -4,49 +4,49 @@ #define HERCULES_CORE -#include "../config/core.h" // AUTOLOOT_DISTANCE, DBPATH, DEFTYPE_MAX, DEFTYPE_MIN, RENEWAL_DROP, RENEWAL_EXP +#include "config/core.h" // AUTOLOOT_DISTANCE, DBPATH, DEFTYPE_MAX, DEFTYPE_MIN, RENEWAL_DROP, RENEWAL_EXP #include "mob.h" +#include "map/atcommand.h" +#include "map/battle.h" +#include "map/clif.h" +#include "map/date.h" +#include "map/elemental.h" +#include "map/guild.h" +#include "map/homunculus.h" +#include "map/intif.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/map.h" +#include "map/mercenary.h" +#include "map/npc.h" +#include "map/party.h" +#include "map/path.h" +#include "map/pc.h" +#include "map/pet.h" +#include "map/quest.h" +#include "map/script.h" +#include "map/skill.h" +#include "map/status.h" +#include "common/HPM.h" +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/ers.h" +#include "common/malloc.h" +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "common/timer.h" +#include "common/utils.h" + #include <math.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "atcommand.h" -#include "battle.h" -#include "clif.h" -#include "date.h" -#include "elemental.h" -#include "guild.h" -#include "homunculus.h" -#include "intif.h" -#include "itemdb.h" -#include "log.h" -#include "map.h" -#include "mercenary.h" -#include "npc.h" -#include "party.h" -#include "path.h" -#include "pc.h" -#include "pet.h" -#include "quest.h" -#include "script.h" -#include "skill.h" -#include "status.h" -#include "../common/HPM.h" -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/ers.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/timer.h" -#include "../common/utils.h" - struct mob_interface mob_s; #define ACTIVE_AI_RANGE 2 //Distance added on top of 'AREA_SIZE' at which mobs enter active AI mode. diff --git a/src/map/mob.h b/src/map/mob.h index 0a5844f39..85d2bf9b8 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -5,11 +5,11 @@ #ifndef MAP_MOB_H #define MAP_MOB_H -#include "map.h" // struct status_data, struct view_data, struct mob_skill -#include "status.h" // struct status_data, struct status_change -#include "unit.h" // struct unit_data -#include "../common/cbasetypes.h" -#include "../common/mmo.h" // struct item +#include "map/map.h" // struct block_list +#include "map/status.h" // struct status_data, struct status_change +#include "map/unit.h" // struct unit_data, view_data +#include "common/cbasetypes.h" +#include "common/mmo.h" // struct item #define MAX_RANDOMMONSTER 5 diff --git a/src/map/npc.c b/src/map/npc.c index ef56c7872..8114cacaa 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -4,9 +4,37 @@ #define HERCULES_CORE -#include "../config/core.h" // NPC_SECURE_TIMEOUT_INPUT, NPC_SECURE_TIMEOUT_MENU, NPC_SECURE_TIMEOUT_NEXT, SECURE_NPCTIMEOUT, SECURE_NPCTIMEOUT_INTERVAL +#include "config/core.h" // NPC_SECURE_TIMEOUT_INPUT, NPC_SECURE_TIMEOUT_MENU, NPC_SECURE_TIMEOUT_NEXT, SECURE_NPCTIMEOUT, SECURE_NPCTIMEOUT_INTERVAL #include "npc.h" +#include "map/battle.h" +#include "map/chat.h" +#include "map/clif.h" +#include "map/guild.h" +#include "map/instance.h" +#include "map/intif.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/map.h" +#include "map/mob.h" +#include "map/pc.h" +#include "map/pet.h" +#include "map/script.h" +#include "map/skill.h" +#include "map/status.h" +#include "map/unit.h" +#include "common/HPM.h" +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/ers.h" +#include "common/malloc.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "common/timer.h" +#include "common/utils.h" + #include <errno.h> #include <math.h> #include <stdio.h> @@ -14,33 +42,6 @@ #include <string.h> #include <time.h> -#include "battle.h" -#include "chat.h" -#include "clif.h" -#include "instance.h" -#include "intif.h" -#include "itemdb.h" -#include "log.h" -#include "map.h" -#include "mob.h" -#include "pc.h" -#include "pet.h" -#include "script.h" -#include "skill.h" -#include "status.h" -#include "unit.h" -#include "../common/HPM.h" -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/ers.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/timer.h" -#include "../common/utils.h" - struct npc_interface npc_s; static int npc_id=START_NPC_NUM; diff --git a/src/map/npc.h b/src/map/npc.h index e57abc519..bc779b56b 100644 --- a/src/map/npc.h +++ b/src/map/npc.h @@ -5,11 +5,11 @@ #ifndef MAP_NPC_H #define MAP_NPC_H -#include "map.h" // struct block_list -#include "status.h" // struct status_change -#include "unit.h" // struct unit_data -#include "../common/cbasetypes.h" -#include "../common/db.h" +#include "map/map.h" // struct block_list +#include "map/status.h" // struct status_change +#include "map/unit.h" // struct unit_data +#include "common/cbasetypes.h" +#include "common/db.h" struct HPluginData; struct view_data; @@ -288,7 +288,7 @@ void npc_defaults(void); /* comes from npc_chat.c */ #ifdef PCRE_SUPPORT -#include "../../3rdparty/pcre/include/pcre.h" +#include <pcre/include/pcre.h> /* Structure containing all info associated with a single pattern block */ struct pcrematch_entry { struct pcrematch_entry* next; diff --git a/src/map/npc_chat.c b/src/map/npc_chat.c index 8bc246819..3fe379f36 100644 --- a/src/map/npc_chat.c +++ b/src/map/npc_chat.c @@ -8,22 +8,22 @@ #include "npc.h" // struct npc_data +#include "map/mob.h" // struct mob_data +#include "map/pc.h" // struct map_session_data +#include "map/script.h" // set_var() +#include "common/malloc.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/strlib.h" +#include "common/timer.h" + +#include <pcre/include/pcre.h> + #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "../../3rdparty/pcre/include/pcre.h" - -#include "mob.h" // struct mob_data -#include "pc.h" // struct map_session_data -#include "script.h" // set_var() -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/timer.h" - /** * interface sources **/ diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 47e566662..231321c88 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -6,8 +6,8 @@ #ifndef MAP_PACKETS_STRUCT_H #define MAP_PACKETS_STRUCT_H -#include "../common/cbasetypes.h" -#include "../common/mmo.h" +#include "common/cbasetypes.h" +#include "common/mmo.h" /** * @@ -360,8 +360,8 @@ struct packet_dropflooritem { unsigned char subY; short count; } __attribute__((packed)); -#if PACKETVER < 20091103 struct packet_idle_unit2 { +#if PACKETVER < 20091103 short PacketType; #if PACKETVER >= 20071106 unsigned char objecttype; @@ -392,8 +392,13 @@ struct packet_idle_unit2 { unsigned char ySize; unsigned char state; short clevel; +#else // ! PACKETVER < 20091103 + char UNUSED; +#endif // PACKETVER < 20091103 } __attribute__((packed)); + struct packet_spawn_unit2 { +#if PACKETVER < 20091103 short PacketType; #if PACKETVER >= 20071106 unsigned char objecttype; @@ -418,8 +423,11 @@ struct packet_spawn_unit2 { unsigned char PosDir[3]; unsigned char xSize; unsigned char ySize; +#else // ! PACKETVER < 20091103 + char UNUSED; +#endif // PACKETVER < 20091103 } __attribute__((packed)); -#endif + struct packet_spawn_unit { short PacketType; #if PACKETVER >= 20091103 diff --git a/src/map/party.c b/src/map/party.c index ccb522809..6b35debe5 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -4,36 +4,36 @@ #define HERCULES_CORE -#include "../config/core.h" // GP_BOUND_ITEMS, RENEWAL_EXP +#include "config/core.h" // GP_BOUND_ITEMS, RENEWAL_EXP #include "party.h" +#include "map/atcommand.h" //msg_txt() +#include "map/battle.h" +#include "map/clif.h" +#include "map/instance.h" +#include "map/intif.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/map.h" +#include "map/mob.h" // struct mob_data +#include "map/pc.h" +#include "map/skill.h" +#include "map/status.h" +#include "common/HPM.h" +#include "common/cbasetypes.h" +#include "common/malloc.h" +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/socket.h" // last_tick +#include "common/strlib.h" +#include "common/timer.h" +#include "common/utils.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "atcommand.h" //msg_txt() -#include "battle.h" -#include "clif.h" -#include "instance.h" -#include "intif.h" -#include "itemdb.h" -#include "log.h" -#include "map.h" -#include "mob.h" // struct mob_data -#include "pc.h" -#include "skill.h" -#include "status.h" -#include "../common/HPM.h" -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" // last_tick -#include "../common/strlib.h" -#include "../common/timer.h" -#include "../common/utils.h" - struct party_interface party_s; /*========================================== diff --git a/src/map/party.h b/src/map/party.h index a541d03cb..95faa2213 100644 --- a/src/map/party.h +++ b/src/map/party.h @@ -5,12 +5,12 @@ #ifndef MAP_PARTY_H #define MAP_PARTY_H -#include <stdarg.h> +#include "map/map.h" // TBL_PC +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/mmo.h" // struct party -#include "map.h" // TBL_PC -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/mmo.h" // struct party +#include <stdarg.h> #define PARTY_BOOKING_JOBS 6 #define PARTY_BOOKING_RESULTS 10 diff --git a/src/map/path.c b/src/map/path.c index 600dfc082..3ded5423e 100644 --- a/src/map/path.c +++ b/src/map/path.c @@ -4,21 +4,21 @@ #define HERCULES_CORE -#include "../config/core.h" // CELL_NOSTACK, CIRCULAR_AREA +#include "config/core.h" // CELL_NOSTACK, CIRCULAR_AREA #include "path.h" +#include "map/map.h" +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/malloc.h" +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" + +#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <math.h> - -#include "map.h" -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" #define SET_OPEN 0 #define SET_CLOSED 1 diff --git a/src/map/path.h b/src/map/path.h index eb42df6d0..bbd81b8c6 100644 --- a/src/map/path.h +++ b/src/map/path.h @@ -5,8 +5,8 @@ #ifndef MAP_PATH_H #define MAP_PATH_H -#include "map.h" // enum cell_chk -#include "../common/cbasetypes.h" +#include "map/map.h" // enum cell_chk +#include "common/cbasetypes.h" #define MOVE_COST 10 #define MOVE_DIAGONAL_COST 14 diff --git a/src/map/pc.c b/src/map/pc.c index ce4f31f25..9e9f993d0 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -4,58 +4,58 @@ #define HERCULES_CORE -#include "../config/core.h" // DBPATH, GP_BOUND_ITEMS, MAX_SPIRITBALL, RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EXP, SECURE_NPCTIMEOUT +#include "config/core.h" // DBPATH, GP_BOUND_ITEMS, MAX_SPIRITBALL, RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EXP, SECURE_NPCTIMEOUT #include "pc.h" +#include "map/atcommand.h" // get_atcommand_level() +#include "map/battle.h" // battle_config +#include "map/battleground.h" +#include "map/channel.h" +#include "map/chat.h" +#include "map/chrif.h" +#include "map/clif.h" +#include "map/date.h" // is_day_of_*() +#include "map/duel.h" +#include "map/elemental.h" +#include "map/guild.h" // guild-"search(), guild_request_info() +#include "map/homunculus.h" +#include "map/instance.h" +#include "map/intif.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/mail.h" +#include "map/map.h" +#include "map/mercenary.h" +#include "map/mob.h" // struct mob_data +#include "map/npc.h" // fake_nd +#include "map/party.h" // party-"search() +#include "map/path.h" +#include "map/pc_groups.h" +#include "map/pet.h" // pet_unlocktarget() +#include "map/quest.h" +#include "map/script.h" // script_config +#include "map/skill.h" +#include "map/status.h" // struct status_data +#include "map/storage.h" +#include "common/cbasetypes.h" +#include "common/conf.h" +#include "common/core.h" // get_svn_revision() +#include "common/malloc.h" +#include "common/mmo.h" // NAME_LENGTH, MAX_CARTS, NEW_CARTS +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/socket.h" // session[] +#include "common/strlib.h" // safestrncpy() +#include "common/sysinfo.h" +#include "common/timer.h" +#include "common/utils.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> -#include "atcommand.h" // get_atcommand_level() -#include "battle.h" // battle_config -#include "battleground.h" -#include "channel.h" -#include "chat.h" -#include "chrif.h" -#include "clif.h" -#include "date.h" // is_day_of_*() -#include "duel.h" -#include "elemental.h" -#include "guild.h" // guild->search(), guild_request_info() -#include "homunculus.h" -#include "instance.h" -#include "intif.h" -#include "itemdb.h" -#include "log.h" -#include "mail.h" -#include "map.h" -#include "mercenary.h" -#include "mob.h" // struct mob_data -#include "npc.h" // fake_nd -#include "party.h" // party->search() -#include "path.h" -#include "pc_groups.h" -#include "pet.h" // pet_unlocktarget() -#include "quest.h" -#include "script.h" // script_config -#include "skill.h" -#include "status.h" // struct status_data -#include "storage.h" -#include "../common/cbasetypes.h" -#include "../common/conf.h" -#include "../common/core.h" // get_svn_revision() -#include "../common/malloc.h" -#include "../common/mmo.h" // NAME_LENGTH, MAX_CARTS, NEW_CARTS -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" // session[] -#include "../common/strlib.h" // safestrncpy() -#include "../common/sysinfo.h" -#include "../common/timer.h" -#include "../common/utils.h" - struct pc_interface pc_s; //Converts a class to its array index for CLASS_COUNT defined arrays. diff --git a/src/map/pc.h b/src/map/pc.h index 8a110a6d1..4dea27693 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -5,23 +5,23 @@ #ifndef MAP_PC_H #define MAP_PC_H -#include "../config/core.h" // AUTOLOOTITEM_SIZE, RENEWAL, SECURE_NPCTIMEOUT - -#include "battle.h" // battle -#include "battleground.h" // enum bg_queue_types -#include "buyingstore.h" // struct s_buyingstore -#include "itemdb.h" // MAX_ITEMDELAYS -#include "log.h" // struct e_log_pick_type -#include "map.h" // RC_MAX, ELE_MAX -#include "pc_groups.h" // GroupSettings -#include "script.h" // struct reg_db -#include "searchstore.h" // struct s_search_store_info -#include "status.h" // enum sc_type, OPTION_* -#include "unit.h" // struct unit_data, struct view_data -#include "vending.h" // struct s_vending -#include "../common/cbasetypes.h" -#include "../common/ers.h" // struct eri -#include "../common/mmo.h" // JOB_*, MAX_FAME_LIST, struct fame_list, struct mmo_charstatus, NEW_CARTS +#include "config/core.h" // AUTOLOOTITEM_SIZE, RENEWAL, SECURE_NPCTIMEOUT + +#include "map/battle.h" // battle +#include "map/battleground.h" // enum bg_queue_types +#include "map/buyingstore.h" // struct s_buyingstore +#include "map/itemdb.h" // MAX_ITEMDELAYS +#include "map/log.h" // struct e_log_pick_type +#include "map/map.h" // RC_MAX, ELE_MAX +#include "map/pc_groups.h" // GroupSettings +#include "map/script.h" // struct reg_db +#include "map/searchstore.h" // struct s_search_store_info +#include "map/status.h" // enum sc_type, OPTION_* +#include "map/unit.h" // struct unit_data, struct view_data +#include "map/vending.h" // struct s_vending +#include "common/cbasetypes.h" +#include "common/ers.h" // struct eri +#include "common/mmo.h" // JOB_*, MAX_FAME_LIST, struct fame_list, struct mmo_charstatus, NEW_CARTS /** * Defines diff --git a/src/map/pc_groups.c b/src/map/pc_groups.c index 9cd478b3f..f9a442d97 100644 --- a/src/map/pc_groups.c +++ b/src/map/pc_groups.c @@ -6,17 +6,17 @@ #include "pc_groups.h" -#include "atcommand.h" // atcommand->exists(), atcommand->load_groups() -#include "clif.h" // clif->GM_kick() -#include "map.h" // mapiterator -#include "pc.h" // pc->set_group() -#include "../common/cbasetypes.h" -#include "../common/conf.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" // strcmp +#include "map/atcommand.h" // atcommand-"exists(), atcommand-"load_groups() +#include "map/clif.h" // clif-"GM_kick() +#include "map/map.h" // mapiterator +#include "map/pc.h" // pc-"set_group() +#include "common/cbasetypes.h" +#include "common/conf.h" +#include "common/db.h" +#include "common/malloc.h" +#include "common/nullpo.h" +#include "common/showmsg.h" +#include "common/strlib.h" // strcmp static GroupSettings dummy_group; ///< dummy group used in dummy map sessions @see pc_get_dummy_sd() diff --git a/src/map/pc_groups.h b/src/map/pc_groups.h index 8dd95a177..4fee312a4 100644 --- a/src/map/pc_groups.h +++ b/src/map/pc_groups.h @@ -5,9 +5,9 @@ #ifndef MAP_PC_GROUPS_H #define MAP_PC_GROUPS_H -#include "../common/cbasetypes.h" -#include "../common/conf.h" -#include "../common/db.h" +#include "common/cbasetypes.h" +#include "common/conf.h" +#include "common/db.h" /// PC permissions enum e_pc_permission { diff --git a/src/map/pet.c b/src/map/pet.c index 8160f88b0..2379ec984 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -6,36 +6,36 @@ #include "pet.h" +#include "map/atcommand.h" // msg_txt() +#include "map/battle.h" +#include "map/chrif.h" +#include "map/clif.h" +#include "map/intif.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/map.h" +#include "map/mob.h" +#include "map/npc.h" +#include "map/path.h" +#include "map/pc.h" +#include "map/script.h" +#include "map/skill.h" +#include "map/status.h" +#include "map/unit.h" +#include "common/db.h" +#include "common/ers.h" +#include "common/malloc.h" +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/strlib.h" +#include "common/timer.h" +#include "common/utils.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "atcommand.h" // msg_txt() -#include "battle.h" -#include "chrif.h" -#include "clif.h" -#include "intif.h" -#include "itemdb.h" -#include "log.h" -#include "map.h" -#include "mob.h" -#include "npc.h" -#include "path.h" -#include "pc.h" -#include "script.h" -#include "skill.h" -#include "status.h" -#include "unit.h" -#include "../common/db.h" -#include "../common/ers.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/timer.h" -#include "../common/utils.h" - struct pet_interface pet_s; #define MIN_PETTHINKTIME 100 diff --git a/src/map/pet.h b/src/map/pet.h index 0b51bcb16..06302c9b2 100644 --- a/src/map/pet.h +++ b/src/map/pet.h @@ -5,11 +5,11 @@ #ifndef MAP_PET_H #define MAP_PET_H -#include "map.h" // struct block_list -#include "status.h" // enum sc_type -#include "unit.h" // struct unit_data -#include "../common/cbasetypes.h" -#include "../common/mmo.h" // NAME_LENGTH, struct s_pet +#include "map/map.h" // struct block_list +#include "map/status.h" // enum sc_type +#include "map/unit.h" // struct unit_data +#include "common/cbasetypes.h" +#include "common/mmo.h" // NAME_LENGTH, struct s_pet #define MAX_PET_DB 300 #define MAX_PETLOOT_SIZE 30 diff --git a/src/map/quest.c b/src/map/quest.c index 93ec1b04c..da5f73caa 100644 --- a/src/map/quest.c +++ b/src/map/quest.c @@ -6,36 +6,36 @@ #include "quest.h" +#include "map/battle.h" +#include "map/chrif.h" +#include "map/clif.h" +#include "map/intif.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/map.h" +#include "map/mob.h" +#include "map/npc.h" +#include "map/party.h" +#include "map/pc.h" +#include "map/script.h" +#include "map/unit.h" +#include "common/cbasetypes.h" +#include "common/conf.h" +#include "common/malloc.h" +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "common/timer.h" +#include "common/utils.h" + #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> -#include "battle.h" -#include "chrif.h" -#include "clif.h" -#include "intif.h" -#include "itemdb.h" -#include "log.h" -#include "map.h" -#include "mob.h" -#include "npc.h" -#include "party.h" -#include "pc.h" -#include "script.h" -#include "unit.h" -#include "../common/cbasetypes.h" -#include "../common/conf.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/timer.h" -#include "../common/utils.h" - struct quest_interface quest_s; /** diff --git a/src/map/quest.h b/src/map/quest.h index 36ac69a53..014f82527 100644 --- a/src/map/quest.h +++ b/src/map/quest.h @@ -5,9 +5,9 @@ #ifndef MAP_QUEST_H #define MAP_QUEST_H -#include "map.h" // TBL_PC -#include "../common/cbasetypes.h" -#include "../common/conf.h" +#include "map/map.h" // TBL_PC +#include "common/cbasetypes.h" +#include "common/conf.h" #define MAX_QUEST_DB (60355+1) // Highest quest ID + 1 diff --git a/src/map/script.c b/src/map/script.c index 724b3b135..87762f44e 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -4,60 +4,59 @@ #define HERCULES_CORE -#include "../config/core.h" // RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EDP, RENEWAL_EXP, RENEWAL_LVDMG, SCRIPT_CALLFUNC_CHECK, SECURE_NPCTIMEOUT, SECURE_NPCTIMEOUT_INTERVAL +#include "config/core.h" // RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EDP, RENEWAL_EXP, RENEWAL_LVDMG, SCRIPT_CALLFUNC_CHECK, SECURE_NPCTIMEOUT, SECURE_NPCTIMEOUT_INTERVAL #include "script.h" +#include "map/atcommand.h" +#include "map/battle.h" +#include "map/battleground.h" +#include "map/channel.h" +#include "map/chat.h" +#include "map/chrif.h" +#include "map/clif.h" +#include "map/elemental.h" +#include "map/guild.h" +#include "map/homunculus.h" +#include "map/instance.h" +#include "map/intif.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/mail.h" +#include "map/map.h" +#include "map/mapreg.h" +#include "map/mercenary.h" +#include "map/mob.h" +#include "map/npc.h" +#include "map/party.h" +#include "map/path.h" +#include "map/pc.h" +#include "map/pet.h" +#include "map/pet.h" +#include "map/quest.h" +#include "map/skill.h" +#include "map/status.h" +#include "map/status.h" +#include "map/storage.h" +#include "map/unit.h" +#include "common/cbasetypes.h" +#include "common/malloc.h" +#include "common/md5calc.h" +#include "common/mmo.h" // NEW_CARTS +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/socket.h" // usage: getcharip +#include "common/strlib.h" +#include "common/sysinfo.h" +#include "common/timer.h" +#include "common/utils.h" +#include "common/HPM.h" + #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> - -#include "atcommand.h" -#include "battle.h" -#include "battleground.h" -#include "channel.h" -#include "chat.h" -#include "chrif.h" -#include "clif.h" -#include "elemental.h" -#include "guild.h" -#include "homunculus.h" -#include "instance.h" -#include "intif.h" -#include "itemdb.h" -#include "log.h" -#include "mail.h" -#include "map.h" -#include "mapreg.h" -#include "mercenary.h" -#include "mob.h" -#include "npc.h" -#include "party.h" -#include "path.h" -#include "pc.h" -#include "pet.h" -#include "pet.h" -#include "quest.h" -#include "skill.h" -#include "status.h" -#include "status.h" -#include "storage.h" -#include "unit.h" -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/md5calc.h" -#include "../common/mmo.h" // NEW_CARTS -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" // usage: getcharip -#include "../common/strlib.h" -#include "../common/sysinfo.h" -#include "../common/timer.h" -#include "../common/utils.h" -#include "../common/HPM.h" - #ifndef WIN32 #include <sys/time.h> #endif diff --git a/src/map/script.h b/src/map/script.h index 25c4283ca..93d60f416 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -5,16 +5,16 @@ #ifndef MAP_SCRIPT_H #define MAP_SCRIPT_H +#include "map/map.h" //EVENT_NAME_LENGTH +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/mmo.h" // struct item +#include "common/sql.h" // Sql +#include "common/strlib.h" //StringBuf + #include <errno.h> #include <setjmp.h> -#include "map.h" //EVENT_NAME_LENGTH -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/mmo.h" // struct item -#include "../common/sql.h" // Sql -#include "../common/strlib.h" //StringBuf - /** * Declarations **/ diff --git a/src/map/searchstore.c b/src/map/searchstore.c index 782c14987..b9e23ae82 100644 --- a/src/map/searchstore.c +++ b/src/map/searchstore.c @@ -4,15 +4,15 @@ #define HERCULES_CORE -#include "searchstore.h" // struct s_search_store_info - -#include "battle.h" // battle_config.* -#include "clif.h" // clif->open_search_store_info, clif->search_store_info_* -#include "pc.h" // struct map_session_data -#include "../common/cbasetypes.h" -#include "../common/malloc.h" // aMalloc, aRealloc, aFree -#include "../common/showmsg.h" // ShowError, ShowWarning -#include "../common/strlib.h" // safestrncpy +#include "searchstore.h" // struct s_search_store_info + +#include "map/battle.h" // battle_config.* +#include "map/clif.h" // clif-"open_search_store_info, clif-"search_store_info_* +#include "map/pc.h" // struct map_session_data +#include "common/cbasetypes.h" +#include "common/malloc.h" // aMalloc, aRealloc, aFree +#include "common/showmsg.h" // ShowError, ShowWarning +#include "common/strlib.h" // safestrncpy struct searchstore_interface searchstore_s; diff --git a/src/map/searchstore.h b/src/map/searchstore.h index 6664eddfa..2778740a5 100644 --- a/src/map/searchstore.h +++ b/src/map/searchstore.h @@ -5,11 +5,11 @@ #ifndef MAP_SEARCHSTORE_H #define MAP_SEARCHSTORE_H -#include <time.h> +#include "map/map.h" // MESSAGE_SIZE +#include "common/cbasetypes.h" +#include "common/mmo.h" // MAX_SLOTS -#include "map.h" // MESSAGE_SIZE -#include "../common/cbasetypes.h" -#include "../common/mmo.h" // MAX_SLOTS +#include <time.h> /** * Defines diff --git a/src/map/skill.c b/src/map/skill.c index b39ea380f..c6233c31d 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -4,47 +4,47 @@ #define HERCULES_CORE -#include "../config/core.h" // DBPATH, MAGIC_REFLECTION_TYPE, OFFICIAL_WALKPATH, RENEWAL, RENEWAL_CAST, VARCAST_REDUCTION() +#include "config/core.h" // DBPATH, MAGIC_REFLECTION_TYPE, OFFICIAL_WALKPATH, RENEWAL, RENEWAL_CAST, VARCAST_REDUCTION() #include "skill.h" +#include "map/battle.h" +#include "map/battleground.h" +#include "map/chrif.h" +#include "map/clif.h" +#include "map/date.h" +#include "map/elemental.h" +#include "map/guild.h" +#include "map/homunculus.h" +#include "map/intif.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/map.h" +#include "map/mercenary.h" +#include "map/mob.h" +#include "map/npc.h" +#include "map/party.h" +#include "map/path.h" +#include "map/pc.h" +#include "map/pet.h" +#include "map/script.h" +#include "map/status.h" +#include "map/unit.h" +#include "common/cbasetypes.h" +#include "common/ers.h" +#include "common/malloc.h" +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/strlib.h" +#include "common/timer.h" +#include "common/utils.h" + #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> -#include "battle.h" -#include "battleground.h" -#include "chrif.h" -#include "clif.h" -#include "date.h" -#include "elemental.h" -#include "guild.h" -#include "homunculus.h" -#include "intif.h" -#include "itemdb.h" -#include "log.h" -#include "map.h" -#include "mercenary.h" -#include "mob.h" -#include "npc.h" -#include "party.h" -#include "path.h" -#include "pc.h" -#include "pet.h" -#include "script.h" -#include "status.h" -#include "unit.h" -#include "../common/cbasetypes.h" -#include "../common/ers.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/timer.h" -#include "../common/utils.h" - #define SKILLUNITTIMER_INTERVAL 100 // ranges reserved for mapping skill ids to skilldb offsets diff --git a/src/map/skill.h b/src/map/skill.h index bbf5b5458..6e56e276b 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -5,13 +5,13 @@ #ifndef MAP_SKILL_H #define MAP_SKILL_H -#include "../config/core.h" // RENEWAL_CAST +#include "config/core.h" // RENEWAL_CAST -#include "map.h" // struct block_list -#include "status.h" // enum sc_type -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/mmo.h" // MAX_SKILL, struct square +#include "map/map.h" // struct block_list +#include "map/status.h" // enum sc_type +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/mmo.h" // MAX_SKILL, struct square /** * Declarations diff --git a/src/map/status.c b/src/map/status.c index ffc534de9..62d4f27fe 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -4,9 +4,38 @@ #define HERCULES_CORE -#include "../config/core.h" // ANTI_MAYAP_CHEAT, DBPATH, DEFTYPE_MAX, DEFTYPE_MIN, DEVOTION_REFLECT_DAMAGE, RENEWAL, RENEWAL_ASPD, RENEWAL_EDP +#include "config/core.h" // ANTI_MAYAP_CHEAT, DBPATH, DEFTYPE_MAX, DEFTYPE_MIN, DEVOTION_REFLECT_DAMAGE, RENEWAL, RENEWAL_ASPD, RENEWAL_EDP #include "status.h" +#include "map/battle.h" +#include "map/chrif.h" +#include "map/clif.h" +#include "map/elemental.h" +#include "map/guild.h" +#include "map/homunculus.h" +#include "map/itemdb.h" +#include "map/map.h" +#include "map/mercenary.h" +#include "map/mob.h" +#include "map/npc.h" +#include "map/path.h" +#include "map/pc.h" +#include "map/pet.h" +#include "map/script.h" +#include "map/skill.h" +#include "map/skill.h" +#include "map/unit.h" +#include "map/vending.h" +#include "common/cbasetypes.h" +#include "common/ers.h" +#include "common/malloc.h" +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/strlib.h" +#include "common/timer.h" +#include "common/utils.h" + #include <math.h> #include <memory.h> #include <stdio.h> @@ -14,35 +43,6 @@ #include <string.h> #include <time.h> -#include "battle.h" -#include "chrif.h" -#include "clif.h" -#include "elemental.h" -#include "guild.h" -#include "homunculus.h" -#include "itemdb.h" -#include "map.h" -#include "mercenary.h" -#include "mob.h" -#include "npc.h" -#include "path.h" -#include "pc.h" -#include "pet.h" -#include "script.h" -#include "skill.h" -#include "skill.h" -#include "unit.h" -#include "vending.h" -#include "../common/cbasetypes.h" -#include "../common/ers.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/timer.h" -#include "../common/utils.h" - struct status_interface status_s; /** diff --git a/src/map/status.h b/src/map/status.h index af11683a0..4bda57fa9 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -5,10 +5,11 @@ #ifndef MAP_STATUS_H #define MAP_STATUS_H -#include "../config/core.h" // defType, RENEWAL, RENEWAL_ASPD -#include "../common/conf.h" -#include "../common/cbasetypes.h" -#include "../common/mmo.h" // NEW_CARTS +#include "config/core.h" // defType, RENEWAL, RENEWAL_ASPD + +#include "common/conf.h" +#include "common/cbasetypes.h" +#include "common/mmo.h" // NEW_CARTS struct block_list; struct elemental_data; diff --git a/src/map/storage.c b/src/map/storage.c index 2706b3683..0a22b9ec6 100644 --- a/src/map/storage.c +++ b/src/map/storage.c @@ -6,25 +6,25 @@ #include "storage.h" +#include "map/atcommand.h" +#include "map/battle.h" +#include "map/chrif.h" +#include "map/clif.h" +#include "map/guild.h" +#include "map/intif.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/map.h" // struct map_session_data +#include "map/pc.h" +#include "common/cbasetypes.h" +#include "common/db.h" +#include "common/malloc.h" +#include "common/nullpo.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "atcommand.h" -#include "battle.h" -#include "chrif.h" -#include "clif.h" -#include "guild.h" -#include "intif.h" -#include "itemdb.h" -#include "log.h" -#include "map.h" // struct map_session_data -#include "pc.h" -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" - struct storage_interface storage_s; struct guild_storage_interface gstorage_s; diff --git a/src/map/storage.h b/src/map/storage.h index 6a9e7a2ac..5f2c69f56 100644 --- a/src/map/storage.h +++ b/src/map/storage.h @@ -5,8 +5,8 @@ #ifndef MAP_STORAGE_H #define MAP_STORAGE_H -#include "../common/cbasetypes.h" -#include "../common/db.h" +#include "common/cbasetypes.h" +#include "common/db.h" struct guild_storage; struct item; diff --git a/src/map/trade.c b/src/map/trade.c index a17938779..4dd6ffafa 100644 --- a/src/map/trade.c +++ b/src/map/trade.c @@ -6,24 +6,24 @@ #include "trade.h" +#include "map/atcommand.h" +#include "map/battle.h" +#include "map/chrif.h" +#include "map/clif.h" +#include "map/intif.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/map.h" +#include "map/npc.h" +#include "map/path.h" +#include "map/pc.h" +#include "map/storage.h" +#include "common/nullpo.h" +#include "common/socket.h" + #include <stdio.h> #include <string.h> -#include "atcommand.h" -#include "battle.h" -#include "chrif.h" -#include "clif.h" -#include "intif.h" -#include "itemdb.h" -#include "log.h" -#include "map.h" -#include "npc.h" -#include "path.h" -#include "pc.h" -#include "storage.h" -#include "../common/nullpo.h" -#include "../common/socket.h" - struct trade_interface trade_s; /*========================================== diff --git a/src/map/unit.c b/src/map/unit.c index 5ead7527e..60911b85a 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -4,47 +4,47 @@ #define HERCULES_CORE -#include "../config/core.h" // RENEWAL_CAST +#include "config/core.h" // RENEWAL_CAST #include "unit.h" +#include "map/battle.h" +#include "map/battleground.h" +#include "map/chat.h" +#include "map/chrif.h" +#include "map/clif.h" +#include "map/duel.h" +#include "map/elemental.h" +#include "map/guild.h" +#include "map/homunculus.h" +#include "map/instance.h" +#include "map/intif.h" +#include "map/map.h" +#include "map/mercenary.h" +#include "map/mob.h" +#include "map/npc.h" +#include "map/party.h" +#include "map/path.h" +#include "map/pc.h" +#include "map/pet.h" +#include "map/script.h" +#include "map/skill.h" +#include "map/status.h" +#include "map/storage.h" +#include "map/trade.h" +#include "map/vending.h" +#include "common/HPM.h" +#include "common/db.h" +#include "common/malloc.h" +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/timer.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "battle.h" -#include "battleground.h" -#include "chat.h" -#include "chrif.h" -#include "clif.h" -#include "duel.h" -#include "elemental.h" -#include "guild.h" -#include "homunculus.h" -#include "instance.h" -#include "intif.h" -#include "map.h" -#include "mercenary.h" -#include "mob.h" -#include "npc.h" -#include "party.h" -#include "path.h" -#include "pc.h" -#include "pet.h" -#include "script.h" -#include "skill.h" -#include "status.h" -#include "storage.h" -#include "trade.h" -#include "vending.h" -#include "../common/HPM.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/timer.h" - const short dirx[8]={0,-1,-1,-1,0,1,1,1}; const short diry[8]={1,1,0,-1,-1,-1,0,1}; diff --git a/src/map/unit.h b/src/map/unit.h index d434d52e4..00fff5981 100644 --- a/src/map/unit.h +++ b/src/map/unit.h @@ -5,10 +5,10 @@ #ifndef MAP_UNIT_H #define MAP_UNIT_H -#include "clif.h" // clr_type -#include "path.h" // struct walkpath_data -#include "skill.h" // 'MAX_SKILLTIMERSKILL, struct skill_timerskill, struct skill_unit_group, struct skill_unit_group_tickset -#include "../common/cbasetypes.h" +#include "map/clif.h" // clr_type +#include "map/path.h" // struct walkpath_data +#include "map/skill.h" // 'MAX_SKILLTIMERSKILL, struct skill_timerskill, struct skill_unit_group, struct skill_unit_group_tickset +#include "common/cbasetypes.h" struct map_session_data; struct block_list; diff --git a/src/map/vending.c b/src/map/vending.c index b32c3e43e..d0f0dee00 100644 --- a/src/map/vending.c +++ b/src/map/vending.c @@ -6,24 +6,24 @@ #include "vending.h" +#include "map/atcommand.h" +#include "map/battle.h" +#include "map/chrif.h" +#include "map/clif.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/map.h" +#include "map/npc.h" +#include "map/path.h" +#include "map/pc.h" +#include "map/skill.h" +#include "common/nullpo.h" +#include "common/strlib.h" +#include "common/utils.h" + #include <stdio.h> #include <string.h> -#include "atcommand.h" -#include "battle.h" -#include "chrif.h" -#include "clif.h" -#include "itemdb.h" -#include "log.h" -#include "map.h" -#include "npc.h" -#include "path.h" -#include "pc.h" -#include "skill.h" -#include "../common/nullpo.h" -#include "../common/strlib.h" -#include "../common/utils.h" - struct vending_interface vending_s; /// Returns an unique vending shop id. diff --git a/src/map/vending.h b/src/map/vending.h index 00d3eefff..189189227 100644 --- a/src/map/vending.h +++ b/src/map/vending.h @@ -5,8 +5,8 @@ #ifndef MAP_VENDING_H #define MAP_VENDING_H -#include "../common/cbasetypes.h" -#include "../common/db.h" +#include "common/cbasetypes.h" +#include "common/db.h" struct map_session_data; struct s_search_store_search; diff --git a/src/plugins/HPMHooking.c b/src/plugins/HPMHooking.c index c6fb6462d..e15cc363d 100644 --- a/src/plugins/HPMHooking.c +++ b/src/plugins/HPMHooking.c @@ -2,99 +2,99 @@ // See the LICENSE file // Sample Hercules Plugin -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "../common/HPMi.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/socket.h" +#include "common/HPMi.h" +#include "common/db.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/socket.h" #if defined (HPMHOOKING_LOGIN) #define HPM_SERVER_TYPE SERVER_TYPE_LOGIN -#define HPM_CORE_INCLUDE "../plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc" -#define HPM_SYMBOL_INCLUDE "../plugins/HPMHooking/HPMHooking_login.GetSymbol.inc" -#define HPM_HOOKS_INCLUDE "../plugins/HPMHooking/HPMHooking_login.Hooks.inc" -#define HPM_POINTS_INCLUDE "../plugins/HPMHooking/HPMHooking_login.HookingPoints.inc" -#define HPM_SOURCES_INCLUDE "../plugins/HPMHooking/HPMHooking_login.sources.inc" -#include "../login/login.h" +#define HPM_CORE_INCLUDE "HPMHooking/HPMHooking_login.HPMHooksCore.inc" +#define HPM_SYMBOL_INCLUDE "HPMHooking/HPMHooking_login.GetSymbol.inc" +#define HPM_HOOKS_INCLUDE "HPMHooking/HPMHooking_login.Hooks.inc" +#define HPM_POINTS_INCLUDE "HPMHooking/HPMHooking_login.HookingPoints.inc" +#define HPM_SOURCES_INCLUDE "HPMHooking/HPMHooking_login.sources.inc" +#include "login/login.h" #elif defined (HPMHOOKING_CHAR) #define HPM_SERVER_TYPE SERVER_TYPE_CHAR -#define HPM_CORE_INCLUDE "../plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc" -#define HPM_SYMBOL_INCLUDE "../plugins/HPMHooking/HPMHooking_char.GetSymbol.inc" -#define HPM_HOOKS_INCLUDE "../plugins/HPMHooking/HPMHooking_char.Hooks.inc" -#define HPM_POINTS_INCLUDE "../plugins/HPMHooking/HPMHooking_char.HookingPoints.inc" -#define HPM_SOURCES_INCLUDE "../plugins/HPMHooking/HPMHooking_char.sources.inc" -#include "../char/char.h" -#include "../char/geoip.h" -#include "../char/int_auction.h" -#include "../char/int_elemental.h" -#include "../char/int_guild.h" -#include "../char/int_homun.h" -#include "../char/int_mail.h" -#include "../char/int_mercenary.h" -#include "../char/int_party.h" -#include "../char/int_pet.h" -#include "../char/int_quest.h" -#include "../char/int_storage.h" -#include "../char/inter.h" -#include "../char/loginif.h" -#include "../char/mapif.h" -#include "../char/pincode.h" +#define HPM_CORE_INCLUDE "HPMHooking/HPMHooking_char.HPMHooksCore.inc" +#define HPM_SYMBOL_INCLUDE "HPMHooking/HPMHooking_char.GetSymbol.inc" +#define HPM_HOOKS_INCLUDE "HPMHooking/HPMHooking_char.Hooks.inc" +#define HPM_POINTS_INCLUDE "HPMHooking/HPMHooking_char.HookingPoints.inc" +#define HPM_SOURCES_INCLUDE "HPMHooking/HPMHooking_char.sources.inc" +#include "char/char.h" +#include "char/geoip.h" +#include "char/int_auction.h" +#include "char/int_elemental.h" +#include "char/int_guild.h" +#include "char/int_homun.h" +#include "char/int_mail.h" +#include "char/int_mercenary.h" +#include "char/int_party.h" +#include "char/int_pet.h" +#include "char/int_quest.h" +#include "char/int_storage.h" +#include "char/inter.h" +#include "char/loginif.h" +#include "char/mapif.h" +#include "char/pincode.h" #elif defined (HPMHOOKING_MAP) #define HPM_SERVER_TYPE SERVER_TYPE_MAP -#define HPM_CORE_INCLUDE "../plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc" -#define HPM_SYMBOL_INCLUDE "../plugins/HPMHooking/HPMHooking_map.GetSymbol.inc" -#define HPM_HOOKS_INCLUDE "../plugins/HPMHooking/HPMHooking_map.Hooks.inc" -#define HPM_POINTS_INCLUDE "../plugins/HPMHooking/HPMHooking_map.HookingPoints.inc" -#define HPM_SOURCES_INCLUDE "../plugins/HPMHooking/HPMHooking_map.sources.inc" -#include "../map/atcommand.h" -#include "../map/battle.h" -#include "../map/battleground.h" -#include "../map/channel.h" -#include "../map/chat.h" -#include "../map/chrif.h" -#include "../map/clif.h" -#include "../map/duel.h" -#include "../map/elemental.h" -#include "../map/guild.h" -#include "../map/homunculus.h" -#include "../map/instance.h" -#include "../map/intif.h" -#include "../map/irc-bot.h" -#include "../map/itemdb.h" -#include "../map/log.h" -#include "../map/mail.h" -#include "../map/map.h" -#include "../map/mapreg.h" -#include "../map/mercenary.h" -#include "../map/mob.h" -#include "../map/npc.h" -#include "../map/npc.h" -#include "../map/party.h" -#include "../map/path.h" -#include "../map/pc.h" -#include "../map/pet.h" -#include "../map/quest.h" -#include "../map/script.h" -#include "../map/skill.h" -#include "../map/status.h" -#include "../map/storage.h" -#include "../map/trade.h" -#include "../map/unit.h" +#define HPM_CORE_INCLUDE "HPMHooking/HPMHooking_map.HPMHooksCore.inc" +#define HPM_SYMBOL_INCLUDE "HPMHooking/HPMHooking_map.GetSymbol.inc" +#define HPM_HOOKS_INCLUDE "HPMHooking/HPMHooking_map.Hooks.inc" +#define HPM_POINTS_INCLUDE "HPMHooking/HPMHooking_map.HookingPoints.inc" +#define HPM_SOURCES_INCLUDE "HPMHooking/HPMHooking_map.sources.inc" +#include "map/atcommand.h" +#include "map/battle.h" +#include "map/battleground.h" +#include "map/channel.h" +#include "map/chat.h" +#include "map/chrif.h" +#include "map/clif.h" +#include "map/duel.h" +#include "map/elemental.h" +#include "map/guild.h" +#include "map/homunculus.h" +#include "map/instance.h" +#include "map/intif.h" +#include "map/irc-bot.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/mail.h" +#include "map/map.h" +#include "map/mapreg.h" +#include "map/mercenary.h" +#include "map/mob.h" +#include "map/npc.h" +#include "map/npc.h" +#include "map/party.h" +#include "map/path.h" +#include "map/pc.h" +#include "map/pet.h" +#include "map/quest.h" +#include "map/script.h" +#include "map/skill.h" +#include "map/status.h" +#include "map/storage.h" +#include "map/trade.h" +#include "map/unit.h" #else #define HPM_SERVER_TYPE SERVER_TYPE_UNKNOWN -#define HPM_CORE_INCLUDE "../plugins/HPMHooking/HPMHooking.HPMHooksCore.inc" -#define HPM_SYMBOL_INCLUDE "../plugins/HPMHooking/HPMHooking.GetSymbol.inc" -#define HPM_HOOKS_INCLUDE "../plugins/HPMHooking/HPMHooking.Hooks.inc" -#define HPM_POINTS_INCLUDE "../plugins/HPMHooking/HPMHooking.HookingPoints.inc" -#define HPM_SOURCES_INCLUDE "../plugins/HPMHooking/HPMHooking.sources.inc" +#define HPM_CORE_INCLUDE "HPMHooking/HPMHooking.HPMHooksCore.inc" +#define HPM_SYMBOL_INCLUDE "HPMHooking/HPMHooking.GetSymbol.inc" +#define HPM_HOOKS_INCLUDE "HPMHooking/HPMHooking.Hooks.inc" +#define HPM_POINTS_INCLUDE "HPMHooking/HPMHooking.HookingPoints.inc" +#define HPM_SOURCES_INCLUDE "HPMHooking/HPMHooking.sources.inc" #error HPMHooking plugin needs to be compiled for a specific server type. Please make sure your Makefiles are up to date. #endif -#include "../common/HPMDataCheck.h" +#include "common/HPMDataCheck.h" + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> HPExport struct hplugin_info pinfo = { "HPMHooking", // Plugin name @@ -134,13 +134,13 @@ HPExport void server_post_final (void) { HPM_HP_final(); } -HPExport bool Hooked (bool *fr) { +HPExport const char *Hooked (bool *fr) { HPMforce_return = fr; - DB = GET_SYMBOL("DB"); - iMalloc = GET_SYMBOL("iMalloc"); + if (!(DB = GET_SYMBOL("DB"))) return "DB"; + if (!(iMalloc = GET_SYMBOL("iMalloc"))) return "iMalloc"; #include HPM_SYMBOL_INCLUDE HPM_HP_load(); - return true; + return NULL; } diff --git a/src/plugins/HPMHooking/HPMHooking_char.GetSymbol.inc b/src/plugins/HPMHooking/HPMHooking_char.GetSymbol.inc index 6d6db24ae..af7df2980 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.GetSymbol.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.GetSymbol.inc @@ -4,19 +4,19 @@ // NOTE: This file was auto-generated and should never be manually edited, // as it will get overwritten. -if( !(chr = GET_SYMBOL("chr") ) ) return false; -if( !(geoip = GET_SYMBOL("geoip") ) ) return false; -if( !(inter_auction = GET_SYMBOL("inter_auction") ) ) return false; -if( !(inter_elemental = GET_SYMBOL("inter_elemental") ) ) return false; -if( !(inter_guild = GET_SYMBOL("inter_guild") ) ) return false; -if( !(inter_homunculus = GET_SYMBOL("inter_homunculus") ) ) return false; -if( !(inter = GET_SYMBOL("inter") ) ) return false; -if( !(inter_mail = GET_SYMBOL("inter_mail") ) ) return false; -if( !(inter_mercenary = GET_SYMBOL("inter_mercenary") ) ) return false; -if( !(inter_party = GET_SYMBOL("inter_party") ) ) return false; -if( !(inter_pet = GET_SYMBOL("inter_pet") ) ) return false; -if( !(inter_quest = GET_SYMBOL("inter_quest") ) ) return false; -if( !(inter_storage = GET_SYMBOL("inter_storage") ) ) return false; -if( !(loginif = GET_SYMBOL("loginif") ) ) return false; -if( !(mapif = GET_SYMBOL("mapif") ) ) return false; -if( !(pincode = GET_SYMBOL("pincode") ) ) return false; +if( !(chr = GET_SYMBOL("chr") ) ) return "chr"; +if( !(geoip = GET_SYMBOL("geoip") ) ) return "geoip"; +if( !(inter_auction = GET_SYMBOL("inter_auction") ) ) return "inter_auction"; +if( !(inter_elemental = GET_SYMBOL("inter_elemental") ) ) return "inter_elemental"; +if( !(inter_guild = GET_SYMBOL("inter_guild") ) ) return "inter_guild"; +if( !(inter_homunculus = GET_SYMBOL("inter_homunculus") ) ) return "inter_homunculus"; +if( !(inter = GET_SYMBOL("inter") ) ) return "inter"; +if( !(inter_mail = GET_SYMBOL("inter_mail") ) ) return "inter_mail"; +if( !(inter_mercenary = GET_SYMBOL("inter_mercenary") ) ) return "inter_mercenary"; +if( !(inter_party = GET_SYMBOL("inter_party") ) ) return "inter_party"; +if( !(inter_pet = GET_SYMBOL("inter_pet") ) ) return "inter_pet"; +if( !(inter_quest = GET_SYMBOL("inter_quest") ) ) return "inter_quest"; +if( !(inter_storage = GET_SYMBOL("inter_storage") ) ) return "inter_storage"; +if( !(loginif = GET_SYMBOL("loginif") ) ) return "loginif"; +if( !(mapif = GET_SYMBOL("mapif") ) ) return "mapif"; +if( !(pincode = GET_SYMBOL("pincode") ) ) return "pincode"; diff --git a/src/plugins/HPMHooking/HPMHooking_login.GetSymbol.inc b/src/plugins/HPMHooking/HPMHooking_login.GetSymbol.inc index 3348b5cde..fd9eeba8c 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.GetSymbol.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.GetSymbol.inc @@ -4,4 +4,4 @@ // NOTE: This file was auto-generated and should never be manually edited, // as it will get overwritten. -if( !(login = GET_SYMBOL("login") ) ) return false; +if( !(login = GET_SYMBOL("login") ) ) return "login"; diff --git a/src/plugins/HPMHooking/HPMHooking_map.GetSymbol.inc b/src/plugins/HPMHooking/HPMHooking_map.GetSymbol.inc index 6b1b84c69..88fe7745a 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.GetSymbol.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.GetSymbol.inc @@ -4,42 +4,42 @@ // NOTE: This file was auto-generated and should never be manually edited, // as it will get overwritten. -if( !(atcommand = GET_SYMBOL("atcommand") ) ) return false; -if( !(battle = GET_SYMBOL("battle") ) ) return false; -if( !(bg = GET_SYMBOL("battlegrounds") ) ) return false; -if( !(buyingstore = GET_SYMBOL("buyingstore") ) ) return false; -if( !(channel = GET_SYMBOL("channel") ) ) return false; -if( !(chat = GET_SYMBOL("chat") ) ) return false; -if( !(chrif = GET_SYMBOL("chrif") ) ) return false; -if( !(clif = GET_SYMBOL("clif") ) ) return false; -if( !(duel = GET_SYMBOL("duel") ) ) return false; -if( !(elemental = GET_SYMBOL("elemental") ) ) return false; -if( !(guild = GET_SYMBOL("guild") ) ) return false; -if( !(gstorage = GET_SYMBOL("gstorage") ) ) return false; -if( !(homun = GET_SYMBOL("homun") ) ) return false; -if( !(instance = GET_SYMBOL("instance") ) ) return false; -if( !(intif = GET_SYMBOL("intif") ) ) return false; -if( !(ircbot = GET_SYMBOL("ircbot") ) ) return false; -if( !(itemdb = GET_SYMBOL("itemdb") ) ) return false; -if( !(logs = GET_SYMBOL("logs") ) ) return false; -if( !(mail = GET_SYMBOL("mail") ) ) return false; -if( !(map = GET_SYMBOL("map") ) ) return false; -if( !(mapit = GET_SYMBOL("mapit") ) ) return false; -if( !(mapreg = GET_SYMBOL("mapreg") ) ) return false; -if( !(mercenary = GET_SYMBOL("mercenary") ) ) return false; -if( !(mob = GET_SYMBOL("mob") ) ) return false; -if( !(npc = GET_SYMBOL("npc") ) ) return false; -if( !(party = GET_SYMBOL("party") ) ) return false; -if( !(path = GET_SYMBOL("path") ) ) return false; -if( !(pcg = GET_SYMBOL("pc_groups") ) ) return false; -if( !(pc = GET_SYMBOL("pc") ) ) return false; -if( !(pet = GET_SYMBOL("pet") ) ) return false; -if( !(quest = GET_SYMBOL("quest") ) ) return false; -if( !(script = GET_SYMBOL("script") ) ) return false; -if( !(searchstore = GET_SYMBOL("searchstore") ) ) return false; -if( !(skill = GET_SYMBOL("skill") ) ) return false; -if( !(status = GET_SYMBOL("status") ) ) return false; -if( !(storage = GET_SYMBOL("storage") ) ) return false; -if( !(trade = GET_SYMBOL("trade") ) ) return false; -if( !(unit = GET_SYMBOL("unit") ) ) return false; -if( !(vending = GET_SYMBOL("vending") ) ) return false; +if( !(atcommand = GET_SYMBOL("atcommand") ) ) return "atcommand"; +if( !(battle = GET_SYMBOL("battle") ) ) return "battle"; +if( !(bg = GET_SYMBOL("battlegrounds") ) ) return "battlegrounds"; +if( !(buyingstore = GET_SYMBOL("buyingstore") ) ) return "buyingstore"; +if( !(channel = GET_SYMBOL("channel") ) ) return "channel"; +if( !(chat = GET_SYMBOL("chat") ) ) return "chat"; +if( !(chrif = GET_SYMBOL("chrif") ) ) return "chrif"; +if( !(clif = GET_SYMBOL("clif") ) ) return "clif"; +if( !(duel = GET_SYMBOL("duel") ) ) return "duel"; +if( !(elemental = GET_SYMBOL("elemental") ) ) return "elemental"; +if( !(guild = GET_SYMBOL("guild") ) ) return "guild"; +if( !(gstorage = GET_SYMBOL("gstorage") ) ) return "gstorage"; +if( !(homun = GET_SYMBOL("homun") ) ) return "homun"; +if( !(instance = GET_SYMBOL("instance") ) ) return "instance"; +if( !(intif = GET_SYMBOL("intif") ) ) return "intif"; +if( !(ircbot = GET_SYMBOL("ircbot") ) ) return "ircbot"; +if( !(itemdb = GET_SYMBOL("itemdb") ) ) return "itemdb"; +if( !(logs = GET_SYMBOL("logs") ) ) return "logs"; +if( !(mail = GET_SYMBOL("mail") ) ) return "mail"; +if( !(map = GET_SYMBOL("map") ) ) return "map"; +if( !(mapit = GET_SYMBOL("mapit") ) ) return "mapit"; +if( !(mapreg = GET_SYMBOL("mapreg") ) ) return "mapreg"; +if( !(mercenary = GET_SYMBOL("mercenary") ) ) return "mercenary"; +if( !(mob = GET_SYMBOL("mob") ) ) return "mob"; +if( !(npc = GET_SYMBOL("npc") ) ) return "npc"; +if( !(party = GET_SYMBOL("party") ) ) return "party"; +if( !(path = GET_SYMBOL("path") ) ) return "path"; +if( !(pcg = GET_SYMBOL("pc_groups") ) ) return "pc_groups"; +if( !(pc = GET_SYMBOL("pc") ) ) return "pc"; +if( !(pet = GET_SYMBOL("pet") ) ) return "pet"; +if( !(quest = GET_SYMBOL("quest") ) ) return "quest"; +if( !(script = GET_SYMBOL("script") ) ) return "script"; +if( !(searchstore = GET_SYMBOL("searchstore") ) ) return "searchstore"; +if( !(skill = GET_SYMBOL("skill") ) ) return "skill"; +if( !(status = GET_SYMBOL("status") ) ) return "status"; +if( !(storage = GET_SYMBOL("storage") ) ) return "storage"; +if( !(trade = GET_SYMBOL("trade") ) ) return "trade"; +if( !(unit = GET_SYMBOL("unit") ) ) return "unit"; +if( !(vending = GET_SYMBOL("vending") ) ) return "vending"; diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in index 802d1015a..3184353d1 100644 --- a/src/plugins/Makefile.in +++ b/src/plugins/Makefile.in @@ -32,6 +32,9 @@ PLUGINS = sample db2sql HPMHooking_char HPMHooking_login HPMHooking_map $(MYPLUG COMMON_D = ../common COMMON_H = $(wildcard $(COMMON_D)/*.h) +COMMON_INCLUDE = -I.. + +THIRDPARTY_INCLUDE = -I../../3rdparty CONFIG_D = ../config CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h) @@ -84,7 +87,7 @@ Makefile: Makefile.in ../../plugins/%@DLLEXT@: %.c $(ALL_H) $$(shell ls %/* 2>/dev/null) @echo " CC $<" - @$(CC) @PLUGINSTATIC@ @DEFS@ @CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $< + @$(CC) $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @PLUGINSTATIC@ @DEFS@ @CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $< ../../plugins/HPMHooking_login@DLLEXT@: HPMHOOKINGTYPE = LOGIN ../../plugins/HPMHooking_char@DLLEXT@: HPMHOOKINGTYPE = CHAR @@ -92,4 +95,4 @@ Makefile: Makefile.in ../../plugins/HPMHooking_%@DLLEXT@: HPMHooking.c $(ALL_H) $$(shell ls HPMHooking/*_%* HPMHooking/*_common* 2>/dev/null) @echo " CC $< ($(HPMHOOKINGTYPE))" - @$(CC) -DHPMHOOKING_$(HPMHOOKINGTYPE) @PLUGINSTATIC@ @DEFS@ @CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $< + @$(CC) -DHPMHOOKING_$(HPMHOOKINGTYPE) $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @PLUGINSTATIC@ @DEFS@ @CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $< diff --git a/src/plugins/db2sql.c b/src/plugins/db2sql.c index 1e27058c0..7cef173d2 100644 --- a/src/plugins/db2sql.c +++ b/src/plugins/db2sql.c @@ -1,25 +1,25 @@ // Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file -#include "../config/core.h" +#include "config/core.h" + +#include "common/HPMi.h" +#include "common/cbasetypes.h" +#include "common/conf.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/strlib.h" +#include "common/timer.h" +#include "map/clif.h" +#include "map/itemdb.h" +#include "map/map.h" +#include "map/pc.h" + +#include "common/HPMDataCheck.h" #include <stdio.h> #include <stdlib.h> -#include "../common/HPMi.h" -#include "../common/cbasetypes.h" -#include "../common/conf.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/strlib.h" -#include "../common/timer.h" -#include "../map/clif.h" -#include "../map/itemdb.h" -#include "../map/map.h" -#include "../map/pc.h" - -#include "../common/HPMDataCheck.h" - HPExport struct hplugin_info pinfo = { "DB2SQL", // Plugin name SERVER_TYPE_MAP, // Which server types this plugin works with? diff --git a/src/plugins/dbghelpplug.c b/src/plugins/dbghelpplug.c index ac72b8eb2..6ed16d7a6 100644 --- a/src/plugins/dbghelpplug.c +++ b/src/plugins/dbghelpplug.c @@ -5,12 +5,13 @@ // Ported from eAthena Dev Team's version @ http://eathena-project.googlecode.com/svn/trunk/src/plugins/dbghelpplug.c // Currently supported dbghelp 5.1 +#include "common/sysinfo.h" +#include "common/HPMi.h" + +#include "common/HPMDataCheck.h" + #include <stdio.h> #include <string.h> -#include "../common/sysinfo.h" -#include "../common/HPMi.h" - -#include "../common/HPMDataCheck.h" /** * Plugin basic information diff --git a/src/plugins/sample.c b/src/plugins/sample.c index 82cb198bd..b034775b0 100644 --- a/src/plugins/sample.c +++ b/src/plugins/sample.c @@ -2,21 +2,21 @@ // See the LICENSE file // Sample Hercules Plugin +#include "common/HPMi.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "map/clif.h" +#include "map/pc.h" +#include "map/script.h" + +#include "common/HPMDataCheck.h" /* should always be the last file included! (if you don't make it last, it'll intentionally break compile time) */ + #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "../common/HPMi.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../map/clif.h" -#include "../map/pc.h" -#include "../map/script.h" - -#include "../common/HPMDataCheck.h" /* should always be the last file included! (if you don't make it last, it'll intentionally break compile time) */ - HPExport struct hplugin_info pinfo = { "Sample", // Plugin name SERVER_TYPE_CHAR|SERVER_TYPE_LOGIN|SERVER_TYPE_MAP,// Which server types this plugin works with? diff --git a/src/test/Makefile.in b/src/test/Makefile.in index dea126e46..8f999fb37 100644 --- a/src/test/Makefile.in +++ b/src/test/Makefile.in @@ -9,18 +9,20 @@ CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h) COMMON_D = ../common COMMON_H = $(wildcard $(COMMON_D)/*.h) SYSINFO_INC = $(COMMON_D)/sysinfo.inc +COMMON_INCLUDE = -I.. -LIBCONFIG_D = ../../3rdparty/libconfig +THIRDPARTY_D = ../../3rdparty +THIRDPARTY_INCLUDE = -I$(THIRDPARTY_D) + +LIBCONFIG_D = $(THIRDPARTY_D)/libconfig LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \ scanner.o strbuf.o) LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \ scanctx.h scanner.h strbuf.h wincompat.h) -LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D) -MT19937AR_D = ../../3rdparty/mt19937ar +MT19937AR_D = $(THIRDPARTY_D)/mt19937ar MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o MT19937AR_H = $(MT19937AR_D)/mt19937ar.h -MT19937AR_INCLUDE = -I$(MT19937AR_D) TEST_SPINLOCK_OBJ = obj/test_spinlock.o TEST_SPINLOCK_C = test_spinlock.c @@ -70,7 +72,7 @@ test_spinlock: $(TEST_SPINLOCK_DEPENDS) Makefile obj/%.o: %.c $(TEST_SPINLOCK_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj @echo " CC $<" - @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) -DWITH_SQL @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< + @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) -DWITH_SQL @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< # missing object files $(COMMON_D)/obj_all/common.a: diff --git a/src/test/test_spinlock.c b/src/test/test_spinlock.c index 19ae9aee7..4f235907d 100644 --- a/src/test/test_spinlock.c +++ b/src/test/test_spinlock.c @@ -1,9 +1,11 @@ +#define HERCULES_CORE -#include "../common/core.h" -#include "../common/atomic.h" -#include "../common/thread.h" -#include "../common/spinlock.h" -#include "../common/showmsg.h" +#include "common/atomic.h" +#include "common/cbasetypes.h" +#include "common/core.h" +#include "common/thread.h" +#include "common/spinlock.h" +#include "common/showmsg.h" #include <stdio.h> #include <stdlib.h> @@ -12,8 +14,6 @@ // Simple test for the spinlock implementation to see if it works properly.. // - - #define THRC 32 //thread Count #define PERINC 100000 #define LOOPS 47 diff --git a/src/tool/Makefile.in b/src/tool/Makefile.in index 2d7699db0..b0c07b2fb 100644 --- a/src/tool/Makefile.in +++ b/src/tool/Makefile.in @@ -9,13 +9,16 @@ CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h) COMMON_D = ../common COMMON_H = $(wildcard $(COMMON_D)/*.h) SYSINFO_INC = $(COMMON_D)/sysinfo.inc +COMMON_INCLUDE = -I.. -LIBCONFIG_D = ../../3rdparty/libconfig +THIRDPARTY_D = ../../3rdparty +THIRDPARTY_INCLUDE = -I$(THIRDPARTY_D) + +LIBCONFIG_D = $(THIRDPARTY_D)/libconfig LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \ scanner.o strbuf.o) LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \ scanctx.h scanner.h strbuf.h wincompat.h) -LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D) MAPCACHE_OBJ = obj_all/mapcache.o MAPCACHE_C = mapcache.c @@ -70,7 +73,7 @@ obj_all: obj_all/%.o: %.c $(MAPCACHE_H) $(COMMON_H) $(CONFIG_H) $(LIBCONFIG_H) | obj_all @echo " CC $<" - @$(CC) @CFLAGS@ @DEFS@ $(LIBCONFIG_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $< + @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $< # missing common object files $(COMMON_D)/obj_all/common_mini.a: diff --git a/src/tool/mapcache.c b/src/tool/mapcache.c index 5cdaf6c94..356cdd352 100644 --- a/src/tool/mapcache.c +++ b/src/tool/mapcache.c @@ -3,21 +3,17 @@ #define HERCULES_CORE -#include "../config/core.h" // RENEWAL +#include "common/cbasetypes.h" +#include "common/core.h" +#include "common/grfio.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/showmsg.h" +#include "common/strlib.h" +#include "common/utils.h" #include <stdio.h> #include <stdlib.h> -#include <string.h> - -#include "../common/cbasetypes.h" -#include "../common/core.h" -#include "../common/grfio.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/showmsg.h" -#include "../common/utils.h" -#include "../common/strlib.h" - #ifndef _WIN32 #include <unistd.h> #endif |