Skip playerbots so bot re-rolls don't spam the realm #1

Merged
yrtria merged 1 commit from fix/skip-playerbots into main 2026-09-03 11:21:46 -06:00
Owner

Upstream compiles clean against AzerothCore efe123fab / mod-playerbots 8d9f6aa6 (2026-08-14) -- all six TUs, no changes needed. The problem is behavioural, and specific to a Playerbots realm.

PlayerbotFactory calls Player::GiveLevel() in six places while randomising a bot, and GiveLevel fires OnPlayerLevelChanged exactly as a real ding does. So every bot re-roll past 10/20/.../80 currently:

  • broadcasts X has reached Level Y to the whole server (twice -- per-level and reward-level)
  • sends a raid warning
  • hands the bot gold (1g at 10, rising to 100g at 80) and two reward items

With 135 bot accounts cycling, that is close to continuous. Setting CongratsPerLevel.Enable = 0 does not fix it: the reward-level broadcast and raid warning sit outside that gate, and there is no upstream option to exclude bots.

Change

Adds Congrats.SkipBots, default 1. The bot test is GET_PLAYERBOT_AI(player) != nullptr, guarded by #ifdef MOD_PLAYERBOTS -- the core applies -DMOD_PLAYERBOTS and all 105 playerbots include dirs to every module in the modules target when mod-playerbots is present, so this stays portable to a core built without it.

Also adds the missing override on OnPlayerLogin. The signature already matched PlayerScript::OnPlayerLogin(Player*) so behaviour is unchanged; it just stops a future base-class change from silently detaching the hook.

Verification

clang++ -fsyntax-only -DMOD_PLAYERBOTS against the live build's own flags plus the playerbots include tree: clean. Not built or run.

Note

The two SQL files apply automatically -- Updates.EnableDatabases = 7, AutoSetup = 1. No collision at acore_string 60000 and no existing mod_congrats_on_level_items table.

Upstream compiles clean against AzerothCore `efe123fab` / mod-playerbots `8d9f6aa6` (2026-08-14) -- all six TUs, no changes needed. The problem is behavioural, and specific to a Playerbots realm. `PlayerbotFactory` calls `Player::GiveLevel()` in six places while randomising a bot, and `GiveLevel` fires `OnPlayerLevelChanged` exactly as a real ding does. So every bot re-roll past 10/20/.../80 currently: - broadcasts `X has reached Level Y` to the whole server (twice -- per-level and reward-level) - sends a raid warning - hands the bot gold (1g at 10, rising to 100g at 80) and two reward items With 135 bot accounts cycling, that is close to continuous. Setting `CongratsPerLevel.Enable = 0` does **not** fix it: the reward-level broadcast and raid warning sit outside that gate, and there is no upstream option to exclude bots. ## Change Adds `Congrats.SkipBots`, default `1`. The bot test is `GET_PLAYERBOT_AI(player) != nullptr`, guarded by `#ifdef MOD_PLAYERBOTS` -- the core applies `-DMOD_PLAYERBOTS` and all 105 playerbots include dirs to every module in the `modules` target when mod-playerbots is present, so this stays portable to a core built without it. Also adds the missing `override` on `OnPlayerLogin`. The signature already matched `PlayerScript::OnPlayerLogin(Player*)` so behaviour is unchanged; it just stops a future base-class change from silently detaching the hook. ## Verification `clang++ -fsyntax-only -DMOD_PLAYERBOTS` against the live build's own flags plus the playerbots include tree: clean. Not built or run. ## Note The two SQL files apply automatically -- `Updates.EnableDatabases = 7`, `AutoSetup = 1`. No collision at `acore_string` 60000 and no existing `mod_congrats_on_level_items` table.
yrtria added 1 commit 2026-09-03 11:21:41 -06:00
fix: skip playerbots so bot re-rolls do not spam the server
Some checks failed
core-build / build (pull_request) Has been cancelled
0ad5f1d345
PlayerbotFactory calls Player::GiveLevel() in six places while randomising a
bot, and GiveLevel fires OnPlayerLevelChanged exactly as a real ding does. On
a Playerbots realm that means every bot re-roll past level 10/20/.../80 sends
a server-wide broadcast plus a raid warning and hands the bot gold and two
reward items. Turning off CongratsPerLevel.Enable does not help: the
reward-level announcements sit outside that gate.

Adds Congrats.SkipBots (default 1). The bot test is guarded by
#ifdef MOD_PLAYERBOTS, which the core defines for every module when
mod-playerbots is present, so a core built without it is unaffected.

Also adds the missing `override` on OnPlayerLogin. The signature already
matched the base, so behaviour is unchanged -- it just stops a future
signature change from silently detaching the hook.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019vTNrJGsprcjdjjjDJD5ZM
yrtria merged commit 1e8d21b517 into main 2026-09-03 11:21:46 -06:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: yrtria/mod-congrats-on-level#1
No description provided.