Core/Commands: Make vehicle_accessory and vehicle_template_accessory reloadable with commands

This commit is contained in:
Machiavelli
2011-03-07 20:25:56 +01:00
parent 27680e420f
commit 311d0cf989
3 changed files with 27 additions and 0 deletions
+2
View File
@@ -650,6 +650,8 @@ INSERT INTO `command` VALUES
('reload spell_target_position',3,'Syntax: .reload spell_target_position\nReload spell_target_position table.'), ('reload spell_target_position',3,'Syntax: .reload spell_target_position\nReload spell_target_position table.'),
('reload spell_threats',3,'Syntax: .reload spell_threats\nReload spell_threats table.'), ('reload spell_threats',3,'Syntax: .reload spell_threats\nReload spell_threats table.'),
('reload trinity_string',3,'Syntax: .reload trinity_string\nReload trinity_string table.'), ('reload trinity_string',3,'Syntax: .reload trinity_string\nReload trinity_string table.'),
('reload vehicle_accessory', 3, 'Syntax: .reload vehicle_accessory\n\nReloads GUID-based vehicle accessory definitions from the database.'),
('reload vehicle_template_accessory', 3, 'Syntax: .reload vehicle_template_accessory\n\nReloads entry-based vehicle accessory definitions from the database.'),
('reload waypoint_scripts',3,'Syntax: .reload waypoint_scripts\nReload waypoint_scripts table.'), ('reload waypoint_scripts',3,'Syntax: .reload waypoint_scripts\nReload waypoint_scripts table.'),
('repairitems',2,'Syntax: .repairitems\r\n\r\nRepair all selected player''s items.'), ('repairitems',2,'Syntax: .repairitems\r\n\r\nRepair all selected player''s items.'),
('reset',3,'Syntax: .reset $subcommand\nType .reset to see the list of possible subcommands or .help reset $subcommand to see info on subcommands'), ('reset',3,'Syntax: .reset $subcommand\nType .reset to see the list of possible subcommands or .help reset $subcommand to see info on subcommands'),
@@ -0,0 +1,4 @@
DELETE FROM `command` WHERE `name` IN('reload vehicle_accessory','reload vehicle_template_accessory');
INSERT INTO `command` (`name`,`security`,`help`) VALUES
('reload vehicle_accessory', 3, 'Syntax: .reload vehicle_accessory\n\nReloads GUID-based vehicle accessory definitions from the database.'),
('reload vehicle_template_accessory', 3, 'Syntax: .reload vehicle_template_accessory\n\nReloads entry-based vehicle accessory definitions from the database.');
+21
View File
@@ -151,6 +151,8 @@ public:
{ "spell_group_stack_rules", SEC_ADMINISTRATOR, true, &HandleReloadSpellGroupStackRulesCommand, "", NULL }, { "spell_group_stack_rules", SEC_ADMINISTRATOR, true, &HandleReloadSpellGroupStackRulesCommand, "", NULL },
{ "trinity_string", SEC_ADMINISTRATOR, true, &HandleReloadTrinityStringCommand, "", NULL }, { "trinity_string", SEC_ADMINISTRATOR, true, &HandleReloadTrinityStringCommand, "", NULL },
{ "waypoint_scripts", SEC_ADMINISTRATOR, true, &HandleReloadWpScriptsCommand, "", NULL }, { "waypoint_scripts", SEC_ADMINISTRATOR, true, &HandleReloadWpScriptsCommand, "", NULL },
{ "vehicle_accessory", SEC_ADMINISTRATOR, true, &HandleReloadVehicleAccessoryCommand, "", NULL },
{ "vehicle_template_accessory", SEC_ADMINISTRATOR, true, &HandleReloadVehicleTemplateAccessoryCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "", NULL }
}; };
static ChatCommand commandTable[] = static ChatCommand commandTable[] =
@@ -190,6 +192,9 @@ public:
HandleReloadTrinityStringCommand(handler,""); HandleReloadTrinityStringCommand(handler,"");
HandleReloadGameTeleCommand(handler,""); HandleReloadGameTeleCommand(handler,"");
HandleReloadVehicleAccessoryCommand(handler, "");
HandleReloadVehicleTemplateAccessoryCommand(handler, "");
HandleReloadAutobroadcastCommand(handler,""); HandleReloadAutobroadcastCommand(handler,"");
return true; return true;
} }
@@ -1273,6 +1278,22 @@ public:
handler->SendGlobalGMSysMessage("Smart Scripts reloaded."); handler->SendGlobalGMSysMessage("Smart Scripts reloaded.");
return true; return true;
} }
static bool HandleReloadVehicleAccessoryCommand(ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Reloading vehicle_accessory table...");
sObjectMgr->LoadVehicleAccessories();
handler->SendGlobalGMSysMessage("Vehicle accessories reloaded.");
return true;
}
static bool HandleReloadVehicleTemplateAccessoryCommand(ChatHandler* handler, const char* /*args*/)
{
sLog->outString("Reloading vehicle_template_accessory table...");
sObjectMgr->LoadVehicleTemplateAccessories();
handler->SendGlobalGMSysMessage("Vehicle template accessories reloaded.");
return true;
}
}; };
void AddSC_reload_commandscript() void AddSC_reload_commandscript()