Jump to content

Playerbot (archive)


Recommended Posts

  • Replies 1.8k
  • Created
  • Last Reply

Top Posters In This Topic

hey blueboy,any news of the "detection thing"??

Hi,

You tell me?

I provided the survey patch in post #890 ,a couple of days ago. It is only a prototype, so I have no intention of integrating it into the playerbot code yet. It needs testing and refining!. I have provided a find command that works with the survey command, to detect things.

Hope this helps

Link to comment
Share on other sites

Hi Bramm,

So you commented out the two typedefs in PlayerbotAI.cpp, and your still getting the access violation :confused: Hmmm I'll have another look at the code, once I've had some sleep. I've been up all night removing trailing whitespaces form the code.

Thanks for the feedback

O.K I've had some sleep :cool: I need some more info from you. I cannot reproduce your issue on my linux box.

How is the crash triggered? // As soon as the bots logon and try to apply AURAS (i.e spells), or after some specific event.

@Everyone If this issue is also happening to you, let me know

Please get back to me

Link to comment
Share on other sites

an example of the problem

Revision: * * 9573 09969c4c6d0a68ca429d61effd1abc365d02451d

Date 12:3:2010. Time 20:6

//=====================================================

*** Hardware ***

Processor: Intel® Core i7 CPU 920 @ 2.67GHz

Number Of Processors: 8

Physical Memory: 12573784 KB (Available: 3517952 KB)

Commit Charge Limit: 25145672 KB

*** Operation System ***

Windows Vista or Windows Server 2008 Server 4.0, Enterprise Edition (Version 6.1, Build 7600)

//=====================================================

Exception code: C0000005 ACCESS_VIOLATION

Fault address: 00000001404E223D 01:00000000004E123D C:\\users_sys\\games\\WoW\\Mangos\\server\\mangosd.exe

Registers:

RAX:0000000000000000

RBX:0000000006BA8CF0

RCX:000007FFE9A3A780

RDX:000000000000C54F

RSI:000007FFE9A98E00

RDI:0000000140306B50

R8: 000007FFE99A4000

R9: 8000000000000000

R10:000000000D7E5AD8

R11:0000000000000000

R12:0000000000000000

R13:0000000000000000

R14:0000000000000000

R15:000000000D7E7750

CS:RIP:0033:00000001404E223D

SS:RSP:002B:000000000D7E7D10 RBP:00000000

DS:002B ES:002B FS:0053 GS:002B

Flags:00010202

Call stack:

Address Frame Function SourceFile

00000001404E223D 000000000D7E7D90 PlayerbotAI::HasAura+1D c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 866

00000001404E7A78 000000000D7E7E90 PlayerbotAI::CastSpell+208 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 2126

00000001404E7808 000000000D7E8F20 PlayerbotAI::CastSpell+B8 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 2080

0000000140654274 000000000D7F0170 PlayerbotWarlockAI::DoNextCombatManeuver+574 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotwarlockai.cpp line 127

00000001404E3C12 000000000D7F0200 PlayerbotAI::DoNextCombatManeuver+282 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 1320

00000001404E732D 000000000D7F23D0 PlayerbotAI::UpdateAI+77D c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 2008

000000014015AFF3 000000000D7FF7D0 Player::Update+11F3 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\player.cpp line 1406

000000014012684E 000000000D7FFB60 Map::Update+19E c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\map.cpp line 593

000000014036692F 000000000D7FFC50 MapManager::Update+19F c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\mapmanager.cpp line 266

00000001402E0CE3 000000000D7FFE00 World::Update+733 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\world.cpp line 1414

000000014006ABB5 000000000D7FFE40 WorldRunnable::run+A5 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\mangosd\\worldrunnable.cpp line 61

0000000140306B73 000000000D7FFEB0 ACE_Based::Thread::ThreadTask+23 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\threading.cpp line 190

000007FEF3C6170B 000000000D7FFEF0 ?invoke@ACE_OS_Thread_Adapter@@UEAAKXZ+5B

00000000741F2FDF 000000000D7FFF20 _endthreadex+47

00000000741F3080 000000000D7FFF50 _endthreadex+E8

0000000076D3F56D 000000000D7FFF80 BaseThreadInitThunk+D

0000000076E73281 000000000D7FFFD0 RtlUserThreadStart+21

Call stack:

Address Frame Function SourceFile

0000000076E8FEFA 000000000042F990 NtWaitForSingleObject+A

000007FEFD0C10AC 000000000042FA30 WaitForSingleObjectEx+9C

000007FEF3C0B64A 000000000042FA60 ?__ace_assert@@YAXPEBDH0@Z+38A

000007FEF3C8E8E3 000000000042FAE0 ?wait_task@ACE_Thread_Manager@@QEAAHPEAVACE_Task_Base@@@Z+243

