Rename WorldPackets to ID_WORLD_OBJECT_DELETE and ID_WORLD_OBJECT_PLACE

This commit is contained in:
David Cernat 2016-10-22 18:05:32 +03:00
parent 40f1db2d86
commit 3c49157ed7
14 changed files with 84 additions and 84 deletions

View file

@ -375,9 +375,9 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
switch (packet->data[0]) 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()); player->Npc()->mName.c_str());
myPacket->Read(event); myPacket->Read(event);
@ -386,9 +386,9 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
break; 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()); player->Npc()->mName.c_str());
myPacket->Read(event); myPacket->Read(event);

View file

@ -637,7 +637,7 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
switch (packet->data[0]) 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); MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), event->cellRef.mRefID, 1);
@ -645,11 +645,11 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
break; break;
} }
case ID_WORLD_OBJECT_REMOVAL: case ID_WORLD_OBJECT_DELETE:
{ {
myPacket->Packet(&bsIn, event, false); 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", LOG_APPEND(Log::LOG_WARN, "- cellRefId: %s, %i",
event->cellRef.mRefID.c_str(), event->cellRef.mRefID.c_str(),
event->cellRef.mRefNum); event->cellRef.mRefNum);

View file

@ -27,9 +27,9 @@ namespace MWWorld
event->cellRef.mRefID = getTarget().getCellRef().getRefId(); event->cellRef.mRefID = getTarget().getCellRef().getRefId();
event->cellRef.mRefNum = getTarget().getCellRef().getRefNum(); 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.mRefID.c_str(),
event->cellRef.mRefNum); event->cellRef.mRefNum);

View file

@ -157,7 +157,7 @@ add_component_dir (openmw-mp
Packets/Player/PacketHandshake Packets/Player/PacketGUIBoxes Packets/Player/PacketClass Packets/Player/PacketHandshake Packets/Player/PacketGUIBoxes Packets/Player/PacketClass
Packets/Player/PacketTime Packets/Player/PacketTime
Packets/World/PacketObjectCreation Packets/World/PacketObjectRemoval) Packets/World/PacketObjectDelete Packets/World/PacketObjectPlace)
add_component_dir (fallback add_component_dir (fallback
fallback validate fallback validate

View file

@ -2,8 +2,8 @@
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <boost/make_shared.hpp> #include <boost/make_shared.hpp>
#include "../Packets/World/PacketObjectCreation.hpp" #include "../Packets/World/PacketObjectPlace.hpp"
#include "../Packets/World/PacketObjectRemoval.hpp" #include "../Packets/World/PacketObjectDelete.hpp"
#include "WorldPacketController.hpp" #include "WorldPacketController.hpp"
@ -17,8 +17,8 @@ inline void AddPacket(mwmp::WorldPacketController::packets_t *packets, RakNet::R
mwmp::WorldPacketController::WorldPacketController(RakNet::RakPeerInterface *peer) mwmp::WorldPacketController::WorldPacketController(RakNet::RakPeerInterface *peer)
{ {
AddPacket<PacketObjectCreation>(&packets, peer); AddPacket<PacketObjectPlace>(&packets, peer);
AddPacket<PacketObjectRemoval>(&packets, peer); AddPacket<PacketObjectDelete>(&packets, peer);
} }

View file

@ -32,8 +32,8 @@ enum GameMessages
ID_GUI_MESSAGEBOX, ID_GUI_MESSAGEBOX,
ID_GAME_TIME, ID_GAME_TIME,
ID_WORLD_OBJECT_CREATION, ID_WORLD_OBJECT_PLACE,
ID_WORLD_OBJECT_REMOVAL ID_WORLD_OBJECT_DELETE
}; };

View file

@ -1,17 +0,0 @@
#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.mRefID, send);
RW(event->cellRef.mRefNum, send);
}

View file

@ -1,17 +0,0 @@
#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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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