From ca8fd1aa72cd50d5c077b9d0c45ad32ab7e4d2f2 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sat, 15 Apr 2017 15:49:40 +0300 Subject: [PATCH] [General] Remove ActorHeadRotation packet because it would be too spammy --- apps/openmw-mp/ProcessorInitializer.cpp | 2 - .../actor/ProcessorActorHeadRotation.hpp | 29 ----------- apps/openmw/mwmechanics/character.cpp | 25 ---------- apps/openmw/mwmp/Networking.cpp | 4 -- components/CMakeLists.txt | 4 +- components/openmw-mp/Base/BaseActor.hpp | 3 -- .../Controllers/ActorPacketController.cpp | 2 - components/openmw-mp/NetworkMessages.hpp | 1 - .../Packets/Actor/PacketActorHeadRotation.cpp | 48 ------------------- .../Packets/Actor/PacketActorHeadRotation.hpp | 17 ------- 10 files changed, 2 insertions(+), 133 deletions(-) delete mode 100644 apps/openmw-mp/processors/actor/ProcessorActorHeadRotation.hpp delete mode 100644 components/openmw-mp/Packets/Actor/PacketActorHeadRotation.cpp delete mode 100644 components/openmw-mp/Packets/Actor/PacketActorHeadRotation.hpp diff --git a/apps/openmw-mp/ProcessorInitializer.cpp b/apps/openmw-mp/ProcessorInitializer.cpp index 1c0be2e2b..dd6e851d0 100644 --- a/apps/openmw-mp/ProcessorInitializer.cpp +++ b/apps/openmw-mp/ProcessorInitializer.cpp @@ -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()); diff --git a/apps/openmw-mp/processors/actor/ProcessorActorHeadRotation.hpp b/apps/openmw-mp/processors/actor/ProcessorActorHeadRotation.hpp deleted file mode 100644 index 1c10850c1..000000000 --- a/apps/openmw-mp/processors/actor/ProcessorActorHeadRotation.hpp +++ /dev/null @@ -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(player.getId(), actorList.cell.getDescription().c_str()); - } - }; -} - -#endif //OPENMW_PROCESSORACTORHEADROTATION_HPP diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 608b76829..b9da153b8 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -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); } diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index 0dc7cae64..a69007f1d 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -895,10 +895,6 @@ void Networking::processActorPacket(RakNet::Packet *packet) { break; } - case ID_ACTOR_HEAD_ROTATION: - { - break; - } case ID_ACTOR_SPEECH: { break; diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 2c5f8609d..f45440322 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -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 diff --git a/components/openmw-mp/Base/BaseActor.hpp b/components/openmw-mp/Base/BaseActor.hpp index 51b159696..e92fcce47 100644 --- a/components/openmw-mp/Base/BaseActor.hpp +++ b/components/openmw-mp/Base/BaseActor.hpp @@ -29,9 +29,6 @@ namespace mwmp char drawState; bool isFlying; - float headPitch; - float headYaw; - Animation animation; }; diff --git a/components/openmw-mp/Controllers/ActorPacketController.cpp b/components/openmw-mp/Controllers/ActorPacketController.cpp index 57a186236..8b0383417 100644 --- a/components/openmw-mp/Controllers/ActorPacketController.cpp +++ b/components/openmw-mp/Controllers/ActorPacketController.cpp @@ -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(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); - AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); } diff --git a/components/openmw-mp/NetworkMessages.hpp b/components/openmw-mp/NetworkMessages.hpp index 2bec1ef8e..c03e356bc 100644 --- a/components/openmw-mp/NetworkMessages.hpp +++ b/components/openmw-mp/NetworkMessages.hpp @@ -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, diff --git a/components/openmw-mp/Packets/Actor/PacketActorHeadRotation.cpp b/components/openmw-mp/Packets/Actor/PacketActorHeadRotation.cpp deleted file mode 100644 index abf94f847..000000000 --- a/components/openmw-mp/Packets/Actor/PacketActorHeadRotation.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include -#include -#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); - } - } -} diff --git a/components/openmw-mp/Packets/Actor/PacketActorHeadRotation.hpp b/components/openmw-mp/Packets/Actor/PacketActorHeadRotation.hpp deleted file mode 100644 index a941c663a..000000000 --- a/components/openmw-mp/Packets/Actor/PacketActorHeadRotation.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef OPENMW_PACKETACTORHEADROTATION_HPP -#define OPENMW_PACKETACTORHEADROTATION_HPP - -#include - -namespace mwmp -{ - class PacketActorHeadRotation : public ActorPacket - { - public: - PacketActorHeadRotation(RakNet::RakPeerInterface *peer); - - virtual void Packet(RakNet::BitStream *bs, bool send); - }; -} - -#endif //OPENMW_PACKETACTORHEADROTATION_HPP