From 52d156e136c18efd75eb4cc635df8f69841f7390 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Tue, 25 Oct 2016 00:50:32 +0300 Subject: [PATCH] Make server able to receive the 5 new WorldPackets --- apps/openmw-mp/Networking.cpp | 85 +++++++++++++++++++ .../Controllers/WorldPacketController.cpp | 12 +++ components/openmw-mp/NetworkMessages.hpp | 5 ++ 3 files changed, 102 insertions(+) diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index 09c013e99..8ce6392b2 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -444,6 +444,91 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet) break; } + case ID_WORLD_OBJECT_SCALE: + { + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_OBJECT_SCALE from %s", + player->Npc()->mName.c_str()); + + myPacket->Read(event); + + LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s", + event->cellRef.mRefID.c_str(), + event->cellRef.mRefNum.mIndex, + event->cell.getDescription().c_str()); + + myPacket->Send(event, true); + + break; + } + + case ID_WORLD_CONTAINER_ADD: + { + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_CONTAINER_ADD from %s", + player->Npc()->mName.c_str()); + + myPacket->Read(event); + + LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s", + event->cellRef.mRefID.c_str(), + event->cellRef.mRefNum.mIndex, + event->cell.getDescription().c_str()); + + myPacket->Send(event, true); + + break; + } + + case ID_WORLD_CONTAINER_REMOVE: + { + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_CONTAINER_REMOVE from %s", + player->Npc()->mName.c_str()); + + myPacket->Read(event); + + LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s", + event->cellRef.mRefID.c_str(), + event->cellRef.mRefNum.mIndex, + event->cell.getDescription().c_str()); + + myPacket->Send(event, true); + + break; + } + + case ID_WORLD_DOOR_ACTIVATE: + { + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_DOOR_ACTIVATE from %s", + player->Npc()->mName.c_str()); + + myPacket->Read(event); + + LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s", + event->cellRef.mRefID.c_str(), + event->cellRef.mRefNum.mIndex, + event->cell.getDescription().c_str()); + + myPacket->Send(event, true); + + break; + } + + case ID_WORLD_ACTIVATOR_ACTIVATE: + { + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_ACTIVATOR_ACTIVATE from %s", + player->Npc()->mName.c_str()); + + myPacket->Read(event); + + LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s", + event->cellRef.mRefID.c_str(), + event->cellRef.mRefNum.mIndex, + event->cell.getDescription().c_str()); + + myPacket->Send(event, true); + + break; + } + case ID_WORLD_VIDEO_PLAY: { LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_WORLD_VIDEO_PLAY from %s", diff --git a/components/openmw-mp/Controllers/WorldPacketController.cpp b/components/openmw-mp/Controllers/WorldPacketController.cpp index 915df1d06..231feda0d 100644 --- a/components/openmw-mp/Controllers/WorldPacketController.cpp +++ b/components/openmw-mp/Controllers/WorldPacketController.cpp @@ -6,6 +6,12 @@ #include "../Packets/World/PacketObjectPlace.hpp" #include "../Packets/World/PacketObjectLock.hpp" #include "../Packets/World/PacketObjectUnlock.hpp" +#include "../Packets/World/PacketObjectScale.hpp" + +#include "../Packets/World/PacketContainerAdd.hpp" +#include "../Packets/World/PacketContainerRemove.hpp" +#include "../Packets/World/PacketDoorActivate.hpp" +#include "../Packets/World/PacketActivatorActivate.hpp" #include "../Packets/World/PacketVideoPlay.hpp" #include "WorldPacketController.hpp" @@ -24,6 +30,12 @@ mwmp::WorldPacketController::WorldPacketController(RakNet::RakPeerInterface *pee 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 bb459db6d..19a2f2654 100644 --- a/components/openmw-mp/NetworkMessages.hpp +++ b/components/openmw-mp/NetworkMessages.hpp @@ -37,7 +37,12 @@ enum GameMessages ID_WORLD_OBJECT_DELETE, ID_WORLD_OBJECT_LOCK, ID_WORLD_OBJECT_UNLOCK, + ID_WORLD_OBJECT_SCALE, + ID_WORLD_CONTAINER_ADD, + ID_WORLD_CONTAINER_REMOVE, + ID_WORLD_DOOR_ACTIVATE, + ID_WORLD_ACTIVATOR_ACTIVATE, ID_WORLD_VIDEO_PLAY };