mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(object): add CClientObjCreate
This commit is contained in:
parent
775320a7fc
commit
be264e22bf
72
src/object/client/CClientObjCreate.cpp
Normal file
72
src/object/client/CClientObjCreate.cpp
Normal file
@ -0,0 +1,72 @@
|
||||
#include "object/client/CClientObjCreate.hpp"
|
||||
#include "util/DataStore.hpp"
|
||||
#include "util/GUID.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
#include <common/DataStore.hpp>
|
||||
|
||||
int32_t CClientObjCreate::Get(CDataStore* msg) {
|
||||
uint16_t flags;
|
||||
msg->Get(flags);
|
||||
|
||||
this->flags = flags;
|
||||
|
||||
if (this->flags & 0x20) {
|
||||
*msg >> this->move;
|
||||
} else if (this->flags & 0x100) {
|
||||
SmartGUID guid;
|
||||
*msg >> guid;
|
||||
this->move.status.transport = guid;
|
||||
|
||||
*msg >> this->move.status.position28;
|
||||
*msg >> this->move.status.position18;
|
||||
|
||||
msg->Get(this->move.status.facing34);
|
||||
msg->Get(this->move.status.facing24);
|
||||
} else if (this->flags & 0x40) {
|
||||
this->move.status.transport = 0;
|
||||
|
||||
*msg >> this->move.status.position28;
|
||||
this->move.status.position18 = this->move.status.position28;
|
||||
|
||||
msg->Get(this->move.status.facing34);
|
||||
}
|
||||
|
||||
if (this->flags & 0x8) {
|
||||
msg->Get(this->uint2AC);
|
||||
} else {
|
||||
this->uint2AC = 0;
|
||||
}
|
||||
|
||||
if (this->flags & 0x10) {
|
||||
msg->Get(this->uint2B0);
|
||||
} else {
|
||||
this->uint2B0 = 0;
|
||||
}
|
||||
|
||||
if (this->flags & 0x4) {
|
||||
SmartGUID guid;
|
||||
*msg >> guid;
|
||||
this->guid2B8 = guid;
|
||||
} else {
|
||||
this->guid2B8 = 0;
|
||||
}
|
||||
|
||||
if (this->flags & 0x2) {
|
||||
msg->Get(this->uint2C0);
|
||||
}
|
||||
|
||||
if (this->flags & 0x80) {
|
||||
msg->Get(this->uint2C4);
|
||||
msg->Get(this->float2C8);
|
||||
}
|
||||
|
||||
if (this->flags & 0x200) {
|
||||
SmartGUID guid;
|
||||
*msg >> guid;
|
||||
this->guid2D4 = guid;
|
||||
} else {
|
||||
this->guid2D4 = 0;
|
||||
}
|
||||
|
||||
return msg->Size() >= msg->Tell();
|
||||
}
|
||||
26
src/object/client/CClientObjCreate.hpp
Normal file
26
src/object/client/CClientObjCreate.hpp
Normal file
@ -0,0 +1,26 @@
|
||||
#ifndef OBJECT_CLIENT_C_CLIENT_OBJ_CREATE_HPP
|
||||
#define OBJECT_CLIENT_C_CLIENT_OBJ_CREATE_HPP
|
||||
|
||||
#include "object/client/CClientMoveUpdate.hpp"
|
||||
#include "util/GUID.hpp"
|
||||
#include <cstdint>
|
||||
|
||||
class CDataStore;
|
||||
|
||||
struct CClientObjCreate {
|
||||
CClientMoveUpdate move;
|
||||
uint32_t flags = 0x0;
|
||||
uint32_t uint2AC;
|
||||
uint32_t uint2B0;
|
||||
// TODO
|
||||
WOWGUID guid2B8 = 0;
|
||||
uint32_t uint2C0;
|
||||
uint32_t uint2C4;
|
||||
float float2C8;
|
||||
// TODO
|
||||
WOWGUID guid2D4 = 0;
|
||||
|
||||
int32_t Get(CDataStore* msg);
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Reference in New Issue
Block a user