From 32b6134fad36ceef19f6b2dc1beacebb9fe8597d Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sun, 15 Jul 2018 00:17:13 +0300 Subject: [PATCH] [General] Add placeholder for CellReplace packet --- apps/openmw/CMakeLists.txt | 4 ++-- .../mwmp/processors/ProcessorInitializer.cpp | 2 ++ .../worldstate/ProcessorCellReplace.hpp | 23 +++++++++++++++++++ components/CMakeLists.txt | 3 ++- .../WorldstatePacketController.cpp | 2 ++ components/openmw-mp/NetworkMessages.hpp | 4 ++-- .../Packets/Worldstate/PacketCellReplace.cpp | 17 ++++++++++++++ .../Packets/Worldstate/PacketCellReplace.hpp | 18 +++++++++++++++ 8 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 apps/openmw/mwmp/processors/worldstate/ProcessorCellReplace.hpp create mode 100644 components/openmw-mp/Packets/Worldstate/PacketCellReplace.cpp create mode 100644 components/openmw-mp/Packets/Worldstate/PacketCellReplace.hpp diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index f70b0d219..ce80ec15e 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -130,8 +130,8 @@ add_openmw_dir (mwmp/processors/object BaseObjectProcessor ProcessorConsoleComma ProcessorScriptMemberShort ProcessorScriptMemberFloat ProcessorScriptGlobalShort ProcessorScriptGlobalFloat ) -add_openmw_dir (mwmp/processors/worldstate ProcessorCellCreate ProcessorRecordDynamic ProcessorWorldCollisionOverride - ProcessorWorldMap ProcessorWorldTime +add_openmw_dir (mwmp/processors/worldstate ProcessorCellCreate ProcessorCellReplace ProcessorRecordDynamic + ProcessorWorldCollisionOverride ProcessorWorldMap ProcessorWorldTime ) # Main executable diff --git a/apps/openmw/mwmp/processors/ProcessorInitializer.cpp b/apps/openmw/mwmp/processors/ProcessorInitializer.cpp index 12e30da26..2bd1da441 100644 --- a/apps/openmw/mwmp/processors/ProcessorInitializer.cpp +++ b/apps/openmw/mwmp/processors/ProcessorInitializer.cpp @@ -89,6 +89,7 @@ #include "WorldstateProcessor.hpp" #include "worldstate/ProcessorCellCreate.hpp" +#include "worldstate/ProcessorCellReplace.hpp" #include "worldstate/ProcessorRecordDynamic.hpp" #include "worldstate/ProcessorWorldCollisionOverride.hpp" #include "worldstate/ProcessorWorldMap.hpp" @@ -183,6 +184,7 @@ void ProcessorInitializer() ActorProcessor::AddProcessor(new ProcessorActorTest()); WorldstateProcessor::AddProcessor(new ProcessorCellCreate()); + WorldstateProcessor::AddProcessor(new ProcessorCellReplace()); WorldstateProcessor::AddProcessor(new ProcessorRecordDynamic()); WorldstateProcessor::AddProcessor(new ProcessorWorldCollisionOverride()); WorldstateProcessor::AddProcessor(new ProcessorWorldMap()); diff --git a/apps/openmw/mwmp/processors/worldstate/ProcessorCellReplace.hpp b/apps/openmw/mwmp/processors/worldstate/ProcessorCellReplace.hpp new file mode 100644 index 000000000..ce17f4a94 --- /dev/null +++ b/apps/openmw/mwmp/processors/worldstate/ProcessorCellReplace.hpp @@ -0,0 +1,23 @@ +#ifndef OPENMW_PROCESSORCELLREPLACE_HPP +#define OPENMW_PROCESSORCELLREPLACE_HPP + +#include "../WorldstateProcessor.hpp" + +namespace mwmp +{ + class ProcessorCellReplace : public WorldstateProcessor + { + public: + ProcessorCellReplace() + { + BPP_INIT(ID_CELL_REPLACE) + } + + virtual void Do(WorldstatePacket &packet, Worldstate &worldstate) + { + // Placeholder + } + }; +} + +#endif //OPENMW_PROCESSORCELLREPLACE_HPP diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index b8327ad3d..e761181fa 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -201,7 +201,8 @@ add_component_dir (openmw-mp/Packets/Object add_component_dir (openmw-mp/Packets/Worldstate WorldstatePacket - PacketCellCreate PacketRecordDynamic PacketWorldCollisionOverride PacketWorldMap PacketWorldTime + PacketCellCreate PacketCellReplace PacketRecordDynamic PacketWorldCollisionOverride PacketWorldMap + PacketWorldTime ) add_component_dir (fallback diff --git a/components/openmw-mp/Controllers/WorldstatePacketController.cpp b/components/openmw-mp/Controllers/WorldstatePacketController.cpp index 0fe636a6b..31f2ca8a8 100644 --- a/components/openmw-mp/Controllers/WorldstatePacketController.cpp +++ b/components/openmw-mp/Controllers/WorldstatePacketController.cpp @@ -1,4 +1,5 @@ #include "../Packets/Worldstate/PacketCellCreate.hpp" +#include "../Packets/Worldstate/PacketCellReplace.hpp" #include "../Packets/Worldstate/PacketRecordDynamic.hpp" #include "../Packets/Worldstate/PacketWorldCollisionOverride.hpp" #include "../Packets/Worldstate/PacketWorldMap.hpp" @@ -17,6 +18,7 @@ inline void AddPacket(mwmp::WorldstatePacketController::packets_t *packets, RakN mwmp::WorldstatePacketController::WorldstatePacketController(RakNet::RakPeerInterface *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 70ccef260..6af00212a 100644 --- a/components/openmw-mp/NetworkMessages.hpp +++ b/components/openmw-mp/NetworkMessages.hpp @@ -86,8 +86,6 @@ enum GameMessages ID_OBJECT_SPAWN, ID_OBJECT_STATE, ID_OBJECT_TRAP, - - ID_CELL_CREATE, ID_CONSOLE_COMMAND, ID_CONTAINER, @@ -106,6 +104,8 @@ enum GameMessages ID_GAME_SETTINGS, ID_GAME_PREINIT, + ID_CELL_CREATE, + ID_CELL_REPLACE, ID_RECORD_DYNAMIC, ID_WORLD_COLLISION_OVERRIDE, ID_WORLD_MAP, diff --git a/components/openmw-mp/Packets/Worldstate/PacketCellReplace.cpp b/components/openmw-mp/Packets/Worldstate/PacketCellReplace.cpp new file mode 100644 index 000000000..bf143991b --- /dev/null +++ b/components/openmw-mp/Packets/Worldstate/PacketCellReplace.cpp @@ -0,0 +1,17 @@ +#include "PacketCellReplace.hpp" +#include + +using namespace mwmp; + +PacketCellReplace::PacketCellReplace(RakNet::RakPeerInterface *peer) : WorldstatePacket(peer) +{ + packetID = ID_CELL_REPLACE; + orderChannel = CHANNEL_SYSTEM; +} + +void PacketCellReplace::Packet(RakNet::BitStream *bs, bool send) +{ + WorldstatePacket::Packet(bs, send); + + // Placeholder +} diff --git a/components/openmw-mp/Packets/Worldstate/PacketCellReplace.hpp b/components/openmw-mp/Packets/Worldstate/PacketCellReplace.hpp new file mode 100644 index 000000000..0b7be34e8 --- /dev/null +++ b/components/openmw-mp/Packets/Worldstate/PacketCellReplace.hpp @@ -0,0 +1,18 @@ +#ifndef OPENMW_PACKETCELLREPLACE_HPP +#define OPENMW_PACKETCELLREPLACE_HPP + +#include +#include + +namespace mwmp +{ + class PacketCellReplace: public WorldstatePacket + { + public: + PacketCellReplace(RakNet::RakPeerInterface *peer); + + virtual void Packet(RakNet::BitStream *bs, bool send); + }; +} + +#endif //OPENMW_PACKETCELLREPLACE_HPP