Adding reload command

This commit is contained in:
Dustin Hendrickson
2025-10-18 14:09:37 -05:00
parent 8669a4dbcb
commit 74fb4876f5
3 changed files with 39 additions and 6 deletions

View File

@@ -1806,18 +1806,51 @@ public:
}
};
/**
* @class BotLevelBracketsCommandScript
* @brief Handles chat commands for the Player Bot Level Brackets module.
*
* This script provides administrative commands to manage the bot level brackets configuration.
*/
class BotLevelBracketsCommandScript : public CommandScript
{
public:
BotLevelBracketsCommandScript() : CommandScript("BotLevelBracketsCommandScript") {}
std::vector<ChatCommand> GetCommands() const override
{
static std::vector<ChatCommand> commandTable =
{
{ "reload", SEC_ADMINISTRATOR, false, &HandleReloadConfig, "" }
};
static std::vector<ChatCommand> commandTableMain =
{
{ "botlevelbrackets", SEC_ADMINISTRATOR, true, nullptr, "", commandTable }
};
return commandTableMain;
}
static bool HandleReloadConfig(ChatHandler* handler, const char* args)
{
LoadBotLevelBracketsConfig();
handler->SendSysMessage("Bot level brackets config reloaded.");
return true;
}
};
// -----------------------------------------------------------------------------
// ENTRY POINT: Register the Bot Level Distribution Module
// -----------------------------------------------------------------------------
/**
* @brief Registers the world and player scripts for the Player Bot Level Brackets module.
* @brief Registers the world, player, and command scripts for the Player Bot Level Brackets module.
*
* This function instantiates and adds the BotLevelBracketsWorldScript and BotLevelBracketsPlayerScript
* to the script system, enabling custom logic for player bot level brackets within the game world.
* This function instantiates and adds the BotLevelBracketsWorldScript, BotLevelBracketsPlayerScript,
* and BotLevelBracketsCommandScript to the script system, enabling custom logic and commands
* for player bot level brackets within the game world.
*/
void Addmod_player_bot_level_bracketsScripts()
{
new BotLevelBracketsWorldScript();
new BotLevelBracketsPlayerScript();
new BotLevelBracketsCommandScript();
}