diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index aa7937fba..37e3f94bf 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -374,6 +374,17 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet) switch (packet->data[0]) { + case ID_WORLD_OBJECT_CREATION: + { + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_OBJECT_CREATION from %s", + player->Npc()->mName.c_str()); + + myPacket->Read(event); + myPacket->Send(event, true); + + break; + } + case ID_WORLD_OBJECT_REMOVAL: { LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_OBJECT_REMOVAL from %s", diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index 7e8a1c0c1..bc0680a09 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -635,6 +635,10 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet) switch (packet->data[0]) { + case ID_WORLD_OBJECT_CREATION: + { + break; + } case ID_WORLD_OBJECT_REMOVAL: { myPacket->Packet(&bsIn, event, false); diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 417528d23..843f30475 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/PacketObjectRemoval) + Packets/World/PacketObjectCreation Packets/World/PacketObjectRemoval) add_component_dir (fallback fallback validate diff --git a/components/openmw-mp/Controllers/WorldPacketController.cpp b/components/openmw-mp/Controllers/WorldPacketController.cpp index b3295ceb8..d7be1666c 100644 --- a/components/openmw-mp/Controllers/WorldPacketController.cpp +++ b/components/openmw-mp/Controllers/WorldPacketController.cpp @@ -2,6 +2,7 @@ #include #include +#include "../Packets/World/PacketObjectCreation.hpp" #include "../Packets/World/PacketObjectRemoval.hpp" #include "WorldPacketController.hpp" @@ -16,6 +17,7 @@ inline void AddPacket(mwmp::WorldPacketController::packets_t *packets, RakNet::R mwmp::WorldPacketController::WorldPacketController(RakNet::RakPeerInterface *peer) { + AddPacket(&packets, peer); AddPacket(&packets, peer); } diff --git a/components/openmw-mp/NetworkMessages.hpp b/components/openmw-mp/NetworkMessages.hpp index 1bcd02b08..d5c65908a 100644 --- a/components/openmw-mp/NetworkMessages.hpp +++ b/components/openmw-mp/NetworkMessages.hpp @@ -32,6 +32,7 @@ enum GameMessages ID_GUI_MESSAGEBOX, ID_GAME_TIME, + ID_WORLD_OBJECT_CREATION, ID_WORLD_OBJECT_REMOVAL }; diff --git a/components/openmw-mp/Packets/World/PacketObjectCreation.cpp b/components/openmw-mp/Packets/World/PacketObjectCreation.cpp new file mode 100644 index 000000000..d5adb8f7a --- /dev/null +++ b/components/openmw-mp/Packets/World/PacketObjectCreation.cpp @@ -0,0 +1,16 @@ +#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(), send); +} diff --git a/components/openmw-mp/Packets/World/PacketObjectCreation.hpp b/components/openmw-mp/Packets/World/PacketObjectCreation.hpp new file mode 100644 index 000000000..7cbf801d6 --- /dev/null +++ b/components/openmw-mp/Packets/World/PacketObjectCreation.hpp @@ -0,0 +1,17 @@ +#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