From 5fbda48c54c5f348da2064448b99c25bcc997e18 Mon Sep 17 00:00:00 2001 From: Uleat Date: Sat, 16 Nov 2019 17:10:40 -0500 Subject: [PATCH] Brought Actor Position Update packets up to RoF2 standard in preparation for boat control modifications. Tested on all 6 supported clients - please report any anomalies --- common/eq_packet_structs.h | 65 +++++++++++++++-------------- common/patches/rof.cpp | 2 + common/patches/rof2.cpp | 40 ------------------ common/patches/rof2_ops.h | 2 - common/patches/rof2_structs.h | 69 ++++++++++++++++--------------- common/patches/rof_structs.h | 63 ++++++++++++++-------------- common/patches/sod.cpp | 1 + common/patches/sod_structs.h | 60 +++++++++++++-------------- common/patches/sof.cpp | 1 + common/patches/sof_structs.h | 58 +++++++++++++------------- common/patches/titanium.cpp | 41 ++++++++++++++++++ common/patches/titanium_ops.h | 2 + common/patches/titanium_structs.h | 56 ++++++++++++------------- common/patches/uf.cpp | 1 + common/patches/uf_structs.h | 60 +++++++++++++-------------- zone/mob.cpp | 9 ++-- 16 files changed, 272 insertions(+), 258 deletions(-) diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index fb9260857..53d7021ba 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -1358,21 +1358,24 @@ struct BecomeCorpse_Struct { */ struct PlayerPositionUpdateServer_Struct { -/*0000*/ uint16 spawn_id; -/*0002*/ int32 delta_heading:10, // change in heading - x_pos:19, // x coord - padding0002:3; // ***Placeholder -/*0006*/ int32 y_pos:19, // y coord - animation:10, // animation - padding0006:3; // ***Placeholder -/*0010*/ int32 z_pos:19, // z coord - delta_y:13; // change in y -/*0014*/ int32 delta_x:13, // change in x - heading:12, // heading - padding0014:7; // ***Placeholder -/*0018*/ int32 delta_z:13, // change in z - padding0018:19; // ***Placeholder -/*0022*/ +/*0000*/ uint16 spawn_id; +/*0002*/ uint16 vehicle_id; +/*0004*/ signed padding0004 : 12; + signed y_pos : 19; // y coord + unsigned padding : 1; +/*0008*/ signed delta_z : 13; // change in z + signed delta_x : 13; // change in x + signed padding0008 : 6; +/*0012*/ signed x_pos : 19; // x coord + unsigned heading : 12; // heading + signed padding0016 : 1; +/*0016*/ signed delta_heading : 10; // change in heading + signed z_pos : 19; // z coord + signed padding0020 : 3; +/*0020*/ signed animation : 10; // animation + signed delta_y : 13; // change in y + signed padding0024 : 9; +/*0024*/ }; /* @@ -1383,21 +1386,23 @@ struct PlayerPositionUpdateServer_Struct */ struct PlayerPositionUpdateClient_Struct { -/*0000*/ uint16 spawn_id; -/*0002*/ uint16 sequence; //increments one each packet -/*0004*/ float y_pos; // y coord -/*0008*/ float delta_z; // Change in z -/*0012*/ float delta_x; // Change in x -/*0016*/ float delta_y; // Change in y -/*0020*/ int32 animation:10, // animation - delta_heading:10, // change in heading - padding0020:12; // ***Placeholder (mostly 1) -/*0024*/ float x_pos; // x coord -/*0028*/ float z_pos; // z coord -/*0032*/ uint16 heading:12, // Directional heading - padding0004:4; // ***Placeholder -/*0034*/ uint8 unknown0006[2]; // ***Placeholder -/*0036*/ +/*0000*/ uint16 sequence; // increments one each packet - Verified +/*0002*/ uint16 spawn_id; // Player's spawn id +/*0004*/ uint16 vehicle_id; // Player's vehicle spawn id +/*0006*/ uint8 unknown0004[4]; // ***Placeholder +/*0010*/ float delta_x; // Change in x +/*0014*/ unsigned heading : 12; // Directional heading + unsigned padding0040 : 20; // ***Placeholder +/*0018*/ float x_pos; // x coord (2nd loc value) +/*0022*/ float delta_z; // Change in z +/*0026*/ float z_pos; // z coord (3rd loc value) +/*0030*/ float y_pos; // y coord (1st loc value) +/*0034*/ unsigned animation : 10; // ***Placeholder + unsigned padding0024 : 22; // animation +/*0038*/ float delta_y; // Change in y +/*0042*/ signed delta_heading : 10; // change in heading + unsigned padding0041 : 22; // ***Placeholder +/*0046*/ }; struct SpawnPositionUpdate_Struct diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index cfc3458c3..fd75cb3db 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -624,6 +624,7 @@ namespace RoF SETUP_DIRECT_ENCODE(PlayerPositionUpdateServer_Struct, structs::PlayerPositionUpdateServer_Struct); OUT(spawn_id); + OUT(vehicle_id); OUT(x_pos); OUT(delta_x); OUT(delta_y); @@ -4314,6 +4315,7 @@ namespace RoF SETUP_DIRECT_DECODE(PlayerPositionUpdateClient_Struct, structs::PlayerPositionUpdateClient_Struct); IN(spawn_id); + IN(vehicle_id); IN(sequence); IN(x_pos); IN(y_pos); diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 2dc361b26..11bb99af7 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -686,25 +686,6 @@ namespace RoF2 FINISH_ENCODE(); } - ENCODE(OP_ClientUpdate) - { - ENCODE_LENGTH_EXACT(PlayerPositionUpdateServer_Struct); - SETUP_DIRECT_ENCODE(PlayerPositionUpdateServer_Struct, structs::PlayerPositionUpdateServer_Struct); - - OUT(spawn_id); - OUT(x_pos); - OUT(delta_x); - OUT(delta_y); - OUT(z_pos); - OUT(delta_heading); - OUT(y_pos); - OUT(delta_z); - OUT(animation); - OUT(heading); - - FINISH_ENCODE(); - } - ENCODE(OP_Consider) { ENCODE_LENGTH_EXACT(Consider_Struct); @@ -4545,27 +4526,6 @@ namespace RoF2 FINISH_DIRECT_DECODE(); } - DECODE(OP_ClientUpdate) - { - // for some odd reason, there is an extra byte on the end of this on occasion.. - DECODE_LENGTH_ATLEAST(structs::PlayerPositionUpdateClient_Struct); - SETUP_DIRECT_DECODE(PlayerPositionUpdateClient_Struct, structs::PlayerPositionUpdateClient_Struct); - - IN(spawn_id); - IN(sequence); - IN(x_pos); - IN(y_pos); - IN(z_pos); - IN(heading); - IN(delta_x); - IN(delta_y); - IN(delta_z); - IN(delta_heading); - IN(animation); - - FINISH_DIRECT_DECODE(); - } - DECODE(OP_Consider) { DECODE_LENGTH_EXACT(structs::Consider_Struct); diff --git a/common/patches/rof2_ops.h b/common/patches/rof2_ops.h index 7ee120c97..32798fef5 100644 --- a/common/patches/rof2_ops.h +++ b/common/patches/rof2_ops.h @@ -52,7 +52,6 @@ E(OP_CastSpell) E(OP_ChannelMessage) E(OP_CharInventory) E(OP_ClickObjectAction) -E(OP_ClientUpdate) E(OP_Consider) E(OP_Damage) E(OP_DeleteCharge) @@ -155,7 +154,6 @@ D(OP_BuffRemoveRequest) D(OP_CastSpell) D(OP_ChannelMessage) D(OP_CharacterCreate) -D(OP_ClientUpdate) D(OP_Consider) D(OP_ConsiderCorpse) D(OP_Consume) diff --git a/common/patches/rof2_structs.h b/common/patches/rof2_structs.h index f36906df0..cecafb767 100644 --- a/common/patches/rof2_structs.h +++ b/common/patches/rof2_structs.h @@ -1620,24 +1620,24 @@ struct RespawnWindow_Struct { */ struct PlayerPositionUpdateServer_Struct { - /*0000*/ uint16 spawn_id; - /*0002*/ uint16 spawnId2; - /*0004*/ signed padding0004 : 12; - signed y_pos : 19; // y coord - unsigned padding : 1; - /*0008*/ signed delta_z : 13; // change in z - signed delta_x : 13; // change in x - signed padding0008 : 6; - /*0012*/ signed x_pos : 19; // x coord - unsigned heading : 12; // heading - signed padding0016 : 1; - /*0016*/ signed delta_heading : 10; // change in heading - signed z_pos : 19; // z coord - signed padding0020 : 3; - /*0020*/ signed animation : 10; // animation - signed delta_y : 13; // change in y - signed padding0024 : 9; - /*0024*/ +/*0000*/ uint16 spawn_id; +/*0002*/ uint16 vehicle_id; +/*0004*/ signed padding0004 : 12; + signed y_pos : 19; // y coord + unsigned padding : 1; +/*0008*/ signed delta_z : 13; // change in z + signed delta_x : 13; // change in x + signed padding0008 : 6; +/*0012*/ signed x_pos : 19; // x coord + unsigned heading : 12; // heading + signed padding0016 : 1; +/*0016*/ signed delta_heading : 10; // change in heading + signed z_pos : 19; // z coord + signed padding0020 : 3; +/*0020*/ signed animation : 10; // animation + signed delta_y : 13; // change in y + signed padding0024 : 9; +/*0024*/ }; /* @@ -1648,22 +1648,23 @@ struct PlayerPositionUpdateServer_Struct */ struct PlayerPositionUpdateClient_Struct { - /*0000*/ uint16 sequence; // increments one each packet - Verified - /*0002*/ uint16 spawn_id; // Player's spawn id - /*0004*/ uint8 unknown0004[6]; // ***Placeholder - /*0010*/ float delta_x; // Change in x - /*0014*/ unsigned heading : 12; // Directional heading - unsigned padding0040 : 20; // ***Placeholder - /*0018*/ float x_pos; // x coord (2nd loc value) - /*0022*/ float delta_z; // Change in z - /*0026*/ float z_pos; // z coord (3rd loc value) - /*0030*/ float y_pos; // y coord (1st loc value) - /*0034*/ unsigned animation : 10; // ***Placeholder - unsigned padding0024 : 22; // animation - /*0038*/ float delta_y; // Change in y - /*0042*/ signed delta_heading : 10; // change in heading - unsigned padding0041 : 22; // ***Placeholder - /*0046*/ +/*0000*/ uint16 sequence; // increments one each packet - Verified +/*0002*/ uint16 spawn_id; // Player's spawn id +/*0004*/ uint16 vehicle_id; // Player's vehicle spawn id +/*0006*/ uint8 unknown0004[4]; // ***Placeholder +/*0010*/ float delta_x; // Change in x +/*0014*/ unsigned heading : 12; // Directional heading + unsigned padding0040 : 20; // ***Placeholder +/*0018*/ float x_pos; // x coord (2nd loc value) +/*0022*/ float delta_z; // Change in z +/*0026*/ float z_pos; // z coord (3rd loc value) +/*0030*/ float y_pos; // y coord (1st loc value) +/*0034*/ unsigned animation : 10; // ***Placeholder + unsigned padding0024 : 22; // animation +/*0038*/ float delta_y; // Change in y +/*0042*/ signed delta_heading : 10; // change in heading + unsigned padding0041 : 22; // ***Placeholder +/*0046*/ }; /* diff --git a/common/patches/rof_structs.h b/common/patches/rof_structs.h index e9122a156..7f466f09b 100644 --- a/common/patches/rof_structs.h +++ b/common/patches/rof_structs.h @@ -1608,22 +1608,22 @@ struct RespawnWindow_Struct { */ struct PlayerPositionUpdateServer_Struct { -/*0000*/ uint16 spawn_id; -/*0002*/ uint16 spawnId2; -/*0004*/ signed padding0004:12; - signed y_pos:19; // y coord - unsigned padding:1; -/*0008*/ signed delta_x:13; // change in x - signed delta_heading:10;// change in heading - signed padding0008:9; -/*0012*/ signed delta_y:13; // change in y - signed z_pos:19; // z coord -/*0016*/ signed x_pos:19; // x coord - signed animation:10; // animation - signed padding0016:3; -/*0020*/ unsigned heading:12; // heading - signed delta_z:13; // change in z - signed padding0020:7; +/*0000*/ uint16 spawn_id; +/*0002*/ uint16 vehicle_id; +/*0004*/ signed padding0004 : 12; + signed y_pos : 19; // y coord + unsigned padding : 1; +/*0008*/ signed delta_x : 13; // change in x + signed delta_heading : 10; // change in heading + signed padding0008 : 9; +/*0012*/ signed delta_y : 13; // change in y + signed z_pos : 19; // z coord +/*0016*/ signed x_pos : 19; // x coord + signed animation : 10; // animation + signed padding0016 : 3; +/*0020*/ unsigned heading : 12; // heading + signed delta_z : 13; // change in z + signed padding0020 : 7; /*0024*/ }; @@ -1636,21 +1636,22 @@ struct PlayerPositionUpdateServer_Struct */ struct PlayerPositionUpdateClient_Struct { -/*0000*/ uint16 sequence; // increments one each packet - Verified -/*0002*/ uint16 spawn_id; // Player's spawn id -/*0004*/ uint8 unknown0004[6]; // ***Placeholder -/*0010*/ float delta_y; // Change in y -/*0014*/ float x_pos; // x coord (2nd loc value) -/*0018*/ float y_pos; // y coord (1st loc value) -/*0022*/ signed delta_heading:10; // change in heading - unsigned animation:10; // ***Placeholder - unsigned padding0024:12; // animation -/*0026*/ float delta_z; // Change in z -/*0030*/ float delta_x; // Change in x -/*0034*/ float z_pos; // z coord (3rd loc value) -/*0038*/ unsigned heading:12; // Directional heading - unsigned padding0040:10; // ***Placeholder - unsigned padding0041:10; // ***Placeholder +/*0000*/ uint16 sequence; // increments one each packet - Verified +/*0002*/ uint16 spawn_id; // Player's spawn id +/*0004*/ uint16 vehicle_id; // Player's vehicle spawn id +/*0006*/ uint8 unknown0004[4]; // ***Placeholder +/*0010*/ float delta_y; // Change in y +/*0014*/ float x_pos; // x coord (2nd loc value) +/*0018*/ float y_pos; // y coord (1st loc value) +/*0022*/ signed delta_heading : 10; // change in heading + unsigned animation : 10; // ***Placeholder + unsigned padding0024 : 12; // animation +/*0026*/ float delta_z; // Change in z +/*0030*/ float delta_x; // Change in x +/*0034*/ float z_pos; // z coord (3rd loc value) +/*0038*/ unsigned heading : 12; // Directional heading + unsigned padding0040 : 10; // ***Placeholder + unsigned padding0041 : 10; // ***Placeholder /*0042*/ }; diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 2c05c1425..709b07363 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -2926,6 +2926,7 @@ namespace SoD IN(delta_z); IN(delta_heading); IN(animation); + emu->vehicle_id = 0; FINISH_DIRECT_DECODE(); } diff --git a/common/patches/sod_structs.h b/common/patches/sod_structs.h index 0d201e13a..0803432db 100644 --- a/common/patches/sod_structs.h +++ b/common/patches/sod_structs.h @@ -1372,21 +1372,21 @@ struct RespawnWindow_Struct { */ struct PlayerPositionUpdateServer_Struct { -/*0000*/ uint16 spawn_id; -/*0002*/ signed padding0000:12; // ***Placeholder - signed delta_x:13; // change in x - signed padding0005:7; // ***Placeholder -/*0006*/ signed delta_heading:10;// change in heading - signed delta_y:13; // change in y - signed padding0006:9; // ***Placeholder -/*0010*/ signed y_pos:19; // y coord - signed animation:10; // animation - signed padding0010:3; // ***Placeholder -/*0014*/ unsigned heading:12; // heading - signed x_pos:19; // x coord - signed padding0014:1; // ***Placeholder -/*0018*/ signed z_pos:19; // z coord - signed delta_z:13; // change in z +/*0000*/ uint16 spawn_id; +/*0002*/ signed padding0000 : 12; // ***Placeholder + signed delta_x : 13; // change in x + signed padding0005 : 7; // ***Placeholder +/*0006*/ signed delta_heading : 10; // change in heading + signed delta_y : 13; // change in y + signed padding0006 : 9; // ***Placeholder +/*0010*/ signed y_pos : 19; // y coord + signed animation : 10; // animation + signed padding0010 : 3; // ***Placeholder +/*0014*/ unsigned heading : 12; // heading + signed x_pos : 19; // x coord + signed padding0014 : 1; // ***Placeholder +/*0018*/ signed z_pos : 19; // z coord + signed delta_z : 13; // change in z /*0022*/ }; @@ -1399,21 +1399,21 @@ struct PlayerPositionUpdateServer_Struct */ struct PlayerPositionUpdateClient_Struct { -/*0000*/ uint16 spawn_id; // Player's spawn id -/*0002*/ uint16 sequence; // increments one each packet - Verified -/*0004*/ uint8 unknown0004[4]; // ***Placeholder -/*0008*/ float x_pos; // x coord (2nd loc value) -/*0012*/ float y_pos; // y coord (1st loc value) -/*0016*/ signed delta_heading:10; // change in heading - unsigned padding0036:10; // animation - unsigned padding0016:12; // ***Placeholder -/*0020*/ float delta_x; // Change in x -/*0024*/ float delta_y; // Change in y -/*0028*/ float z_pos; // z coord (3rd loc value) -/*0032*/ float delta_z; // Change in z -/*0036*/ unsigned animation:10; // ***Placeholder - unsigned heading:12; // Directional heading - unsigned padding0037:10; // ***Placeholder +/*0000*/ uint16 spawn_id; // Player's spawn id +/*0002*/ uint16 sequence; // increments one each packet - Verified +/*0004*/ uint8 unknown0004[4]; // ***Placeholder +/*0008*/ float x_pos; // x coord (2nd loc value) +/*0012*/ float y_pos; // y coord (1st loc value) +/*0016*/ signed delta_heading : 10; // change in heading + unsigned padding0036 : 10; // animation + unsigned padding0016 : 12; // ***Placeholder +/*0020*/ float delta_x; // Change in x +/*0024*/ float delta_y; // Change in y +/*0028*/ float z_pos; // z coord (3rd loc value) +/*0032*/ float delta_z; // Change in z +/*0036*/ unsigned animation : 10; // ***Placeholder + unsigned heading : 12; // Directional heading + unsigned padding0037 : 10; // ***Placeholder /*0040*/ }; diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 0d2189740..9f5626100 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -2387,6 +2387,7 @@ namespace SoF IN(delta_z); IN(delta_heading); IN(animation); + emu->vehicle_id = 0; FINISH_DIRECT_DECODE(); } diff --git a/common/patches/sof_structs.h b/common/patches/sof_structs.h index 4d4a591e1..0b175b643 100644 --- a/common/patches/sof_structs.h +++ b/common/patches/sof_structs.h @@ -1373,21 +1373,21 @@ struct RespawnWindow_Struct { struct PlayerPositionUpdateServer_Struct { -/*0000*/ uint16 spawn_id; // Entity ID of the Spawn/Player -/*0002*/ signed padding0000:12; // ***Placeholder - signed x_pos:19; // x coord - signed padding0290:1; // ***Placeholder -/*0006*/ signed delta_x:13; // change in x - signed delta_y:13; // change in y - signed padding0294:6; // ***Placeholder -/*0010*/ signed z_pos:19; // z coord - signed delta_heading:10; // change in heading - signed padding0298:3; // ***Placeholder -/*0014*/ signed y_pos:19; // y coord - signed delta_z:13; // change in z -/*0022*/ signed animation:10; // animation - unsigned heading:12; // heading - signed padding0302:10; // ***Placeholder +/*0000*/ uint16 spawn_id; // Entity ID of the Spawn/Player +/*0002*/ signed padding0000 : 12; // ***Placeholder + signed x_pos : 19; // x coord + signed padding0290 : 1; // ***Placeholder +/*0006*/ signed delta_x : 13; // change in x + signed delta_y : 13; // change in y + signed padding0294 : 6; // ***Placeholder +/*0010*/ signed z_pos : 19; // z coord + signed delta_heading : 10; // change in heading + signed padding0298 : 3; // ***Placeholder +/*0014*/ signed y_pos : 19; // y coord + signed delta_z : 13; // change in z +/*0022*/ signed animation : 10; // animation + unsigned heading : 12; // heading + signed padding0302 : 10; // ***Placeholder /*0026*/ }; @@ -1399,20 +1399,20 @@ struct PlayerPositionUpdateServer_Struct */ struct PlayerPositionUpdateClient_Struct { -/*0000*/ uint16 spawn_id; // Player's Entity ID - Verified -/*0002*/ uint16 sequence; //increments one each packet - Verified -/*0004*/ uint8 unknown0004[4]; // ***Placeholder -/*0008*/ float delta_z; // Change in z -/*0012*/ float x_pos; // x coord - Verified -/*0016*/ signed delta_heading:10; // Change in heading - signed animation:10; // Animation - unsigned padding0028:12; // Seems to always be 0 -/*0020*/ float y_pos; // y coord - Verified -/*0024*/ float delta_x; // Change in x -/*0028*/ unsigned heading:12; // Directional heading - Verified - unsigned padding0032:20; // ***Placeholder - Some Static Number -/*0032*/ float delta_y; // Change in y -/*0036*/ float z_pos; // z coord - Verified +/*0000*/ uint16 spawn_id; // Player's Entity ID - Verified +/*0002*/ uint16 sequence; //increments one each packet - Verified +/*0004*/ uint8 unknown0004[4]; // ***Placeholder +/*0008*/ float delta_z; // Change in z +/*0012*/ float x_pos; // x coord - Verified +/*0016*/ signed delta_heading : 10; // Change in heading + signed animation : 10; // Animation + unsigned padding0028 : 12; // Seems to always be 0 +/*0020*/ float y_pos; // y coord - Verified +/*0024*/ float delta_x; // Change in x +/*0028*/ unsigned heading : 12; // Directional heading - Verified + unsigned padding0032 : 20; // ***Placeholder - Some Static Number +/*0032*/ float delta_y; // Change in y +/*0036*/ float z_pos; // z coord - Verified /*0040*/ }; diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index 5cb8e5897..b612b9173 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -350,6 +350,25 @@ namespace Titanium dest->FastQueuePacket(&in, ack_req); } + ENCODE(OP_ClientUpdate) + { + ENCODE_LENGTH_EXACT(PlayerPositionUpdateServer_Struct); + SETUP_DIRECT_ENCODE(PlayerPositionUpdateServer_Struct, structs::PlayerPositionUpdateServer_Struct); + + OUT(spawn_id); + OUT(x_pos); + OUT(delta_x); + OUT(delta_y); + OUT(z_pos); + OUT(delta_heading); + OUT(y_pos); + OUT(delta_z); + OUT(animation); + OUT(heading); + + FINISH_ENCODE(); + } + ENCODE(OP_Damage) { ENCODE_LENGTH_EXACT(CombatDamage_Struct); @@ -1878,6 +1897,28 @@ namespace Titanium FINISH_DIRECT_DECODE(); } + DECODE(OP_ClientUpdate) + { + // for some odd reason, there is an extra byte on the end of this on occasion.. (copied from SoF..not sure if applies to Ti - TODO: check) + DECODE_LENGTH_ATLEAST(structs::PlayerPositionUpdateClient_Struct); + SETUP_DIRECT_DECODE(PlayerPositionUpdateClient_Struct, structs::PlayerPositionUpdateClient_Struct); + + IN(spawn_id); + IN(sequence); + IN(x_pos); + IN(y_pos); + IN(z_pos); + IN(heading); + IN(delta_x); + IN(delta_y); + IN(delta_z); + IN(delta_heading); + IN(animation); + emu->vehicle_id = 0; + + FINISH_DIRECT_DECODE(); + } + DECODE(OP_Consume) { DECODE_LENGTH_EXACT(structs::Consume_Struct); diff --git a/common/patches/titanium_ops.h b/common/patches/titanium_ops.h index dafb8b903..d3c8c1dde 100644 --- a/common/patches/titanium_ops.h +++ b/common/patches/titanium_ops.h @@ -27,6 +27,7 @@ E(OP_BecomeTrader) E(OP_Buff) E(OP_ChannelMessage) E(OP_CharInventory) +E(OP_ClientUpdate) E(OP_Damage) E(OP_DeleteCharge) E(OP_DeleteItem) @@ -82,6 +83,7 @@ D(OP_Bug) D(OP_CastSpell) D(OP_ChannelMessage) D(OP_CharacterCreate) +D(OP_ClientUpdate) D(OP_Consume) D(OP_DeleteItem) D(OP_Emote) diff --git a/common/patches/titanium_structs.h b/common/patches/titanium_structs.h index 6ffee7ddf..de350db0b 100644 --- a/common/patches/titanium_structs.h +++ b/common/patches/titanium_structs.h @@ -1197,20 +1197,20 @@ struct BecomeCorpse_Struct { */ struct PlayerPositionUpdateServer_Struct { -/*0000*/ uint16 spawn_id; -/*0002*/ int32 delta_heading:10, // change in heading - x_pos:19, // x coord - padding0002:3; // ***Placeholder -/*0006*/ int32 y_pos:19, // y coord - animation:10, // animation - padding0006:3; // ***Placeholder -/*0010*/ int32 z_pos:19, // z coord - delta_y:13; // change in y -/*0014*/ int32 delta_x:13, // change in x - heading:12, // heading - padding0014:7; // ***Placeholder -/*0018*/ int32 delta_z:13, // change in z - padding0018:19; // ***Placeholder +/*0000*/ uint16 spawn_id; +/*0002*/ int32 delta_heading : 10, // change in heading + x_pos : 19, // x coord + padding0002 : 3; // ***Placeholder +/*0006*/ int32 y_pos : 19, // y coord + animation : 10, // animation + padding0006 : 3; // ***Placeholder +/*0010*/ int32 z_pos : 19, // z coord + delta_y : 13; // change in y +/*0014*/ int32 delta_x : 13, // change in x + heading : 12, // heading + padding0014 : 7; // ***Placeholder +/*0018*/ int32 delta_z : 13, // change in z + padding0018 : 19; // ***Placeholder /*0022*/ }; @@ -1222,20 +1222,20 @@ struct PlayerPositionUpdateServer_Struct */ struct PlayerPositionUpdateClient_Struct { -/*0000*/ uint16 spawn_id; -/*0022*/ uint16 sequence; //increments one each packet -/*0004*/ float y_pos; // y coord -/*0008*/ float delta_z; // Change in z -/*0016*/ float delta_x; // Change in x -/*0012*/ float delta_y; // Change in y -/*0020*/ int32 animation:10, // animation - delta_heading:10, // change in heading - padding0020:12; // ***Placeholder (mostly 1) -/*0024*/ float x_pos; // x coord -/*0028*/ float z_pos; // z coord -/*0034*/ uint16 heading:12, // Directional heading - padding0004:4; // ***Placeholder -/*0032*/ uint8 unknown0006[2]; // ***Placeholder +/*0000*/ uint16 spawn_id; +/*0022*/ uint16 sequence; // increments one each packet +/*0004*/ float y_pos; // y coord +/*0008*/ float delta_z; // Change in z +/*0016*/ float delta_x; // Change in x +/*0012*/ float delta_y; // Change in y +/*0020*/ int32 animation : 10, // animation + delta_heading : 10, // change in heading + padding0020 : 12; // ***Placeholder (mostly 1) +/*0024*/ float x_pos; // x coord +/*0028*/ float z_pos; // z coord +/*0034*/ uint16 heading : 12, // Directional heading + padding0004 : 4; // ***Placeholder +/*0032*/ uint8 unknown0006[2]; // ***Placeholder /*0036*/ }; diff --git a/common/patches/uf.cpp b/common/patches/uf.cpp index 0d44d7d1a..ef28e8e33 100644 --- a/common/patches/uf.cpp +++ b/common/patches/uf.cpp @@ -3252,6 +3252,7 @@ namespace UF IN(delta_z); IN(delta_heading); IN(animation); + emu->vehicle_id = 0; FINISH_DIRECT_DECODE(); } diff --git a/common/patches/uf_structs.h b/common/patches/uf_structs.h index 8e3309734..e165da794 100644 --- a/common/patches/uf_structs.h +++ b/common/patches/uf_structs.h @@ -1413,21 +1413,21 @@ struct RespawnWindow_Struct { */ struct PlayerPositionUpdateServer_Struct { -/*0000*/ uint16 spawn_id; -/*0002*/ signed padding0000:12; // ***Placeholder - signed delta_x:13; // change in x - signed padding0005:7; // ***Placeholder -/*0006*/ signed delta_heading:10;// change in heading - signed delta_y:13; // change in y - signed padding0006:9; // ***Placeholder -/*0010*/ signed y_pos:19; // y coord - signed animation:10; // animation - signed padding0010:3; // ***Placeholder -/*0014*/ unsigned heading:12; // heading - signed x_pos:19; // x coord - signed padding0014:1; // ***Placeholder -/*0018*/ signed z_pos:19; // z coord - signed delta_z:13; // change in z +/*0000*/ uint16 spawn_id; +/*0002*/ signed padding0000 : 12; // ***Placeholder + signed delta_x : 13; // change in x + signed padding0005 : 7; // ***Placeholder +/*0006*/ signed delta_heading : 10; // change in heading + signed delta_y : 13; // change in y + signed padding0006 : 9; // ***Placeholder +/*0010*/ signed y_pos : 19; // y coord + signed animation : 10; // animation + signed padding0010 : 3; // ***Placeholder +/*0014*/ unsigned heading : 12; // heading + signed x_pos : 19; // x coord + signed padding0014 : 1; // ***Placeholder +/*0018*/ signed z_pos : 19; // z coord + signed delta_z : 13; // change in z /*0022*/ }; @@ -1440,21 +1440,21 @@ struct PlayerPositionUpdateServer_Struct */ struct PlayerPositionUpdateClient_Struct { -/*0000*/ uint16 spawn_id; // Player's spawn id -/*0002*/ uint16 sequence; // increments one each packet - Verified -/*0004*/ uint8 unknown0004[4]; // ***Placeholder -/*0008*/ float x_pos; // x coord (2nd loc value) -/*0012*/ float y_pos; // y coord (1st loc value) -/*0016*/ signed delta_heading:10; // change in heading - unsigned padding0036:10; // animation - unsigned padding0016:12; // ***Placeholder -/*0020*/ float delta_x; // Change in x -/*0024*/ float delta_y; // Change in y -/*0028*/ float z_pos; // z coord (3rd loc value) -/*0032*/ float delta_z; // Change in z -/*0036*/ unsigned animation:10; // ***Placeholder - unsigned heading:12; // Directional heading - unsigned padding0037:10; // ***Placeholder +/*0000*/ uint16 spawn_id; // Player's spawn id +/*0002*/ uint16 sequence; // increments one each packet - Verified +/*0004*/ uint8 unknown0004[4]; // ***Placeholder +/*0008*/ float x_pos; // x coord (2nd loc value) +/*0012*/ float y_pos; // y coord (1st loc value) +/*0016*/ signed delta_heading : 10; // change in heading + unsigned padding0036 : 10; // animation + unsigned padding0016 : 12; // ***Placeholder +/*0020*/ float delta_x; // Change in x +/*0024*/ float delta_y; // Change in y +/*0028*/ float z_pos; // z coord (3rd loc value) +/*0032*/ float delta_z; // Change in z +/*0036*/ unsigned animation : 10; // ***Placeholder + unsigned heading : 12; // Directional heading + unsigned padding0037 : 10; // ***Placeholder /*0040*/ }; diff --git a/zone/mob.cpp b/zone/mob.cpp index a8723545f..37d59c78c 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -4445,10 +4445,11 @@ void Mob::DoKnockback(Mob *caster, uint32 pushback, uint32 pushup) spu->delta_y = FloatToEQ13(static_cast(new_y)); spu->delta_z = FloatToEQ13(static_cast(pushup)); spu->heading = FloatToEQ12(GetHeading()); - spu->padding0002 =0; - spu->padding0006 =7; - spu->padding0014 =0x7f; - spu->padding0018 =0x5df27; + // for ref: these were not passed on to other 5 clients while on Titanium standard (change to RoF2 standard: 11/16/2019) + //eq->padding0002 = 0; + //eq->padding0006 = 0x7; + //eq->padding0014 = 0x7F; + //eq->padding0018 = 0x5dF27; spu->animation = 0; spu->delta_heading = FloatToEQ10(0); outapp_push->priority = 6;