00000001403085D3 000000000042FB20 WorldSocketMgr::Wait+63 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\worldsocketmgr.cpp line 313

000000014003A158 000000000042FEE0 Master::Run+9B8 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\mangosd\\master.cpp line 325

0000000140038B9D 000000000042FF20 main+42D c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\mangosd\\main.cpp line 180

000000014006B692 000000000042FF50 __tmainCRTStartup+11A f:\\dd\\vctools\\crt_bld\\self_64_amd64\\crt\\src\\crtexe.c line 582

0000000076D3F56D 000000000042FF80 BaseThreadInitThunk+D

0000000076E73281 000000000042FFD0 RtlUserThreadStart+21

Call stack:

Address Frame Function SourceFile

0000000076E9046A 00000000032FFCB0 ZwWaitForMultipleObjects+A

0000000076E59BD7 00000000032FFF50 EtwTraceMessageVa+E07

0000000076D3F56D 00000000032FFF80 BaseThreadInitThunk+D

0000000076E73281 00000000032FFFD0 RtlUserThreadStart+21

Call stack:

Address Frame Function SourceFile

0000000076E901FA 00000000036FFC60 NtDelayExecution+A

000007FEFD0C1203 00000000036FFD00 SleepEx+B3

0000000140306DD9 00000000036FFD50 ACE_Based::Thread::Sleep+39 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\threading.cpp line 238

00000001405E72CF 00000000036FFE40 SqlDelayThread::run+6F c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\database\\sqldelaythread.cpp line 45

0000000140306B73 00000000036FFEB0 ACE_Based::Thread::ThreadTask+23 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\threading.cpp line 190

000007FEF3C6170B 00000000036FFEF0 ?invoke@ACE_OS_Thread_Adapter@@UEAAKXZ+5B

00000000741F2FDF 00000000036FFF20 _endthreadex+47

00000000741F3080 00000000036FFF50 _endthreadex+E8

0000000076D3F56D 00000000036FFF80 BaseThreadInitThunk+D

0000000076E73281 00000000036FFFD0 RtlUserThreadStart+21

Call stack:

Address Frame Function SourceFile

0000000076E901FA 0000000003AFFC60 NtDelayExecution+A

000007FEFD0C1203 0000000003AFFD00 SleepEx+B3

0000000140306DD9 0000000003AFFD50 ACE_Based::Thread::Sleep+39 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\threading.cpp line 238

00000001405E72CF 0000000003AFFE40 SqlDelayThread::run+6F c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\database\\sqldelaythread.cpp line 45

0000000140306B73 0000000003AFFEB0 ACE_Based::Thread::ThreadTask+23 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\threading.cpp line 190

000007FEF3C6170B 0000000003AFFEF0 ?invoke@ACE_OS_Thread_Adapter@@UEAAKXZ+5B

00000000741F2FDF 0000000003AFFF20 _endthreadex+47

00000000741F3080 0000000003AFFF50 _endthreadex+E8

0000000076D3F56D 0000000003AFFF80 BaseThreadInitThunk+D

0000000076E73281 0000000003AFFFD0 RtlUserThreadStart+21

Call stack:

Address Frame Function SourceFile

0000000076E901FA 0000000003EFFC60 NtDelayExecution+A

000007FEFD0C1203 0000000003EFFD00 SleepEx+B3

0000000140306DD9 0000000003EFFD50 ACE_Based::Thread::Sleep+39 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\threading.cpp line 238

00000001405E72CF 0000000003EFFE40 SqlDelayThread::run+6F c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\database\\sqldelaythread.cpp line 45

0000000140306B73 0000000003EFFEB0 ACE_Based::Thread::ThreadTask+23 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\threading.cpp line 190

000007FEF3C6170B 0000000003EFFEF0 ?invoke@ACE_OS_Thread_Adapter@@UEAAKXZ+5B

00000000741F2FDF 0000000003EFFF20 _endthreadex+47

00000000741F3080 0000000003EFFF50 _endthreadex+E8

0000000076D3F56D 0000000003EFFF80 BaseThreadInitThunk+D

0000000076E73281 0000000003EFFFD0 RtlUserThreadStart+21

Call stack:

Address Frame Function SourceFile

0000000076E90B8A 000000000D7E5620 ZwGetContextThread+A

0000000076D244FA 000000000D7E5650 GetThreadContext+A

0000000140069459 000000000D7E5B90 WheatyExceptionReport::PrintTracesForAllThreads+C9 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\wheatyexceptionreport.cpp line 370

0000000140069826 000000000D7E6C00 WheatyExceptionReport::GenerateExceptionReport+396 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\wheatyexceptionreport.cpp line 468

0000000140068ABA 000000000D7E6EB0 WheatyExceptionReport::WheatyUnhandledExceptionFilter+18A c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\wheatyexceptionreport.cpp line 109

