Jump to content

[Help] Implementing Vehicles


Recommended Posts

  • Replies 604
  • Created
  • Last Reply

Top Posters In This Topic

Why this appear? Packet is longer than expected? Unexpected data type in packet?

could anyone tell me what causes that error have unprocessed tail data to appear? I have other mods I have been trying to merge and have run into this error before... (in fact i believe it is this error that is currently causing mangchat to be unusable) I tried to google it for perhaps more info but was unsuccessful.

Link to comment
Share on other sites

could anyone tell me what causes that error have unprocessed tail data to appear? I have other mods I have been trying to merge and have run into this error before... (in fact i believe it is this error that is currently causing mangchat to be unusable) I tried to google it for perhaps more info but was unsuccessful.

I could be totally off base but it looks like when the function changes abruptly from eather a user command or system command it puts out this error due to the data not getting processed in time and there is some data that is and or will be lost because of it. :eek:

Link to comment
Share on other sites

I could be totally off base but it looks like when the function changes abruptly from eather a user command or system command it puts out this error due to the data not getting processed in time and there is some data that is and or will be lost because of it. :eek:

I think that from the packets obtains not only seatId, but something else. Or... This is crazy idea, but...

May be we have to defined seatID as uint32...

Link to comment
Share on other sites

I could be totally off base but it looks like when the function changes abruptly from eather a user command or system command it puts out this error due to the data not getting processed in time and there is some data that is and or will be lost because of it. :eek:

i cant say in the current instance but i can make an example that might back up your idea:

in the mangchat dev (prior to recent changes in which it refuses to build at all) the build would complete but when u ran the exe's the result would be that you couldnt create new chars because it would read the string wrong and expect the client to be expansion 8 instead of 2 in order to create chars) well this error also resulted in an unprocessed tail data entry. what I am thinking is that the server tries to read the information sent from the client and check its own stores but it gets stuck in some sort of loop to find the correct identifier for client expansion and gets lost and stops looking around 8. it says that the unprocessed data is 7-14 (whatever that is).

point is... I was hoping I could figure out exactly what causes such errors so we might be able to track it directly to the code error and fix

incidentally has anyone noticed you cant build mangos in debug-mode anymore... at least in windows.. it causes a link error and wont build.

3raZar3

Link to comment
Share on other sites

i cant say in the current instance but i can make an example that might back up your idea:

in the mangchat dev (prior to recent changes in which it refuses to build at all) the build would complete but when u ran the exe's the result would be that you couldnt create new chars because it would read the string wrong and expect the client to be expansion 8 instead of 2 in order to create chars) well this error also resulted in an unprocessed tail data entry. what I am thinking is that the server tries to read the information sent from the client and check its own stores but it gets stuck in some sort of loop to find the correct identifier for client expansion and gets lost and stops looking around 8. it says that the unprocessed data is 7-14 (whatever that is).

point is... I was hoping I could figure out exactly what causes such errors so we might be able to track it directly to the code error and fix

incidentally has anyone noticed you cant build mangos in debug-mode anymore... at least in windows.. it causes a link error and wont build.

3raZar3

That give me the explanation why on a recent build I couldn't create a character thank you, and as to my thought was the information that was avalible here in the last couple of post is all I had to go on with plus the fact I'm not versed in C++ but do know Assymber well is the only reason I could follow what was posted. I hope that gives you an idea of where I got it. now with your explanation combined with what I can see in source I think the math they us to figgure out the client could be off and thats why the error. but it was fixed with in a couple rev's. Thank You Vladmir for the fix on that. :D

Link to comment
Share on other sites

That give me the explanation why on a recent build I couldn't create a character thank you, and as to my thought was the information that was avalible here in the last couple of post is all I had to go on with plus the fact I'm not versed in C++ but do know Assymber well is the only reason I could follow what was posted. I hope that gives you an idea of where I got it. now with your explanation combined with what I can see in source I think the math they us to figgure out the client could be off and thats why the error. but it was fixed with in a couple rev's. Thank You Vladmir for the fix on that. :D

fix on what?

Link to comment
Share on other sites

we need new patch file.

vehicel v1. patch error.

why?

git clone git://github.com/mangos/mangos.git

cd mangos

git pull git://github.com/Tasssadar/Valhalla-Project.git vehicle

thats it.. works like a charm I am running it compiled with playerbot and ahbot installed with 9015 and SDx2

Link to comment
Share on other sites

ERROR: Attempted to get in ByteBuffer (pos: 44 size: 47) value with size: 4
WorldSession::Update ByteBufferException occured while parsing a packet (opcode: 1179) from client 83.240.110.109, accountid=1254332. Skipped packet.

bad news...I get this when I try to switch seat, even if there is no accessory in vehicle...

Link to comment
Share on other sites

some bags:

---POWER_ENERGY doesnt work with Salvaged Chopper spells

