diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/Makefile.in | 8 | ||||
-rw-r--r-- | src/map/atcommand.c | 42 | ||||
-rw-r--r-- | src/map/battle.c | 2 | ||||
-rw-r--r-- | src/map/battle.h | 2 | ||||
-rw-r--r-- | src/map/chrif.c | 2 | ||||
-rw-r--r-- | src/map/clif.c | 4 | ||||
-rw-r--r-- | src/map/elemental.c | 2 | ||||
-rw-r--r-- | src/map/homunculus.c | 2 | ||||
-rw-r--r-- | src/map/map.c | 6 | ||||
-rw-r--r-- | src/map/map.h | 2 | ||||
-rw-r--r-- | src/map/mercenary.c | 2 | ||||
-rw-r--r-- | src/map/mob.c | 2 | ||||
-rw-r--r-- | src/map/npc.c | 2 | ||||
-rw-r--r-- | src/map/pc.c | 2 | ||||
-rw-r--r-- | src/map/pc.h | 2 | ||||
-rw-r--r-- | src/map/script.c | 2 | ||||
-rw-r--r-- | src/map/skill.c | 4 | ||||
-rw-r--r-- | src/map/skill.h | 8 | ||||
-rw-r--r-- | src/map/sql/CMakeLists.txt | 18 | ||||
-rw-r--r-- | src/map/status.c | 2 | ||||
-rw-r--r-- | src/map/unit.c | 2 |
21 files changed, 70 insertions, 48 deletions
diff --git a/src/map/Makefile.in b/src/map/Makefile.in index 8e97221a7..d2c9d63d0 100644 --- a/src/map/Makefile.in +++ b/src/map/Makefile.in @@ -32,7 +32,7 @@ MAP_H = map.h chrif.h clif.h pc.h status.h npc.h \ HAVE_MYSQL=@HAVE_MYSQL@ ifeq ($(HAVE_MYSQL),yes) ALL_DEPENDS=txt sql - SQL_DEPENDS=map-server_sql + SQL_DEPENDS=map-server else ALL_TARGET=txt SQL_DEPENDS=needs_mysql @@ -59,7 +59,7 @@ sql: $(SQL_DEPENDS) clean: @echo " CLEAN map" - @rm -rf *.o obj_txt obj_sql ../../map-server@EXEEXT@ ../../map-server_sql@EXEEXT@ + @rm -rf *.o obj_txt obj_sql ../../map-server@EXEEXT@ ../../map-server@EXEEXT@ help: ifeq ($(HAVE_MYSQL),yes) @@ -90,9 +90,9 @@ obj_sql: # executables -map-server_sql: obj_sql $(MAP_SQL_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a +map-server: obj_sql $(MAP_SQL_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a @echo " LD $@" - @@CC@ @LDFLAGS@ -o ../../map-server_sql@EXEEXT@ $(MAP_SQL_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@ + @@CC@ @LDFLAGS@ -o ../../map-server@EXEEXT@ $(MAP_SQL_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@ # map object files diff --git a/src/map/atcommand.c b/src/map/atcommand.c index e54166019..320ca83ff 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -5379,27 +5379,47 @@ ACMD_FUNC(clearcart) * @skillid by [MouseJstr] * lookup a skill by name *------------------------------------------*/ -ACMD_FUNC(skillid) -{ - int skillen, idx; +#define MAX_SKILLID_PARTIAL_RESULTS 5 +#define MAX_SKILLID_PARTIAL_RESULTS_LEN 74 /* "skill " (6) + "%d:" (up to 5) + "%s" (up to 30) + " (%s)" (up to 33) */ +ACMD_FUNC(skillid) { + int skillen, idx, i, found = 0; + DBIterator* iter; + DBKey key; + DBData *data; + char partials[MAX_SKILLID_PARTIAL_RESULTS][MAX_SKILLID_PARTIAL_RESULTS_LEN]; + nullpo_retr(-1, sd); - if (!message || !*message) - { + if (!message || !*message) { clif_displaymessage(fd, msg_txt(1163)); // Please enter a skill name to look up (usage: @skillid <skill name>). return -1; } skillen = strlen(message); - - for (idx = 0; idx < MAX_SKILL_DB; idx++) { - if (strnicmp(skill_db[idx].name, message, skillen) == 0 || strnicmp(skill_db[idx].desc, message, skillen) == 0) - { - sprintf(atcmd_output, msg_txt(1164), idx, skill_db[idx].desc); // skill %d: %s + + iter = db_iterator(skilldb_name2id); + + for( data = iter->first(iter,&key); iter->exists(iter); data = iter->next(iter,&key) ) { + idx = skill_get_index(db_data2i(data)); + if (strnicmp(key.str, message, skillen) == 0 || strnicmp(skill_db[idx].desc, message, skillen) == 0) { + sprintf(atcmd_output, msg_txt(1164), db_data2i(data), skill_db[idx].desc, key.str); // skill %d: %s (%s) clif_displaymessage(fd, atcmd_output); + } else if ( found < MAX_SKILLID_PARTIAL_RESULTS && ( stristr(key.str,message) || stristr(skill_db[idx].desc,message) ) ) { + snprintf(partials[found++], MAX_SKILLID_PARTIAL_RESULTS_LEN, msg_txt(1164), db_data2i(data), skill_db[idx].desc, key.str); } } - + + dbi_destroy(iter); + + if( found ) { + sprintf(atcmd_output, msg_txt(1398), found); // -- Displaying first %d partial matches + clif_displaymessage(fd, atcmd_output); + } + + for(i = 0; i < found; i++) { /* partials */ + clif_displaymessage(fd, partials[i]); + } + return 0; } diff --git a/src/map/battle.c b/src/map/battle.c index a6605da5e..cfb3df52e 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -1,4 +1,4 @@ -// Copyright (c) Hercules dev team, licensed under GNU GPL. +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams diff --git a/src/map/battle.h b/src/map/battle.h index e3a0a51ab..14bd70fee 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -1,4 +1,4 @@ -// Copyright (c) Hercules dev team, licensed under GNU GPL. +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams diff --git a/src/map/chrif.c b/src/map/chrif.c index 06eef0564..573fd8501 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -1,4 +1,4 @@ -// Copyright (c) Hercules dev team, licensed under GNU GPL. +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams diff --git a/src/map/clif.c b/src/map/clif.c index 6d9e57bd2..ed2044127 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1,4 +1,4 @@ -// Copyright (c) Hercules dev team, licensed under GNU GPL. +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams @@ -17119,7 +17119,7 @@ int do_init_clif(void) { set_defaultparse(clif_parse); if( make_listen_bind(bind_ip,map_port) == -1 ) { - ShowFatalError("can't bind game port\n"); + ShowFatalError("Failed to bind to port '"CL_WHITE"%d"CL_RESET"'\n",map_port); exit(EXIT_FAILURE); } diff --git a/src/map/elemental.c b/src/map/elemental.c index 33ef4d1b9..453845288 100644 --- a/src/map/elemental.c +++ b/src/map/elemental.c @@ -1,4 +1,4 @@ -// Copyright (c) Hercules dev team, licensed under GNU GPL. +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams diff --git a/src/map/homunculus.c b/src/map/homunculus.c index 92868c7c7..6cc671526 100644 --- a/src/map/homunculus.c +++ b/src/map/homunculus.c @@ -1,4 +1,4 @@ -// Copyright (c) Hercules dev team, licensed under GNU GPL. +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams diff --git a/src/map/map.c b/src/map/map.c index dde922f39..c02506073 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -1,4 +1,4 @@ -// Copyright (c) Hercules dev team, licensed under GNU GPL. +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams @@ -3985,10 +3985,10 @@ int do_init(int argc, char *argv[]) if (battle_config.pk_mode) ShowNotice("Server is running on '"CL_WHITE"PK Mode"CL_RESET"'.\n"); - ShowStatus("Server is '"CL_GREEN"ready"CL_RESET"' and listening on port '"CL_WHITE"%d"CL_RESET"'.\n\n", map_port); - Sql_HerculesUpdateCheck(mmysql_handle); + ShowStatus("Server is '"CL_GREEN"ready"CL_RESET"' and listening on port '"CL_WHITE"%d"CL_RESET"'.\n\n", map_port); + if( runflag != CORE_ST_STOP ) { shutdown_callback = do_shutdown; diff --git a/src/map/map.h b/src/map/map.h index 861a55d0a..38d9726cb 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -1,4 +1,4 @@ -// Copyright (c) Hercules dev team, licensed under GNU GPL. +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams diff --git a/src/map/mercenary.c b/src/map/mercenary.c index a97651b87..665e6aeac 100644 --- a/src/map/mercenary.c +++ b/src/map/mercenary.c @@ -1,4 +1,4 @@ -// Copyright (c) Hercules dev team, licensed under GNU GPL. +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams diff --git a/src/map/mob.c b/src/map/mob.c index 4f28923e9..b85238899 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1,4 +1,4 @@ -// Copyright (c) Hercules dev team, licensed under GNU GPL. +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams diff --git a/src/map/npc.c b/src/map/npc.c index 671b4485a..d734381af 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1,4 +1,4 @@ -// Copyright (c) Hercules dev team, licensed under GNU GPL. +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams diff --git a/src/map/pc.c b/src/map/pc.c index ad779a268..77b9948c4 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1,4 +1,4 @@ -// Copyright (c) Hercules dev team, licensed under GNU GPL. +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams diff --git a/src/map/pc.h b/src/map/pc.h index 6e56a612e..1b00b7191 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -1,4 +1,4 @@ -// Copyright (c) Hercules dev team, licensed under GNU GPL. +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams diff --git a/src/map/script.c b/src/map/script.c index fe00599a6..dd137d575 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -1,4 +1,4 @@ -// Copyright (c) Hercules dev team, licensed under GNU GPL. +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams diff --git a/src/map/skill.c b/src/map/skill.c index 86a03b64b..51124e93b 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -1,4 +1,4 @@ -// Copyright (c) Hercules dev team, licensed under GNU GPL. +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams @@ -63,8 +63,6 @@ static struct eri *skill_timer_ers = NULL; //For handling skill_timerskills [Sko DBMap* skillunit_db = NULL; // int id -> struct skill_unit* -DBMap* skilldb_name2id = NULL; - /** * Skill Cool Down Delay Saving * Struct skill_cd is not a member of struct map_session_data diff --git a/src/map/skill.h b/src/map/skill.h index 9b6ba1b0c..94159d524 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -1,10 +1,12 @@ -// Copyright (c) Athena Dev Teams - Licensed under GNU GPL -// For more information, see LICENCE in the main folder +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. +// See the LICENSE file +// Portions Copyright (c) Athena Dev Teams #ifndef _SKILL_H_ #define _SKILL_H_ #include "../common/mmo.h" // MAX_SKILL, struct square +#include "../common/db.h" #include "map.h" // struct block_list struct map_session_data; struct homun_data; @@ -22,6 +24,8 @@ struct status_change_entry; #define MAX_SKILL_LEVEL 100 +DBMap* skilldb_name2id; + //Constants to identify the skill's inf value: enum e_skill_inf { diff --git a/src/map/sql/CMakeLists.txt b/src/map/sql/CMakeLists.txt index 47c8e495c..1d8bd5fe2 100644 --- a/src/map/sql/CMakeLists.txt +++ b/src/map/sql/CMakeLists.txt @@ -3,7 +3,7 @@ # map sql # if( BUILD_SQL_SERVERS ) -message( STATUS "Creating target map-server_sql" ) +message( STATUS "Creating target map-server" ) set( SQL_MAP_HEADERS "${SQL_MAP_SOURCE_DIR}/atcommand.h" "${SQL_MAP_SOURCE_DIR}/battle.h" @@ -97,16 +97,16 @@ set( SOURCE_FILES ${COMMON_BASE_HEADERS} ${COMMON_SQL_HEADERS} ${SQL_MAP_HEADERS source_group( common FILES ${COMMON_BASE_HEADERS} ${COMMON_SQL_HEADERS} ) source_group( map FILES ${SQL_MAP_HEADERS} ${SQL_MAP_SOURCES} ) include_directories( ${INCLUDE_DIRS} ) -add_executable( map-server_sql ${SOURCE_FILES} ) -add_dependencies( map-server_sql ${DEPENDENCIES} ) -target_link_libraries( map-server_sql ${LIBRARIES} ${DEPENDENCIES} ) -set_target_properties( map-server_sql PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" ) +add_executable( map-server ${SOURCE_FILES} ) +add_dependencies( map-server ${DEPENDENCIES} ) +target_link_libraries( map-server ${LIBRARIES} ${DEPENDENCIES} ) +set_target_properties( map-server PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" ) if( INSTALL_COMPONENT_RUNTIME ) - cpack_add_component( Runtime_mapserver_sql DESCRIPTION "map-server (sql version)" DISPLAY_NAME "map-server_sql" GROUP Runtime ) - install( TARGETS map-server_sql + cpack_add_component( Runtime_mapserver_sql DESCRIPTION "map-server (sql version)" DISPLAY_NAME "map-server" GROUP Runtime ) + install( TARGETS map-server DESTINATION "." COMPONENT Runtime_mapserver_sql ) endif( INSTALL_COMPONENT_RUNTIME ) -set( TARGET_LIST ${TARGET_LIST} map-server_sql CACHE INTERNAL "" ) -message( STATUS "Creating target map-server_sql - done" ) +set( TARGET_LIST ${TARGET_LIST} map-server CACHE INTERNAL "" ) +message( STATUS "Creating target map-server - done" ) endif( BUILD_SQL_SERVERS ) diff --git a/src/map/status.c b/src/map/status.c index 97b7c61a1..b07625322 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1,4 +1,4 @@ -// Copyright (c) Hercules dev team, licensed under GNU GPL. +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams diff --git a/src/map/unit.c b/src/map/unit.c index 60de14093..4ca64d7f8 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -1,4 +1,4 @@ -// Copyright (c) Hercules dev team, licensed under GNU GPL. +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams |