mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-13 19:58:21 +00:00
Fix incorrect serialization of SendTeleport (#1121)
* Fix incorrect serialization of SendTeleport - Fixes all incorrect teleports in the game - remove hacks in mast teleport - ... - ...... Update GameMessages.cpp * Remove stupid argument there got it all out * remove extra true
This commit is contained in:
parent
f46bc33dd4
commit
2d31b7e4bb
@ -124,8 +124,7 @@ void RacingControlComponent::LoadPlayerVehicle(Entity* player,
|
|||||||
// Make sure the player is at the correct position.
|
// Make sure the player is at the correct position.
|
||||||
|
|
||||||
GameMessages::SendTeleport(player->GetObjectID(), startPosition,
|
GameMessages::SendTeleport(player->GetObjectID(), startPosition,
|
||||||
startRotation, player->GetSystemAddress(), true,
|
startRotation, player->GetSystemAddress(), true);
|
||||||
true);
|
|
||||||
|
|
||||||
// Spawn the vehicle entity.
|
// Spawn the vehicle entity.
|
||||||
|
|
||||||
@ -243,11 +242,9 @@ void RacingControlComponent::LoadPlayerVehicle(Entity* player,
|
|||||||
|
|
||||||
// Make sure everything has the correct position.
|
// Make sure everything has the correct position.
|
||||||
GameMessages::SendTeleport(player->GetObjectID(), startPosition,
|
GameMessages::SendTeleport(player->GetObjectID(), startPosition,
|
||||||
startRotation, player->GetSystemAddress(), true,
|
startRotation, player->GetSystemAddress(), true);
|
||||||
true);
|
|
||||||
GameMessages::SendTeleport(carEntity->GetObjectID(), startPosition,
|
GameMessages::SendTeleport(carEntity->GetObjectID(), startPosition,
|
||||||
startRotation, player->GetSystemAddress(), true,
|
startRotation, player->GetSystemAddress(), true);
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RacingControlComponent::OnRacingClientReady(Entity* player) {
|
void RacingControlComponent::OnRacingClientReady(Entity* player) {
|
||||||
@ -634,7 +631,7 @@ void RacingControlComponent::Update(float deltaTime) {
|
|||||||
GameMessages::SendTeleport(
|
GameMessages::SendTeleport(
|
||||||
player.playerID, player.respawnPosition,
|
player.playerID, player.respawnPosition,
|
||||||
player.respawnRotation,
|
player.respawnRotation,
|
||||||
playerEntity->GetSystemAddress(), true, true);
|
playerEntity->GetSystemAddress(), true);
|
||||||
|
|
||||||
vehicle->SetPosition(player.respawnPosition);
|
vehicle->SetPosition(player.respawnPosition);
|
||||||
vehicle->SetRotation(player.respawnRotation);
|
vehicle->SetRotation(player.respawnRotation);
|
||||||
|
@ -120,7 +120,7 @@ void GameMessages::SendFireEventClientSide(const LWOOBJID& objectID, const Syste
|
|||||||
SEND_PACKET;
|
SEND_PACKET;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameMessages::SendTeleport(const LWOOBJID& objectID, const NiPoint3& pos, const NiQuaternion& rot, const SystemAddress& sysAddr, bool bSetRotation, bool noGravTeleport) {
|
void GameMessages::SendTeleport(const LWOOBJID& objectID, const NiPoint3& pos, const NiQuaternion& rot, const SystemAddress& sysAddr, bool bSetRotation) {
|
||||||
CBITSTREAM;
|
CBITSTREAM;
|
||||||
CMSGHEADER;
|
CMSGHEADER;
|
||||||
bitStream.Write(objectID);
|
bitStream.Write(objectID);
|
||||||
@ -141,7 +141,6 @@ void GameMessages::SendTeleport(const LWOOBJID& objectID, const NiPoint3& pos, c
|
|||||||
bitStream.Write(pos.y);
|
bitStream.Write(pos.y);
|
||||||
bitStream.Write(pos.z);
|
bitStream.Write(pos.z);
|
||||||
bitStream.Write(bUseNavmesh);
|
bitStream.Write(bUseNavmesh);
|
||||||
bitStream.Write(noGravTeleport);
|
|
||||||
|
|
||||||
bitStream.Write(rot.w != 1.0f);
|
bitStream.Write(rot.w != 1.0f);
|
||||||
if (rot.w != 1.0f) bitStream.Write(rot.w);
|
if (rot.w != 1.0f) bitStream.Write(rot.w);
|
||||||
|
@ -40,7 +40,7 @@ enum class eRebuildState : uint32_t;
|
|||||||
namespace GameMessages {
|
namespace GameMessages {
|
||||||
class PropertyDataMessage;
|
class PropertyDataMessage;
|
||||||
void SendFireEventClientSide(const LWOOBJID& objectID, const SystemAddress& sysAddr, std::u16string args, const LWOOBJID& object, int64_t param1, int param2, const LWOOBJID& sender);
|
void SendFireEventClientSide(const LWOOBJID& objectID, const SystemAddress& sysAddr, std::u16string args, const LWOOBJID& object, int64_t param1, int param2, const LWOOBJID& sender);
|
||||||
void SendTeleport(const LWOOBJID& objectID, const NiPoint3& pos, const NiQuaternion& rot, const SystemAddress& sysAddr, bool bSetRotation = false, bool noGravTeleport = true);
|
void SendTeleport(const LWOOBJID& objectID, const NiPoint3& pos, const NiQuaternion& rot, const SystemAddress& sysAddr, bool bSetRotation = false);
|
||||||
void SendPlayAnimation(Entity* entity, const std::u16string& animationName, float fPriority = 0.0f, float fScale = 1.0f);
|
void SendPlayAnimation(Entity* entity, const std::u16string& animationName, float fPriority = 0.0f, float fScale = 1.0f);
|
||||||
void SendPlayerReady(Entity* entity, const SystemAddress& sysAddr);
|
void SendPlayerReady(Entity* entity, const SystemAddress& sysAddr);
|
||||||
void SendPlayerAllowedRespawn(LWOOBJID entityID, bool doNotPromptRespawn, const SystemAddress& systemAddress);
|
void SendPlayerAllowedRespawn(LWOOBJID entityID, bool doNotPromptRespawn, const SystemAddress& systemAddress);
|
||||||
|
@ -43,15 +43,7 @@ void MastTeleport::OnTimerDone(Entity* self, std::string timerName) {
|
|||||||
|
|
||||||
GameMessages::SendTeleport(playerId, position, rotation, player->GetSystemAddress(), true);
|
GameMessages::SendTeleport(playerId, position, rotation, player->GetSystemAddress(), true);
|
||||||
|
|
||||||
// Hacky fix for odd rotations
|
GameMessages::SendTeleport(playerId, position, rotation, player->GetSystemAddress(), true);
|
||||||
auto mastName = self->GetVar<std::u16string>(u"MastName");
|
|
||||||
if (mastName == u"Elephant") {
|
|
||||||
GameMessages::SendOrientToAngle(playerId, true, (M_PI / 180) * 140.0f, player->GetSystemAddress());
|
|
||||||
} else if (mastName == u"Jail") {
|
|
||||||
GameMessages::SendOrientToAngle(playerId, true, (M_PI / 180) * 100.0f, player->GetSystemAddress());
|
|
||||||
} else if (mastName == u""){
|
|
||||||
GameMessages::SendOrientToAngle(playerId, true, (M_PI / 180) * 203.0f, player->GetSystemAddress());
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto cinematic = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Cinematic"));
|
const auto cinematic = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Cinematic"));
|
||||||
const auto leanIn = self->GetVar<float>(u"LeanIn");
|
const auto leanIn = self->GetVar<float>(u"LeanIn");
|
||||||
|
Loading…
Reference in New Issue
Block a user