From 50c2e8eca24cb036bb7a7c809fa197bd71305710 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Fri, 23 Jul 2010 19:33:12 +0400 Subject: [PATCH] [10251] Clarify error message for one from redundent `commamd` data case. --- sql/mangos.sql | 3 +-- sql/updates/10251_01_mangos_command.sql | 3 +++ sql/updates/Makefile.am | 2 ++ src/game/Chat.cpp | 6 +++++- src/shared/revision_nr.h | 2 +- src/shared/revision_sql.h | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 sql/updates/10251_01_mangos_command.sql diff --git a/sql/mangos.sql b/sql/mangos.sql index 4a85be202..1fdb3b9e2 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -24,7 +24,7 @@ CREATE TABLE `db_version` ( `version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL, `cache_id` int(10) default '0', - `required_10244_01_mangos_command` bit(1) default NULL + `required_10251_01_mangos_command` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -788,7 +788,6 @@ INSERT INTO `command` VALUES ('waterwalk',2,'Syntax: .waterwalk on/off\r\n\r\nSet on/off waterwalk state for selected player.'), ('wchange',3,'Syntax: .wchange #weathertype #status\r\n\r\nSet current weather to #weathertype with an intensity of #status.\r\n\r\n#weathertype can be 1 for rain, 2 for snow, and 3 for sand. #status can be 0 for disabled, and 1 for enabled.'), ('whispers',1,'Syntax: .whispers on|off\r\nEnable/disable accepting whispers by GM from players. By default use mangosd.conf setting.'), -('wp',2,'Using WP Command:\r\nEach Waypoint Command has it\'s own description!'), ('wp add',2,'Syntax: .wp add [#creature_guid or Select a Creature]'), ('wp export',3,'Syntax: .wp export [#creature_guid or Select a Creature] $filename'), ('wp import',3,'Syntax: .wp import $filename'), diff --git a/sql/updates/10251_01_mangos_command.sql b/sql/updates/10251_01_mangos_command.sql new file mode 100644 index 000000000..01e33b477 --- /dev/null +++ b/sql/updates/10251_01_mangos_command.sql @@ -0,0 +1,3 @@ +ALTER TABLE db_version CHANGE COLUMN required_10244_01_mangos_command required_10251_01_mangos_command bit; + +DELETE FROM command WHERE name = 'wp'; diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index 4ee08133c..2fef3e905 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -120,6 +120,7 @@ pkgdata_DATA = \ 10223_01_mangos_spell_proc_event.sql \ 10237_01_mangos_spell_bonus_data.sql \ 10244_01_mangos_command.sql \ + 10251_01_mangos_command.sql \ README ## Additional files to include when running 'make dist' @@ -220,4 +221,5 @@ EXTRA_DIST = \ 10223_01_mangos_spell_proc_event.sql \ 10237_01_mangos_spell_bonus_data.sql \ 10244_01_mangos_command.sql \ + 10251_01_mangos_command.sql \ README diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index 73f59b26b..99e7c7e50 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -1155,7 +1155,11 @@ bool ChatHandler::SetDataForCommandInTable(ChatCommand *commandTable, const char } case CHAT_COMMAND_UNKNOWN_SUBCOMMAND: { - sLog.outErrorDb("Table `command` have unexpected subcommand '%s' in command '%s', skip.", cmdName.c_str(), fullcommand.c_str()); + // command have subcommands, but not '' subcommand and then any data in `command` useless for it. + if (cmdName.empty()) + sLog.outErrorDb("Table `command` have command '%s' that only used with some subcommand selection, it can't have help or overwritten access level, skip.", cmdName.c_str(), fullcommand.c_str()); + else + sLog.outErrorDb("Table `command` have unexpected subcommand '%s' in command '%s', skip.", cmdName.c_str(), fullcommand.c_str()); return false; } case CHAT_COMMAND_UNKNOWN: diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index b08ecba4b..f761398ad 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10250" + #define REVISION_NR "10251" #endif // __REVISION_NR_H__ diff --git a/src/shared/revision_sql.h b/src/shared/revision_sql.h index a513bf367..61c3ca1a1 100644 --- a/src/shared/revision_sql.h +++ b/src/shared/revision_sql.h @@ -1,6 +1,6 @@ #ifndef __REVISION_SQL_H__ #define __REVISION_SQL_H__ #define REVISION_DB_CHARACTERS "required_10160_02_characters_pet_aura" - #define REVISION_DB_MANGOS "required_10244_01_mangos_command" + #define REVISION_DB_MANGOS "required_10251_01_mangos_command" #define REVISION_DB_REALMD "required_10008_01_realmd_realmd_db_version" #endif // __REVISION_SQL_H__