mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(object): add CClientMoveUpdate::Skip
This commit is contained in:
parent
31fca17064
commit
1e13e33f2a
@ -1,5 +1,16 @@
|
|||||||
#include "object/client/CClientMoveUpdate.hpp"
|
#include "object/client/CClientMoveUpdate.hpp"
|
||||||
|
|
||||||
|
void CClientMoveUpdate::Skip(CDataStore* msg) {
|
||||||
|
uint32_t moveFlags = CMovementStatus::Skip(msg);
|
||||||
|
|
||||||
|
void* data;
|
||||||
|
msg->GetDataInSitu(data, 9 * sizeof(float));
|
||||||
|
|
||||||
|
if (moveFlags & 0x8000000) {
|
||||||
|
CMoveSpline::Skip(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CDataStore& operator>>(CDataStore& msg, CClientMoveUpdate& move) {
|
CDataStore& operator>>(CDataStore& msg, CClientMoveUpdate& move) {
|
||||||
msg >> move.status;
|
msg >> move.status;
|
||||||
|
|
||||||
|
|||||||
@ -18,6 +18,8 @@ struct CClientMoveUpdate {
|
|||||||
float float80;
|
float float80;
|
||||||
// TODO
|
// TODO
|
||||||
CMoveSpline spline;
|
CMoveSpline spline;
|
||||||
|
|
||||||
|
static void Skip(CDataStore* msg);
|
||||||
};
|
};
|
||||||
|
|
||||||
CDataStore& operator>>(CDataStore& msg, CClientMoveUpdate& move);
|
CDataStore& operator>>(CDataStore& msg, CClientMoveUpdate& move);
|
||||||
|
|||||||
@ -2,6 +2,29 @@
|
|||||||
#include "util/DataStore.hpp"
|
#include "util/DataStore.hpp"
|
||||||
#include <common/Time.hpp>
|
#include <common/Time.hpp>
|
||||||
|
|
||||||
|
void CMoveSpline::Skip(CDataStore* msg) {
|
||||||
|
uint32_t flags;
|
||||||
|
msg->Get(flags);
|
||||||
|
|
||||||
|
uint32_t faceBytes = 0;
|
||||||
|
|
||||||
|
if (flags & 0x20000) {
|
||||||
|
faceBytes = 4;
|
||||||
|
} else if (flags & 0x10000) {
|
||||||
|
faceBytes = 8;
|
||||||
|
} else if (flags & 0x8000) {
|
||||||
|
faceBytes = 12;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* data;
|
||||||
|
msg->GetDataInSitu(data, faceBytes + 28);
|
||||||
|
|
||||||
|
uint32_t splinePoints = 0;
|
||||||
|
msg->Get(splinePoints);
|
||||||
|
|
||||||
|
msg->GetDataInSitu(data, (splinePoints * sizeof(C3Vector)) + 13);
|
||||||
|
}
|
||||||
|
|
||||||
CDataStore& operator>>(CDataStore& msg, CMoveSpline& spline) {
|
CDataStore& operator>>(CDataStore& msg, CMoveSpline& spline) {
|
||||||
msg.Get(spline.flags);
|
msg.Get(spline.flags);
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,8 @@ struct CMoveSpline {
|
|||||||
float float20C;
|
float float20C;
|
||||||
uint32_t uint210;
|
uint32_t uint210;
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
static void Skip(CDataStore* msg);
|
||||||
};
|
};
|
||||||
|
|
||||||
CDataStore& operator>>(CDataStore& msg, CMoveSpline& spline);
|
CDataStore& operator>>(CDataStore& msg, CMoveSpline& spline);
|
||||||
|
|||||||
@ -1,6 +1,48 @@
|
|||||||
#include "object/movement/CMovementStatus.hpp"
|
#include "object/movement/CMovementStatus.hpp"
|
||||||
#include "util/DataStore.hpp"
|
#include "util/DataStore.hpp"
|
||||||
|
|
||||||
|
uint32_t CMovementStatus::Skip(CDataStore* msg) {
|
||||||
|
uint32_t moveFlags = 0;
|
||||||
|
msg->Get(moveFlags);
|
||||||
|
|
||||||
|
uint16_t uint14;
|
||||||
|
msg->Get(uint14);
|
||||||
|
|
||||||
|
void* data;
|
||||||
|
msg->GetDataInSitu(data, 20);
|
||||||
|
|
||||||
|
uint32_t skipBytes = 0;
|
||||||
|
|
||||||
|
if (moveFlags & 0x200) {
|
||||||
|
SmartGUID guid;
|
||||||
|
*msg >> guid;
|
||||||
|
|
||||||
|
skipBytes += 21;
|
||||||
|
|
||||||
|
if (uint14 & 0x400) {
|
||||||
|
skipBytes += 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((moveFlags & (0x200000 | 0x2000000)) || (uint14 & 0x20)) {
|
||||||
|
skipBytes += 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
skipBytes += 4;
|
||||||
|
|
||||||
|
if (moveFlags & 0x1000) {
|
||||||
|
skipBytes += 16;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (moveFlags & 0x4000000) {
|
||||||
|
skipBytes += 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
msg->GetDataInSitu(data, skipBytes);
|
||||||
|
|
||||||
|
return moveFlags;
|
||||||
|
}
|
||||||
|
|
||||||
CDataStore& operator>>(CDataStore& msg, CMovementStatus& move) {
|
CDataStore& operator>>(CDataStore& msg, CMovementStatus& move) {
|
||||||
msg.Get(move.moveFlags);
|
msg.Get(move.moveFlags);
|
||||||
msg.Get(move.uint14);
|
msg.Get(move.uint14);
|
||||||
|
|||||||
@ -25,6 +25,8 @@ struct CMovementStatus {
|
|||||||
float float4C = 0.0f;
|
float float4C = 0.0f;
|
||||||
float float50 = 0.0f;
|
float float50 = 0.0f;
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
static uint32_t Skip(CDataStore* msg);
|
||||||
};
|
};
|
||||||
|
|
||||||
CDataStore& operator>>(CDataStore& msg, CMovementStatus& move);
|
CDataStore& operator>>(CDataStore& msg, CMovementStatus& move);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user