Jump to content

Playerbot (archive)


Recommended Posts

  • Replies 1.8k
  • Created
  • Last Reply

Top Posters In This Topic

How can I patche manual??

I`m litle noob abouth C and hardly understand core modifications..

I read post #243, #231 and many other posts.. Do I need remove /src/game/Makefile.am and replace

new Makefile.am file on post 231 ?? Sorry for my bad english..

And the otherthig, mangos.conf.. How can I modify this.. If I don`t do modify mangos.conf, Server will work perfect??

Thanks for replay..

Link to comment
Share on other sites

I just study codes again

and I see a lot of security issues, like, bot is not checking if it is in the same map with master in Updated() and "attack" command and others. Making a delay of teleporting without a check won't fix crashes. It is making the same problem while creating a corpse of bot.

I believe, PlayerBotAI really need to rewrite.

Link to comment
Share on other sites

I tried using playerbot this summer. My last pull was on the 27th or 28th of july, and these where some wierd things I experienced:

If you bot add a hunter who has no pet "equipped", it will try to summon it in an infinite loop. The hunter should try to summon it only once, whether it is successful or not.

If you add a warlock, it will summon a demon and cast soul link continuously (my lock does demonology), and again, it is something that should be done only once.

Link to comment
Share on other sites

Wow Playerbot used to be quite reliable, I used to be able to add 40 bots no problem, limited only by how many WoW clients my pc could handle. Now I can't even add 9 bots from the same account without the server crashing on the 9th summon. I also tried adding 9 bots from 1 account, then more from another, doing that I can get to 9+2, on the 12th bot the server crashes.

Would it be possible to revert Playerbot to an older simpler version?

Link to comment
Share on other sites

I rewrote it abit to this

while (pBotWorldSession->_recvQueue.next(packet) == true) // empty()))
{
   //WorldPacket* const packet = pBotWorldSession->_recvQueue.next(*packet);
   WorldPacket* const packet2 = packet;
   OpcodeHandler& opHandle = opcodeTable[packet2->GetOpcode()];
   (pBotWorldSession->*opHandle.handler)(*packet2);
    delete packet2;
}

Link to comment
Share on other sites

Anyone else getting this when they try to do a pull into the latest version of mangos repo?

$ git pull git://github.com/playerbot/mangos.git master

remote: Counting objects: 1131, done.

remote: Compressing objects: 100% (341/341), done.

emote: Total 979 (delta 802), reused 787 (delta 638)Receiving obj

/979), 316.00 KiB | 117 KiB/s

Receiving objects: 100% (979/979), 340.75 KiB | 117 KiB/s, done.

Resolving deltas: 100% (802/802), completed with 47 local objects

From git://github.com/playerbot/mangos

* branch master -> FETCH_HEAD

Auto-merging src/game/CharacterHandler.cpp

Auto-merging src/game/Chat.cpp

Auto-merging src/game/Chat.h

Auto-merging src/game/ChatHandler.cpp

CONFLICT (content): Merge conflict in src/game/ChatHandler.cpp

Auto-merging src/game/Creature.cpp

Auto-merging src/game/Creature.h

Auto-merging src/game/Group.cpp

Auto-merging src/game/Player.cpp

Auto-merging src/game/Player.h

Auto-merging src/game/WorldSession.cpp

Auto-merging src/mangosd/mangosd.conf.dist.in

Automatic merge failed; fix conflicts and then commit the result.

how can I resolve this?

Link to comment
Share on other sites

for chathandler conflict i resolved it manually, here is my diff

--------------------------- src/game/ChatHandler.cpp ---------------------------

index f6bd8db..b202b5e 100644

@@ -37,4 +37,6 @@

#include "GridNotifiersImpl.h"

#include "CellImpl.h"

+// Playerbot mod

+#include "PlayerbotAI.h"

bool WorldSession::ProcessChatmessageFurtherAfterSecurityChecks(std::string& msg, uint32 lang)

@@ -231,4 +233,13 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )

}

+ // Playerbot mod: handle whispered command to bot

+ if (player->GetPlayerbotAI())

+ {

+ player->GetPlayerbotAI()->HandleCommand(msg, *GetPlayer());

+ GetPlayer()->m_speakTime = 0;

+ GetPlayer()->m_speakCount = 0;

+ }

+ else

+ // END Playerbot mod

GetPlayer()->Whisper(msg, lang,player->GetGUID());

} break;

@@ -257,4 +268,17 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )

return;

+ // Playerbot mod: broadcast message to bot members

+ for(GroupReference* itr = group->GetFirstMember(); itr != NULL; itr=itr->next())

