[6961] Remove redundent code that prevent show .reload subcomands list in normal way.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
begemot 2008-12-28 04:58:21 +03:00 committed by VladimirMangos
parent 41cbc67dfc
commit b9e0787c2a
7 changed files with 11 additions and 17 deletions

View file

@ -22,7 +22,7 @@
DROP TABLE IF EXISTS `db_version`; DROP TABLE IF EXISTS `db_version`;
CREATE TABLE `db_version` ( CREATE TABLE `db_version` (
`version` varchar(120) default NULL, `version` varchar(120) default NULL,
`required_6960_02_mangos_string` bit(1) default NULL `required_6961_01_mangos_command` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
-- --
@ -386,7 +386,6 @@ INSERT INTO `command` VALUES
('quest complete',3,'Syntax: .quest complete #questid\r\nMark all quest objectives as completed for target character active quest. After this target character can go and get quest reward.'), ('quest complete',3,'Syntax: .quest complete #questid\r\nMark all quest objectives as completed for target character active quest. After this target character can go and get quest reward.'),
('quest remove',3,'Syntax: .quest remove #quest_id\r\n\r\nSet quest #quest_id state to not completed and not active (and remove from active quest list) for selected player.'), ('quest remove',3,'Syntax: .quest remove #quest_id\r\n\r\nSet quest #quest_id state to not completed and not active (and remove from active quest list) for selected player.'),
('recall',1,'Syntax: .recall [$playername]\r\n\r\nTeleport $playername or selected player to the place where he has been before last use of a teleportation command. If no $playername is entered and no player is selected, it will teleport you.'), ('recall',1,'Syntax: .recall [$playername]\r\n\r\nTeleport $playername or selected player to the place where he has been before last use of a teleportation command. If no $playername is entered and no player is selected, it will teleport you.'),
('reload',3,'Syntax: .reload table_name\r\n\r\nReload table `table_name` if reload support added for this table and this table can be _safe_ reloaded.'),
('reload all',3,'Syntax: .reload all\r\n\r\nReload all tables with reload support added and that can be _safe_ reloaded.'), ('reload all',3,'Syntax: .reload all\r\n\r\nReload all tables with reload support added and that can be _safe_ reloaded.'),
('reload all_area',3,'Syntax: .reload all_area\r\n\r\nReload all `areatrigger_*` tables if reload support added for this table and this table can be _safe_ reloaded.'), ('reload all_area',3,'Syntax: .reload all_area\r\n\r\nReload all `areatrigger_*` tables if reload support added for this table and this table can be _safe_ reloaded.'),
('reload all_loot',3,'Syntax: .reload all_loot\r\n\r\nReload all `*_loot_template` tables. This can be slow operation with lags for server run.'), ('reload all_loot',3,'Syntax: .reload all_loot\r\n\r\nReload all `*_loot_template` tables. This can be slow operation with lags for server run.'),

View file

@ -0,0 +1,3 @@
ALTER TABLE db_version CHANGE COLUMN required_6960_02_mangos_string required_6961_01_mangos_command bit;
DELETE FROM `command` WHERE name = 'reload';

View file

@ -103,6 +103,7 @@ pkgdata_DATA = \
6958_01_mangos_spell_proc_event.sql \ 6958_01_mangos_spell_proc_event.sql \
6960_01_mangos_command.sql \ 6960_01_mangos_command.sql \
6960_02_mangos_string.sql \ 6960_02_mangos_string.sql \
6961_01_mangos_command.sql \
README README
## Additional files to include when running 'make dist' ## Additional files to include when running 'make dist'
@ -186,4 +187,5 @@ EXTRA_DIST = \
6958_01_mangos_spell_proc_event.sql \ 6958_01_mangos_spell_proc_event.sql \
6960_01_mangos_command.sql \ 6960_01_mangos_command.sql \
6960_02_mangos_string.sql \ 6960_02_mangos_string.sql \
6961_01_mangos_command.sql \
README README

View file

@ -295,7 +295,6 @@ ChatCommand * ChatHandler::getCommandTable()
{ "locales_page_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesPageTextCommand, "", NULL }, { "locales_page_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesPageTextCommand, "", NULL },
{ "locales_quest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesQuestCommand, "", NULL }, { "locales_quest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesQuestCommand, "", NULL },
{ "", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "", NULL }
}; };
@ -695,9 +694,9 @@ void ChatHandler::PSendSysMessage(int32 entry, ...)
{ {
const char *format = GetMangosString(entry); const char *format = GetMangosString(entry);
va_list ap; va_list ap;
char str [1024]; char str [2048];
va_start(ap, entry); va_start(ap, entry);
vsnprintf(str,1024,format, ap ); vsnprintf(str,2048,format, ap );
va_end(ap); va_end(ap);
SendSysMessage(str); SendSysMessage(str);
} }
@ -705,9 +704,9 @@ void ChatHandler::PSendSysMessage(int32 entry, ...)
void ChatHandler::PSendSysMessage(const char *format, ...) void ChatHandler::PSendSysMessage(const char *format, ...)
{ {
va_list ap; va_list ap;
char str [1024]; char str [2048];
va_start(ap, format); va_start(ap, format);
vsnprintf(str,1024,format, ap ); vsnprintf(str,2048,format, ap );
va_end(ap); va_end(ap);
SendSysMessage(str); SendSysMessage(str);
} }

View file

@ -196,7 +196,6 @@ class ChatHandler
bool HandleNpcWhisperCommand(const char* args); bool HandleNpcWhisperCommand(const char* args);
bool HandleNpcYellCommand(const char* args); bool HandleNpcYellCommand(const char* args);
bool HandleReloadCommand(const char* args);
bool HandleReloadAllCommand(const char* args); bool HandleReloadAllCommand(const char* args);
bool HandleReloadAllAreaCommand(const char* args); bool HandleReloadAllAreaCommand(const char* args);
bool HandleReloadAllItemCommand(const char* args); bool HandleReloadAllItemCommand(const char* args);

View file

@ -52,14 +52,6 @@
#include "InstanceData.h" #include "InstanceData.h"
//reload commands //reload commands
bool ChatHandler::HandleReloadCommand(const char* arg)
{
// this is error catcher for wrong table name in .reload commands
PSendSysMessage("Db table with name starting from '%s' not found and can't be reloaded.",arg);
SetSentErrorMessage(true);
return false;
}
bool ChatHandler::HandleReloadAllCommand(const char*) bool ChatHandler::HandleReloadAllCommand(const char*)
{ {
HandleReloadAreaTriggerTeleportCommand(""); HandleReloadAreaTriggerTeleportCommand("");

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "6960" #define REVISION_NR "6961"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__