Skip to content

Initial attempt to merge playerbots from zero into two#188

Draft
leprasmurf wants to merge 14 commits into
mangostwo:masterfrom
leprasmurf:player_bots
Draft

Initial attempt to merge playerbots from zero into two#188
leprasmurf wants to merge 14 commits into
mangostwo:masterfrom
leprasmurf:player_bots

Conversation

@leprasmurf

@leprasmurf leprasmurf commented Mar 23, 2022

Copy link
Copy Markdown
Contributor

Most of the changes are pulled from mangoszero/server@ee33683 or mangos zero HEAD.

WIP:
Almost there, compilation fails towards the end

[ 99%] Building CXX object src/mangosd/CMakeFiles/mangosd.dir/mangosd.cpp.o
[100%] Linking CXX executable mangosd
/usr/bin/ld: ../../dep/lualib/liblualib.a(loslib.c.o): in function `os_tmpname':
loslib.c:(.text+0x2d5): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
/usr/bin/ld: ../../dep/acelite/libace.a(MMAP_Memory_Pool.cpp.o): in function `ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool(char const*, ACE_MMAP_Memory_Pool_Options const*)':
MMAP_Memory_Pool.cpp:(.text+0xa45): warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'
/usr/bin/ld: ../game/libgame.a(BuyAction.cpp.o): in function `ai::BuyAction::Execute(ai::Event)':
BuyAction.cpp:(.text+0x247): undefined reference to `Player::BuyItemFromVendor(ObjectGuid, unsigned int, unsigned char, unsigned char, unsigned char)'
collect2: error: ld returned 1 exit status
make[2]: *** [src/mangosd/CMakeFiles/mangosd.dir/build.make:160: src/mangosd/mangosd] Error 1
make[1]: *** [CMakeFiles/Makefile2:912: src/mangosd/CMakeFiles/mangosd.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

This change is Reviewable

@leprasmurf

Copy link
Copy Markdown
Contributor Author

Bots module compiles and loads from config as expected (now that I've setup my project with the correct directory structure: binary in /usr/local/bin and configs in /usr/local/etc). Pulled in some code from https://github.com/celguar/mangosbot-bots to fill out the deathknight logic. As per @Foereaper the modules need additional TLC across all cores.

@leprasmurf leprasmurf changed the title WIP: Initial attempt to merge playerbots from zero into two Initial attempt to merge playerbots from zero into two Mar 26, 2022
@billy1arm

Copy link
Copy Markdown
Member

@leprasmurf checked and eliminated most of the complaints the checks had, there are two mediums remaining:

https://app.codacy.com/gh/mangostwo/server/pullRequest?prid=9108498

@billy1arm billy1arm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 606 of 614 files at r1, 8 of 8 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @leprasmurf)

Most of the changes are pulled from
mangoszero/server@ee33683
or mangos zero HEAD.
Whitespace and buffer overflow fix (PR checks)
Pull in some of the updates from Celguar's playerbot repo.
Post-increments converted to pre-increments for efficiency
* Convert <string>.find -> <string>.starts_with
* Pass string by constant reference instead of value
* Pre-increment in the for loop post-action
* Built-in and module auctionhouse bots conflict on the .ahbot command.
Reconfigure module integration for .auctionbot command and finish
integrating.
* cppcheck fixes
* Bot module documentation
@leprasmurf

Copy link
Copy Markdown
Contributor Author

Player, Random, and the Auction House Bots are all building and configurable. The ahbot module config disables the built-in ahbot's buyer and seller agents before enabling its own.

There is a final assertion that I've yet to track down:

server/src/game/Object/AuctionHouseMgr.cpp:634: Error: Assertion in Update failed: !itr->second->itemGuidLow

Otherwise the auction house bot responds to the console or chat commands auctionbot as opposed to the preexisting command ahbot for the built-in bot. The Random Bots command, rndbot, is console-only; while the Player Bots command, bots, is chat-only.

@leprasmurf

Copy link
Copy Markdown
Contributor Author

There's a memory leak in here somewhere, my instance crashes within 24 hours of running. I'm going to recompile with the -DDEBUG:BOOL=1 flag to try and track it down.

@Jgoodwin64

Copy link
Copy Markdown

Is this partly merged?

@AppVeyorBot

Copy link
Copy Markdown

Attempting to fix compile issues after recent changes
@billy1arm

Copy link
Copy Markdown
Member

@leprasmurf - My apologies for my extended absence, trying to get things moving again

@AppVeyorBot

Copy link
Copy Markdown

@AppVeyorBot

Copy link
Copy Markdown

@billy1arm
billy1arm marked this pull request as draft February 28, 2026 23:57
Copilot AI added a commit that referenced this pull request Mar 1, 2026
…ame code

Co-authored-by: billy1arm <2219118+billy1arm@users.noreply.github.com>
billy1arm pushed a commit that referenced this pull request Jun 29, 2026
…ellAura*.cpp (#219)

* [Decomp][Spell] Cohesion split: extract SpellAuras.cpp handlers to SpellAura*.cpp

Mirror of mangosthree #188-195 (bundled, same source file). Pure cohesion
split of SpellAuras.cpp (12,928 -> 6,069 lines) with no behaviour change.
The Aura::HandleXxx / SpellAuraHolder handlers move to dedicated TUs:

- SpellAuraDummy.cpp       - HandleAuraDummy.
- SpellAuraControl.cpp     - crowd-control + immunity handlers (carries the
  static frozenAuraTypes table).
- SpellAuraMisc.cpp        - shapeshift-boost/absorb/misc handlers.
- SpellAuraShapeshift.cpp  - shapeshift/movement handlers.
- SpellAuraPeriodic.cpp    - periodic + stat handlers.
- SpellAuraTrailing.cpp    - trailing handlers.
- SpellAuraLate.cpp        - late crit/mastery/vehicle handlers.
- SpellAuraAddModifier.cpp - HandleAddModifier.

SpellAuras.h is unchanged; aura holder lifecycle / ApplyModifier dispatch
stay in SpellAuras.cpp. CMake file(GLOB) auto-compiles the new TUs.

* [Decomp][Spell] Drop redundant caster null-check in HandleSchoolAbsorb

Codacy/Cppcheck flagged the `caster &&` condition as always-true: the
method early-returns on `if (!caster)` near the top, so caster cannot be
null at this point. No behaviour change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants