Jump to content

Mangos Zero fix playerbot crash on looting


slimy

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

 

Link to comment
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).

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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