Commit Graph

1489 Commits

Author SHA1 Message Date
Bobblybook
3f7f306124 Revert "Dungeon code cleanup"
This reverts commit d0a9e98801.
2024-10-20 15:58:14 +11:00
Bobblybook
d0a9e98801 Dungeon code cleanup
Consistent code, easier to read logic flow and some missing nullptr checks
2024-10-20 15:49:10 +11:00
avirar
30c36ccbf2 Update LootRollAction.cpp
Removed spaces
2024-10-20 09:38:05 +11:00
Revision
23ed033307 Merge pull request #624 from EricksOliveira/patch-7
Fix Crash The Nexux
2024-10-19 22:14:01 +02:00
Revision
b6ab4219d0 Merge pull request #623 from EricksOliveira/patch-6
Fix Crash q [ link item ]
2024-10-19 19:49:04 +02:00
EricksOliveira
8ac7d58230 Fix Crash The Nexux
Log Crash: 00007FF7750C05ED  00000028A47FEA10  FirebombSpreadAction::Execute+1AD  E:\Server\Heroes_Azeroth\modules\mod-playerbots\src\strategy\dungeons\wotlk\nexus\NexusActions.cpp line 58

This PR fixes a possible crash in the FirebombSpreadAction::Execute function, located in the NexusActions.cpp file, which occurred due to the lack of checking for null pointers when accessing group members.

Main changes: Added a null pointer check to ensure botAI->GetUnit(member) returns a valid unit before calling functions like GetExactDist2d and MoveAway.
If botAI->GetUnit(member) returns nullptr, execution ignores the specific member, avoiding access to an invalid pointer that could cause a server crash.
2024-10-19 14:29:44 -03:00
EricksOliveira
72debb6e83 Fix Crash q [ link item ]
This PR adds a null pointer check to the ChatHelper::FormatQuest function to avoid a crash that occurred when trying to format a null quest. The crash occurred when the quest pointer was nullptr and the code tried to access the GetQuestId(), GetQuestLevel() and GetTitle() methods.

Changes:
Added a nullptr check to the beginning of the ChatHelper::FormatQuest function.
Return of a standard error message ("Invalid quest") if the quest is null.

Impact:
Prevents crashes when formatting null quests.
Improves bot system stability when dealing with invalid quests.
2024-10-19 09:55:27 -03:00
Bobblybook
a430786133 Reapply "Preferred mount selection for bots"
This reverts commit eb5dd450cd.
2024-10-19 22:44:11 +11:00
Bobblybook
b97b6775da Merge pull request #621 from Bobblybook/master
Winged Steed of the Ebon Blade northrend fix
2024-10-19 22:43:12 +11:00
Bobblybook
eb5dd450cd Revert "Preferred mount selection for bots"
This reverts commit 312c661311.
2024-10-19 22:42:21 +11:00
Bobblybook
312c661311 Preferred mount selection for bots
Added a new table to store user-specified mount ids.
Can specify flying and ground mounts for a character which will prioritise that mount. If multiple entries, a random entry will be selected from that list.

Currently no way to add entries other than manual DB editing, but can be developed into a whisper command pretty easily.

This should gracefully fail (if no entries exist for the character, or the db table does not exist) and fallback to the default random selection as usual.
2024-10-19 22:40:26 +11:00
Bobblybook
1165442505 Winged Steed of the Ebon Blade northrend fix
Winged Steed of the Ebon Blade gets incorrectly categorised as a ground mount, causes issues and bots will not be able to ground mount if they have this mount in the account spellbook.

There may by other scaling mounts that have the same issue, either we blacklist them all or figure out a way to correctly read them as flyers.
2024-10-19 18:16:44 +11:00
bash
742199b1de Merge pull request #612 from EricksOliveira/patch-4
Fix Bug Bot blocked in PT
2024-10-19 07:19:17 +02:00
bash
168d711a21 Merge pull request #616 from EricksOliveira/master
Fix Crash - OnBotLogin
2024-10-19 07:14:41 +02:00
bash
e4cc24f64e Merge pull request #619 from noisiver/fix-typo-and-split-files
Fix typo in chat and move tables into their own file
2024-10-19 07:12:54 +02:00
Revision
8d7a7aed2a Fix a typo 2024-10-19 03:11:40 +02:00
Revision
c313cdfa8e Move tables into their own files 2024-10-19 03:10:46 +02:00
Revision
68c5d9124d Merge pull request #615 from Bobblybook/master
Halls of Lightning implementation
2024-10-19 03:03:52 +02:00
avirar
2846b48833 Merge branch 'liyunfan1223:master' into armor_token_usage 2024-10-19 11:47:42 +11:00
avirar
472050abd9 Update LootRollAction.cpp
Added logic for bots to roll need/greed on armor tokens based on class.
2024-10-19 11:43:51 +11:00
EricksOliveira
eabad44d4b Revert "Update PlayerbotCommandServer.cpp"
This reverts commit 8f2455b766.
2024-10-18 14:40:25 -03:00
EricksOliveira
8f2455b766 Update PlayerbotCommandServer.cpp
Protection against race conditions: Added a global mutex (session_mutex) to synchronize access to the session() function when multiple threads are running. This avoids concurrency problems in environments with many simultaneous connections.

Thread pool usage: Replaced manual thread creation with boost::thread with a thread pool using boost::asio::thread_pool. The thread pool improves resource management and limits the number of simultaneous threads, optimizing performance.