---after using spell with id 50896 if you come out(from vehicle) and come in then Client CRASHED:(

---this we have sometimes on switch seat

WORLD: Recvd CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE

STORAGE_SIZE: 49

DB 62 05 BE 6D 50 F1 00 | 00 00 00 20 00 8E 56 EB

00 86 59 19 46 C4 54 82 | 44 76 FB A2 44 00 FC 2D

40 00 00 00 00 00 00 00 | 00 DB 62 05 BE 6D 50 F1

02

ERROR: Attempted to get in ByteBuffer (pos: 46 size: 49) value with size: 4

WorldSession::Update ByteBufferException occured while parsing a packet (opcode:

1179) from client 127.0.0.1, accountid=6. Skipped packet.

Dumping error causing packet:

STORAGE_SIZE: 49

DB 62 05 BE 6D 50 F1 00 | 00 00 00 20 00 8E 56 EB

00 86 59 19 46 C4 54 82 | 44 76 FB A2 44 00 FC 2D

40 00 00 00 00 00 00 00 | 00 DB 62 05 BE 6D 50 F1

02

after this you cant move(two times)

----cant use spells(ramm speels) 50652, 62308, 62345, 62522

+++addition on base from old patches:

-- Salvaged Chopper

REPLACE INTO npc_spellclick_spells VALUES

(33062, 52196, 0, 0, 0, 0);

REPLACE INTO creature_template_addon VALUES

(33062, 0, 0, 0, 0, 0, 335, NULL, NULL);

REPLACE INTO vehicle_data VALUES

(335, 12, 62974, 62286, 62299, 64660, 0, 0, 0, 0, 0, 0, 0);

REPLACE INTO vehicle_seat_data VALUES

(3005, 1);

-- Salvaged Demolisher

REPLACE INTO npc_spellclick_spells VALUES

(33109, 52196, 0, 0, 0, 0);

REPLACE INTO creature_template_addon VALUES

(33109, 0, 0, 0, 0, 0, 338, NULL, NULL);

REPLACE INTO vehicle_data VALUES

(338, 12, 62306, 62490, 62308, 62324, 0, 0, 0, 0, 0, 0, 0);

REPLACE INTO vehicle_seat_data VALUES

(3011, 1);

-- Salvaged Siege Engine

REPLACE INTO npc_spellclick_spells VALUES

(33060, 52196, 0, 0, 0, 0);

REPLACE INTO creature_template_addon VALUES

(33060, 0, 0, 0, 0, 0, 336, NULL, NULL);

REPLACE INTO vehicle_data VALUES

(336, 12, 62345, 62522, 62346, 0, 0, 0, 0, 0, 0, 0, 0);

REPLACE INTO vehicle_seat_data VALUES

(3006, 1);

ps sorry for my english

Link to comment
Share on other sites

I have remastered the regen system for vehicles. And now there are works a vehicles like Salvaged Chopper.

Added new data for vahicle_* tables. Thanks to gen1us2k

There was posted only base part of my fix.

diff --git a/src/game/Vehicle.cpp b/src/game/Vehicle.cpp
index 04c7e99..24d6da9 100644
--- a/src/game/Vehicle.cpp
+++ b/src/game/Vehicle.cpp
@@ -81,14 +81,14 @@ void Vehicle::Update(uint32 diff)

    if(m_regenTimer <= diff)
    {
-        Regenerate(getPowerType());
+        RegeneratePower(getPowerType());
        m_regenTimer = 4000;
    }
    else
        m_regenTimer -= diff;
}

-void Vehicle::Regenerate(Powers power)
+void Vehicle::RegeneratePower(Powers power)
{
    uint32 curValue = GetPower(power);
    uint32 maxValue = GetMaxPower(power);
@@ -98,11 +98,12 @@ void Vehicle::Regenerate(Powers power)

    float addvalue = 0.0f;

-    if(m_vehicleInfo->m_powerType == POWER_STEAM)
-        addvalue = 20.0;
-    else 
-        if(m_vehicleInfo->m_powerType == POWER_PYRITE)
-            return;
+    // hack: needs more research of power type from the dbc. 
+    // It must contains some info about vehicles like Salvaged Chopper.
+    if(m_vehicleInfo->m_powerType == POWER_TYPE_PYRITE)
+        return;
+
+    addvalue = 20.0f;

    ModifyPower(power, (int32)addvalue);
}
@@ -149,43 +150,42 @@ bool Vehicle::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, u
    {
        ((InstanceMap*)map)->GetInstanceData()->OnCreatureCreate(this);
    }
