Jump to content

[DEV] Dungeon Finder


Recommended Posts

Check /src/server/scripts/World/dungeon_finder.cpp

Group Hooks: AddMember, RemoveMember, Disband, ChangeLeader, InviteMember

Player Hooks: LevelChanged (Not used atm), Logout

Move all functions in dungeon_finder file to LFGMgr.cpp. Now go to Group.cpp and compare Trinity with Mangos. Where you find sScriptMgr.OnGroupXXX change that line with a call to the dungeon_finder function.

Ex. Group::AddMember, change 

sScriptMgr.OnGroupAddMember(this, guid);

with 

sLFGMgr.OnAddMember(this, guid);

Will try to find time to finish the other changes in Player.cpp/Group.cpp. General idea is this patch (Trinitycore repo) it's not up to date, just to get the idea http://aokromes.pastebin.com/iftjjAFt

Link to comment
Share on other sites

  • Replies 288
  • Created
  • Last Reply

Top Posters In This Topic

Wow the diff is clear. I have started porting one month too early.

This caused me follow the old spaghetti code. Anyway i am continuing to debug it for now. It will give me enought understainding to be more near of your next code.

Can you confirm me when a group is completed, created and all member teleported, all member of this group automatically leave the queue?

Link to comment
Share on other sites

Wow the diff is clear. I have started porting one month too early.

This caused me follow the old spaghetti code. Anyway i am continuing to debug it for now. It will give me enought understainding to be more near of your next code.

Can you confirm me when a group is completed, created and all member teleported, all member of this group automatically leave the queue?

Yes, in ::UpdateProposal

       // Remove players/groups from Queue
       for (LfgGuidList::const_iterator it = pProposal->queues.begin(); it != pProposal->queues.end(); ++it)
           RemoveFromQueue(*it);

       // Teleport Player
       for (LfgPlayerList::const_iterator it = players.begin(); it != players.end(); ++it)
           TeleportPlayer(*it, false);

Link to comment
Share on other sites

Ok but i still see the button "looking for group" on the minimap and the status "group found click for more detail.

In the UpdateProposal i didn't see any code like this

//from LFGMgr::leave()
       plr->GetSession()->SendLfgUpdatePlayer(LFG_UPDATETYPE_REMOVED_FROM_QUEUE);
       plr->GetLfgDungeons()->clear();
       plr->SetLfgRoles(ROLE_NONE);
       plr->SetLfgState(LFG_STATE_NONE);
       plr->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW);

So when/where the player status is updated/send after RemoveFromQueue who only remove guid (and assosiated data) from the server side?

Link to comment
Share on other sites

All task are done in ::UpdateProposal, in the else of "if (!allAnswered)"

       // Save wait times before redoing groups
       ... some code ...
       // Create a new group (if needed)
       for (LfgPlayerList::const_iterator it = players.begin(); it != players.end(); ++it)
       {
// (comment not in code) Send update if needed
           if (sendUpdate)
               plr->GetSession()->SendUpdateProposal(proposalId, pProposal);
// (comment not in code) inform a group have been found
           if (plr->GetGroup())
           {
               plr->GetSession()->SendLfgUpdateParty(LFG_UPDATETYPE_GROUP_FOUND); <------------- HERE Client is informed group have been found
               if (plr->GetGroup() != grp)
                   plr->RemoveFromGroup();
           }
           else
               plr->GetSession()->SendLfgUpdatePlayer(LFG_UPDATETYPE_GROUP_FOUND); <------------- HERE Client is informed group have been found

// (comment not in code) Create new group or move from old group to new group
           if (!grp)
             ... some code...
            else if (plr->GetGroup() != grp)
               grp->AddMember(plr->GetGUID(), plr->GetName());

           // Update timers
           ... some code...
       }
       // Remove players/groups from Queue
           ... some code...
       // Teleport Player
           ... some code...
// (comment not in code) Clear stuff
           ... some code...

Link to comment
Share on other sites

It's still me :)

// (comment not in code) Send update if needed
           if (sendUpdate)
               plr->GetSession()->SendUpdateProposal(proposalId, pProposal);
// (comment not in code) inform a group have been found

           plr->SetLfgUpdate(false); /* =====>>> You disable SendLfgUpdateParty by doing this! */
           if (plr->GetGroup())
           {
               plr->GetSession()->SendLfgUpdateParty(LFG_UPDATETYPE_GROUP_FOUND); <------------- HERE Client is informed group have been found
               if (plr->GetGroup() != grp)
                   plr->RemoveFromGroup();
           }
           else
               plr->GetSession()->SendLfgUpdatePlayer(LFG_UPDATETYPE_GROUP_FOUND); <------------- HERE Client is informed group have been found

           ... code ...

           plr->SetLfgUpdate(true); /* =====>>> You enable SendLfgUpdateParty by doing this! */