0000000076DB9380 000000000D7E6F90 UnhandledExceptionFilter+160

0000000076ED573C 000000000D7E6FC0 MD5Final+1DEC

0000000076E55148 000000000D7E7030 __C_specific_handler+9C

0000000076E7554D 000000000D7E7060 RtlCompareUnicodeString+7D

0000000076E55D1C 000000000D7E7740 RtlTimeToSecondsSince1970+62C

0000000076E8FE48 000000000D7E7D00 KiUserExceptionDispatcher+2E

00000001404E223D 000000000D7E7D90 PlayerbotAI::HasAura+1D c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 866

00000001404E7A78 000000000D7E7E90 PlayerbotAI::CastSpell+208 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 2126

00000001404E7808 000000000D7E8F20 PlayerbotAI::CastSpell+B8 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 2080

0000000140654274 000000000D7F0170 PlayerbotWarlockAI::DoNextCombatManeuver+574 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotwarlockai.cpp line 127

00000001404E3C12 000000000D7F0200 PlayerbotAI::DoNextCombatManeuver+282 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 1320

00000001404E732D 000000000D7F23D0 PlayerbotAI::UpdateAI+77D c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 2008

000000014015AFF3 000000000D7FF7D0 Player::Update+11F3 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\player.cpp line 1406

000000014012684E 000000000D7FFB60 Map::Update+19E c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\map.cpp line 593

000000014036692F 000000000D7FFC50 MapManager::Update+19F c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\mapmanager.cpp line 266

00000001402E0CE3 000000000D7FFE00 World::Update+733 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\world.cpp line 1414

000000014006ABB5 000000000D7FFE40 WorldRunnable::run+A5 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\mangosd\\worldrunnable.cpp line 61

0000000140306B73 000000000D7FFEB0 ACE_Based::Thread::ThreadTask+23 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\threading.cpp line 190

000007FEF3C6170B 000000000D7FFEF0 ?invoke@ACE_OS_Thread_Adapter@@UEAAKXZ+5B

00000000741F2FDF 000000000D7FFF20 _endthreadex+47

00000000741F3080 000000000D7FFF50 _endthreadex+E8

0000000076D3F56D 000000000D7FFF80 BaseThreadInitThunk+D

0000000076E73281 000000000D7FFFD0 RtlUserThreadStart+21

Call stack:

Address Frame Function SourceFile

0000000076E900DA 000000000DBFF7C0 ZwRequestWaitReplyPort+A

0000000076D42B08 000000000DBFF7F0 GetConsoleMode+F8

0000000076D75601 000000000DBFF940 VerifyConsoleIoHandle+281

0000000076D8A922 000000000DBFFA20 ReadConsoleA+B2

0000000076D59934 000000000DBFFA60 GetEnvironmentStringsA+5AB8

000000007423DC36 000000000DBFFB00 realloc+72A

000000007423E29D 000000000DBFFB60 _read+10D

00000000741FE7E3 000000000DBFFBA0 _filbuf+8F

00000000741FDC6C 000000000DBFFC10 fgets+198

0000000140013F79 000000000DBFFE40 CliRunnable::run+B9 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\mangosd\\clirunnable.cpp line 327

0000000140306B73 000000000DBFFEB0 ACE_Based::Thread::ThreadTask+23 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\shared\\threading.cpp line 190

000007FEF3C6170B 000000000DBFFEF0 ?invoke@ACE_OS_Thread_Adapter@@UEAAKXZ+5B

00000000741F2FDF 000000000DBFFF20 _endthreadex+47

00000000741F3080 000000000DBFFF50 _endthreadex+E8

0000000076D3F56D 000000000DBFFF80 BaseThreadInitThunk+D

0000000076E73281 000000000DBFFFD0 RtlUserThreadStart+21

Call stack:

Address Frame Function SourceFile

0000000076E8FEFA 000000000E1AF880 NtWaitForSingleObject+A

000007FEFC5D3978 000000000E1AF900 0001:0000000000002978 C:\\Windows\\system32\\MSWSOCK.dll

000007FEFC5E06B6 000000000E1AFAA0 WSPStartup+7CD6

000007FEFD7572BC 000000000E1AFAE0 select+15C

000007FEFD75723D 000000000E1AFBE0 select+DD

000007FEF3C18252 000000000E1AFC60 ?wait_for_multiple_events@?$ACE_Select_Reactor_T@V?$ACE_Reactor_Token_T@VACE_Token@@@@@@MEAAHAEAVACE_Select_Reactor_Handle_Set@@PEAVACE_Time_Value@@@Z+132

000007FEF3C90DC0 000000000E1AFCD0 ?handle_events@ACE_TP_Reactor@@UEAAHPEAVACE_Time_Value@@@Z+A0

000007FEF3C6E55D 000000000E1AFD00 ?run_reactor_event_loop@ACE_Reactor@@QEAAHAEAVACE_Time_Value@@P6AHPEAV1@@Z@Z+4D