-    if(Creature *cre = dynamic_cast<Creature*>(this))
+    
+    if(m_vehicleInfo->m_powerType == POWER_TYPE_STEAM)
    {
-        if(m_vehicleInfo->m_powerType == POWER_STEAM)
-        {
-            this->setPowerType(POWER_ENERGY);
-            this->SetMaxPower(POWER_ENERGY, 100);
-            this->SetPower(POWER_ENERGY, 100);
-        }
-        else if(m_vehicleInfo->m_powerType == POWER_PYRITE)
-        {
-            this->setPowerType(POWER_ENERGY);
-            this->SetMaxPower(POWER_ENERGY, 50);
-            this->SetPower(POWER_ENERGY, 50);
-        }
-        else
+        setPowerType(POWER_ENERGY);
+        SetMaxPower(POWER_ENERGY, 100);
+        SetPower(POWER_ENERGY, 100);
+    }
+    else if(m_vehicleInfo->m_powerType == POWER_TYPE_PYRITE)
+    {
+        setPowerType(POWER_ENERGY);
+        SetMaxPower(POWER_ENERGY, 50);
+        SetPower(POWER_ENERGY, 50);
+    }
+    else
+    {
+        for (uint32 i = 0; i < MAX_VEHICLE_SPELLS; ++i)
        {
-            for (uint32 i = 0; i < MAX_VEHICLE_SPELLS; ++i)
-            {
-                if(!cre->m_spells[i])
-                    continue;
-                SpellEntry const *spellInfo = sSpellStore.LookupEntry(cre->m_spells[i]);
-                if(!spellInfo)
-                    continue;
+            if(!GetVehicleData()->v_spells[i])
+                continue;
+            SpellEntry const *spellInfo = sSpellStore.LookupEntry(GetVehicleData()->v_spells[i]);
+            if(!spellInfo)
+                continue;

-                if(spellInfo->powerType == POWER_MANA)
-                    break;
+            if(spellInfo->powerType == POWER_MANA)
+                break;

-                if(spellInfo->powerType == POWER_ENERGY)
-                {
-                    this->setPowerType(POWER_ENERGY);
-                    this->SetMaxPower(POWER_ENERGY, 100);
-                    this->SetPower(POWER_ENERGY, 100);
-                    break;
-                }
+            if(spellInfo->powerType == POWER_ENERGY)
+            {
+                setPowerType(POWER_ENERGY);
+                SetMaxPower(POWER_ENERGY, 100);
+                SetPower(POWER_ENERGY, 100);
+                break;
            }
        }
    }
+
    InstallAllAccessories();

    return true;
diff --git a/src/game/Vehicle.h b/src/game/Vehicle.h
index 7c17edc..b164172 100644
--- a/src/game/Vehicle.h
+++ b/src/game/Vehicle.h
@@ -43,8 +43,8 @@ enum VehicleSeatFlags

enum PowerType
{
-    POWER_STEAM     = 61,
-    POWER_PYRITE    = 41,
+    POWER_TYPE_PYRITE = 41,
+    POWER_TYPE_STEAM  = 61
};

#define MAX_SEAT 8
@@ -66,7 +66,7 @@ class Vehicle : public Creature
        void setDeathState(DeathState s);                   // overwrite virtual Creature::setDeathState and Unit::setDeathState
        void Update(uint32 diff);                           // overwrite virtual Creature::Update and Unit::Update

-        void Regenerate(Powers power);
+        void RegeneratePower(Powers power);

        uint32 GetVehicleId() { return m_vehicleId; }
        bool SetVehicleId(uint32 vehicleid);

DOWNLOAD*NOW!

PS to Wojta. When you'll apply the patch add my "signed-off".

Signed-off-by: AntiDiavol <[email protected]>
Link to comment
Share on other sites

I have remastered the regen system for vehicles. And now there are works a vehicles like Salvaged Chopper.

Added new data for vahicle_* tables. Thanks to gen1us2k

There was posted only base part of my fix.

diff --git a/src/game/Vehicle.cpp b/src/game/Vehicle.cpp
index 04c7e99..24d6da9 100644
--- a/src/game/Vehicle.cpp
+++ b/src/game/Vehicle.cpp
@@ -81,14 +81,14 @@ void Vehicle::Update(uint32 diff)

    if(m_regenTimer <= diff)
    {
-        Regenerate(getPowerType());
+        RegeneratePower(getPowerType());
        m_regenTimer = 4000;
    }
    else
        m_regenTimer -= diff;
}

-void Vehicle::Regenerate(Powers power)
+void Vehicle::RegeneratePower(Powers power)
{
    uint32 curValue = GetPower(power);
    uint32 maxValue = GetMaxPower(power);
@@ -98,11 +98,12 @@ void Vehicle::Regenerate(Powers power)

    float addvalue = 0.0f;

-    if(m_vehicleInfo->m_powerType == POWER_STEAM)
-        addvalue = 20.0;
-    else 
-        if(m_vehicleInfo->m_powerType == POWER_PYRITE)
-            return;
+    // hack: needs more research of power type from the dbc. 
+    // It must contains some info about vehicles like Salvaged Chopper.
+    if(m_vehicleInfo->m_powerType == POWER_TYPE_PYRITE)
+        return;
+
+    addvalue = 20.0f;

    ModifyPower(power, (int32)addvalue);
}
@@ -149,43 +150,42 @@ bool Vehicle::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, u
    {
        ((InstanceMap*)map)->GetInstanceData()->OnCreatureCreate(this);
    }
