mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 13:15:32 +00:00
[General] Remove ActorHeadRotation packet because it would be too spammy
This commit is contained in:
parent
2872675f5e
commit
ca8fd1aa72
10 changed files with 2 additions and 133 deletions
|
@ -33,7 +33,6 @@
|
|||
#include "processors/actor/ProcessorActorAttack.hpp"
|
||||
#include "processors/actor/ProcessorActorCellChange.hpp"
|
||||
#include "processors/actor/ProcessorActorDynamicStats.hpp"
|
||||
#include "processors/actor/ProcessorActorHeadRotation.hpp"
|
||||
#include "processors/actor/ProcessorActorPosition.hpp"
|
||||
#include "processors/actor/ProcessorActorSpeech.hpp"
|
||||
#include "WorldProcessor.hpp"
|
||||
|
@ -86,7 +85,6 @@ void ProcessorInitializer()
|
|||
ActorProcessor::AddProcessor(new ProcessorActorAttack());
|
||||
ActorProcessor::AddProcessor(new ProcessorActorCellChange());
|
||||
ActorProcessor::AddProcessor(new ProcessorActorDynamicStats());
|
||||
ActorProcessor::AddProcessor(new ProcessorActorHeadRotation());
|
||||
ActorProcessor::AddProcessor(new ProcessorActorPosition());
|
||||
ActorProcessor::AddProcessor(new ProcessorActorSpeech());
|
||||
ActorProcessor::AddProcessor(new ProcessorActorTest());
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
#ifndef OPENMW_PROCESSORACTORHEADROTATION_HPP
|
||||
#define OPENMW_PROCESSORACTORHEADROTATION_HPP
|
||||
|
||||
#include "apps/openmw-mp/ActorProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorActorHeadRotation : public ActorProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorActorHeadRotation()
|
||||
{
|
||||
BPP_INIT(ID_ACTOR_HEAD_ROTATION)
|
||||
}
|
||||
|
||||
void Do(ActorPacket &packet, Player &player, BaseActorList &actorList) override
|
||||
{
|
||||
// Send only to players who have the cell loaded
|
||||
Cell *serverCell = CellController::get()->getCell(&actorList.cell);
|
||||
|
||||
if (serverCell != nullptr)
|
||||
serverCell->sendToLoaded(&packet, &actorList);
|
||||
|
||||
//Script::Call<Script::CallbackIdentity("OnActorHeadRotation")>(player.getId(), actorList.cell.getDescription().c_str());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORACTORHEADROTATION_HPP
|
|
@ -2439,31 +2439,6 @@ void CharacterController::updateHeadTracking(float duration)
|
|||
xAngleRadians = (1.f-factor) * mAnimation->getHeadPitch() + factor * (-xAngleRadians);
|
||||
zAngleRadians = (1.f-factor) * mAnimation->getHeadYaw() + factor * (-zAngleRadians);
|
||||
|
||||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
Save or load head pitch and yaw depending on whether this is a local or dedicated actor
|
||||
*/
|
||||
if (mwmp::Main::get().getCellController()->isLocalActor(mPtr))
|
||||
{
|
||||
mwmp::LocalActor *localActor = mwmp::Main::get().getCellController()->getLocalActor(mPtr);
|
||||
localActor->headPitch = xAngleRadians;
|
||||
localActor->headYaw = zAngleRadians;
|
||||
}
|
||||
else if (mwmp::Main::get().getCellController()->isDedicatedActor(mPtr))
|
||||
{
|
||||
mwmp::DedicatedActor *dedicatedActor = mwmp::Main::get().getCellController()->getDedicatedActor(mPtr);
|
||||
|
||||
//if (dedicatedActor->headPitch != -1)
|
||||
// xAngleRadians = dedicatedActor->headPitch;
|
||||
|
||||
//if (dedicatedActor->headYaw != -1)
|
||||
// zAngleRadians = dedicatedActor->headYaw;
|
||||
}
|
||||
/*
|
||||
End of tes3mp addition
|
||||
*/
|
||||
|
||||
mAnimation->setHeadPitch(xAngleRadians);
|
||||
mAnimation->setHeadYaw(zAngleRadians);
|
||||
}
|
||||
|
|
|
@ -895,10 +895,6 @@ void Networking::processActorPacket(RakNet::Packet *packet)
|
|||
{
|
||||
break;
|
||||
}
|
||||
case ID_ACTOR_HEAD_ROTATION:
|
||||
{
|
||||
break;
|
||||
}
|
||||
case ID_ACTOR_SPEECH:
|
||||
{
|
||||
break;
|
||||
|
|
|
@ -169,8 +169,8 @@ add_component_dir (openmw-mp
|
|||
|
||||
Packets/Actor/PacketActorList Packets/Actor/PacketActorAuthority Packets/Actor/PacketActorTest
|
||||
Packets/Actor/PacketActorAnimPlay Packets/Actor/PacketActorAttack Packets/Actor/PacketActorCellChange
|
||||
Packets/Actor/PacketActorAnimFlags Packets/Actor/PacketActorDynamicStats Packets/Actor/PacketActorHeadRotation
|
||||
Packets/Actor/PacketActorPosition Packets/Actor/PacketActorSpeech
|
||||
Packets/Actor/PacketActorAnimFlags Packets/Actor/PacketActorDynamicStats Packets/Actor/PacketActorPosition
|
||||
Packets/Actor/PacketActorSpeech
|
||||
|
||||
Packets/World/PacketObjectDelete Packets/World/PacketObjectPlace Packets/World/PacketObjectScale
|
||||
Packets/World/PacketObjectLock Packets/World/PacketObjectUnlock Packets/World/PacketObjectMove
|
||||
|
|
|
@ -29,9 +29,6 @@ namespace mwmp
|
|||
char drawState;
|
||||
bool isFlying;
|
||||
|
||||
float headPitch;
|
||||
float headYaw;
|
||||
|
||||
Animation animation;
|
||||
};
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "../Packets/Actor/PacketActorAttack.hpp"
|
||||
#include "../Packets/Actor/PacketActorCellChange.hpp"
|
||||
#include "../Packets/Actor/PacketActorDynamicStats.hpp"
|
||||
#include "../Packets/Actor/PacketActorHeadRotation.hpp"
|
||||
#include "../Packets/Actor/PacketActorPosition.hpp"
|
||||
#include "../Packets/Actor/PacketActorSpeech.hpp"
|
||||
|
||||
|
@ -35,7 +34,6 @@ mwmp::ActorPacketController::ActorPacketController(RakNet::RakPeerInterface *pee
|
|||
AddPacket<PacketActorAttack>(&packets, peer);
|
||||
AddPacket<PacketActorCellChange>(&packets, peer);
|
||||
AddPacket<PacketActorDynamicStats>(&packets, peer);
|
||||
AddPacket<PacketActorHeadRotation>(&packets, peer);
|
||||
AddPacket<PacketActorPosition>(&packets, peer);
|
||||
AddPacket<PacketActorSpeech>(&packets, peer);
|
||||
}
|
||||
|
|
|
@ -47,7 +47,6 @@ enum GameMessages
|
|||
ID_ACTOR_CELL_CHANGE,
|
||||
ID_ACTOR_ANIM_FLAGS,
|
||||
ID_ACTOR_DYNAMICSTATS,
|
||||
ID_ACTOR_HEAD_ROTATION,
|
||||
ID_ACTOR_POSITION,
|
||||
ID_ACTOR_SPEECH,
|
||||
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
#include <components/openmw-mp/NetworkMessages.hpp>
|
||||
#include <components/openmw-mp/Log.hpp>
|
||||
#include "PacketActorHeadRotation.hpp"
|
||||
|
||||
using namespace mwmp;
|
||||
|
||||
PacketActorHeadRotation::PacketActorHeadRotation(RakNet::RakPeerInterface *peer) : ActorPacket(peer)
|
||||
{
|
||||
packetID = ID_ACTOR_HEAD_ROTATION;
|
||||
}
|
||||
|
||||
void PacketActorHeadRotation::Packet(RakNet::BitStream *bs, bool send)
|
||||
{
|
||||
ActorPacket::Packet(bs, send);
|
||||
|
||||
if (!send)
|
||||
actorList->baseActors.clear();
|
||||
else
|
||||
actorList->count = (unsigned int)(actorList->baseActors.size());
|
||||
|
||||
RW(actorList->count, send);
|
||||
|
||||
RW(actorList->cell.mData.mFlags, send);
|
||||
RW(actorList->cell.mData.mX, send);
|
||||
RW(actorList->cell.mData.mY, send);
|
||||
RW(actorList->cell.mName, send);
|
||||
|
||||
BaseActor actor;
|
||||
|
||||
for (unsigned int i = 0; i < actorList->count; i++)
|
||||
{
|
||||
if (send)
|
||||
{
|
||||
actor = actorList->baseActors.at(i);
|
||||
}
|
||||
|
||||
RW(actor.refId, send);
|
||||
RW(actor.refNumIndex, send);
|
||||
RW(actor.mpNum, send);
|
||||
|
||||
// TODO: Fill this in
|
||||
|
||||
if (!send)
|
||||
{
|
||||
actorList->baseActors.push_back(actor);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#ifndef OPENMW_PACKETACTORHEADROTATION_HPP
|
||||
#define OPENMW_PACKETACTORHEADROTATION_HPP
|
||||
|
||||
#include <components/openmw-mp/Packets/Actor/ActorPacket.hpp>
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class PacketActorHeadRotation : public ActorPacket
|
||||
{
|
||||
public:
|
||||
PacketActorHeadRotation(RakNet::RakPeerInterface *peer);
|
||||
|
||||
virtual void Packet(RakNet::BitStream *bs, bool send);
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PACKETACTORHEADROTATION_HPP
|
Loading…
Reference in a new issue