Jump to content

[9651] [fix]improved quest POI's code + make use of actual data


Auntie Mangos

Recommended Posts

sincerely you can name them sh... 3 and 4 since i provided the corect data for all it's not that important now what data they represent... the problem i think is whit index deciding on eater autoincrement or using db i dont know sombodey just tell me what the best option is and i will adapt it but seams no dev want to point out what the problem is so later today i will make both ways patch and post it and see what's the reaction...

Link to comment
Share on other sites

  • Replies 85
  • Created
  • Last Reply

Top Posters In This Topic

diff for no PoiId in db using lame method of counting/incrementing index from core witch in my opinion is hacky :)

Sorry i took so long to post it , meh i was playing starcraft 2 and got all add :))

Author: Blizzy <[email protected]>  2010-03-10 04:56:19
Committer: Blizzy <[email protected]>  2010-03-10 04:56:19
Parent: 6486fa3ad2ab23852ccca67f99e33faffd3de644 ([9559] Update AiReaction enum.)
Branch: master
Follows: v0.16-dev1
Precedes: 

   Improved quest POI's code now with db support Quest Tracking Feature is full working

---------------------------- src/game/ObjectMgr.cpp ----------------------------
index 7fea7af..69f18c6 100644
@@ -6507,8 +6507,8 @@ void ObjectMgr::LoadQuestPOI()

    uint32 count = 0;

-    //                                                0        1         2      3     4     5     6
-    QueryResult *result = WorldDatabase.Query("SELECT questId, objIndex, mapId, unk1, unk2, unk3, unk4 FROM quest_poi");
+    //                                                0        1         2      3       4        5     6
+    QueryResult *result = WorldDatabase.Query("SELECT questId, objIndex, mapId, areaId, floorId, unk3, unk4 FROM quest_poi");

    if(!result)
    {
@@ -6531,14 +6531,14 @@ void ObjectMgr::LoadQuestPOI()
        uint32 questId  = fields[0].GetUInt32();
        int32 objIndex  = fields[1].GetInt32();
        uint32 mapId    = fields[2].GetUInt32();
-        uint32 unk1     = fields[3].GetUInt32();
-        uint32 unk2     = fields[4].GetUInt32();
+        uint32 areaId   = fields[3].GetUInt32();
+        uint32 floorId  = fields[4].GetUInt32();
        uint32 unk3     = fields[5].GetUInt32();
        uint32 unk4     = fields[6].GetUInt32();

-        QuestPOI POI(objIndex, mapId, unk1, unk2, unk3, unk4);
+        QuestPOI POI(objIndex, mapId, areaId, floorId, unk3, unk4);

-        QueryResult *points = WorldDatabase.PQuery("SELECT x, y FROM quest_poi_points WHERE questId='%u' AND objIndex='%i'", questId, objIndex);
+        QueryResult *points = WorldDatabase.PQuery("SELECT x, y FROM quest_poi_points WHERE questId='%u' AND poiId='%i'", questId, poiId);

        if(points)
        {

----------------------------- src/game/ObjectMgr.h -----------------------------
index e565570..6431ce1 100644
@@ -262,14 +262,14 @@ struct QuestPOI
{
    int32 ObjectiveIndex;
    uint32 MapId;
-    uint32 Unk1;
-    uint32 Unk2;
+    uint32 AreaId;
+    uint32 FloorId;
    uint32 Unk3;
    uint32 Unk4;
    std::vector<QuestPOIPoint> points;

-    QuestPOI() : ObjectiveIndex(0), MapId(0), Unk1(0), Unk2(0), Unk3(0), Unk4(0) {}
-    QuestPOI(int32 objIndex, uint32 mapId, uint32 unk1, uint32 unk2, uint32 unk3, uint32 unk4) : ObjectiveIndex(objIndex), MapId(mapId), Unk1(unk1), Unk2(unk2), Unk3(unk3), Unk4(unk4) {}
+    QuestPOI() : ObjectiveIndex(0), MapId(0), AreaId(0), FloorId(0), Unk3(0), Unk4(0) {}
+    QuestPOI(int32 objIndex, uint32 mapId, uint32 areaId, uint32 floorId, uint32 unk3, uint32 unk4) : ObjectiveIndex(objIndex), MapId(mapId), AreaId(areaId), FloorId(floorId), Unk3(unk3), Unk4(unk4) {}
};

typedef std::vector<QuestPOI> QuestPOIVector;

-------------------------- src/game/QueryHandler.cpp --------------------------
index 5e3f8c8..f6def70 100644
@@ -485,7 +485,7 @@ void WorldSession::HandleQueryQuestsCompleted( WorldPacket & /*recv_data */)
    SendPacket(&data);
}

-void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data)
+void WorldSession::HandleQuestPOIQuery( WorldPacket & recv_data )
{
    uint32 count;
    recv_data >> count;                                     // quest count, max=25
@@ -524,12 +524,12 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data)
                for(QuestPOIVector::const_iterator itr = POI->begin(); itr != POI->end(); ++itr)
                {
                    data << uint32(index);                  // POI index
-                    data << int32(itr->ObjectiveIndex);     // objective index
-                    data << uint32(itr->MapId);             // mapid
-                    data << uint32(itr->Unk1);              // unknown
-                    data << uint32(itr->Unk2);              // unknown
-                    data << uint32(itr->Unk3);              // unknown
-                    data << uint32(itr->Unk4);              // unknown
+                    data << int32(itr->ObjectiveIndex);     // Objective index
+                    data << uint32(itr->MapId);             // Mapid
+                    data << uint32(itr->AreaId);            // WorldMapArea index
+                    data << uint32(itr->FloorId);           // Floor
+                    data << uint32(itr->Unk3);              // Unknown
+                    data << uint32(itr->Unk4);              // Unknown
                    data << uint32(itr->points.size());     // POI points count

                    for(std::vector<QuestPOIPoint>::const_iterator itr2 = itr->points.begin(); itr2 != itr->points.end(); ++itr2)
@@ -553,7 +553,6 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data)
        }
    }

