From 95967ea289664618597f9004b4f69f7584f7ab66 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sun, 1 Sep 2019 08:30:03 +0300 Subject: [PATCH] [General] Rename unused ObjectReset packet into ObjectHit --- apps/openmw/CMakeLists.txt | 2 +- .../mwmp/processors/ProcessorInitializer.cpp | 4 +-- .../processors/object/ProcessorObjectHit.hpp | 26 +++++++++++++++++++ .../object/ProcessorObjectReset.hpp | 26 ------------------- components/CMakeLists.txt | 11 ++++---- .../Controllers/ObjectPacketController.cpp | 4 +-- components/openmw-mp/NetworkMessages.hpp | 2 +- .../Packets/Object/PacketObjectHit.cpp | 16 ++++++++++++ .../Packets/Object/PacketObjectHit.hpp | 17 ++++++++++++ .../Packets/Object/PacketObjectReset.cpp | 16 ------------ .../Packets/Object/PacketObjectReset.hpp | 17 ------------ 11 files changed, 71 insertions(+), 70 deletions(-) create mode 100644 apps/openmw/mwmp/processors/object/ProcessorObjectHit.hpp delete mode 100644 apps/openmw/mwmp/processors/object/ProcessorObjectReset.hpp create mode 100644 components/openmw-mp/Packets/Object/PacketObjectHit.cpp create mode 100644 components/openmw-mp/Packets/Object/PacketObjectHit.hpp delete mode 100644 components/openmw-mp/Packets/Object/PacketObjectReset.cpp delete mode 100644 components/openmw-mp/Packets/Object/PacketObjectReset.hpp diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 543e6f751..05a684732 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -128,7 +128,7 @@ add_openmw_dir (mwmp/processors/object BaseObjectProcessor ProcessorVideoPlay ProcessorObjectActivate ProcessorObjectAnimPlay ProcessorObjectAttach ProcessorObjectCollision ProcessorObjectDelete - ProcessorObjectLock ProcessorObjectMove ProcessorObjectPlace ProcessorObjectReset ProcessorObjectRotate + ProcessorObjectHit ProcessorObjectLock ProcessorObjectMove ProcessorObjectPlace ProcessorObjectRotate ProcessorObjectScale ProcessorObjectSpawn ProcessorObjectState ProcessorObjectTrap ProcessorScriptLocalShort ProcessorScriptLocalFloat ProcessorScriptMemberShort ProcessorScriptMemberFloat ProcessorScriptGlobalShort ProcessorScriptGlobalFloat diff --git a/apps/openmw/mwmp/processors/ProcessorInitializer.cpp b/apps/openmw/mwmp/processors/ProcessorInitializer.cpp index 7aeb45778..4e3c71de3 100644 --- a/apps/openmw/mwmp/processors/ProcessorInitializer.cpp +++ b/apps/openmw/mwmp/processors/ProcessorInitializer.cpp @@ -55,10 +55,10 @@ #include "object/ProcessorObjectAttach.hpp" #include "object/ProcessorObjectCollision.hpp" #include "object/ProcessorObjectDelete.hpp" +#include "object/ProcessorObjectHit.hpp" #include "object/ProcessorObjectLock.hpp" #include "object/ProcessorObjectMove.hpp" #include "object/ProcessorObjectPlace.hpp" -#include "object/ProcessorObjectReset.hpp" #include "object/ProcessorObjectRotate.hpp" #include "object/ProcessorObjectScale.hpp" #include "object/ProcessorObjectSpawn.hpp" @@ -155,10 +155,10 @@ void ProcessorInitializer() ObjectProcessor::AddProcessor(new ProcessorObjectAttach()); ObjectProcessor::AddProcessor(new ProcessorObjectCollision()); ObjectProcessor::AddProcessor(new ProcessorObjectDelete()); + ObjectProcessor::AddProcessor(new ProcessorObjectHit()); ObjectProcessor::AddProcessor(new ProcessorObjectLock()); ObjectProcessor::AddProcessor(new ProcessorObjectMove()); ObjectProcessor::AddProcessor(new ProcessorObjectPlace()); - ObjectProcessor::AddProcessor(new ProcessorObjectReset()); ObjectProcessor::AddProcessor(new ProcessorObjectRotate()); ObjectProcessor::AddProcessor(new ProcessorObjectScale()); ObjectProcessor::AddProcessor(new ProcessorObjectSpawn()); diff --git a/apps/openmw/mwmp/processors/object/ProcessorObjectHit.hpp b/apps/openmw/mwmp/processors/object/ProcessorObjectHit.hpp new file mode 100644 index 000000000..53150a0dd --- /dev/null +++ b/apps/openmw/mwmp/processors/object/ProcessorObjectHit.hpp @@ -0,0 +1,26 @@ +#ifndef OPENMW_PROCESSOROBJECTHIT_HPP +#define OPENMW_PROCESSOROBJECTHIT_HPP + +#include "BaseObjectProcessor.hpp" + +namespace mwmp +{ + class ProcessorObjectHit : public BaseObjectProcessor + { + public: + ProcessorObjectHit() + { + BPP_INIT(ID_OBJECT_HIT) + } + + virtual void Do(ObjectPacket &packet, ObjectList &objectList) + { + BaseObjectProcessor::Do(packet, objectList); + + //objectList.hitObjects(ptrCellStore); + } + + }; +} + +#endif //OPENMW_PROCESSOROBJECTHIT_HPP diff --git a/apps/openmw/mwmp/processors/object/ProcessorObjectReset.hpp b/apps/openmw/mwmp/processors/object/ProcessorObjectReset.hpp deleted file mode 100644 index 8fa943af3..000000000 --- a/apps/openmw/mwmp/processors/object/ProcessorObjectReset.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef OPENMW_PROCESSOROBJECTRESET_HPP -#define OPENMW_PROCESSOROBJECTRESET_HPP - -#include "BaseObjectProcessor.hpp" - -namespace mwmp -{ - class ProcessorObjectReset : public BaseObjectProcessor - { - public: - ProcessorObjectReset() - { - BPP_INIT(ID_OBJECT_RESET) - } - - virtual void Do(ObjectPacket &packet, ObjectList &objectList) - { - BaseObjectProcessor::Do(packet, objectList); - - //objectList.resetObjects(ptrCellStore); - } - - }; -} - -#endif //OPENMW_PROCESSOROBJECTRESET_HPP diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 26f05f9fb..339de9071 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -196,12 +196,13 @@ add_component_dir (openmw-mp/Packets/Player add_component_dir (openmw-mp/Packets/Object ObjectPacket + PacketDoorDestination PacketDoorState + PacketConsoleCommand PacketContainer PacketObjectActivate PacketObjectAnimPlay PacketObjectAttach - PacketObjectCollision PacketObjectDelete PacketDoorDestination PacketDoorState PacketObjectLock - PacketObjectMove PacketObjectPlace PacketObjectReset PacketObjectRotate PacketObjectScale - PacketObjectSpawn PacketObjectState PacketObjectTrap PacketMusicPlay PacketVideoPlay PacketScriptLocalShort - PacketScriptLocalFloat PacketScriptMemberShort PacketScriptMemberFloat PacketScriptGlobalShort - PacketScriptGlobalFloat + PacketObjectCollision PacketObjectDelete PacketObjectHit PacketObjectLock PacketObjectMove PacketObjectPlace + PacketObjectRotate PacketObjectScale PacketObjectSpawn PacketObjectState PacketObjectTrap PacketMusicPlay + PacketVideoPlay PacketScriptLocalShort PacketScriptLocalFloat PacketScriptMemberShort PacketScriptMemberFloat + PacketScriptGlobalShort PacketScriptGlobalFloat ) add_component_dir (openmw-mp/Packets/Worldstate diff --git a/components/openmw-mp/Controllers/ObjectPacketController.cpp b/components/openmw-mp/Controllers/ObjectPacketController.cpp index 99ea4e1ea..5583fd299 100644 --- a/components/openmw-mp/Controllers/ObjectPacketController.cpp +++ b/components/openmw-mp/Controllers/ObjectPacketController.cpp @@ -3,10 +3,10 @@ #include "../Packets/Object/PacketObjectAttach.hpp" #include "../Packets/Object/PacketObjectCollision.hpp" #include "../Packets/Object/PacketObjectDelete.hpp" +#include "../Packets/Object/PacketObjectHit.hpp" #include "../Packets/Object/PacketObjectLock.hpp" #include "../Packets/Object/PacketObjectMove.hpp" #include "../Packets/Object/PacketObjectPlace.hpp" -#include "../Packets/Object/PacketObjectReset.hpp" #include "../Packets/Object/PacketObjectRotate.hpp" #include "../Packets/Object/PacketObjectScale.hpp" #include "../Packets/Object/PacketObjectSpawn.hpp" @@ -44,10 +44,10 @@ mwmp::ObjectPacketController::ObjectPacketController(RakNet::RakPeerInterface *p AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); + AddPacket(&packets, peer); AddPacket(&packets, peer); 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 49f554ae0..19b957404 100644 --- a/components/openmw-mp/NetworkMessages.hpp +++ b/components/openmw-mp/NetworkMessages.hpp @@ -75,7 +75,7 @@ enum GameMessages ID_OBJECT_LOCK, ID_OBJECT_MOVE, ID_OBJECT_PLACE, - ID_OBJECT_RESET, + ID_OBJECT_HIT, ID_OBJECT_ROTATE, ID_OBJECT_SCALE, ID_OBJECT_SPAWN, diff --git a/components/openmw-mp/Packets/Object/PacketObjectHit.cpp b/components/openmw-mp/Packets/Object/PacketObjectHit.cpp new file mode 100644 index 000000000..0585f761f --- /dev/null +++ b/components/openmw-mp/Packets/Object/PacketObjectHit.cpp @@ -0,0 +1,16 @@ +#include +#include "PacketObjectHit.hpp" + +using namespace mwmp; + +PacketObjectHit::PacketObjectHit(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) +{ + packetID = ID_OBJECT_HIT; + hasCellData = true; +} + +void PacketObjectHit::Object(BaseObject &baseObject, bool send) +{ + ObjectPacket::Object(baseObject, send); + // Placeholder +} diff --git a/components/openmw-mp/Packets/Object/PacketObjectHit.hpp b/components/openmw-mp/Packets/Object/PacketObjectHit.hpp new file mode 100644 index 000000000..9ddbbf8ed --- /dev/null +++ b/components/openmw-mp/Packets/Object/PacketObjectHit.hpp @@ -0,0 +1,17 @@ +#ifndef OPENMW_PACKETOBJECTHIT_HPP +#define OPENMW_PACKETOBJECTHIT_HPP + +#include + +namespace mwmp +{ + class PacketObjectHit : public ObjectPacket + { + public: + PacketObjectHit(RakNet::RakPeerInterface *peer); + + virtual void Object(BaseObject &baseObject, bool send); + }; +} + +#endif //OPENMW_PACKETOBJECTHIT_HPP diff --git a/components/openmw-mp/Packets/Object/PacketObjectReset.cpp b/components/openmw-mp/Packets/Object/PacketObjectReset.cpp deleted file mode 100644 index 2fc9230a9..000000000 --- a/components/openmw-mp/Packets/Object/PacketObjectReset.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include "PacketObjectReset.hpp" - -using namespace mwmp; - -PacketObjectReset::PacketObjectReset(RakNet::RakPeerInterface *peer) : ObjectPacket(peer) -{ - packetID = ID_OBJECT_RESET; - hasCellData = true; -} - -void PacketObjectReset::Object(BaseObject &baseObject, bool send) -{ - ObjectPacket::Object(baseObject, send); - // Placeholder -} diff --git a/components/openmw-mp/Packets/Object/PacketObjectReset.hpp b/components/openmw-mp/Packets/Object/PacketObjectReset.hpp deleted file mode 100644 index 5040c5b0b..000000000 --- a/components/openmw-mp/Packets/Object/PacketObjectReset.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef OPENMW_PACKETOBJECTRESET_HPP -#define OPENMW_PACKETOBJECTRESET_HPP - -#include - -namespace mwmp -{ - class PacketObjectReset : public ObjectPacket - { - public: - PacketObjectReset(RakNet::RakPeerInterface *peer); - - virtual void Object(BaseObject &baseObject, bool send); - }; -} - -#endif //OPENMW_PACKETOBJECTRESET_HPP