mirror of
https://github.com/kadeshar/mod-player-bot-level-brackets.git
synced 2026-01-13 01:08:36 +00:00
Adding reload command
This commit is contained in:
@@ -80,7 +80,7 @@ BotLevelBrackets.CheckFrequency | Frequency (in seconds) at which t
|
||||
BotLevelBrackets.CheckFlaggedFrequency | Frequency (in seconds) at which the bot level reset is performed for flagged bots that initially failed safety checks. | 15 | Positive Integer
|
||||
BotLevelBrackets.FlaggedProcessLimit | Maximum number of flagged bots to process per pending level change step. | 5 | Positive Integer
|
||||
BotLevelBrackets.Dynamic.UseDynamicDistribution | Enables dynamic bot distribution: when on, brackets with more real players get a higher share of bots in their level bracket, based on the weight below. | 0 | 0 (off) / 1 (on)
|
||||
BotLevelBrackets.Dynamic.RealPlayerWeight | Controls how much bots "follow" real player activity when dynamic distribution is enabled. 0.0 = bots always spread evenly; 1.0 = minimal effect; 10.0 = heavy effect; higher values = more bots go where players are, but the effect is scaled. | 10.0 | ≥ 0.0 (float)
|
||||
BotLevelBrackets.Dynamic.RealPlayerWeight | Controls how much bots "follow" real player activity when dynamic distribution is enabled. 0.0 = bots always spread evenly; 1.0 = minimal effect; 10.0 = heavy effect; higher values = more bots go where players are, but the effect is scaled. | 1.0 | ≥ 0.0 (float)
|
||||
BotLevelBrackets.Dynamic.SyncFactions | Enables synchronized brackets and weighting between Alliance and Horde factions when Dynamic Distribution is also enabled. | 0 | 0 (off) / 1 (on)
|
||||
BotLevelBrackets.IgnoreFriendListed | Ignores bots that are on real players' friend lists from any bracket calculations. | 1 | 0 (off) / 1 (on)
|
||||
BotLevelBrackets.IgnoreGuildBotsWithRealPlayers | Excludes bots in a guild with at least one real (non-bot) player from adjustments. Uses persistent database tracking for both online and offline real players. | 1 | 0 (disabled) / 1 (enabled)
|
||||
|
||||
@@ -107,8 +107,8 @@ BotLevelBrackets.Dynamic.UseDynamicDistribution = 0
|
||||
# Formula (per bracket):
|
||||
# bracket_weight = 1.0 + (RealPlayerWeight × (1 / TotalRealPlayers) × log(1 + RealPlayersInBracket))
|
||||
# All bracket weights are normalized to total 100%.
|
||||
# Default: 10.0
|
||||
BotLevelBrackets.Dynamic.RealPlayerWeight = 10.0
|
||||
# Default: 1.0
|
||||
BotLevelBrackets.Dynamic.RealPlayerWeight = 1.0
|
||||
|
||||
#
|
||||
# BotLevelBrackets.Dynamic.SyncFactions
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user