Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial attempt to merge playerbots from zero into two #188

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

leprasmurf
Copy link
Contributor

@leprasmurf leprasmurf commented Mar 23, 2022

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
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
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

Copy link
Member

@billy1arm billy1arm left a comment

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
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
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

Is this partly merged?

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.

3 participants