-    data.hexlike();
    SendPacket(&data);
}

And for db use the same only drop PoiId from quest_poi table.

Link to comment
Share on other sites

final patch no work say

$ patch -p1 < ../commit-bf21846

missing header for unified diff at line 12 of patch

can't find file to patch at input line 12

Perhaps you used the wrong -p or --strip option?

The text leading up to this was:

--------------------------

|Author: Blizzy <[email protected]> 2010-03-10 04:56:19

|Committer: Blizzy <[email protected]> 2010-03-10 04:56:19

|Parent: 6486fa3ad2ab23852ccca67f99e33faffd3de644 ([9559] Update AiReaction enum

.)

|Branch: master

|Follows: v0.16-dev1

|Precedes:

|

| Improved quest POI's code now with db support Quest Tracking Feature is ful

l working

|

|---------------------------- src/game/ObjectMgr.cpp ---------------------------

-

|index 7fea7af..69f18c6 100644

--------------------------

File to patch:

any help pls

thanks

Link to comment
Share on other sites

you don't relay have to use it it's just for show on how it would look like whit not storing PoiId in db you should use first post as i always check for compatibility on first i did this patch fast i think i have some typos il check it tonight

Link to comment
Share on other sites

Did you check if client crash on some quest? Nofantasy complains that this is reason why poiID is in DB....
that's my point exactly why we should have PoiId in db i personaly tested all quest's by zones all tirysfal galades , blasted lands , hellfire peninsula , shadowmoon valey , borean tundra , befor i posted the patch here and why have the core do extra work on counting and incrementin when we all know he can some times f.... it up :) why not make use of the sniff structure and send what we know should be send to client
Link to comment
Share on other sites

You missed a few lines while you were patching.. it seems likely that you did the patch manually. I would think its probably in one of the sections where those are listed that you forgot to add ones that are needed or something. recheck your patched files and im sure youll notice the mistake.

Link to comment
Share on other sites

Core 9620

commit 3d9de856bbd7ddaad905b4a3dd71d945d2d921b1
Author: Xadiaris <[email protected]>
Date:   Sat Mar 13 13:21:34 2010 +0200

   Improved quest POI's code now with db support Quest Tracking Feature is full working

diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index b6997b7..308aef3 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -6438,8 +6438,8 @@ void ObjectMgr::LoadQuestPOI()

    uint32 count = 0;