These line plr->SetLfgUpdate(false); /* =====>>> You disable SendLfgUpdateParty by doing this! */ is not correctly placed in my version...

That's why :)

As i see my version is too much old than yours i must do sync before continue...

I will not have time to sync it until nextweek. So i 'll soon post latest patch if anyone have time to do more test :)

Thanks for your support _SPP

Link to comment
Share on other sites

Latest Patch for 10654

- correct close proposal windows after group created.

- More objectguid uses.

- Correct bug when group entered in queue.

If you whant me to continue on this please make minimal feedback this week... I cannot test all the feature of this good core because i don"t know it/or cannot make test with more than 5 client connected...

See You after this week-end :)

Link to comment
Share on other sites

1) Don't show who is already join to group (shoul show role then cursor on LFG eya)

Don't understaind, can you (or anyone else) make screenchot of this?

2) One from test char wasn't telepor into dangeon

Is that player have all dungeon/map unlocked? (anyway the code must handle this case)

3) Some players who was teleported into dangeon have name "Unknown"

It appen sometime i cannot reproduce it. It's perhaps lied to the posistion of the player i need make more test.

4) I can't complite dangeon (test on VanCliff)

What you mean? VanCliff doesn't appear?

Link to comment
Share on other sites

Yeah the idea is i must code better :P

No seriously i tested only 5 members with

- All non grouped, roles: 1 tank one heal 3 dps for random dungeon. -> group founded and created.

- All non grouped, roles: 1 tank one heal 3 dps for Some selected dungeon with some common one. -> group founded and created.

- 2 grouped and 3 non grouped for the same dungeon with roles: 1 tank one heal 3 dps. -> group founded and created.

- 3 test above with more choice checked under role. -> group founded and created.

- If one member refuse the role assigned it will not correctly removed from the queue -> bug.

So verify your roles/level/accessrequirement at first (but anyway the code must handle that case, it just can bug)

Thanks for any feedback :)

Link to comment
Share on other sites

1) Don't show who is already join to group (shoul show role then cursor on LFG eya)

Don't understaind, can you (or anyone else) make screenchot of this?

Probably he means mouse over the eye, roles don't get updated (wich code does in ::Update every 15 secs)

2) One from test char wasn't telepor into dangeon

Is that player have all dungeon/map unlocked? (anyway the code must handle this case)

If people don't get teleported for any reason they get a msg (Ex: Jumping). They can use the eye and select teleport to dungeon. If it's a core fail then you will find a line in server.log about failing to teleport.

3) Some players who was teleported into dangeon have name "Unknown"

It appen sometime i cannot reproduce it. It's perhaps lied to the posistion of the player i need make more test.

Known bug i can't manage to reproduce. Seen blizz way to solve it is send the Group update multiple times... but, i can't believe it's the solution

4) I can't complite dangeon (test on VanCliff)

What you mean? VanCliff doesn't appear?

To get rewards Achievement system have to call to sLFGMgr. Cyberium forgot to add it to the patch.

Will do some test about someone not accepting the role assigned.

are there _any_ ids anywhere related to "complete" a dungeon (either opcodes or DBCs)

(for Van Cleef I would expect an idea somewhere between 1000 and 3000, not related to the npc-entry)

DungeonEncounters.dbc, but neither Mangos or Trinitycore use that dbc (you can find some info about it in another post). This implementation of DF uses Achievements, which have the problem that not all dungeons have counter achievements, so some of the dungeons (low level) will only get rewards the first time you do them. Need to move to a system that uses DungeonEncounters to mark a dungeon. Boss kills will be easy to add, but there are cases when you don't need to kill a boss, those cases will need to be handled by scripts.

Link to comment
Share on other sites

Where can be modified rewards?

For example if i select random heroic dungeon it rewards 2 emblems and money but I have seen "lfg_dungeon_rewards" and rewards for those quests are not emblems and money, just things like "Satchel of Helpful Goods"

How does rewards works?

Thank you

Link to comment
Share on other sites

Where can be modified rewards?

For example if i select random heroic dungeon it rewards 2 emblems and money but I have seen "lfg_dungeon_rewards" and rewards for those quests are not emblems and money, just things like "Satchel of Helpful Goods"

How does rewards works?

Thank you

You only get rewards when you finish a dungeon you have joined as random. So each field in that table contains the id of a random dungeon and 2 quests. 1st completion and 2nd. So rewards just rely on quest system.

So if you wanna modify the rewards just modify the quests.

Note: Quest system was also modified in Trinity to fit DF quests as some of them are daily and others repetable and both of them are not shown in the client.

Link to comment
Share on other sites

thanks Spp for your reply, this is at least an extremely interesting DBC - though it didn't yield the answer I hoped for ;)

A bit about understanding DF:

- Player A has done an instance, then DF needs to be able to check which encounters are done in the instance?

- If a player changes the state of an instance, will there be some need to "notify" DF?

- What else is needed as "communication" between boss encounters and DF?

