1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 22:15:32 +00:00

Create and implement placeholder for ID_WORLD_OBJECT_CREATION

This commit is contained in:
David Cernat 2016-10-21 21:57:05 +03:00
parent 32dc8cf63f
commit 565e7e4b9f
7 changed files with 52 additions and 1 deletions

View file

@ -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",

View file

@ -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);

View file

@ -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

View file

@ -2,6 +2,7 @@
#include <boost/foreach.hpp>
#include <boost/make_shared.hpp>
#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<PacketObjectCreation>(&packets, peer);
AddPacket<PacketObjectRemoval>(&packets, peer);
}

View file

@ -32,6 +32,7 @@ enum GameMessages
ID_GUI_MESSAGEBOX,
ID_GAME_TIME,
ID_WORLD_OBJECT_CREATION,
ID_WORLD_OBJECT_REMOVAL
};

View file

@ -0,0 +1,16 @@
#include <components/openmw-mp/NetworkMessages.hpp>
#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);
}

View file

@ -0,0 +1,17 @@
#ifndef OPENMW_PACKETOBJECTCREATION_HPP
#define OPENMW_PACKETOBJECTCREATION_HPP
#include <components/openmw-mp/Packets/World/WorldPacket.hpp>
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