Jump to content
slimy

ai playerbot Mangos Zero fix playerbot crash on looting

Recommended Posts

A couple of days after playing with Mangos Zero installation I decided to try to enable the included ai playerbot extension.

For information's sake, I eventually changed aiplayerbot.conf to include these tokens (not a fan of the random bots, but the others work well enough)

AiPlayerbot.Enabled = 1

AiPlayerbot.RandomBotAutologin = 0

AiPlayerbot.RandomBotAutoCreate = 0

AiPlayerbot.MinRandomBots = 1

AiPlayerbot.MaxRandomBots = 1

With aiplayerbot enabled I noticed server would crash whenever I looted an item that required the bots to roll, or one of the bots attempted to loot an item. 

This crash originated from QueryItemUsageAction::Execute. The format of the packet that this method attempts to read doesn't seem to match what the server has sent and the read results in meaningless data and a crash. I tried to apply a brute force solution and simply have this method return true, and nothing else. 

This made for a much more usable playerbot module. I can't say I would ever want to group with one of the mages, but so far warrior, paladin and rogue seem to do well enough... ;)

I have not spent too much time looking for the correct packet. If someone can point me in the right direction, I would appreciate it. Otherwise, bots are functional enough to be enjoyable :)

 

Share this post


Link to post
Share on other sites

For a start, read this please. The playerbot suffered even more due to my recent changes to the packet formats, making the sent SMSG packets at least the same length expected by the 1.12 client.

Your issue is related to the SMSG_ITEM_PUSH_RESULT packet. You can find it description here, as well as the late change: removing the "uint32 item count in inventory" field not expected by the client. Thus, the correct fix: remove the last read

data >> invCount;

in the QueryItemUsageAction::Execute() method.

Note this all is valid only for Zero (1.12 client).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Contact Us

To contact us click here
You can also email us at [email protected]

Privacy Policy | Terms & Conditions

Repositories

The Link to the master list
of MaNGOS repositories:
Copyright © getMaNGOS. All rights Reserved.

This website is in no way associated with or endorsed by Blizzard Entertainment®
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use