0000000140307F37 000000000E1AFE40 ReactorRunnable::svc+77 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\worldsocketmgr.cpp line 167

000007FEF3C8A171 000000000E1AFE70 ?svc_run@ACE_Task_Base@@SAKPEAX@Z+41

000007FEF3C8A72B 000000000E1AFEB0 ?invoke_i@ACE_Thread_Adapter@@EEAAKXZ+4B

000007FEF3C8A851 000000000E1AFEF0 ?invoke@ACE_Thread_Adapter@@UEAAKXZ+71

00000000741F2FDF 000000000E1AFF20 _endthreadex+47

00000000741F3080 000000000E1AFF50 _endthreadex+E8

0000000076D3F56D 000000000E1AFF80 BaseThreadInitThunk+D

0000000076E73281 000000000E1AFFD0 RtlUserThreadStart+21

Call stack:

Address Frame Function SourceFile

0000000076E8FEFA 000000000E5AF880 NtWaitForSingleObject+A

000007FEFC5D3978 000000000E5AF900 0001:0000000000002978 C:\\Windows\\system32\\MSWSOCK.dll

000007FEFC5E06B6 000000000E5AFAA0 WSPStartup+7CD6

000007FEFD7572BC 000000000E5AFAE0 select+15C

000007FEFD75723D 000000000E5AFBE0 select+DD

000007FEF3C18252 000000000E5AFC60 ?wait_for_multiple_events@?$ACE_Select_Reactor_T@V?$ACE_Reactor_Token_T@VACE_Token@@@@@@MEAAHAEAVACE_Select_Reactor_Handle_Set@@PEAVACE_Time_Value@@@Z+132

000007FEF3C90DC0 000000000E5AFCD0 ?handle_events@ACE_TP_Reactor@@UEAAHPEAVACE_Time_Value@@@Z+A0

000007FEF3C6E55D 000000000E5AFD00 ?run_reactor_event_loop@ACE_Reactor@@QEAAHAEAVACE_Time_Value@@P6AHPEAV1@@Z@Z+4D

0000000140307F37 000000000E5AFE40 ReactorRunnable::svc+77 c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\worldsocketmgr.cpp line 167

000007FEF3C8A171 000000000E5AFE70 ?svc_run@ACE_Task_Base@@SAKPEAX@Z+41

000007FEF3C8A72B 000000000E5AFEB0 ?invoke_i@ACE_Thread_Adapter@@EEAAKXZ+4B

000007FEF3C8A851 000000000E5AFEF0 ?invoke@ACE_Thread_Adapter@@UEAAKXZ+71

00000000741F2FDF 000000000E5AFF20 _endthreadex+47

00000000741F3080 000000000E5AFF50 _endthreadex+E8

0000000076D3F56D 000000000E5AFF80 BaseThreadInitThunk+D

0000000076E73281 000000000E5AFFD0 RtlUserThreadStart+21

========================

Local Variables And Parameters

Call stack:

Address Frame Function SourceFile

00000001404E223D 000000000D7E7D90 PlayerbotAI::HasAura+1D c:\\users_sys\\games\\wow\\mangos\\git\\ahbot3\\src\\game\\playerbotai.cpp line 866

Link to comment
Share on other sites

Hi mrelfire,

No more crash dumps please, they're not telling me much. We have already determined that the crash occurs as the AuraMap is accessed to determine available spells (@ line 866 HasAura function in PlayerbotAI.cpp). The question is why is it crashing on your systems, and not on mine. Your both using Windows, but I also need know what else your running (i.e mods, multiple realms, etc..). Also, does your system crash immediately, or is it triggered by some event like combat for instance.

You could try, placing a flag in the function HasAura, and observe on the server whether the function works at all.

//typedef std::Pair<uint32, uint8> spellEffectPair;
//typedef std::multimap<spellEffectPair, Aura*> AuraMap;

bool PlayerbotAI::HasAura(uint32 spellId, const Unit& player) const
{
   for (Unit::AuraMap::const_iterator iter = player.GetAuras().begin(); iter != player.GetAuras().end(); ++iter)
   {
       sLog.outDebug("PlayerbotAI::HasAura"); // Flag to monitor use
   if (iter->second->GetId() == spellId)
           return true;
   }
   return false;
}

I have tried this and it cycles through all available spells for each bot, without issue. Please try this and let me know how you get on.

Cheers

Link to comment
Share on other sites

Looks like MaNGOS commit [9575] broke playerbot. I'm guessing it has to the with the changes in ObjectAccessor...

../../../src/game/PlayerbotAI.cpp: In member function ‘void PlayerbotAI::HandleCommand(const std::string&, Player&)’:
../../../src/game/PlayerbotAI.cpp:2816: error: ‘GetObjectByTypeMask’ is not a member of ‘ObjectAccessor’

