-
Автор темы
- #1
Данная реализация не моя, да и в общем-то пользуйтесь пока не пофиксили, надеюсь обновить сможете
СДЕЛАНО ПРИ ПОМОЩИ ACEID
Код:
enum ESMType {
eSMT_None = 0xFFFFFFFF,
eSMT_Haste = 0x0,
eSMT_Climb = 0x1,
eSMT_Slide = 0x2,
eSMT_KnockBack = 0x3,
eSMT_RaiseAssist = 0x4,
eSMT_Vault = 0x5,
eSMT_CoopCinematic = 0x6,
eSMT_CoopClimb = 0x7,
eSMT_CoopAssist = 0x8,
eSMT_InteractionAction = 0x9,
eSMT_HoldEntity = 0xA,
eSMT_RopeClimb = 0xB,
eSMT_NumSpecialMoves = 0xC,
};
C++:
enum EMessageType : int {
eMT_Start = 0x0,
eMT_End = 0x1,
eMT_Message = 0x2,
};
C++:
class CEidSerializer {
public:
__int32 m_id; //0x0000
__int32 m_valid; //0x0004
};
C++:
namespace SM_Network {
struct SMessage {
void* handler;
ESMType type;
SM_Network::EMessageType msgType;
CTimeValue serverTime;
int opcode;
bool instant;
}; //Size=0x0018
struct SHoldEntityMessage : SM_Network::SMessage
{
unsigned int entityId;
unsigned int playerId;
CryStringT<char> itemName;
};
struct SKnockBackMessage : SMessage {
Quat_tpl<float> animStartLocalRot;
Vec3_tpl<float> startPos;
CEidSerializer standingOn;
}; //Size=0x0040
struct SVaultMessage : SMessage {
int animIndex;
QuatT_tpl<float> animStartPose;
Vec3_tpl<float> helperClosestPoint;
bool animFinished;
}; //Size=0x0048
struct SClimbMessage : SMessage {
int animIndex;
QuatT_tpl<float> animStartPose;
Vec3_tpl<float> helperClosestPoint;
bool animFinished;
};
struct SCoopAssistMessage : SMessage {
int animIndex;
bool singleClimb;
Vec3_tpl<float> animStartPos;
Vec3_tpl<float> helperClosestPoint;
unsigned int climber;
Lineseg_tpl<float> edge;
__int64 ServerStartFrame;
};
struct SCoopCinematicMessage : SMessage {
EntityId locatorId;
};
struct SCoopClimbMessage : SMessage {
EntityId targetId;
};
struct SRaiseAssistMessage : SMessage {
unsigned int targetId;
};
struct SInteractionActionMessage : SMessage {
CryStringT<char> action;
float interactionTime;
int stance;
unsigned int interactionTrigger;
Vec3_tpl<float> moveToPos;
Vec3_tpl<float> lookAtPos;
unsigned int attachmentId;
CryStringT<char> attachmentModel;
bool attachModelOnStart;
bool holsterInBeforeAction;
bool holsterOutAfterAction;
};
}
C++:
SM_Network::SClimbMessage msg;
::memset(&msg, 0, sizeof(SM_Network::SClimbMessage));
{
msg.type = ESMType::eSMT_Climb;
msg.msgType = SM_Network::EMessageType::eMT_End;
msg.instant = false;
msg.opcode = 0;
msg.animIndex = 3;
msg.animFinished = true;
msg.animStartPose = QuatT();
msg.helperClosestPoint = position;
msg.animStartPose.t = position;
msg.animStartPose.q.v = position;
msg.serverTime = time;
}
auto method = this->m_pGameObject->Create(msg);
if (method) {
_InterlockedIncrement(&method->m_cnt);
this->m_pGameObject->DoInvokeRMI(&method, 256, -1);
}
C++:
if (this->m_pGameObject == nullptr
|| this->m_pEntity == nullptr) {
return;
}
SM_Network::SKnockBackMessage msg;
::memset(&msg, 0, sizeof(SM_Network::SKnockBackMessage));
{
msg.type = ESMType::eSMT_KnockBack;
msg.msgType = SM_Network::EMessageType::eMT_Start;
msg.startPos = ZERO;
}
auto method = this->m_pGameObject->Create(msg);
if (method != nullptr) {
_InterlockedIncrement(&method->m_cnt);
this->m_pGameObject->DoInvokeRMI(&method, 256, -1);
msg.msgType = SM_Network::EMessageType::eMT_End;
msg.startPos = ZERO;
method = this->m_pGameObject->Create(msg);
if (method != nullptr) {
_InterlockedIncrement(&method->m_cnt);
this->m_pGameObject->DoInvokeRMI(&method, 256, -1);
}
}
C++:
if (this->m_pGameObject == nullptr
|| this->m_pEntity == nullptr) {
return;
}
SM_Network::SKnockBackMessage msg;
::memset(&msg, 0, sizeof(SM_Network::SKnockBackMessage));
{
msg.type = ESMType::eSMT_KnockBack;
msg.msgType = SM_Network::EMessageType::eMT_Message;
msg.instant = false;
msg.opcode = NULL;
msg.startPos = position;
msg.serverTime = time;
}
auto method = this->m_pGameObject->Create(msg);
if (method != nullptr) {
_InterlockedIncrement(&method->m_cnt);
this->m_pGameObject->DoInvokeRMI(&method, 256, -1);
}
C++:
CTimeValue time;
m_pFramework->GetServerTime(&time);
m_pActor->SendTeleportPacket(m_pActor->m_pEntity->GetPhysics()->m_pos + m_pActor->GetFireDirection() * 3.f, time);