Compare commits

...

7 Commits

Author SHA1 Message Date
bash
f0dc6de606 force build 2026-02-01 22:43:16 +01:00
bashermens
8c2a27b9fe Update check_pr_source.yml (#2101) 2026-02-01 22:41:49 +01:00
bashermens
8e316cd321 fix (#2099) 2026-02-01 22:26:07 +01:00
bashermens
cafb95e7bd Create check_pr_source.yml (#2098) 2026-02-01 22:21:57 +01:00
bashermens
8529654f8f Correction after singleton PR (#2095)
# Pull Request

Some logic was changed but differs from the original code, certain edge
cases so not result in same behavior. This returns the original code
with only the singleton chances.

@Wishmaster117 Reviewed the hotfix and noticed the different code paths.

ps: reverted an removed placeholder since its ongoing issue/research.
2026-02-01 10:18:59 +01:00
Crow
6ee1684e9b Fix WSG graveyard camping by flag carrier (#2086)
Quick fix for a very annoying error identified by SmashingQuasar. In
WSG, bots will camp the opposing graveyard if up 2-0. This is supposed
to exclude the flag carrier, but a logical error has resulted in the
flag carrier being excluded for Alliance camping only, meaning the Horde
flag carrier will camp the GY with the rest of the team if up 2-0 and
thus refuse to end the game.
2026-01-31 23:11:40 +01:00
Crow
9546363d41 Hotfix for OnBotLoginOperation() Crash (#2089)
Hotfix for an issue arising from
https://github.com/mod-playerbots/mod-playerbots/pull/2082

OnBotLoginOperation() is calling OnBotLogin() twice for altbots. I don't
know the full implication, but RandomPlayerbotMgr::OnBotLoginInternal()
is being called on altbots, and the server will crash if you attempt to
then log out the altbot.

This fix works for me right now. Discussed with @Celandriel , going to
push this hotfix for now until the rest of the maintainers can take a
look.
2026-01-31 10:54:19 +01:00
5 changed files with 76 additions and 92 deletions

19
.github/workflows/check_pr_source.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
name: Enforce test-staging → main
on:
pull_request:
branches:
- master
jobs:
require-test-staging:
runs-on: ubuntu-22.04
steps:
- name: Ensure PR source is test-staging
run: |
echo "Base: ${{ github.event.pull_request.base.ref }}"
echo "Head: ${{ github.event.pull_request.head.ref }}"
if [ "${{ github.event.pull_request.head.ref }}" != "test-staging" ]; then
echo "✖ Pull request must come from test-staging"
exit 1
fi

View File

@@ -1,71 +0,0 @@
[English](README.md) | [Español](README_ES.md) | [中文](README_CN.md)
# 玩家机器人模块
欢迎使用AzerothCore的玩家机器人模块这是一个基于IKE3玩家机器人的正在进行中的项目。这些玩家机器人利用实际的玩家数据使您能够与您自己的替身进行交互组建队伍升级角色等等。
如果您遇到任何错误或出现崩溃请您将它们报告为GitHub问题。您宝贵的反馈将帮助我们协作改进和增强这个项目。
## 安装
请注意此模块需要对AzerothCore进行特定的自定义更改。为了确保兼容性您必须使用我fork的自定义分支来编译它可以在这里找到[mod-playerbots/azerothcore-wotlk/tree/Playerbot](https://github.com/mod-playerbots/azerothcore-wotlk/tree/Playerbot)。
要安装此模块请参考AzerothCore Wiki的详细说明[AzerothCore安装指南](https://www.azerothcore.org/wiki/installation)。
我们提供了一个简单的方法来克隆该模块:
```bash
git clone https://github.com/mod-playerbots/azerothcore-wotlk.git --branch=Playerbot
cd azerothcore-wotlk/modules
git clone https://github.com/mod-playerbots/mod-playerbots.git --branch=master
```
## 快速开始与文档
要快速开始并了解一系列命令您可以参考ike3原版playerbots的手册。该模块提供了大部分基本命令。您可以在此找到文档[IKE3 Playerbots 文档](https://ike3.github.io/mangosbot-docs/)。请注意,在我们的模块中,您需要将文档中所有的 `.bot` 替换为 `.playerbot bot`
请注意,由于项目仍在开发中,新添加的命令的文档目前尚不完善。
## 进展
该模块主要强调以下关键功能,并在这些领域实施了改进:
- **世界中的机器人(随机机器人):** 我们增强了随机机器人的行为,使它们更接近真实玩家的表现,从而创建了更真实的玩家服务器环境。
- **团队副本中的机器人:** 我们赋予机器人征服具有挑战性的团队副本内容的能力通过为各种Boss实施特定策略使团队副本更加吸引人。此外我们增强了机器人在DPS、治疗和坦克等各种角色中的能力确保它们有效地为团队的成功做出贡献。
- **战场中的机器人:** 机器人现在能够与真实玩家一起积极参与战场为这些PvP场景增添了深度和刺激。
- **与机器人的交互:** 我们改进了真实玩家和机器人之间的交互,使玩家能够在与机器人伙伴合作时完成任务并升级多个角色。
- **玩家进阶路径:** 我们设计了一个改进的玩家进阶路径,辅以机器人,为玩家提供了一种替代且引人入胜的游戏体验。
- **稳定性:** 我们的努力主要集中在增强使用Playerbots模块时AzerothCore的整体稳定性。这些改进旨在防止服务器崩溃并确保所有用户都能获得更流畅的体验。
- **配置:** 我们引入了一系列可配置的选项,以满足不同需求的玩家,从而提供更个性化的体验。
值得注意的是,随着我们继续改进项目,还有大量工作需要完成。我们欢迎每个人以不同的方式做出贡献。
## 插件
为了更好地控制机器人并简化命令的使用,您还可以使用我们的插件:[Unbot Addon](https://github.com/liyunfan1223/unbot-addon)。目前,该插件仅对简体中文客户端提供更好的支持。
## 常见问题
**机器人无法释放技能**
- 请确保必要的英文DBC文件enUS存在。
**编译错误**
- 我们支持Ubuntu、Windows和macOS。
- 我们建立了持续集成工作流。您可以在[GitHub Actions](https://github.com/mod-playerbots/mod-playerbots/actions)中查看构建状态。
- 如果最新的构建状态失败,请恢复到上一个提交。我们将尽快解决此问题。
## 致谢
该模块的代码来自[ZhengPeiRu21/mod-playerbots](https://github.com/ZhengPeiRu21/mod-playerbots)和[celguar/mangosbot-bots](https://github.com/celguar/mangosbot-bots)。我们衷心感谢@ZhengPeiRu21和@celguar对维护该模块的持续努力
我们还要向所有为playerbot开发做出贡献的个人表示诚挚的感谢。您的奉献和努力对塑造这个项目至关重要我们对您的贡献表示感谢。

View File

@@ -2227,8 +2227,8 @@ bool BGTactics::selectObjective(bool reset)
}
// Graveyard Camping if in lead
else if (!hasFlag && role < 8 &&
(team == TEAM_ALLIANCE && allianceScore == 2 && hordeScore == 0) ||
(team == TEAM_HORDE && hordeScore == 2 && allianceScore == 0))
((team == TEAM_ALLIANCE && allianceScore == 2 && hordeScore == 0) ||
(team == TEAM_HORDE && hordeScore == 2 && allianceScore == 0)))
{
if (team == TEAM_ALLIANCE)
SetSafePos(WS_GY_CAMPING_HORDE, 10.0f);

View File

@@ -124,6 +124,52 @@ public:
}
}
bool OnPlayerBeforeTeleport(Player* /*player*/, uint32 /*mapid*/, float /*x*/, float /*y*/, float /*z*/,
float /*orientation*/, uint32 /*options*/, Unit* /*target*/) override
{
/* for now commmented out until proven its actually required
* havent seen any proof CleanVisibilityReferences() is needed
// If the player is not safe to touch, do nothing
if (!player)
return true;
// If same map or not in world do nothing
if (!player->IsInWorld() || player->GetMapId() == mapid)
return true;
// If real player do nothing
PlayerbotAI* ai = GET_PLAYERBOT_AI(player);
if (!ai || ai->IsRealPlayer())
return true;
// Cross-map bot teleport: defer visibility reference cleanup.
// CleanVisibilityReferences() erases this bot's GUID from other objects' visibility containers.
// This is intentionally done via the event queue (instead of directly here) because erasing
// from other players' visibility maps inside the teleport call stack can hit unsafe re-entrancy
// or iterator invalidation while visibility updates are in progress
ObjectGuid guid = player->GetGUID();
player->m_Events.AddEventAtOffset(
[guid, mapid]()
{
// do nothing, if the player is not safe to touch
Player* p = ObjectAccessor::FindPlayer(guid);
if (!p || !p->IsInWorld() || p->IsDuringRemoveFromWorld())
return;
// do nothing if we are already on the target map
if (p->GetMapId() == mapid)
return;
p->GetObjectVisibilityContainer().CleanVisibilityReferences();
},
Milliseconds(0));
*/
return true;
}
void OnPlayerAfterUpdate(Player* player, uint32 diff) override
{
PlayerbotAI* const botAI = PlayerbotsMgr::instance().GetPlayerbotAI(player);

View File

@@ -479,33 +479,23 @@ public:
bool Execute() override
{
// find and verify bot still exists
Player* bot = ObjectAccessor::FindConnectedPlayer(this->m_botGuid);
Player* bot = ObjectAccessor::FindConnectedPlayer(m_botGuid);
if (!bot)
{
return false;
}
if (this->m_masterAccountId)
PlayerbotHolder* holder = &RandomPlayerbotMgr::instance();
if (m_masterAccountId)
{
WorldSession* masterSession = sWorldSessionMgr->FindSession(this->m_masterAccountId);
WorldSession* masterSession = sWorldSessionMgr->FindSession(m_masterAccountId);
Player* masterPlayer = masterSession ? masterSession->GetPlayer() : nullptr;
if (masterPlayer != nullptr)
{
PlayerbotMgr* manager = PlayerbotsMgr::instance().GetPlayerbotMgr(masterPlayer);
if (manager == nullptr)
{
return false;
}
manager->OnBotLogin(bot);
}
if (masterPlayer)
holder = PlayerbotsMgr::instance().GetPlayerbotMgr(masterPlayer);
}
sRandomPlayerbotMgr.OnBotLogin(bot);
if (!holder)
return false;
holder->OnBotLogin(bot);
return true;
}