skinlayers

UPDATE: I tried editing line 2816 myself and changing the code based on the pattern of changes in commit 9575. Unforutnately, that didn't work. I think its time I look into going back to school to study C/C++.

Link to comment
Share on other sites

Good evening Blueboy, I'm not running any other patches or mods in the setup. From what I've seen, the crashes have occurred after spawning and grouping the bots and performing some amount of combat. I can't really pinpoint it to using an instance yet although this was the fact for one of the more recent occurences. I just updated to the a more current Revision 9573 and merged the updated blueboy thread and haven't seen anything yet. If I do, I will go add the monitor flag per your suggestion in #914 and report in w/ findings.

Thanks,

Bramm

Link to comment
Share on other sites

Hi mrelfire,

No more crash dumps please, they're not telling me much. We have already determined that the crash occurs as the AuraMap is accessed to determine available spells (@ line 866 HasAura function in PlayerbotAI.cpp). The question is why is it crashing on your systems, and not on mine. Your both using Windows, but I also need know what else your running (i.e mods, multiple realms, etc..). Also, does your system crash immediately, or is it triggered by some event like combat for instance.

You could try, placing a flag in the function HasAura, and observe on the server whether the function works at all.

I have tried this and it cycles through all available spells for each bot, without issue. Please try this and let me know how you get on.

Cheers

oups: crashdump => I thought it was usefull

ok no problems

Link to comment
Share on other sites

Looks like MaNGOS commit [9575] broke playerbot. I'm guessing it has to the with the changes in ObjectAccessor...

../../../src/game/PlayerbotAI.cpp: In member function ‘void PlayerbotAI::HandleCommand(const std::string&, Player&)’:
../../../src/game/PlayerbotAI.cpp:2816: error: ‘GetObjectByTypeMask’ is not a member of ‘ObjectAccessor’

skinlayers

UPDATE: I tried editing line 2816 myself and changing the code based on the pattern of changes in commit 9575. Unforutnately, that didn't work. I think its time I look into going back to school to study C/C++.

Hi,

Thanks for the info. Yes your right the changes to ObjectAccessor had broken the playerbot patch. They have modified the function GetObjectByTypeMask and shifted it from the ObjectAccessor class to Player class. As such, the function needs to be addressed differently. Changes were also made with the parameters passed.

                uint32 itemId = itemIds.front();
               bool wasRewarded = false;
               uint64 questRewarderGUID = m_bot->GetSelection();
-               Object* const pNpc = ObjectAccessor::GetObjectByTypeMask(*m_bot, questRewarderGUID, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
+               Object* const pNpc = (WorldObject*) m_bot->GetObjectByTypeMask(questRewarderGUID, TYPEMASK_CREATURE_OR_GAMEOBJECT);
               if (!pNpc)0                     return;

I have updated the code on blueboy to be compatible with MaNGOS[9578]

Hope this helps

Link to comment
Share on other sites

Hi Guys

Before you report that MaNGOS[9579] does not work with playerbot, I thought I would get in first. If your getting;

CXX ArenaTeamHandler.o

In file included from ../../../src/game/ArenaTeamHandler.cpp:19:

../../../src/game/WorldSession.h:258: error: ObjectGuid has not been declared

make[3]: *** [ArenaTeamHandler.o] Error 1

make[3]: Leaving directory `/home/mangos/compile/mangos1/objdir/src/game'

make[2]: *** [all-recursive] Error 1

make[2]: Leaving directory `/home/mangos/compile/mangos1/objdir/src'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/home/mangos/compile/mangos1/objdir'

make: *** [all] Error 2

Then you need to add

#include "ObjectGuid.h"

to WorldSession.h, and it should be happy:D

Hope this helps

Link to comment
Share on other sites

thanks for the head up

a question : does the "detection" prototype work with the new rev?

Hi,

Yes it seems to work. I have refined both survey and find commands in a revised patch. The survey command now limits the number of link strings displayed. I found that in some places there were too many objects found, to display properly. I thought it would be a good idea to only display the first 12 found. You can obviously change this to whatever you want. I also found that the bot(s) will literally travel to the objects location. So if the object is a 'sign', eight foot off the ground, the bot will hover there. I have now adjusted find so the bot(s) height will always be at ground level, so the bot now stands below the 'sign' at the objects location.

Revised survey/find patch

diff --git a/src/game/PlayerbotAI.cpp b/src/game/PlayerbotAI.cpp
index 12533fb..28d48c9 100644
--- a/src/game/PlayerbotAI.cpp
+++ b/src/game/PlayerbotAI.cpp
@@ -2229,6 +2229,75 @@ void PlayerbotAI::extractItemIds(const std::string& text, std::list<uint32>& ite
    }
}