Link to comment
Share on other sites

thanks Spp for your reply, this is at least an extremely interesting DBC - though it didn't yield the answer I hoped for ;)

A bit about understanding DF:

- Player A has done an instance, then DF needs to be able to check which encounters are done in the instance?

- If a player changes the state of an instance, will there be some need to "notify" DF?

Current system just rely on Achievements. So when boss dies achievement is called, also it can be called by scripters when the final encounter is not a boss. Achievement system will check if that achievement is marked to notify DF.

The day DungeonEncounter is fully supported then achievement system wont be needed at all.

Link to comment
Share on other sites

Perhaps I wasn't clear enough - I am concerned about what _should_ happen, and not what is done in these hack implementations around

Instances should have a list of Encounters to complete, when a boss is killed the linked encounter should be marked as complete. If is not a boss then it should be done by scripters. When the final Encounter is complete and the group is LFGGroup, it should call sLFGMgr to give rewards. Also it should call Achievement system.

Nowadays all is done by scripters and complete encounters are just stored by each of the scripters

A third and important question:

- What else is needed as "communication" between boss encounters and DF?

Group should be LFGGroup and final encounter complete. Then just call Reward (as a Group), DF Then will check for any extra condition needed (Player being added as random)

Link to comment
Share on other sites

I have one problem compiling with this patch. In windows it works ok, but in linux

g++ -DHAVE_CONFIG_H -I. -I../../../src/game -I../.. -I../../../dep/ACE_wrappers -I../../dep/ACE_wrappers -I/usr/include/mysql -I../../src/shared -I../../../src/game -I../../../src/game/../../dep/include -I../../../src/game/../framework -I../../../src/game/../shared -I../../../src/game/../shared/vmap -I../../../src/game/../realmd -DSYSCONFDIR=\\"/opt/mangos/etc/\\" -DDO_MYSQL -g -O2 -MT GroupHandler.o -MD -MP -MF .deps/GroupHandler.Tpo -c -o GroupHandler.o ../../../src/game/GroupHandler.cpp

../../../dep/ACE_wrappers/ace/Guard_T.inl: In member function 'int ACE_Guard<ACE_LOCK>::acquire() [with ACE_LOCK = ACE_Null_Mutex]':

../../../dep/ACE_wrappers/ace/Guard_T.inl:38: instantiated from 'ACE_Guard<ACE_LOCK>::ACE_Guard(ACE_LOCK&) [with ACE_LOCK = ACE_Null_Mutex]'

../../../dep/ACE_wrappers/ace/Singleton.cpp:86: instantiated from 'static TYPE* ACE_Singleton<TYPE, ACE_LOCK>::instance() [with TYPE = LFGMgr, ACE_LOCK = ACE_Null_Mutex]'

../../../src/game/GroupHandler.cpp:263: instantiated from here

../../../dep/ACE_wrappers/ace/Guard_T.inl:12: error: invalid use of incomplete type 'struct ACE_Null_Mutex'

../../../dep/ACE_wrappers/ace/Synch_Traits.h:29: error: forward declaration of 'struct ACE_Null_Mutex'

../../../dep/ACE_wrappers/ace/Guard_T.inl: In member function 'int ACE_Guard<ACE_LOCK>::release() [with ACE_LOCK = ACE_Null_Mutex]':

../../../dep/ACE_wrappers/ace/Guard_T.inl:65: instantiated from 'ACE_Guard<ACE_LOCK>::~ACE_Guard() [with ACE_LOCK = ACE_Null_Mutex]'

../../../dep/ACE_wrappers/ace/Singleton.cpp:86: instantiated from 'static TYPE* ACE_Singleton<TYPE, ACE_LOCK>::instance() [with TYPE = LFGMgr, ACE_LOCK = ACE_Null_Mutex]'

../../../src/game/GroupHandler.cpp:263: instantiated from here

../../../dep/ACE_wrappers/ace/Guard_T.inl:29: error: invalid use of incomplete type 'struct ACE_Null_Mutex'

../../../dep/ACE_wrappers/ace/Synch_Traits.h:29: error: forward declaration of 'struct ACE_Null_Mutex'

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

line 263 of GroupHandler.cpp is

sLFGMgr.InitBoot(grp, GetPlayer()->GetObjectGuid().GetCounter(), guid.GetCounter(), reason);

Link to comment
Share on other sites

Hello, iam back for some dev :)

@Mizuni> yes no test done for linux at this moment because i prefer to keep my energy for understainding this mod :)

I will do it anyway when i have some time.

For now iam trying to implement missing code about avhievment reward.

Olso test about teleport guy from different map give more often "unknow" name to character's teleported. So i will try to isolate this case.

_SPP olso do some good improvement to his latest code so some of them must be implemented too.

I hope all of this step will be done before the end of this week :)

@_SPP > Can you confirm you olso have this bug with character's not confirm assigned role?

Greetings

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