-    if(Creature *cre = dynamic_cast<Creature*>(this))
+    
+    if(m_vehicleInfo->m_powerType == POWER_TYPE_STEAM)
    {
-        if(m_vehicleInfo->m_powerType == POWER_STEAM)
-        {
-            this->setPowerType(POWER_ENERGY);
-            this->SetMaxPower(POWER_ENERGY, 100);
-            this->SetPower(POWER_ENERGY, 100);
-        }
-        else if(m_vehicleInfo->m_powerType == POWER_PYRITE)
-        {
-            this->setPowerType(POWER_ENERGY);
-            this->SetMaxPower(POWER_ENERGY, 50);
-            this->SetPower(POWER_ENERGY, 50);
-        }
-        else
+        setPowerType(POWER_ENERGY);
+        SetMaxPower(POWER_ENERGY, 100);
+        SetPower(POWER_ENERGY, 100);
+    }
+    else if(m_vehicleInfo->m_powerType == POWER_TYPE_PYRITE)
+    {
+        setPowerType(POWER_ENERGY);
+        SetMaxPower(POWER_ENERGY, 50);
+        SetPower(POWER_ENERGY, 50);
+    }
+    else
+    {
+        for (uint32 i = 0; i < MAX_VEHICLE_SPELLS; ++i)
        {
-            for (uint32 i = 0; i < MAX_VEHICLE_SPELLS; ++i)
-            {
-                if(!cre->m_spells[i])
-                    continue;
-                SpellEntry const *spellInfo = sSpellStore.LookupEntry(cre->m_spells[i]);
-                if(!spellInfo)
-                    continue;
+            if(!GetVehicleData()->v_spells[i])
+                continue;
+            SpellEntry const *spellInfo = sSpellStore.LookupEntry(GetVehicleData()->v_spells[i]);
+            if(!spellInfo)
+                continue;

-                if(spellInfo->powerType == POWER_MANA)
-                    break;
+            if(spellInfo->powerType == POWER_MANA)
+                break;

-                if(spellInfo->powerType == POWER_ENERGY)
-                {
-                    this->setPowerType(POWER_ENERGY);
-                    this->SetMaxPower(POWER_ENERGY, 100);
-                    this->SetPower(POWER_ENERGY, 100);
-                    break;
-                }
+            if(spellInfo->powerType == POWER_ENERGY)
+            {
+                setPowerType(POWER_ENERGY);
+                SetMaxPower(POWER_ENERGY, 100);
+                SetPower(POWER_ENERGY, 100);
+                break;
            }
        }
    }
+
    InstallAllAccessories();

    return true;
diff --git a/src/game/Vehicle.h b/src/game/Vehicle.h
index 7c17edc..b164172 100644
--- a/src/game/Vehicle.h
+++ b/src/game/Vehicle.h
@@ -43,8 +43,8 @@ enum VehicleSeatFlags

enum PowerType
{
-    POWER_STEAM     = 61,
-    POWER_PYRITE    = 41,
+    POWER_TYPE_PYRITE = 41,
+    POWER_TYPE_STEAM  = 61
};

#define MAX_SEAT 8
@@ -66,7 +66,7 @@ class Vehicle : public Creature
        void setDeathState(DeathState s);                   // overwrite virtual Creature::setDeathState and Unit::setDeathState
        void Update(uint32 diff);                           // overwrite virtual Creature::Update and Unit::Update

-        void Regenerate(Powers power);
+        void RegeneratePower(Powers power);

        uint32 GetVehicleId() { return m_vehicleId; }
        bool SetVehicleId(uint32 vehicleid);

DOWNLOAD*NOW!

PS to Wojta. When you'll apply the patch add my "signed-off".

Gonna check them now they regenerate

Link to comment
Share on other sites

is there any newer sql's to make all of this work, because I just tried the branch and I got nothing not even a green arrow for any vehicle.

There are all updates which was posted by gen1us2k. I just applyed it in the commit.

I want vehicle class work with dbc data but I can't implement it now.

Link to comment
Share on other sites

There are all updates which was posted by gen1us2k. I just applyed it in the commit.

I want vehicle class work with dbc data but I can't implement it now.

Ok I'll tryit again thank you!

Ok Anti I've given the sql's another try and now I get the green arrow but can't use the vehicle, this only happens in Ulduar on 10man, 25 man is unpopulated for some reason....

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