From d157481db8a77069628b6186b9a31ea6267854ee Mon Sep 17 00:00:00 2001 From: FlavioJS Date: Fri, 30 Nov 2007 00:17:26 +0000 Subject: * Random cleanup/documentation. * Made common/Makefile get the svn version from the src directory, not src/common. * Added a warning message to the install and uninstall targets. * Renamed all obj directories to obj_all, obj_txt or obj_sql in the makefiles (if an obj/ directory exists, BSD make enters it before reading the makefile) (run ./configure to update your makefiles, and don't forget to do 'make clean' before updating) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11844 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 6 ++++ Makefile.in | 2 ++ src/char/Makefile.in | 26 +++++++-------- src/char_sql/Makefile.in | 26 +++++++-------- src/common/Makefile.in | 22 ++++++------ src/ladmin/Makefile.in | 22 ++++++------ src/login/Makefile.in | 24 ++++++------- src/login_sql/Makefile.in | 27 +++++++-------- src/map/Makefile.in | 32 +++++++++--------- src/map/clif.c | 78 +++++++++++++++++++++++++++++++------------ src/map/clif.h | 6 ++-- src/map/pc.c | 12 +++---- src/plugins/Makefile.in | 8 ++--- src/tool/Makefile.in | 12 +++---- src/txt-converter/Makefile.in | 17 ++++++---- 15 files changed, 184 insertions(+), 136 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 00c951714..a73ad7cb9 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,12 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2007/11/29 + * Random cleanup/documentation. + * Made common/Makefile get the svn version from the src directory, not src/common. + * Added a warning message to the install and uninstall targets. + * Renamed all obj directories to obj_all, obj_txt or obj_sql in the + makefiles (if an obj/ directory exists, BSD make enters it before + reading the makefile) [FlavioJS] * Allowed disguising while riding a peco-peco (this does not seem to cause problems anymore). * The pvp rank packet is no longer sent to other players when disguised, as diff --git a/Makefile.in b/Makefile.in index 2c1b0a95e..aa47001a1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -139,6 +139,7 @@ needs_mysql: # TODO install: conf/%.conf conf/%.txt + $(shell read -p "WARNING: This target does not work properly yet. Press Ctrl+C to cancel or Enter to continue.") $(shell mkdir -p /opt/eathena/bin/) $(shell mkdir -p /opt/eathena/etc/eathena/) $(shell mkdir -p /opt/eathena/var/log/eathena/) @@ -162,6 +163,7 @@ bin-clean: $(shell rm /opt/eathena/bin/ladmin) uninstall: + $(shell read -p "WARNING: This target does not work properly yet. Press Ctrl+C to cancel or Enter to continue.") bin-clean $(shell rm /opt/eathena/bin/save) $(shell rm /opt/eathena/bin/db) diff --git a/src/char/Makefile.in b/src/char/Makefile.in index 334265819..359e19b01 100644 --- a/src/char/Makefile.in +++ b/src/char/Makefile.in @@ -1,17 +1,17 @@ -COMMON_OBJ = ../common/obj/core.o ../common/obj/socket.o ../common/obj/timer.o \ - ../common/obj/db.o ../common/obj/plugins.o ../common/obj/lock.o \ - ../common/obj/malloc.o ../common/obj/showmsg.o ../common/obj/utils.o \ - ../common/obj/strlib.o ../common/obj/grfio.o \ - ../common/obj/mapindex.o ../common/obj/ers.o +COMMON_OBJ = ../common/obj_all/core.o ../common/obj_all/socket.o ../common/obj_all/timer.o \ + ../common/obj_all/db.o ../common/obj_all/plugins.o ../common/obj_all/lock.o \ + ../common/obj_all/malloc.o ../common/obj_all/showmsg.o ../common/obj_all/utils.o \ + ../common/obj_all/strlib.o ../common/obj_all/grfio.o \ + ../common/obj_all/mapindex.o ../common/obj_all/ers.o COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h \ ../common/version.h ../common/db.h ../common/plugins.h ../common/lock.h \ ../common/malloc.h ../common/showmsg.h ../common/utils.h \ ../common/strlib.h ../common/grfio.h \ ../common/mapindex.h ../common/ers.h -CHAR_OBJ = obj/char.o obj/inter.o obj/int_party.o obj/int_guild.o \ - obj/int_storage.o obj/int_status.o obj/int_pet.o obj/int_homun.o +CHAR_OBJ = obj_txt/char.o obj_txt/inter.o obj_txt/int_party.o obj_txt/int_guild.o \ + obj_txt/int_storage.o obj_txt/int_status.o obj_txt/int_pet.o obj_txt/int_homun.o CHAR_H = char.h inter.h int_party.h int_guild.h int_storage.h int_status.h int_pet.h int_homun.h @SET_MAKE@ @@ -21,11 +21,11 @@ CHAR_H = char.h inter.h int_party.h int_guild.h int_storage.h int_status.h int_p all: char-server -char-server: obj $(CHAR_OBJ) $(COMMON_OBJ) +char-server: obj_txt $(CHAR_OBJ) $(COMMON_OBJ) @CC@ @LDFLAGS@ -o ../../char-server@EXEEXT@ $(CHAR_OBJ) $(COMMON_OBJ) @LIBS@ clean: - rm -rf *.o obj ../../char-server@EXEEXT@ + rm -rf *.o obj_txt ../../char-server@EXEEXT@ help: @echo "possible targets are 'char-server' 'all' 'clean' 'help'" @@ -36,12 +36,12 @@ help: ##################################################################### -obj: - -mkdir obj +obj_txt: + -mkdir obj_txt -obj/%.o: %.c $(CHAR_H) $(COMMON_H) +obj_txt/%.o: %.c $(CHAR_H) $(COMMON_H) @CC@ @CFLAGS@ -DTXT_ONLY @CPPFLAGS@ -c $(OUTPUT_OPTION) $< # missing common object files -../common/obj/%.o: +../common/obj_all/%.o: @$(MAKE) -C ../common txt diff --git a/src/char_sql/Makefile.in b/src/char_sql/Makefile.in index 8162511d5..819ddec18 100644 --- a/src/char_sql/Makefile.in +++ b/src/char_sql/Makefile.in @@ -1,9 +1,9 @@ -COMMON_OBJ = ../common/obj/core.o ../common/obj/socket.o ../common/obj/timer.o \ - ../common/obj/db.o ../common/obj/plugins.o ../common/obj/lock.o \ - ../common/obj/malloc.o ../common/obj/showmsg.o ../common/obj/utils.o \ - ../common/obj/strlib.o ../common/obj/grfio.o \ - ../common/obj/mapindex.o ../common/obj/ers.o +COMMON_OBJ = ../common/obj_all/core.o ../common/obj_all/socket.o ../common/obj_all/timer.o \ + ../common/obj_all/db.o ../common/obj_all/plugins.o ../common/obj_all/lock.o \ + ../common/obj_all/malloc.o ../common/obj_all/showmsg.o ../common/obj_all/utils.o \ + ../common/obj_all/strlib.o ../common/obj_all/grfio.o \ + ../common/obj_all/mapindex.o ../common/obj_all/ers.o COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h \ ../common/version.h ../common/db.h ../common/plugins.h ../common/lock.h \ ../common/malloc.h ../common/showmsg.h ../common/utils.h \ @@ -13,13 +13,13 @@ COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h COMMON_SQL_OBJ = ../common/obj_sql/sql.o COMMON_H = ../common/sql.h -CHAR_OBJ = obj/char.o obj/inter.o obj/int_party.o obj/int_guild.o \ - obj/int_storage.o obj/int_pet.o obj/int_homun.o obj/int_mail.o +CHAR_OBJ = obj_sql/char.o obj_sql/inter.o obj_sql/int_party.o obj_sql/int_guild.o \ + obj_sql/int_storage.o obj_sql/int_pet.o obj_sql/int_homun.o obj_sql/int_mail.o CHAR_H = char.h inter.h int_party.h int_guild.h int_storage.h int_pet.h int_homun.h int_mail.h HAVE_MYSQL=@HAVE_MYSQL@ ifeq ($(HAVE_MYSQL),yes) - CHAR_SERVER_SQL_DEPENDS=obj $(CHAR_OBJ) $(COMMON_OBJ) $(COMMON_SQL_OBJ) + CHAR_SERVER_SQL_DEPENDS=obj_sql $(CHAR_OBJ) $(COMMON_OBJ) $(COMMON_SQL_OBJ) else CHAR_SERVER_SQL_DEPENDS=needs_mysql endif @@ -35,7 +35,7 @@ char-server_sql: $(CHAR_SERVER_SQL_DEPENDS) @CC@ @LDFLAGS@ -o ../../char-server_sql@EXEEXT@ $(CHAR_OBJ) $(COMMON_OBJ) $(COMMON_SQL_OBJ) @LIBS@ @MYSQL_LIBS@ clean: - rm -rf *.o obj ../../char-server_sql@EXEEXT@ + rm -rf *.o obj_sql ../../char-server_sql@EXEEXT@ help: @echo "possible targets are 'char-server_sql' 'all' 'clean' 'help'" @@ -50,14 +50,14 @@ needs_mysql: @echo "MySQL not found or disabled by the configure script" @exit 1 -obj: - -mkdir obj +obj_sql: + -mkdir obj_sql -obj/%.o: %.c $(CHAR_H) $(COMMON_H) $(COMMON_SQL_H) +obj_sql/%.o: %.c $(CHAR_H) $(COMMON_H) $(COMMON_SQL_H) @CC@ @CFLAGS@ @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< # missing common object files -../common/obj/%.o: +../common/obj_all/%.o: @$(MAKE) -C ../common sql ../common/obj_sql/%.o: diff --git a/src/common/Makefile.in b/src/common/Makefile.in index 89bb8a75a..bda9e1911 100644 --- a/src/common/Makefile.in +++ b/src/common/Makefile.in @@ -1,8 +1,8 @@ -COMMON_OBJ = obj/core.o obj/socket.o obj/timer.o obj/db.o obj/plugins.o obj/lock.o \ - obj/nullpo.o obj/malloc.o obj/showmsg.o obj/strlib.o obj/utils.o \ - obj/grfio.o obj/mapindex.o obj/ers.o obj/md5calc.o \ - obj/minicore.o obj/minisocket.o obj/minimalloc.o +COMMON_OBJ = obj_all/core.o obj_all/socket.o obj_all/timer.o obj_all/db.o obj_all/plugins.o obj_all/lock.o \ + obj_all/nullpo.o obj_all/malloc.o obj_all/showmsg.o obj_all/strlib.o obj_all/utils.o \ + obj_all/grfio.o obj_all/mapindex.o obj_all/ers.o obj_all/md5calc.o \ + obj_all/minicore.o obj_all/minisocket.o obj_all/minimalloc.o COMMON_H = svnversion.h mmo.h plugin.h version.h \ core.h socket.h timer.h db.h plugins.h lock.h \ nullpo.h malloc.h showmsg.h strlib.h utils.h \ @@ -32,7 +32,7 @@ txt: common sql: $(SQL_DEPENDS) clean: - rm -rf *.o obj obj_sql svnversion.h + rm -rf *.o obj_all obj_sql svnversion.h help: @echo "possible targets are 'txt' 'sql' 'all' 'clean' 'help'" @@ -48,21 +48,21 @@ needs_mysql: @echo "MySQL not found or disabled by the configure script" @exit 1 -obj: - -mkdir obj +obj_all: + -mkdir obj_all obj_sql: -mkdir obj_sql -common: obj $(COMMON_OBJ) +common: obj_all $(COMMON_OBJ) common_sql: obj_sql $(COMMON_SQL_OBJ) -obj/%.o: %.c $(COMMON_H) +obj_all/%.o: %.c $(COMMON_H) @CC@ @CFLAGS@ @LDFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< -obj/mini%.o: %.c $(COMMON_H) +obj_all/mini%.o: %.c $(COMMON_H) @CC@ @CFLAGS@ -DMINICORE @LDFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< obj_sql/%.o: %.c $(COMMON_H) $(COMMON_SQL_H) @@ -74,7 +74,7 @@ HAVESVN = $(shell which svnversion) ifeq ($(findstring /,$(HAVESVN)), /) svnversion.h: @printf "#define SVNVERSION " > svnversion.h - @svnversion . >> svnversion.h + @svnversion .. >> svnversion.h @printf "\n" >> svnversion.h else svnversion.h: diff --git a/src/ladmin/Makefile.in b/src/ladmin/Makefile.in index 87cc2ad49..4703dded1 100644 --- a/src/ladmin/Makefile.in +++ b/src/ladmin/Makefile.in @@ -1,12 +1,12 @@ -COMMON_OBJ = ../common/obj/minicore.o ../common/obj/minisocket.o ../common/obj/timer.o \ - ../common/obj/malloc.o ../common/obj/showmsg.o ../common/obj/strlib.o \ - ../common/obj/utils.o ../common/obj/md5calc.o +COMMON_OBJ = ../common/obj_all/minicore.o ../common/obj_all/minisocket.o ../common/obj_all/timer.o \ + ../common/obj_all/malloc.o ../common/obj_all/showmsg.o ../common/obj_all/strlib.o \ + ../common/obj_all/utils.o ../common/obj_all/md5calc.o COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h \ ../common/version.h ../common/malloc.h ../common/showmsg.h ../common/strlib.h \ ../common/utils.h ../common/md5calc.h ../common/cbasetypes.h -LADMIN_OBJ = obj/ladmin.o +LADMIN_OBJ = obj_all/ladmin.o LADMIN_H = ladmin.h @SET_MAKE@ @@ -16,11 +16,11 @@ LADMIN_H = ladmin.h all: ladmin -ladmin: obj $(LADMIN_OBJ) $(COMMON_OBJ) +ladmin: obj_all $(LADMIN_OBJ) $(COMMON_OBJ) @CC@ @LDFLAGS@ -o ../../ladmin@EXEEXT@ $(LADMIN_OBJ) $(COMMON_OBJ) @LIBS@ clean: - rm -rf *.o obj ../../ladmin@EXEEXT@ + rm -rf *.o obj_all ../../ladmin@EXEEXT@ help: @echo "possible targets are 'ladmin' 'all' 'clean' 'help'" @@ -31,15 +31,15 @@ help: ##################################################################### -obj: - -mkdir obj +obj_all: + -mkdir obj_all -obj/%.o: %.c $(LADMIN_H) $(COMMON_H) +obj_all/%.o: %.c $(LADMIN_H) $(COMMON_H) @CC@ @CFLAGS@ @LDFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< # missing common object files -../common/obj/%.o: +../common/obj_all/%.o: @$(MAKE) -C ../common txt -../common/obj/mini%.o: +../common/obj_all/mini%.o: @$(MAKE) -C ../common txt diff --git a/src/login/Makefile.in b/src/login/Makefile.in index 4bdfb5935..0c194fac4 100644 --- a/src/login/Makefile.in +++ b/src/login/Makefile.in @@ -1,16 +1,16 @@ -COMMON_OBJ = ../common/obj/core.o ../common/obj/socket.o ../common/obj/timer.o \ - ../common/obj/db.o ../common/obj/plugins.o ../common/obj/lock.o \ - ../common/obj/malloc.o ../common/obj/showmsg.o ../common/obj/utils.o \ - ../common/obj/strlib.o ../common/obj/grfio.o ../common/obj/mapindex.o \ - ../common/obj/ers.o ../common/obj/md5calc.o +COMMON_OBJ = ../common/obj_all/core.o ../common/obj_all/socket.o ../common/obj_all/timer.o \ + ../common/obj_all/db.o ../common/obj_all/plugins.o ../common/obj_all/lock.o \ + ../common/obj_all/malloc.o ../common/obj_all/showmsg.o ../common/obj_all/utils.o \ + ../common/obj_all/strlib.o ../common/obj_all/grfio.o ../common/obj_all/mapindex.o \ + ../common/obj_all/ers.o ../common/obj_all/md5calc.o COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h \ ../common/version.h ../common/db.h ../common/plugins.h ../common/lock.h \ ../common/malloc.h ../common/showmsg.h ../common/utils.h ../common/strlib.h \ ../common/grfio.h ../common/mapindex.h \ ../common/ers.h ../common/md5calc.h -LOGIN_OBJ = obj/login.o obj/admin.o +LOGIN_OBJ = obj_txt/login.o obj_txt/admin.o LOGIN_H = login.h @SET_MAKE@ @@ -20,11 +20,11 @@ LOGIN_H = login.h all: login-server -login-server: obj $(LOGIN_OBJ) $(COMMON_OBJ) +login-server: obj_txt $(LOGIN_OBJ) $(COMMON_OBJ) @CC@ @LDFLAGS@ -o ../../login-server@EXEEXT@ $(LOGIN_OBJ) $(COMMON_OBJ) @LIBS@ clean: - rm -rf *.o obj ../../login-server@EXEEXT@ + rm -rf *.o obj_txt ../../login-server@EXEEXT@ help: @echo "possible targets are 'login-server' 'all' 'clean' 'help'" @@ -35,12 +35,12 @@ help: ##################################################################### -obj: - -mkdir obj +obj_txt: + -mkdir obj_txt -obj/%.o: %.c $(LOGIN_H) $(COMMON_H) +obj_txt/%.o: %.c $(LOGIN_H) $(COMMON_H) @CC@ @CFLAGS@ -DTXT_ONLY @CPPFLAGS@ -c $(OUTPUT_OPTION) $< # missing common object files -../common/obj/%.o: +../common/obj_all/%.o: @$(MAKE) -C ../common sql diff --git a/src/login_sql/Makefile.in b/src/login_sql/Makefile.in index 22a1437b3..72d23b183 100644 --- a/src/login_sql/Makefile.in +++ b/src/login_sql/Makefile.in @@ -1,20 +1,21 @@ -COMMON_OBJ = ../common/obj/core.o ../common/obj/socket.o ../common/obj/timer.o \ - ../common/obj/db.o ../common/obj/plugins.o ../common/obj/lock.o \ - ../common/obj/malloc.o ../common/obj/showmsg.o ../common/obj/utils.o \ - ../common/obj/strlib.o ../common/obj/grfio.o ../common/obj/mapindex.o \ - ../common/obj/ers.o ../common/obj/md5calc.o ../common/obj_sql/sql.o + +COMMON_OBJ = ../common/obj_all/core.o ../common/obj_all/socket.o ../common/obj_all/timer.o \ + ../common/obj_all/db.o ../common/obj_all/plugins.o ../common/obj_all/lock.o \ + ../common/obj_all/malloc.o ../common/obj_all/showmsg.o ../common/obj_all/utils.o \ + ../common/obj_all/strlib.o ../common/obj_all/grfio.o ../common/obj_all/mapindex.o \ + ../common/obj_all/ers.o ../common/obj_all/md5calc.o ../common/obj_sql/sql.o COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h \ ../common/version.h ../common/db.h ../common/plugins.h ../common/lock.h \ ../common/malloc.h ../common/showmsg.h ../common/utils.h ../common/strlib.h \ ../common/grfio.h ../common/mapindex.h \ - ../common/ers.h ../common/md5calc.h ../common/sql.h + ../common/ers.h ../common/md5calc.h ../common/sql.h -LOGIN_OBJ = obj/login.o +LOGIN_OBJ = obj_sql/login.o LOGIN_H = login.h HAVE_MYSQL=@HAVE_MYSQL@ ifeq ($(HAVE_MYSQL),yes) - LOGIN_SERVER_SQL_DEPENDS=obj $(LOGIN_OBJ) $(COMMON_OBJ) + LOGIN_SERVER_SQL_DEPENDS=obj_sql $(LOGIN_OBJ) $(COMMON_OBJ) else LOGIN_SERVER_SQL_DEPENDS=needs_mysql endif @@ -30,7 +31,7 @@ login-server_sql: $(LOGIN_SERVER_SQL_DEPENDS) @CC@ @LDFLAGS@ -o ../../login-server_sql@EXEEXT@ $(LOGIN_OBJ) $(COMMON_OBJ) @LIBS@ @MYSQL_LIBS@ clean: - rm -rf *.o obj ../../login-server_sql@EXEEXT@ + rm -rf *.o obj_sql ../../login-server_sql@EXEEXT@ help: @echo "possible targets are 'login-server_sql' 'all' 'clean' 'help'" @@ -45,14 +46,14 @@ needs_mysql: @echo "MySQL not found or disabled by the configure script" @exit 1 -obj: - -mkdir obj +obj_sql: + -mkdir obj_sql -obj/%.o: %.c $(LOGIN_H) $(COMMON_H) +obj_sql/%.o: %.c $(LOGIN_H) $(COMMON_H) @CC@ @CFLAGS@ @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< # missing common object files -../common/obj/%.o: +../common/obj_all/%.o: @$(MAKE) -C ../common sql ../common/obj_sql/%.o: diff --git a/src/map/Makefile.in b/src/map/Makefile.in index 31c0fc3f1..355086127 100644 --- a/src/map/Makefile.in +++ b/src/map/Makefile.in @@ -1,9 +1,9 @@ -COMMON_OBJ = ../common/obj/core.o ../common/obj/socket.o ../common/obj/timer.o \ - ../common/obj/db.o ../common/obj/plugins.o ../common/obj/lock.o \ - ../common/obj/nullpo.o ../common/obj/malloc.o ../common/obj/showmsg.o \ - ../common/obj/utils.o ../common/obj/strlib.o ../common/obj/grfio.o \ - ../common/obj/mapindex.o ../common/obj/ers.o +COMMON_OBJ = ../common/obj_all/core.o ../common/obj_all/socket.o ../common/obj_all/timer.o \ + ../common/obj_all/db.o ../common/obj_all/plugins.o ../common/obj_all/lock.o \ + ../common/obj_all/nullpo.o ../common/obj_all/malloc.o ../common/obj_all/showmsg.o \ + ../common/obj_all/utils.o ../common/obj_all/strlib.o ../common/obj_all/grfio.o \ + ../common/obj_all/mapindex.o ../common/obj_all/ers.o COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h \ ../common/db.h ../common/plugins.h ../common/lock.h \ ../common/nullpo.h ../common/malloc.h ../common/showmsg.h \ @@ -13,11 +13,13 @@ COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h \ COMMON_SQL_OBJ = ../common/obj_sql/sql.o COMMON_SQL_H = ../common/sql.h -MAP_OBJ = obj/map.o obj/chrif.o obj/clif.o obj/pc.o obj/status.o obj/npc.o \ - obj/npc_chat.o obj/chat.o obj/path.o obj/itemdb.o obj/mob.o obj/script.o \ - obj/storage.o obj/skill.o obj/atcommand.o obj/charcommand.o obj/battle.o \ - obj/intif.o obj/trade.o obj/party.o obj/vending.o obj/guild.o obj/pet.o \ - obj/log.o obj/mail.o obj/date.o obj/irc.o obj/unit.o obj/mercenary.o +MAP_OBJ = map.o chrif.o clif.o pc.o status.o npc.o \ + npc_chat.o chat.o path.o itemdb.o mob.o script.o \ + storage.o skill.o atcommand.o charcommand.o battle.o \ + intif.o trade.o party.o vending.o guild.o pet.o \ + log.o mail.o date.o irc.o unit.o mercenary.o +MAP_TXT_OBJ = $(MAP_OBJ:%=obj_txt/%) +MAP_SQL_OBJ = $(MAP_OBJ:%=obj_sql/%) MAP_H = map.h chrif.h clif.h pc.h status.h npc.h \ chat.h itemdb.h mob.h script.h \ storage.h skill.h atcommand.h charcommand.h battle.h \ @@ -80,11 +82,11 @@ obj_sql: -mkdir obj_sql # executables -map-server: obj_txt $(MAP_OBJ:obj/%=obj_txt/%) $(COMMON_OBJ) - @CC@ @LDFLAGS@ -o ../../map-server@EXEEXT@ $(MAP_OBJ:obj/%=obj_txt/%) $(COMMON_OBJ) @LIBS@ @PCRE_LIBS@ +map-server: obj_txt $(MAP_TXT_OBJ) $(COMMON_OBJ) + @CC@ @LDFLAGS@ -o ../../map-server@EXEEXT@ $(MAP_TXT_OBJ) $(COMMON_OBJ) @LIBS@ @PCRE_LIBS@ -map-server_sql: obj_sql $(MAP_OBJ:obj/%=obj_sql/%) $(COMMON_OBJ) $(COMMON_SQL_OBJ) - @CC@ @LDFLAGS@ -o ../../map-server_sql@EXEEXT@ $(MAP_OBJ:obj/%=obj_sql/%) $(COMMON_OBJ) $(COMMON_SQL_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@ +map-server_sql: obj_sql $(MAP_SQL_OBJ) $(COMMON_OBJ) $(COMMON_SQL_OBJ) + @CC@ @LDFLAGS@ -o ../../map-server_sql@EXEEXT@ $(MAP_SQL_OBJ) $(COMMON_OBJ) $(COMMON_SQL_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@ # map object files obj_txt/%.o: %.c $(MAP_H) $(COMMON_H) @@ -94,7 +96,7 @@ obj_sql/%.o: %.c $(MAP_H) $(COMMON_H) $(COMMON_SQL_H) @CC@ @CFLAGS@ $(PCRE_CFLAGS) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< # missing common object files -../common/obj/%.o: +../common/obj_all/%.o: @$(MAKE) -C ../common txt ../common/obj_sql/%.o: diff --git a/src/map/clif.c b/src/map/clif.c index 5f59bda74..2a45b1b79 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -4396,35 +4396,44 @@ void clif_skill_warppoint(struct map_session_data* sd, short skill_num, short sk else sd->menuskill_val = skill_lv; } -/*========================================== - * メモ応答 - *------------------------------------------*/ -int clif_skill_memo(struct map_session_data *sd,int flag) + +/// Memo message. +/// type=0 : "Saved location as a Memo Point for Warp skill." in color 0xFFFF00 (cyan) +/// type=1 : "Skill Level is not high enough." in color 0x0000FF (red) +/// type=2 : "You haven't learned Warp." in color 0x0000FF (red) +/// +/// @param sd Who receives the message +/// @param type What message +void clif_skill_memomessage(struct map_session_data* sd, int type) { int fd; - nullpo_retr(0, sd); + nullpo_retv(sd); fd=sd->fd; - WFIFOHEAD(fd,packet_len(0x11e)); WFIFOW(fd,0)=0x11e; - WFIFOB(fd,2)=flag; + WFIFOB(fd,2)=type; WFIFOSET(fd,packet_len(0x11e)); - return 0; } -int clif_skill_teleportmessage(struct map_session_data *sd,int flag) + +/// Teleport message. +/// type=0 : "Unable to Teleport in this area" in color 0xFFFF00 (cyan) +/// type=1 : "Saved point cannot be memorized." in color 0x0000FF (red) +/// +/// @param sd Who receives the message +/// @param type What message +void clif_skill_teleportmessage(struct map_session_data *sd, int type) { int fd; - nullpo_retr(0, sd); + nullpo_retv(sd); fd=sd->fd; WFIFOHEAD(fd,packet_len(0x189)); WFIFOW(fd,0)=0x189; - WFIFOW(fd,2)=flag; + WFIFOW(fd,2)=type; WFIFOSET(fd,packet_len(0x189)); - return 0; } /*========================================== @@ -4700,18 +4709,43 @@ int clif_resurrection(struct block_list *bl,int type) return 0; } -/*========================================== - * PVP実装?(仮) - *------------------------------------------*/ -int clif_set0199(int fd,int type) +/// Sets the map mode. +/// +/// mode=1 : pvp mode +/// mode=2 : unknown mode (pk?) +/// mode=3 : gvg mode +/// mode=4 : message "You are in a PK area. Please beware of sudden attacks." in color 0x9B9BFF (light red) +/// mode=5 : pvp mode +/// mode=other : ? +void clif_set0199(struct map_session_data* sd, int mode) { + int fd; + + nullpo_retv(sd); + + fd=sd->fd; WFIFOHEAD(fd,packet_len(0x199)); WFIFOW(fd,0)=0x199; - WFIFOW(fd,2)=type; + WFIFOW(fd,2)=mode; WFIFOSET(fd,packet_len(0x199)); +} - return 0; +#if 0 +/// Set the map mode? +/// Differs from the behaviour of clif_set0199 with unknown consequences. +void clif_set01D6(struct map_session_data* sd, int mode) +{ + int fd; + + nullpo_retv(sd); + + fd=sd->fd; + WFIFOHEAD(fd,packet_len(0x1D6)); + WFIFOW(fd,0)=0x1D6; + WFIFOW(fd,2)=mode; + WFIFOSET(fd,packet_len(0x1D6)); } +#endif /*========================================== * PVP実装?(仮) @@ -7762,15 +7796,15 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) sd->pvp_won = 0; sd->pvp_lost = 0; } - clif_set0199(fd,1); + clif_set0199(sd,1); } else // set flag, if it's a duel [LuzZza] if(sd->duel_group) - clif_set0199(fd,1); + clif_set0199(sd,1); if (map[sd->bl.m].flag.gvg_dungeon) { - clif_set0199(fd,1); //TODO: Figure out the real packet to send here. + clif_set0199(sd,1); //TODO: Figure out the real packet to send here. if (!sd->pvp_point) { sd->pvp_point = 5; //Need to die twice to be warped out. @@ -7780,7 +7814,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) } if(map_flag_gvg(sd->bl.m)) - clif_set0199(fd,3); + clif_set0199(sd,3); // info about nearby objects // must use foreachinarea (CIRCULAR_AREA interferes with foreachinrange) diff --git a/src/map/clif.h b/src/map/clif.h index a1246f97a..b68645da9 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -213,8 +213,8 @@ int clif_skill_nodamage(struct block_list *src,struct block_list *dst,int skill_ int clif_skill_poseffect(struct block_list *src,int skill_id,int val,int x,int y,int tick); int clif_skill_estimation(struct map_session_data *sd,struct block_list *dst); void clif_skill_warppoint(struct map_session_data* sd, short skill_num, short skill_lv, unsigned short map1, unsigned short map2, unsigned short map3, unsigned short map4); -int clif_skill_memo(struct map_session_data *sd,int flag); -int clif_skill_teleportmessage(struct map_session_data *sd,int flag); +void clif_skill_memomessage(struct map_session_data* sd, int type); +void clif_skill_teleportmessage(struct map_session_data* sd, int type); int clif_skill_produce_mix_list(struct map_session_data *sd, int trigger); int clif_produceeffect(struct map_session_data* sd,int flag,int nameid); @@ -331,7 +331,7 @@ void clif_MainChatMessage(const char* message); //luzza int clif_announce(struct block_list *bl, const char* mes, int len, unsigned long color, int flag); int clif_heal(int fd,int type,int val); int clif_resurrection(struct block_list *bl,int type); -int clif_set0199(int fd,int type); +void clif_set0199(struct map_session_data* sd, int mode); int clif_pvpset(struct map_session_data *sd, int pvprank, int pvpnum,int type); int clif_send0199(int map,int type); void clif_refine(int fd, int fail, int index, int val); diff --git a/src/map/pc.c b/src/map/pc.c index fc39ea88d..852d06e5e 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -3603,11 +3603,11 @@ int pc_memo(struct map_session_data* sd, int pos) // check required skill level skill = pc_checkskill(sd, AL_WARP); if( skill < 1 ) { - clif_skill_memo(sd,2); // "You haven't learned Warp." + clif_skill_memomessage(sd,2); // "You haven't learned Warp." return 0; } if( skill < 2 || skill - 2 < pos ) { - clif_skill_memo(sd,1); // "Skill Level is not high enough." + clif_skill_memomessage(sd,1); // "Skill Level is not high enough." return 0; } @@ -3624,7 +3624,7 @@ int pc_memo(struct map_session_data* sd, int pos) sd->status.memo_point[pos].x = sd->bl.x; sd->status.memo_point[pos].y = sd->bl.y; - clif_skill_memo(sd, 0); + clif_skill_memomessage(sd, 0); return 1; } @@ -7173,7 +7173,7 @@ int duel_create(struct map_session_data* sd, const unsigned int maxpl) strcpy(output, msg_txt(372)); // " -- Duel has been created (@invite/@leave) --" clif_disp_onlyself(sd, output, strlen(output)); - clif_set0199(sd->fd, 1); + clif_set0199(sd, 1); //clif_misceffect2(&sd->bl, 159); return i; } @@ -7220,7 +7220,7 @@ int duel_leave(const unsigned int did, struct map_session_data* sd) sd->duel_group = 0; duel_savetime(sd); - clif_set0199(sd->fd, 0); + clif_set0199(sd, 0); return 0; } @@ -7237,7 +7237,7 @@ int duel_accept(const unsigned int did, struct map_session_data* sd) sprintf(output, msg_txt(376), sd->status.name); clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS); - clif_set0199(sd->fd, 1); + clif_set0199(sd, 1); //clif_misceffect2(&sd->bl, 159); return 0; } diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in index 00493a7c9..7019fadd8 100644 --- a/src/plugins/Makefile.in +++ b/src/plugins/Makefile.in @@ -1,6 +1,6 @@ -COMMON_OBJ = ../common/obj/showmsg.o ../common/obj/utils.o ../common/obj/strlib.o \ - ../common/obj/minimalloc.o +COMMON_OBJ = ../common/obj_all/showmsg.o ../common/obj_all/utils.o ../common/obj_all/strlib.o \ + ../common/obj_all/minimalloc.o COMMON_H = ../common/plugin.h ../common/cbasetypes.h \ ../common/showmsg.h ../common/utils.h ../common/strlib.h \ ../common/malloc.h @@ -56,8 +56,8 @@ sig@DLLEXT@: sig.c $(COMMON_OBJ) cp -r $< $@ # missing common object files -../common/obj/%.o: ../common/%.c $(COMMON_H) +../common/obj_all/%.o: ../common/%.c $(COMMON_H) @$(MAKE) -C ../common txt -../common/obj/mini%.o: ../common/%.c $(COMMON_H) +../common/obj_all/mini%.o: ../common/%.c $(COMMON_H) @$(MAKE) -C ../common txt diff --git a/src/tool/Makefile.in b/src/tool/Makefile.in index 277ff4c68..f1d688a7d 100644 --- a/src/tool/Makefile.in +++ b/src/tool/Makefile.in @@ -12,12 +12,12 @@ adduser: convert: @CC@ -o ../../tools/convert@EXEEXT@ convert.c -mapcache: obj - @CC@ -c -o obj/grfio.o grfio.c - @CC@ -o ../../mapcache@EXEEXT@ mapcache.c obj/grfio.o -lz +mapcache: obj_mapcache + @CC@ -c -o obj_mapcache/grfio.o grfio.c + @CC@ -o ../../mapcache@EXEEXT@ mapcache.c obj_mapcache/grfio.o -lz clean: - rm -rf *.o obj ../../tools/adduser@EXEEXT@ ../../tools/convert@EXEEXT@ ../../mapcache@EXEEXT@ + rm -rf *.o obj_mapcache ../../tools/adduser@EXEEXT@ ../../tools/convert@EXEEXT@ ../../mapcache@EXEEXT@ help: @echo "possible targets are 'adduser' 'convert' 'mapcache' 'all' 'clean' 'help'" @@ -30,5 +30,5 @@ help: ##################################################################### -obj: - -mkdir obj +obj_mapcache: + -mkdir obj_mapcache diff --git a/src/txt-converter/Makefile.in b/src/txt-converter/Makefile.in index 59d3a6641..c90a6a4b2 100644 --- a/src/txt-converter/Makefile.in +++ b/src/txt-converter/Makefile.in @@ -1,7 +1,7 @@ -LOGIN_CONVERTER_OBJ = obj_login/login-converter.o ../common/obj/minicore.o \ - ../common/obj/malloc.o ../common/obj/strlib.o ../common/obj/showmsg.o \ - ../common/obj/utils.o ../common/obj/ers.o ../common/obj/db.o \ +LOGIN_CONVERTER_OBJ = obj_login/login-converter.o ../common/obj_all/minicore.o \ + ../common/obj_all/malloc.o ../common/obj_all/strlib.o ../common/obj_all/showmsg.o \ + ../common/obj_all/utils.o ../common/obj_all/ers.o ../common/obj_all/db.o \ ../common/obj_sql/sql.o LOGIN_CONVERTER_H = ../common/cbasetypes.h ../common/mmo.h ../common/core.h \ ../common/malloc.h ../common/strlib.h ../common/showmsg.h \ @@ -13,9 +13,9 @@ CHAR_CONVERTER_OBJ = obj_char/char-converter.o \ obj_char/txt-int_party.o obj_char/txt-int_guild.o \ obj_char/sql-char.o obj_char/sql-int_pet.o obj_char/sql-int_storage.o \ obj_char/sql-inter.o obj_char/sql-int_party.o obj_char/sql-int_guild.o \ - ../common/obj/minicore.o \ - ../common/obj/malloc.o ../common/obj/strlib.o ../common/obj/showmsg.o \ - ../common/obj/utils.o ../common/obj/ers.o ../common/obj/mapindex.o \ + ../common/obj_all/minicore.o \ + ../common/obj_all/malloc.o ../common/obj_all/strlib.o ../common/obj_all/showmsg.o \ + ../common/obj_all/utils.o ../common/obj_all/ers.o ../common/obj_all/mapindex.o \ ../common/obj_sql/sql.o CHAR_CONVERTER_H = ../char/char.h ../char/int_pet.h ../char/int_storage.h ../char/inter.h \ ../char/int_party.h ../char/int_guild.h \ @@ -84,5 +84,8 @@ obj_char/sql-%.o: ../char_sql/%.c $(CHAR_CONVERTER_H) @CC@ @CFLAGS@ @MYSQL_CFLAGS@ @CPPFLAGS@ -DTXT_SQL_CONVERT -c $(OUTPUT_OPTION) $< # missing common object files -../common/obj/%.o: +../common/obj_all/%.o: + @$(MAKE) -C ../common sql + +../common/obj_sql/%.o: @$(MAKE) -C ../common sql -- cgit v1.2.3-70-g09d2