+ {

+ Player* player = itr->getSource();

+ if (player && player->GetPlayerbotAI())

+ {

+ player->GetPlayerbotAI()->HandleCommand(msg, *GetPlayer());

+ GetPlayer()->m_speakTime = 0;

+ GetPlayer()->m_speakCount = 0;

+ }

+ }

+ // END Playerbot mod

+

WorldPacket data;

ChatHandler::FillMessageData(&data, this, CHAT_MSG_PARTY, lang, NULL, 0, msg.c_str(),NULL);

edit: sorry i pasted wrong portion of diff... I've not experienced problems with bot quest turn in on my build

Link to comment
Share on other sites

The current issue arises in the Chathandler.cpp not Characterhandler.cpp, I am not having any issues with that file, just the ChatHandler.cpp, I can manually edit the file to include the code from playerbot pull, but then I cant add more patches via get pull, (probably just my lack of knowing git). I have noticed that since I have had to start adding the code manualy, my bots do not accept or turn in quests that are available to them. My main concern is that I may not be putting the code in properly or something, because turning and picking up quests worked fine for me before this unless the bot had to choose an award, that has never worked for me since I had started adding this patch to my server.

Link to comment
Share on other sites

Taking the suggestions here and glancing over the files, I was able to fix mine so it compiled and worked. For those of you who do not know how to fix this, here are the real simple steps.

Open you source folder for your mangos files (The one you download and patch to before compiling)

Go into your src folder

go into your game folder

Look for the file called worldsession.cpp

Open it up with your editor. Now all you have to do is scroll through and find the following line:

while (! pBotWorldSession->_recvQueue.empty())

Make sure it reads as follows:

while (pBotWorldSession->_recvQueue.next(packet) == true) // empty()))
{
   //WorldPacket* const packet = pBotWorldSession->_recvQueue.next(*packet);
   WorldPacket* const packet2 = packet;
   OpcodeHandler& opHandle = opcodeTable[packet2->GetOpcode()];
   (pBotWorldSession->*opHandle.handler)(*packet2);
    delete packet2;
}

Save the file after the changes and in the same folder find the file called ChatHandler.cpp

This fix is easy. Scroll down until you find the following line:

// Playerbot mod
#include PlayerbotAI.h

Select it and cut it out of the program... then scroll up and paste it with the other headers at the top. The bottom of the headers line works, and I even kept the //Playerbot mod comment for future reference.

I compiled fine and tested it. Everything works except I have had to manually share quests in the quest log and they do not turn them in themselves for some reason. So this is a temp fix and the quick and dirty version. Hope the actual fix comes out soon :)

Link to comment
Share on other sites

@ djericphillips, that worked perfect thank you! this coming weekend I will dig around to see if i cant figure out why they wont take quests. I am assuming it has something to do with the packet sent to the client when they take and turn in quests. This is a great mod and has help me and the few players on my server play when no one else is around!! Keep up the great work!

Link to comment
Share on other sites

By any chance do you still get any compile errors when compiling with the changes? I get like 3 failed

I received no compile errors on mine. I am using the latest version of Mangos with the Auction House Bot and Player Bot patches. Which errors are you getting?

*UPDATE ok I see where I messed up on posting.... must not of had much sleep that day. I updated my post above. In the worldsession.cpp file you need to find and replace this section:

                while (! pBotWorldSession->_recvQueue.empty())
               {
                   WorldPacket* const packet = pBotWorldSession->_recvQueue.next();
                   OpcodeHandler& opHandle = opcodeTable[packet->GetOpcode()];
                   (pBotWorldSession->*opHandle.handler)(*packet);
                   delete packet;
               }

with the following:

                 while (pBotWorldSession->_recvQueue.next(packet) == true) // empty()))
                {
                  //WorldPacket* const packet = pBotWorldSession->_recvQueue.next(*packet);
                  WorldPacket* const packet2 = packet;
                  OpcodeHandler& opHandle = opcodeTable[packet2->GetOpcode()];
                  (pBotWorldSession->*opHandle.handler)(*packet2);
                  delete packet2;
                  }

And that should fix your 3 errors while compiling. Like I said, I updated the post above.

Link to comment
Share on other sites

while (pBotWorldSession->_recvQueue.next(packet) == true) // empty()))

{

//WorldPacket* const packet = pBotWorldSession->_recvQueue.next(*packet);

WorldPacket* const packet2 = packet;

OpcodeHandler& opHandle = opcodeTable[packet2->GetOpcode()];

(pBotWorldSession->*opHandle.handler)(*packet2);

delete packet2;

}

this code ,use .bot add $botname,mangos crash!

Link to comment
Share on other sites

Guest
This topic is now 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