From 3c49157ed77e9e23fdc0ee12deaecdce8db24fbe Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sat, 22 Oct 2016 18:05:32 +0300 Subject: [PATCH] Rename WorldPackets to ID_WORLD_OBJECT_DELETE and ID_WORLD_OBJECT_PLACE --- apps/openmw-mp/Networking.cpp | 8 ++++---- apps/openmw/mwmp/Networking.cpp | 6 +++--- apps/openmw/mwworld/actiontake.cpp | 4 ++-- components/CMakeLists.txt | 2 +- .../Controllers/WorldPacketController.cpp | 8 ++++---- components/openmw-mp/NetworkMessages.hpp | 4 ++-- .../Packets/World/PacketObjectCreation.cpp | 17 ----------------- .../Packets/World/PacketObjectCreation.hpp | 17 ----------------- .../Packets/World/PacketObjectDelete.cpp | 17 +++++++++++++++++ .../Packets/World/PacketObjectDelete.hpp | 17 +++++++++++++++++ .../Packets/World/PacketObjectPlace.cpp | 17 +++++++++++++++++ .../Packets/World/PacketObjectPlace.hpp | 17 +++++++++++++++++ .../Packets/World/PacketObjectRemoval.cpp | 17 ----------------- .../Packets/World/PacketObjectRemoval.hpp | 17 ----------------- 14 files changed, 84 insertions(+), 84 deletions(-) delete mode 100644 components/openmw-mp/Packets/World/PacketObjectCreation.cpp delete mode 100644 components/openmw-mp/Packets/World/PacketObjectCreation.hpp create mode 100644 components/openmw-mp/Packets/World/PacketObjectDelete.cpp create mode 100644 components/openmw-mp/Packets/World/PacketObjectDelete.hpp create mode 100644 components/openmw-mp/Packets/World/PacketObjectPlace.cpp create mode 100644 components/openmw-mp/Packets/World/PacketObjectPlace.hpp delete mode 100644 components/openmw-mp/Packets/World/PacketObjectRemoval.cpp delete mode 100644 components/openmw-mp/Packets/World/PacketObjectRemoval.hpp diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index fa66029c9..adfc7c992 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -375,9 +375,9 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet) switch (packet->data[0]) { - case ID_WORLD_OBJECT_CREATION: + case ID_WORLD_OBJECT_PLACE: { - LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_OBJECT_CREATION from %s", + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_OBJECT_PLACE from %s", player->Npc()->mName.c_str()); myPacket->Read(event); @@ -386,9 +386,9 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet) break; } - case ID_WORLD_OBJECT_REMOVAL: + case ID_WORLD_OBJECT_DELETE: { - LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_OBJECT_REMOVAL from %s", + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_OBJECT_DELETE from %s", player->Npc()->mName.c_str()); myPacket->Read(event); diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index 10db928cb..174a348ac 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -637,7 +637,7 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet) switch (packet->data[0]) { - case ID_WORLD_OBJECT_CREATION: + case ID_WORLD_OBJECT_PLACE: { MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), event->cellRef.mRefID, 1); @@ -645,11 +645,11 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet) break; } - case ID_WORLD_OBJECT_REMOVAL: + case ID_WORLD_OBJECT_DELETE: { myPacket->Packet(&bsIn, event, false); - LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_WORLD_OBJECT_REMOVAL"); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_WORLD_OBJECT_DELETE"); LOG_APPEND(Log::LOG_WARN, "- cellRefId: %s, %i", event->cellRef.mRefID.c_str(), event->cellRef.mRefNum); diff --git a/apps/openmw/mwworld/actiontake.cpp b/apps/openmw/mwworld/actiontake.cpp index 02d80de69..b56492e38 100644 --- a/apps/openmw/mwworld/actiontake.cpp +++ b/apps/openmw/mwworld/actiontake.cpp @@ -27,9 +27,9 @@ namespace MWWorld event->cellRef.mRefID = getTarget().getCellRef().getRefId(); event->cellRef.mRefNum = getTarget().getCellRef().getRefNum(); - mwmp::Main::get().getNetworking()->GetWorldPacket(ID_WORLD_OBJECT_REMOVAL)->Send(event); + mwmp::Main::get().getNetworking()->GetWorldPacket(ID_WORLD_OBJECT_DELETE)->Send(event); - printf("Sending ID_WORLD_OBJECT_REMOVAL about %s\n%i\n", + printf("Sending ID_WORLD_OBJECT_DELETE about %s\n%i\n", event->cellRef.mRefID.c_str(), event->cellRef.mRefNum); diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 843f30475..47896b9dd 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -157,7 +157,7 @@ add_component_dir (openmw-mp Packets/Player/PacketHandshake Packets/Player/PacketGUIBoxes Packets/Player/PacketClass Packets/Player/PacketTime - Packets/World/PacketObjectCreation Packets/World/PacketObjectRemoval) + Packets/World/PacketObjectDelete Packets/World/PacketObjectPlace) add_component_dir (fallback fallback validate diff --git a/components/openmw-mp/Controllers/WorldPacketController.cpp b/components/openmw-mp/Controllers/WorldPacketController.cpp index d7be1666c..119c0b581 100644 --- a/components/openmw-mp/Controllers/WorldPacketController.cpp +++ b/components/openmw-mp/Controllers/WorldPacketController.cpp @@ -2,8 +2,8 @@ #include #include -#include "../Packets/World/PacketObjectCreation.hpp" -#include "../Packets/World/PacketObjectRemoval.hpp" +#include "../Packets/World/PacketObjectPlace.hpp" +#include "../Packets/World/PacketObjectDelete.hpp" #include "WorldPacketController.hpp" @@ -17,8 +17,8 @@ inline void AddPacket(mwmp::WorldPacketController::packets_t *packets, RakNet::R mwmp::WorldPacketController::WorldPacketController(RakNet::RakPeerInterface *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 d5c65908a..e3a733f27 100644 --- a/components/openmw-mp/NetworkMessages.hpp +++ b/components/openmw-mp/NetworkMessages.hpp @@ -32,8 +32,8 @@ enum GameMessages ID_GUI_MESSAGEBOX, ID_GAME_TIME, - ID_WORLD_OBJECT_CREATION, - ID_WORLD_OBJECT_REMOVAL + ID_WORLD_OBJECT_PLACE, + ID_WORLD_OBJECT_DELETE }; diff --git a/components/openmw-mp/Packets/World/PacketObjectCreation.cpp b/components/openmw-mp/Packets/World/PacketObjectCreation.cpp deleted file mode 100644 index 02ccd2417..000000000 --- a/components/openmw-mp/Packets/World/PacketObjectCreation.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include "PacketObjectCreation.hpp" - -using namespace mwmp; - -PacketObjectCreation::PacketObjectCreation(RakNet::RakPeerInterface *peer) : WorldPacket(peer) -{ - packetID = ID_WORLD_OBJECT_REMOVAL; -} - -void PacketObjectCreation::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) -{ - WorldPacket::Packet(bs, event, send); - - RW(event->cellRef.mRefID, send); - RW(event->cellRef.mRefNum, send); -} diff --git a/components/openmw-mp/Packets/World/PacketObjectCreation.hpp b/components/openmw-mp/Packets/World/PacketObjectCreation.hpp deleted file mode 100644 index 7cbf801d6..000000000 --- a/components/openmw-mp/Packets/World/PacketObjectCreation.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef OPENMW_PACKETOBJECTCREATION_HPP -#define OPENMW_PACKETOBJECTCREATION_HPP - -#include - -namespace mwmp -{ - class PacketObjectCreation : public WorldPacket - { - public: - PacketObjectCreation(RakNet::RakPeerInterface *peer); - - virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); - }; -} - -#endif //OPENMW_PACKETOBJECTCREATION_HPP diff --git a/components/openmw-mp/Packets/World/PacketObjectDelete.cpp b/components/openmw-mp/Packets/World/PacketObjectDelete.cpp new file mode 100644 index 000000000..d4432c6c9 --- /dev/null +++ b/components/openmw-mp/Packets/World/PacketObjectDelete.cpp @@ -0,0 +1,17 @@ +#include +#include "PacketObjectDelete.hpp" + +using namespace mwmp; + +PacketObjectDelete::PacketObjectDelete(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +{ + packetID = ID_WORLD_OBJECT_DELETE; +} + +void PacketObjectDelete::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) +{ + WorldPacket::Packet(bs, event, send); + + RW(event->cellRef.mRefID, send); + RW(event->cellRef.mRefNum, send); +} diff --git a/components/openmw-mp/Packets/World/PacketObjectDelete.hpp b/components/openmw-mp/Packets/World/PacketObjectDelete.hpp new file mode 100644 index 000000000..d3042bc67 --- /dev/null +++ b/components/openmw-mp/Packets/World/PacketObjectDelete.hpp @@ -0,0 +1,17 @@ +#ifndef OPENMW_PACKETOBJECTDELETE_HPP +#define OPENMW_PACKETOBJECTDELETE_HPP + +#include + +namespace mwmp +{ + class PacketObjectDelete : public WorldPacket + { + public: + PacketObjectDelete(RakNet::RakPeerInterface *peer); + + virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); + }; +} + +#endif //OPENMW_PACKETOBJECTDELETE_HPP diff --git a/components/openmw-mp/Packets/World/PacketObjectPlace.cpp b/components/openmw-mp/Packets/World/PacketObjectPlace.cpp new file mode 100644 index 000000000..73de27d9d --- /dev/null +++ b/components/openmw-mp/Packets/World/PacketObjectPlace.cpp @@ -0,0 +1,17 @@ +#include +#include "PacketObjectPlace.hpp" + +using namespace mwmp; + +PacketObjectPlace::PacketObjectPlace(RakNet::RakPeerInterface *peer) : WorldPacket(peer) +{ + packetID = ID_WORLD_OBJECT_DELETE; +} + +void PacketObjectPlace::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) +{ + WorldPacket::Packet(bs, event, send); + + RW(event->cellRef.mRefID, send); + RW(event->cellRef.mRefNum, send); +} diff --git a/components/openmw-mp/Packets/World/PacketObjectPlace.hpp b/components/openmw-mp/Packets/World/PacketObjectPlace.hpp new file mode 100644 index 000000000..cea0263dd --- /dev/null +++ b/components/openmw-mp/Packets/World/PacketObjectPlace.hpp @@ -0,0 +1,17 @@ +#ifndef OPENMW_PACKETOBJECTPLACE_HPP +#define OPENMW_PACKETOBJECTPLACE_HPP + +#include + +namespace mwmp +{ + class PacketObjectPlace : public WorldPacket + { + public: + PacketObjectPlace(RakNet::RakPeerInterface *peer); + + virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); + }; +} + +#endif //OPENMW_PACKETOBJECTPLACE_HPP diff --git a/components/openmw-mp/Packets/World/PacketObjectRemoval.cpp b/components/openmw-mp/Packets/World/PacketObjectRemoval.cpp deleted file mode 100644 index a23cad4da..000000000 --- a/components/openmw-mp/Packets/World/PacketObjectRemoval.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include "PacketObjectRemoval.hpp" - -using namespace mwmp; - -PacketObjectRemoval::PacketObjectRemoval(RakNet::RakPeerInterface *peer) : WorldPacket(peer) -{ - packetID = ID_WORLD_OBJECT_REMOVAL; -} - -void PacketObjectRemoval::Packet(RakNet::BitStream *bs, WorldEvent *event, bool send) -{ - WorldPacket::Packet(bs, event, send); - - RW(event->cellRef.mRefID, send); - RW(event->cellRef.mRefNum, send); -} diff --git a/components/openmw-mp/Packets/World/PacketObjectRemoval.hpp b/components/openmw-mp/Packets/World/PacketObjectRemoval.hpp deleted file mode 100644 index 1046ad0e0..000000000 --- a/components/openmw-mp/Packets/World/PacketObjectRemoval.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef OPENMW_PACKETOBJECTREMOVAL_HPP -#define OPENMW_PACKETOBJECTREMOVAL_HPP - -#include - -namespace mwmp -{ - class PacketObjectRemoval : public WorldPacket - { - public: - PacketObjectRemoval(RakNet::RakPeerInterface *peer); - - virtual void Packet(RakNet::BitStream *bs, WorldEvent *event, bool send); - }; -} - -#endif //OPENMW_PACKETOBJECTREMOVAL_HPP