+bool PlayerbotAI::extractGOinfo(const std::string& text, uint32 &guid, uint32 &entry, int &mapid, float &x, float &y, float &z) const
+{
+
+     //    Link format
+     //    |cFFFFFF00|Hfound:" << guid << ':'  << entry << ':' << x << ':' << y << ':' << z  << ':' << mapid << ':' <<  "|h[" << gInfo->name << "]|h|r";
+     //    |cFFFFFF00|Hfound:5093:1731:-9295:-270:81.874:0:|h[Copper Vein]|h|r
+
+    uint8 pos = 0;
+
+        // extract GO guid
+        int i = text.find("Hfound:", pos); // base H = 11
+        if (i == -1) // break if error
+            return false;
+
+        pos = i + 7; //start of window in text 11 + 7 = 18
+        int endPos = text.find(':', pos); // end of window in text 22
+        if (endPos == -1) //break if error
+            return false;
+        std::string guidC = text.substr(pos, endPos - pos); // get string within window i.e guid 22 - 18 =  4
+        guid = atol(guidC.c_str()); // convert ascii to long int
+
+        // extract GO entry
+        pos = endPos + 1;
+        endPos = text.find(':', pos); // end of window in text
+        if (endPos == -1) //break if error
+            return false;
+
+        std::string entryC = text.substr(pos, endPos - pos); // get string within window i.e entry
+        entry = atol(entryC.c_str()); // convert ascii to float
+
+        // extract GO x
+        pos = endPos + 1;
+        endPos = text.find(':', pos); // end of window in text
+        if (endPos == -1) //break if error
+            return false;
+
+        std::string xC = text.substr(pos, endPos - pos); // get string within window i.e x
+        x = atof(xC.c_str()); // convert ascii to float
+
+        // extract GO y
+        pos = endPos + 1;
+        endPos = text.find(':', pos); // end of window in text
+        if (endPos == -1) //break if error
+            return false;
+
+        std::string yC = text.substr(pos, endPos - pos); // get string within window i.e y
+        y = atof(yC.c_str()); // convert ascii to float
+
+        // extract GO z
+        pos = endPos + 1;
+        endPos = text.find(':', pos); // end of window in text
+        if (endPos == -1) //break if error
+            return false;
+
+        std::string zC = text.substr(pos, endPos - pos); // get string within window i.e z
+        z = atof(zC.c_str()); // convert ascii to float
+
+        //extract GO mapid
+        pos = endPos + 1;
+        endPos = text.find(':', pos); // end of window in text
+        if (endPos == -1) //break if error
+            return false;
+
+        std::string mapidC = text.substr(pos, endPos - pos); // get string within window i.e mapid
+        mapid = atoi(mapidC.c_str()); // convert ascii to int
+        pos = endPos; // end
+        return true;
+}
+
// extracts currency in #g#s#c format
uint32 PlayerbotAI::extractMoney(const std::string& text) const
{
@@ -2676,6 +2745,23 @@ void PlayerbotAI::HandleCommand(const std::string& text, Player& fromPlayer)
            EquipItem(**it);
    }

+    // find item in world
+     else if (text.size() > 2 && text.substr(0, 2) == "f " || text.size() > 5 && text.substr(0, 5) == "find ")
+    {
+        uint32 guid;
+        float x,y,z;
+        uint32 entry;
+        int mapid;
+        if(extractGOinfo(text, guid, entry, mapid, x, y, z))
+        {      // sLog.outDebug("find: guid : %u entry : %u x : (%f) y : (%f) z : (%f) mapid : %d",guid, entry, x, y, z, mapid);
+               m_bot->UpdateGroundPositionZ(x,y,z);
+               SetMovementOrder( MOVEMENT_STAY );
+               m_bot->GetMotionMaster()->MovePoint( mapid, x, y, z );
+        }
+        else
+               SendWhisper("I have no info on that object", fromPlayer);
+     }
+
    else if (text == "quests")
    {
               bool hasIncompleteQuests = false;
@@ -2803,7 +2889,45 @@ void PlayerbotAI::HandleCommand(const std::string& text, Player& fromPlayer)
         ch.SendSysMessage(out.str().c_str());
    }