Checking for socket errors: Added check to ensure the socket is not null or closed before trying to read it.
Implemented detailed error handling for readings and writings, including detailed logs to facilitate debugging.
Secure socket closure: Now sockets are correctly closed at the end of the session, even in the event of an error, preventing resource leaks.
2024-10-18 14:37:54 -03:00
EricksOliveira
9280188841 Merge branch 'master' of https://github.com/liyunfan1223/mod-playerbots 2024-10-18 09:29:02 -03:00
EricksOliveira
65b6e15ea1 Fix Crash - OnBotLogin
1. Improvements in error handling: Added detailed logs for cases where botAI or master are null, allowing better failure tracking.

2. Additional null pointer checks: Added checks to ensure that the botAI and master are valid before performing actions dependent on these objects, preventing potential crashes.

3. Optimization in bot login logic: Revised the bot input flow to ensure it is added to the group appropriately depending on its relationship to the master.
Added logic for handling different types of groups (raid, LFG, etc.), including the possibility of automatic conversion to raid if necessary.
2024-10-18 09:27:46 -03:00
Bobblybook
66b7a3852d HoL updates 2024-10-18 20:57:48 +11:00
Bobblybook
f6987a80a5 Halls of Lightning implementation
Halls of Lightning implementation
2024-10-18 20:42:36 +11:00
Yunfan Li
4a85a44c02 Merge pull request #610 from Trus3683/patch-1
Visual update playerbots.conf.dist
2024-10-18 10:21:44 +08:00
avirar
4981f46aee Update LootRollAction.cpp
Added logic so bots will only roll need on usable class armor tokens. The tokens/items are classed as MISC > JUNK oddly, code simply checks if the bots class is part of the bitmask of classes for the item, and the item is EPIC. This catches all the tokens I've tested so far.
2024-10-18 12:24:23 +11:00
EricksOliveira
037258fb1a Fix Bug Bot blocked in PT
After leaving PT, the Bot was stuck in a Group, stopped and without receiving invites from other players. Ideally, use the LeaveGroupOnLogout.Enabled = 1 setting in Worldserver.conf so that after the player leaves the game, the Bots are not stuck in Raid.
2024-10-17 21:19:00 -03:00
avirar
efd204bbbe Update LootRollAction.h
Declared CanBotUseToken
2024-10-18 10:08:00 +11:00
avirar
38a5ff778a Update LootRollAction.cpp
Added logic for class/armour token usage.
2024-10-18 10:06:41 +11:00
bash
0dc7a844ea Merge pull request #611 from hermensbas/feature/bugfix_and_back_orginal_values
minor bugfix and back to original cmangos values
2024-10-17 22:30:56 +02:00
bash
4eb40c0395 minor bugfix and back to original cmangos values 2024-10-17 20:28:56 +00:00
Trus3683
a3abc78c24 Visual update playerbots.conf.dist
Cleanup for readability on new scaling/bot tuning implements
2024-10-17 12:53:43 -07:00
bash
1c9115d2cf Merge pull request #609 from hermensbas/feature/revert_rewrite_scaling
Revert "Rewrote scaling, moving away from cmangos solutions"
2024-10-17 20:20:08 +02:00
bash
12be2c9971 Revert "Rewrote scaling, moving away from cmangos solutions"
This reverts commit 62aef235d1.
2024-10-17 17:52:05 +00:00
Yunfan Li
ca9bfc4b9c Merge pull request #605 from Bobblybook/master
Halls of Stone implementation
2024-10-17 11:25:39 +08:00
Bobblybook
70c9bdbd9d Halls of Stone implementation 2024-10-15 22:40:47 +11:00
Yunfan Li
58abb0d9ce Merge pull request #597 from avirar/clean_quest_log
CleanQuestLog Updated
2024-10-14 18:22:36 +08:00
Yunfan Li
d4f3985de0 Merge pull request #602 from EricksOliveira/patch-3
Fix LFG Join bug
2024-10-14 18:22:16 +08:00
EricksOliveira
db395ae13c Fix LFG Join bug
This PR adjusts the execution priority of bot actions in Dungeon Finder (DF), modifying the relevance logic to make responses faster. The relevance calculation formula was changed in RpgAction::SetNextRpgAction to reduce the delay between activating actions, especially to improve the acceptance time of bots in DF queues. With these changes, bots now accept vacancies in a more agile and efficient way, optimizing overall response time.
2024-10-13 20:17:18 -03:00
bash
6af6350f1e Merge pull request #601 from hermensbas/feature/minor_istaxiflying_method_usage
Replaced isTaxiFlying check with new function
2024-10-14 00:49:52 +02:00
bash
6e4db7ee3b Replaced isTaxiFlying check with new function 2024-10-13 22:48:33 +00:00
bash
6d37da89fc Merge pull request #600 from hermensbas/feature/rewrite_scaling
Rewrote scaling moving away from cmangos solutions
2024-10-14 00:20:26 +02:00
bash
62aef235d1 Rewrote scaling, moving away from cmangos solutions 2024-10-13 22:05:39 +00:00
Bobblybook
651c5cdfb0 Merge pull request #599 from Bobblybook/master
Gundrak implementation
2024-10-13 23:58:11 +11:00
Bobblybook
608f9d1a68 Gundrak implementation
EASY one for once
2024-10-13 21:21:40 +11:00
bash
758bc9600a Merge pull request #598 from hermensbas/feature/smartscale_added_missing_activity
[performance] Smartscale added missing acitivity impl
2024-10-13 02:04:16 +02:00
bash
77ba59ed54 [performance] Smartscale added missing acitivity 2024-10-13 00:00:41 +00:00
avirar
ef7d5d9255 Merge branch 'liyunfan1223:master' into clean_quest_log 2024-10-13 10:50:33 +11:00