-    //                                                0        1         2      3     4     5     6
-    QueryResult *result = WorldDatabase.Query("SELECT questId, objIndex, mapId, unk1, unk2, unk3, unk4 FROM quest_poi");
+    //                                                0        1      2         3      4       5        6     7
+    QueryResult *result = WorldDatabase.Query("SELECT questId, poiId, objIndex, mapId, areaId, floorId, unk3, unk4 FROM quest_poi");

    if(!result)
    {
@@ -6460,16 +6460,17 @@ void ObjectMgr::LoadQuestPOI()
        bar.step();

        uint32 questId  = fields[0].GetUInt32();
-        int32 objIndex  = fields[1].GetInt32();
-        uint32 mapId    = fields[2].GetUInt32();
-        uint32 unk1     = fields[3].GetUInt32();
-        uint32 unk2     = fields[4].GetUInt32();
-        uint32 unk3     = fields[5].GetUInt32();
-        uint32 unk4     = fields[6].GetUInt32();
+        uint32 poiId    = fields[1].GetUInt32();
+        int32 objIndex  = fields[2].GetInt32();
+        uint32 mapId    = fields[3].GetUInt32();
+        uint32 areaId   = fields[4].GetUInt32();
+        uint32 floorId  = fields[5].GetUInt32();
+        uint32 unk3     = fields[6].GetUInt32();
+        uint32 unk4     = fields[7].GetUInt32();

-        QuestPOI POI(objIndex, mapId, unk1, unk2, unk3, unk4);
+        QuestPOI POI(poiId, objIndex, mapId, areaId, floorId, unk3, unk4);

-        QueryResult *points = WorldDatabase.PQuery("SELECT x, y FROM quest_poi_points WHERE questId='%u' AND objIndex='%i'", questId, objIndex);
+        QueryResult *points = WorldDatabase.PQuery("SELECT x, y FROM quest_poi_points WHERE questId='%u' AND poiId='%i'", questId, poiId);

        if(points)
        {
diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h
index c16b3d7..5b193e9 100644
--- a/src/game/ObjectMgr.h
+++ b/src/game/ObjectMgr.h
@@ -260,16 +260,17 @@ struct QuestPOIPoint

struct QuestPOI
{
+    uint32 PoiId;
    int32 ObjectiveIndex;
    uint32 MapId;
-    uint32 Unk1;
-    uint32 Unk2;
+    uint32 AreaId;
+    uint32 FloorId;
    uint32 Unk3;
    uint32 Unk4;
    std::vector<QuestPOIPoint> points;

-    QuestPOI() : ObjectiveIndex(0), MapId(0), Unk1(0), Unk2(0), Unk3(0), Unk4(0) {}
-    QuestPOI(int32 objIndex, uint32 mapId, uint32 unk1, uint32 unk2, uint32 unk3, uint32 unk4) : ObjectiveIndex(objIndex), MapId(mapId), Unk1(unk1), Unk2(unk2), Unk3(unk3), Unk4(unk4) {}
+    QuestPOI() : PoiId(0), ObjectiveIndex(0), MapId(0), AreaId(0), FloorId(0), Unk3(0), Unk4(0) {}
+    QuestPOI(uint32 poiId, int32 objIndex, uint32 mapId, uint32 areaId, uint32 floorId, uint32 unk3, uint32 unk4) : PoiId(poiId), ObjectiveIndex(objIndex), MapId(mapId), AreaId(areaId), FloorId(floorId), Unk3(unk3), Unk4(unk4) {}
};

typedef std::vector<QuestPOI> QuestPOIVector;
diff --git a/src/game/QueryHandler.cpp b/src/game/QueryHandler.cpp
index 5e3f8c8..67bac84 100644
--- a/src/game/QueryHandler.cpp
+++ b/src/game/QueryHandler.cpp
@@ -485,7 +485,7 @@ void WorldSession::HandleQueryQuestsCompleted( WorldPacket & /*recv_data */)
    SendPacket(&data);
}

-void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data)
+void WorldSession::HandleQuestPOIQuery( WorldPacket & recv_data )
{
    uint32 count;
    recv_data >> count;                                     // quest count, max=25
@@ -520,16 +520,15 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data)
                data << uint32(questId);                    // quest ID
                data << uint32(POI->size());                // POI count