+    // Survey project: 09:50 09/03/10
+    else if (text == "survey")
+    {
+      float distance = 100.0f;
+      uint32 count = 0;
+      std::ostringstream detectout;
+
+      QueryResult *result = WorldDatabase.PQuery("SELECT guid, id, position_x, position_y, position_z, map, "
+        "(POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ "
+        "FROM gameobject WHERE map='%u' AND (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) <= '%f' ORDER BY order_",
+         m_bot->GetPositionX(), m_bot->GetPositionY(), m_bot->GetPositionZ(),
+         m_bot->GetMapId(), m_bot->GetPositionX(), m_bot->GetPositionY(), m_bot->GetPositionZ(), distance*distance);

+      if (result)
+      {
+         do
+         {
+             Field *fields = result->Fetch();
+             uint32 guid = fields[0].GetUInt32();
+             uint32 entry = fields[1].GetUInt32();
+             float x = fields[2].GetFloat();
+             float y = fields[3].GetFloat();
+             float z = fields[4].GetFloat();
+             int mapid = fields[5].GetUInt16();
+
+             GameObjectInfo const * gInfo = ObjectMgr::GetGameObjectInfo(entry);
+
+             if(!gInfo)
+                 continue;
+
+             if(count < 12) // count, limits number of links
+                  detectout << "|cFFFFFF00|Hfound:" << guid << ":" << entry << ":" << x << ":" << y << ":" << z  << ":" << mapid  << ":" <<  "|h[" << gInfo->name << "]|h|r";
+             ++count;
+         } while (result->NextRow());
+
+         delete result;
+      }
+      SendWhisper(detectout.str().c_str(), fromPlayer);
+    }
    else
    {
        // if this looks like an item link, reward item it completed quest and talking to NPC
diff --git a/src/game/PlayerbotAI.h b/src/game/PlayerbotAI.h
index 377dfaa..02d829c 100644
--- a/src/game/PlayerbotAI.h
+++ b/src/game/PlayerbotAI.h
@@ -126,6 +126,9 @@ class MANGOS_DLL_SPEC PlayerbotAI
        // extracts item ids from links
        void extractItemIds(const std::string& text, std::list<uint32>& itemIds) const;

+        // extracts gameobject info from link
+        bool extractGOinfo(const std::string& text, uint32 &guid,  uint32 &entry, int &mapid, float &x, float &y, float &z) const;
+
        // extracts currency from a string as #g#s#c and returns the total in copper
        uint32 extractMoney(const std::string& text) const;

Hope you like it

Link to comment
Share on other sites

P.S I have revised the gethash script in #394, and this will automatically get the HASH from the MaNGOS commit history.

#!/bin/bash
[ -f "hash.txt" ] && rm hash.txt
git log --pretty=oneline > commit.txt
{
while read line
do
   echo $line > line.txt
   index=0
   while read -r -n1 char;    do
      MYARRAY[$index]=$char
      let "index++"
       done < line.txt

   ELEMENTS=${#MYARRAY[@]}

   i=0;t=1;n=2
   while [ $n -lt $ELEMENTS ]
   do
       [ "${MYARRAY[$t]}" == "[" ] && [ "${MYARRAY[$n]}" == "9" ] && exit
       echo -n "${MYARRAY[$i]}" >> hash.txt
       let "i++";let "t++";let "n++"
   done
       rm hash.txt
done
} < commit.txt

It looks for the pattern '[9' which is used on the MaNGOS branch, for versioning. I realise this might be different on Evo-X. I will check future commits for whitespaces, but try it without the 'whitespace=fix'.

Cheers

Any reason I can't reduce this down to:

#!/bin/bash
[ -f "hash.txt" ] && rm hash.txt
git log --pretty=oneline | grep -m 1 '\\[1[0-9]\\{4\\}]' | cut -d " " -f 1 > hash.txt

skinlayers

Link to comment
Share on other sites

Any reason I can't reduce this down to:

#!/bin/bash
[ -f "hash.txt" ] && rm hash.txt
git log --pretty=oneline | grep -m 1 '\\[9[0-9]\\{3\\}]' | cut -d " " -f 1 > hash.txt

skinlayers

Yes,

I was using the gethash.sh script to obtain the HASH from the commit History of two different repos. First the MaNGOS repo with version format [9XXX]. The http://github.com/Tasssadar/Valhalla-Project also uses square brackets to version the commits, in this format '[prXXX]'. So I needed a script that would filter out '[prXXX]' and search for a pattern, that contains two characters (i.e '[9'). If you can get your script to do this, that would be great. I will certainly give it go, thanks

Cheers

Link to comment
Share on other sites

Yes,

I was using the gethash.sh script to obtain the HASH from the commit History of two different repos. First the MaNGOS repo with version format [9XXX]. The http://github.com/Tasssadar/Valhalla-Project also uses square brackets to version the commits, in this format '[prXXX]'. So I needed a script that would filter out '[prXXX]' and search for a pattern, that contains two characters (i.e '[9'). If you can get your script to do this, that would be great. I will certainly give it go, thanks

Cheers

The '\\[1[0-9]\\{4\\}]' string is a regular expression that tells grep to search for [1XXXX] where X=0-9. However, I've done one better and integrated both pbot.sh and gethash.sh into on simplified script:

#!/bin/bash -x
git clone git://github.com/mangos/mangos.git playerbot
cd playerbot
git fetch git://github.com/blueboy/mangos.git master:Playerbot
HASH=`git log playerbot --pretty=oneline | grep -m 1 '\\[1[0-9]\\{4\\}]' | cut -d " " -f 1`
git diff $HASH playerbot > ../playerbot.patch

This will result in the master branch being the current version of MaNGOS, and the playerbot branch the current blueboy repo.

Or, if you really want playerbot to be in the master branch like your script:

#!/bin/bash -x
git clone git://github.com/blueboy/mangos.git playerbot
cd playerbot
git fetch git://github.com/mangos/mangos.git master:mangos
HASH=`git log --pretty=oneline | grep -m 1 '\\[1[0-9]\\{4\\}]' | cut -d " " -f 1`
git checkout mangos
git diff $HASH master > ../playerbot.patch

skinlayers

Link to comment
Share on other sites

The '\\[9[0-9]\\{3\\}]' string is a regular expression that tells grep to search for [9nnn] where n=0-9. However, I've done one better and integrated both pbot.sh and gethash.sh into on simplified script:

#!/bin/bash -x
git clone git://github.com/mangos/mangos.git playerbot
cd playerbot
git fetch git://github.com/blueboy/mangos.git master:Playerbot
git checkout playerbot
HASH=`git log --pretty=oneline | grep -m 1 '\\[9[0-9]\\{3\\}]' | cut -d " " -f 1`
git diff $HASH > playerbot.patch

This will result in the master branch being the current MaNGOS and the playerbot branch the current blueboy repo. I can tweak it a little if you really want playerbot to be in master like your script does.

skinlayers

Hi,

Yes I agree, it works fine with the blueboy repo and it's alot sleeker, great work. :cool:

Less important; I couldn't get it to work with the 'Tasssador' repo, but I can still use the old script for that :rolleyes:

Thanks for your contribution

Link to comment
Share on other sites

Hi, I am not sure if this is an issue but when trying to get the bots to tank and heal via combat orders it wouldn't work. I am taking a look through the source to see if anything is wrong and it looks like those two are not being processed, I could be wrong and they might be in here somewhere else. This stuff is pretty new to me. :P

void PlayerbotAI::SetCombatOrderByStr( std::string str, Unit *target ) {
   CombatOrderType co;
   if( str == "tank" ) co = ORDERS_TANK;
   else if( str == "assist" ) co = ORDERS_ASSIST;
   else if( str == "heal" ) co = ORDERS_HEAL;
   else if( str == "protect" ) co = ORDERS_PROTECT;
   else co = ORDERS_RESET;
   SetCombatOrder( co, target );
}

void PlayerbotAI::SetCombatOrder( CombatOrderType co, Unit *target ) {
   if( (co == ORDERS_ASSIST || co == ORDERS_PROTECT) && !target )
       return;
   if( co == ORDERS_RESET ) {
       m_combatOrder = ORDERS_NONE;
       m_targetAssist = 0;
       m_targetProtect = 0;
       return;
   }
   if( co == ORDERS_PROTECT )
       m_targetProtect = target;
   else if( co == ORDERS_ASSIST )
       m_targetAssist = target;
   if( (co&ORDERS_PRIMARY) )
       m_combatOrder = (CombatOrderType)(((uint32)m_combatOrder&(uint32)ORDERS_SECONDARY)|(uint32)co);
   else
       m_combatOrder = (CombatOrderType)(((uint32)m_combatOrder&(uint32)ORDERS_PRIMARY)|(uint32)co);
}

Also, when doing .bot co mybot assist myotherbot or commands with co, I am not getting a response back so I don't know if it's being recognized or not. Or maybe you just have it that way. :P

Link to comment
Share on other sites

I issue the orders in Party chat. They seem to respond for me after seting them up with the commands this way.

/p Tankname co tank

/p DPSname co protect Healername

/p Healername co heal

when I want to start an engagement I simple say in party chat

/p attack

while I have an attackable target selected.

This can be applied to your Attack macro

#showicon Attack

/startattack

/p attack

The healer will wait until you are below 50% health or so before it starts healing.

Link to comment
Share on other sites

Hi mrelfire & Bramm,

I've been looking at the HasAura issue, and have something I would like you to test. I have tried it on my linux box and it works with no ill effects. It might just work for you too. I have rewritten the HasAura function in PlayerbotAI.cpp to call on the sister (overloaded) function HasAura in Unit.cpp.

I suggest you comment out the old function and replace it with the new prototype in PlayerbotAI.cpp

/*
bool PlayerbotAI::HasAura(uint32 spellId, const Unit& player) const
{
   for (Unit::AuraMap::const_iterator iter = player.GetAuras().begin(); iter != player.GetAuras().end(); ++iter)
   {
       if (iter->second->GetId() == spellId)
           return true;
   }
   return false;
}
*/

bool PlayerbotAI::HasAura(uint32 spellId, const Unit& player) const
{
   return  player.HasAura(spellId);
}

Please let me know if this works,

Cheers

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