-                int index = 0;
                for(QuestPOIVector::const_iterator itr = POI->begin(); itr != POI->end(); ++itr)
                {
-                    data << uint32(index);                  // POI index
-                    data << int32(itr->ObjectiveIndex);     // objective index
-                    data << uint32(itr->MapId);             // mapid
-                    data << uint32(itr->Unk1);              // unknown
-                    data << uint32(itr->Unk2);              // unknown
-                    data << uint32(itr->Unk3);              // unknown
-                    data << uint32(itr->Unk4);              // unknown
+                    data << uint32(itr->PoiId);             // POI index
+                    data << int32(itr->ObjectiveIndex);     // Objective index
+                    data << uint32(itr->MapId);             // Mapid
+                    data << uint32(itr->AreaId);            // WorldMapArea index
+                    data << uint32(itr->FloorId);           // Floorid
+                    data << uint32(itr->Unk3);              // Unknown
+                    data << uint32(itr->Unk4);              // Unknown
                    data << uint32(itr->points.size());     // POI points count

                    for(std::vector<QuestPOIPoint>::const_iterator itr2 = itr->points.begin(); itr2 != itr->points.end(); ++itr2)
@@ -537,7 +536,6 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data)
                        data << int32(itr2->x);             // POI point x
                        data << int32(itr2->y);             // POI point y
                    }
-                    ++index;
                }
            }
            else
@@ -553,7 +551,6 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data)
        }
    }

-    data.hexlike();
    SendPacket(&data);
}

Link to comment
Share on other sites

Try to complie the patch above gived following errors:

2>..\\..\\src\\game\\QueryHandler.cpp(525) : error C2039: 'PoiId': Ist kein Element von 'QuestPOI'
2>        d:\\spiele\\mangos testserver\\test\\patch test\\mangos\\src\\game\\ObjectMgr.h(261): Siehe Deklaration von 'QuestPOI'
2>..\\..\\src\\game\\QueryHandler.cpp(525) : error C2514: 'uint32': Klasse besitzt keine Konstruktoren
2>        d:\\Spiele\\MANGOS TESTSERVER\\TEST\\patch test\\mangos\\src\\framework\\Platform/Define.h(113): Siehe Deklaration von 'uint32'
2>..\\..\\src\\game\\QueryHandler.cpp(528) : error C2039: 'AreaId': Ist kein Element von 'QuestPOI'
2>        d:\\spiele\\mangos testserver\\test\\patch test\\mangos\\src\\game\\ObjectMgr.h(261): Siehe Deklaration von 'QuestPOI'
2>..\\..\\src\\game\\QueryHandler.cpp(528) : error C2514: 'uint32': Klasse besitzt keine Konstruktoren
2>        d:\\Spiele\\MANGOS TESTSERVER\\TEST\\patch test\\mangos\\src\\framework\\Platform/Define.h(113): Siehe Deklaration von 'uint32'
2>..\\..\\src\\game\\QueryHandler.cpp(529) : error C2039: 'FloorId': Ist kein Element von 'QuestPOI'
2>        d:\\spiele\\mangos testserver\\test\\patch test\\mangos\\src\\game\\ObjectMgr.h(261): Siehe Deklaration von 'QuestPOI'
2>..\\..\\src\\game\\QueryHandler.cpp(529) : error C2514: 'uint32': Klasse besitzt keine Konstruktoren
2>        d:\\Spiele\\MANGOS TESTSERVER\\TEST\\patch test\\mangos\\src\\framework\\Platform/Define.h(113): Siehe Deklaration von 'uint32'
2>..\\..\\src\\game\\ObjectMgr.cpp(6472) : error C2661: 'QuestPOI::QuestPOI': Keine überladene Funktion akzeptiert 7 Argumente
2>Das Buildprotokoll wurde unter "file://c:\\Users\\Oleg\\Desktop\\patch test\\mangos\\win\\VC90\\game__Win32_Release\\BuildLog.htm" gespeichert.
2>game - 7 Fehler, 0 Warnung(en)
========== Erstellen: 1 erfolgreich, Fehler bei 1, 11 aktuell, 0 übersprungen ==========

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