[General] Rename Event into ObjectList & WorldObject into BaseObject

sol2-server-rewrite
David Cernat 7 years ago
parent 6bf3a0be1e
commit 78234f9071

@ -211,7 +211,7 @@ void Cell::sendToLoaded(mwmp::ActorPacket *actorPacket, mwmp::BaseActorList *bas
}
}
void Cell::sendToLoaded(mwmp::ObjectPacket *objectPacket, mwmp::BaseEvent *baseEvent) const
void Cell::sendToLoaded(mwmp::ObjectPacket *objectPacket, mwmp::BaseObjectList *baseObjectList) const
{
if (players.empty())
return;
@ -229,9 +229,9 @@ void Cell::sendToLoaded(mwmp::ObjectPacket *objectPacket, mwmp::BaseEvent *baseE
for (auto pl : plList)
{
if (pl->guid == baseEvent->guid) continue;
if (pl->guid == baseObjectList->guid) continue;
objectPacket->setEvent(baseEvent);
objectPacket->setObjectList(baseObjectList);
// Send the packet to this eligible guid
objectPacket->Send(pl->guid);

@ -9,7 +9,7 @@
#include <string>
#include <components/esm/records.hpp>
#include <components/openmw-mp/Base/BaseActor.hpp>
#include <components/openmw-mp/Base/BaseEvent.hpp>
#include <components/openmw-mp/Base/BaseObject.hpp>
#include <components/openmw-mp/Packets/Actor/ActorPacket.hpp>
#include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
@ -41,7 +41,7 @@ public:
TPlayers getPlayers() const;
void sendToLoaded(mwmp::ActorPacket *actorPacket, mwmp::BaseActorList *baseActorList) const;
void sendToLoaded(mwmp::ObjectPacket *objectPacket, mwmp::BaseEvent *baseEvent) const;
void sendToLoaded(mwmp::ObjectPacket *objectPacket, mwmp::BaseObjectList *baseObjectList) const;
std::string getDescription() const;

@ -4,7 +4,7 @@
#include <deque>
#include <string>
#include <components/esm/records.hpp>
#include <components/openmw-mp/Base/BaseEvent.hpp>
#include <components/openmw-mp/Base/BaseObject.hpp>
#include <components/openmw-mp/Packets/Actor/ActorPacket.hpp>
#include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>

@ -188,7 +188,7 @@ void Networking::processObjectPacket(RakNet::Packet *packet)
if (!player->isHandshaked() || player->getLoadState() != Player::POSTLOADED)
return;
if (!WorldProcessor::Process(*packet, baseEvent))
if (!WorldProcessor::Process(*packet, baseObjectList))
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled ObjectPacket with identifier %i has arrived", packet->data[0]);
}
@ -362,9 +362,9 @@ BaseActorList *Networking::getLastActorList()
return &baseActorList;
}
BaseEvent *Networking::getLastEvent()
BaseObjectList *Networking::getLastObjectList()
{
return &baseEvent;
return &baseObjectList;
}
int Networking::getCurrentMpNum()

@ -46,7 +46,7 @@ namespace mwmp
ObjectPacketController *getObjectPacketController() const;
BaseActorList *getLastActorList();
BaseEvent *getLastEvent();
BaseObjectList *getLastObjectList();
int getCurrentMpNum();
void setCurrentMpNum(int value);
@ -75,7 +75,7 @@ namespace mwmp
MasterClient *mclient;
BaseActorList baseActorList;
BaseEvent baseEvent;
BaseObjectList baseObjectList;
PlayerPacketController *playerPacketController;
ActorPacketController *actorPacketController;

@ -1,5 +1,5 @@
#include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Base/BaseEvent.hpp>
#include <components/openmw-mp/Base/BaseObject.hpp>
#include <apps/openmw-mp/Networking.hpp>
#include <apps/openmw-mp/Player.hpp>
@ -10,280 +10,280 @@
using namespace mwmp;
BaseEvent *readEvent;
BaseEvent writeEvent;
BaseObjectList *readObjectList;
BaseObjectList writeObjectList;
WorldObject tempWorldObject;
const WorldObject emptyWorldObject = {};
BaseObject tempObject;
const BaseObject emptyObject = {};
ContainerItem tempContainerItem;
const ContainerItem emptyContainerItem = {};
void WorldFunctions::ReadLastEvent() noexcept
void WorldFunctions::ReadLastObjectList() noexcept
{
readEvent = mwmp::Networking::getPtr()->getLastEvent();
readObjectList = mwmp::Networking::getPtr()->getLastObjectList();
}
void WorldFunctions::InitializeEvent(unsigned short pid) noexcept
void WorldFunctions::InitializeObjectList(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
writeEvent.cell.blank();
writeEvent.worldObjects.clear();
writeEvent.guid = player->guid;
writeObjectList.cell.blank();
writeObjectList.baseObjects.clear();
writeObjectList.guid = player->guid;
}
unsigned int WorldFunctions::GetObjectChangesSize() noexcept
{
return readEvent->worldObjectCount;
return readObjectList->baseObjectCount;
}
unsigned char WorldFunctions::GetEventAction() noexcept
unsigned char WorldFunctions::GetObjectListAction() noexcept
{
return readEvent->action;
return readObjectList->action;
}
unsigned char WorldFunctions::GetEventContainerSubAction() noexcept
unsigned char WorldFunctions::GetObjectListContainerSubAction() noexcept
{
return readEvent->containerSubAction;
return readObjectList->containerSubAction;
}
const char *WorldFunctions::GetObjectRefId(unsigned int i) noexcept
{
return readEvent->worldObjects.at(i).refId.c_str();
return readObjectList->baseObjects.at(i).refId.c_str();
}
int WorldFunctions::GetObjectRefNumIndex(unsigned int i) noexcept
{
return readEvent->worldObjects.at(i).refNumIndex;
return readObjectList->baseObjects.at(i).refNumIndex;
}
int WorldFunctions::GetObjectMpNum(unsigned int i) noexcept
{
return readEvent->worldObjects.at(i).mpNum;
return readObjectList->baseObjects.at(i).mpNum;
}
int WorldFunctions::GetObjectCount(unsigned int i) noexcept
{
return readEvent->worldObjects.at(i).count;
return readObjectList->baseObjects.at(i).count;
}
int WorldFunctions::GetObjectCharge(unsigned int i) noexcept
{
return readEvent->worldObjects.at(i).charge;
return readObjectList->baseObjects.at(i).charge;
}
double WorldFunctions::GetObjectEnchantmentCharge(unsigned int i) noexcept
{
return readEvent->worldObjects.at(i).enchantmentCharge;
return readObjectList->baseObjects.at(i).enchantmentCharge;
}
int WorldFunctions::GetObjectGoldValue(unsigned int i) noexcept
{
return readEvent->worldObjects.at(i).goldValue;
return readObjectList->baseObjects.at(i).goldValue;
}
double WorldFunctions::GetObjectScale(unsigned int i) noexcept
{
return readEvent->worldObjects.at(i).scale;
return readObjectList->baseObjects.at(i).scale;
}
bool WorldFunctions::GetObjectState(unsigned int i) noexcept
{
return readEvent->worldObjects.at(i).objectState;
return readObjectList->baseObjects.at(i).objectState;
}
int WorldFunctions::GetObjectDoorState(unsigned int i) noexcept
{
return readEvent->worldObjects.at(i).doorState;
return readObjectList->baseObjects.at(i).doorState;
}
int WorldFunctions::GetObjectLockLevel(unsigned int i) noexcept
{
return readEvent->worldObjects.at(i).lockLevel;
return readObjectList->baseObjects.at(i).lockLevel;
}
double WorldFunctions::GetObjectPosX(unsigned int i) noexcept
{
return readEvent->worldObjects.at(i).position.pos[0];
return readObjectList->baseObjects.at(i).position.pos[0];
}
double WorldFunctions::GetObjectPosY(unsigned int i) noexcept
{
return readEvent->worldObjects.at(i).position.pos[1];
return readObjectList->baseObjects.at(i).position.pos[1];
}
double WorldFunctions::GetObjectPosZ(unsigned int i) noexcept
{
return readEvent->worldObjects.at(i).position.pos[2];
return readObjectList->baseObjects.at(i).position.pos[2];
}
double WorldFunctions::GetObjectRotX(unsigned int i) noexcept
{
return readEvent->worldObjects.at(i).position.rot[0];
return readObjectList->baseObjects.at(i).position.rot[0];
}
double WorldFunctions::GetObjectRotY(unsigned int i) noexcept
{
return readEvent->worldObjects.at(i).position.rot[1];
return readObjectList->baseObjects.at(i).position.rot[1];
}
double WorldFunctions::GetObjectRotZ(unsigned int i) noexcept
{
return readEvent->worldObjects.at(i).position.rot[2];
return readObjectList->baseObjects.at(i).position.rot[2];
}
unsigned int WorldFunctions::GetContainerChangesSize(unsigned int objectIndex) noexcept
{
return readEvent->worldObjects.at(objectIndex).containerItemCount;
return readObjectList->baseObjects.at(objectIndex).containerItemCount;
}
const char *WorldFunctions::GetContainerItemRefId(unsigned int objectIndex, unsigned int itemIndex) noexcept
{
return readEvent->worldObjects.at(objectIndex)
return readObjectList->baseObjects.at(objectIndex)
.containerItems.at(itemIndex).refId.c_str();
}
int WorldFunctions::GetContainerItemCount(unsigned int objectIndex, unsigned int itemIndex) noexcept
{
return readEvent->worldObjects.at(objectIndex)
return readObjectList->baseObjects.at(objectIndex)
.containerItems.at(itemIndex).count;
}
int WorldFunctions::GetContainerItemCharge(unsigned int objectIndex, unsigned int itemIndex) noexcept
{
return readEvent->worldObjects.at(objectIndex)
return readObjectList->baseObjects.at(objectIndex)
.containerItems.at(itemIndex).charge;
}
double WorldFunctions::GetContainerItemEnchantmentCharge(unsigned int objectIndex, unsigned int itemIndex) noexcept
{
return readEvent->worldObjects.at(objectIndex)
return readObjectList->baseObjects.at(objectIndex)
.containerItems.at(itemIndex).enchantmentCharge;
}
int WorldFunctions::GetContainerItemActionCount(unsigned int objectIndex, unsigned int itemIndex) noexcept
{
return readEvent->worldObjects.at(objectIndex)
return readObjectList->baseObjects.at(objectIndex)
.containerItems.at(itemIndex).actionCount;
}
void WorldFunctions::SetEventCell(const char* cellDescription) noexcept
void WorldFunctions::SetObjectListCell(const char* cellDescription) noexcept
{
writeEvent.cell = Utils::getCellFromDescription(cellDescription);
writeObjectList.cell = Utils::getCellFromDescription(cellDescription);
}
void WorldFunctions::SetEventAction(unsigned char action) noexcept
void WorldFunctions::SetObjectListAction(unsigned char action) noexcept
{
writeEvent.action = action;
writeObjectList.action = action;
}
void WorldFunctions::SetEventConsoleCommand(const char* consoleCommand) noexcept
void WorldFunctions::SetObjectListConsoleCommand(const char* consoleCommand) noexcept
{
writeEvent.consoleCommand = consoleCommand;
writeObjectList.consoleCommand = consoleCommand;
}
void WorldFunctions::SetObjectRefId(const char* refId) noexcept
{
tempWorldObject.refId = refId;
tempObject.refId = refId;
}
void WorldFunctions::SetObjectRefNumIndex(int refNumIndex) noexcept
{
tempWorldObject.refNumIndex = refNumIndex;
tempObject.refNumIndex = refNumIndex;
}
void WorldFunctions::SetObjectMpNum(int mpNum) noexcept
{
tempWorldObject.mpNum = mpNum;
tempObject.mpNum = mpNum;
}
void WorldFunctions::SetObjectCount(int count) noexcept
{
tempWorldObject.count = count;
tempObject.count = count;
}
void WorldFunctions::SetObjectCharge(int charge) noexcept
{
tempWorldObject.charge = charge;
tempObject.charge = charge;
}
void WorldFunctions::SetObjectEnchantmentCharge(double enchantmentCharge) noexcept
{
tempWorldObject.enchantmentCharge = enchantmentCharge;
tempObject.enchantmentCharge = enchantmentCharge;
}
void WorldFunctions::SetObjectGoldValue(int goldValue) noexcept
{
tempWorldObject.goldValue = goldValue;
tempObject.goldValue = goldValue;
}
void WorldFunctions::SetObjectScale(double scale) noexcept
{
tempWorldObject.scale = scale;
tempObject.scale = scale;
}
void WorldFunctions::SetObjectState(bool objectState) noexcept
{
tempWorldObject.objectState = objectState;
tempObject.objectState = objectState;
}
void WorldFunctions::SetObjectLockLevel(int lockLevel) noexcept
{
tempWorldObject.lockLevel = lockLevel;
tempObject.lockLevel = lockLevel;
}
void WorldFunctions::SetObjectDisarmState(bool disarmState) noexcept
{
tempWorldObject.isDisarmed = disarmState;
tempObject.isDisarmed = disarmState;
}
void WorldFunctions::SetObjectMasterState(bool masterState) noexcept
{
tempWorldObject.hasMaster = masterState;
tempObject.hasMaster = masterState;
}
void WorldFunctions::SetObjectPosition(double x, double y, double z) noexcept
{
tempWorldObject.position.pos[0] = x;
tempWorldObject.position.pos[1] = y;
tempWorldObject.position.pos[2] = z;
tempObject.position.pos[0] = x;
tempObject.position.pos[1] = y;
tempObject.position.pos[2] = z;
}
void WorldFunctions::SetObjectRotation(double x, double y, double z) noexcept
{
tempWorldObject.position.rot[0] = x;
tempWorldObject.position.rot[1] = y;
tempWorldObject.position.rot[2] = z;
tempObject.position.rot[0] = x;
tempObject.position.rot[1] = y;
tempObject.position.rot[2] = z;
}
void WorldFunctions::SetObjectDoorState(int doorState) noexcept
{
tempWorldObject.doorState = doorState;
tempObject.doorState = doorState;
}
void WorldFunctions::SetObjectDoorTeleportState(bool teleportState) noexcept
{
tempWorldObject.teleportState = teleportState;
tempObject.teleportState = teleportState;
}
void WorldFunctions::SetObjectDoorDestinationCell(const char* cellDescription) noexcept
{
tempWorldObject.destinationCell = Utils::getCellFromDescription(cellDescription);
tempObject.destinationCell = Utils::getCellFromDescription(cellDescription);
}
void WorldFunctions::SetObjectDoorDestinationPosition(double x, double y, double z) noexcept
{
tempWorldObject.destinationPosition.pos[0] = x;
tempWorldObject.destinationPosition.pos[1] = y;
tempWorldObject.destinationPosition.pos[2] = z;
tempObject.destinationPosition.pos[0] = x;
tempObject.destinationPosition.pos[1] = y;
tempObject.destinationPosition.pos[2] = z;
}
void WorldFunctions::SetObjectDoorDestinationRotation(double x, double z) noexcept
{
tempWorldObject.destinationPosition.rot[0] = x;
tempWorldObject.destinationPosition.rot[2] = z;
tempObject.destinationPosition.rot[0] = x;
tempObject.destinationPosition.rot[2] = z;
}
void WorldFunctions::SetPlayerAsObject(unsigned short pid) noexcept
@ -291,8 +291,8 @@ void WorldFunctions::SetPlayerAsObject(unsigned short pid) noexcept
Player *player;
GET_PLAYER(pid, player, );
tempWorldObject.guid = player->guid;
tempWorldObject.isPlayer = true;
tempObject.guid = player->guid;
tempObject.isPlayer = true;
}
void WorldFunctions::SetContainerItemRefId(const char* refId) noexcept
@ -317,20 +317,20 @@ void WorldFunctions::SetContainerItemEnchantmentCharge(double enchantmentCharge)
void WorldFunctions::SetReceivedContainerItemActionCount(unsigned int objectIndex, unsigned int itemIndex, int actionCount) noexcept
{
readEvent->worldObjects.at(objectIndex).containerItems.at(itemIndex).actionCount = actionCount;
readObjectList->baseObjects.at(objectIndex).containerItems.at(itemIndex).actionCount = actionCount;
}
void WorldFunctions::AddWorldObject() noexcept
void WorldFunctions::AddObject() noexcept
{
tempWorldObject.droppedByPlayer = false;
writeEvent.worldObjects.push_back(tempWorldObject);
tempObject.droppedByPlayer = false;
writeObjectList.baseObjects.push_back(tempObject);
tempWorldObject = emptyWorldObject;
tempObject = emptyObject;
}
void WorldFunctions::AddContainerItem() noexcept
{
tempWorldObject.containerItems.push_back(tempContainerItem);
tempObject.containerItems.push_back(tempContainerItem);
tempContainerItem = emptyContainerItem;
}
@ -338,7 +338,7 @@ void WorldFunctions::AddContainerItem() noexcept
void WorldFunctions::SendObjectPlace(bool broadcast) noexcept
{
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_PLACE);
packet->setEvent(&writeEvent);
packet->setObjectList(&writeObjectList);
packet->Send(false);
if (broadcast)
@ -348,7 +348,7 @@ void WorldFunctions::SendObjectPlace(bool broadcast) noexcept
void WorldFunctions::SendObjectSpawn(bool broadcast) noexcept
{
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_SPAWN);
packet->setEvent(&writeEvent);
packet->setObjectList(&writeObjectList);
packet->Send(false);
if (broadcast)
@ -358,7 +358,7 @@ void WorldFunctions::SendObjectSpawn(bool broadcast) noexcept
void WorldFunctions::SendObjectDelete(bool broadcast) noexcept
{
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_DELETE);
packet->setEvent(&writeEvent);
packet->setObjectList(&writeObjectList);
packet->Send(false);
if (broadcast)
@ -368,7 +368,7 @@ void WorldFunctions::SendObjectDelete(bool broadcast) noexcept
void WorldFunctions::SendObjectLock(bool broadcast) noexcept
{
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_LOCK);
packet->setEvent(&writeEvent);
packet->setObjectList(&writeObjectList);
packet->Send(false);
if (broadcast)
@ -378,7 +378,7 @@ void WorldFunctions::SendObjectLock(bool broadcast) noexcept
void WorldFunctions::SendObjectTrap(bool broadcast) noexcept
{
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_TRAP);
packet->setEvent(&writeEvent);
packet->setObjectList(&writeObjectList);
packet->Send(false);
if (broadcast)
@ -388,7 +388,7 @@ void WorldFunctions::SendObjectTrap(bool broadcast) noexcept
void WorldFunctions::SendObjectScale(bool broadcast) noexcept
{
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_SCALE);
packet->setEvent(&writeEvent);
packet->setObjectList(&writeObjectList);
packet->Send(false);
if (broadcast)
@ -398,7 +398,7 @@ void WorldFunctions::SendObjectScale(bool broadcast) noexcept
void WorldFunctions::SendObjectState(bool broadcast) noexcept
{
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_OBJECT_STATE);
packet->setEvent(&writeEvent);
packet->setObjectList(&writeObjectList);
packet->Send(false);
if (broadcast)
@ -408,7 +408,7 @@ void WorldFunctions::SendObjectState(bool broadcast) noexcept
void WorldFunctions::SendDoorState(bool broadcast) noexcept
{
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_DOOR_STATE);
packet->setEvent(&writeEvent);
packet->setObjectList(&writeObjectList);
packet->Send(false);
if (broadcast)
@ -418,21 +418,21 @@ void WorldFunctions::SendDoorState(bool broadcast) noexcept
void WorldFunctions::SendDoorDestination(bool broadcast) noexcept
{
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_DOOR_DESTINATION);
packet->setEvent(&writeEvent);
packet->setObjectList(&writeObjectList);
packet->Send(false);
if (broadcast)
packet->Send(true);
}
void WorldFunctions::SendContainer(bool broadcast, bool useLastReadEvent) noexcept
void WorldFunctions::SendContainer(bool broadcast, bool useLastReadObjectList) noexcept
{
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONTAINER);
if (useLastReadEvent)
packet->setEvent(readEvent);
if (useLastReadObjectList)
packet->setObjectList(readObjectList);
else
packet->setEvent(&writeEvent);
packet->setObjectList(&writeObjectList);
packet->Send(false);
@ -443,7 +443,7 @@ void WorldFunctions::SendContainer(bool broadcast, bool useLastReadEvent) noexce
void WorldFunctions::SendConsoleCommand(bool broadcast) noexcept
{
mwmp::ObjectPacket *packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONSOLE_COMMAND);
packet->setEvent(&writeEvent);
packet->setObjectList(&writeObjectList);
packet->Send(false);
if (broadcast)

@ -2,12 +2,12 @@
#define OPENMW_WORLDAPI_HPP
#define WORLDAPI \
{"ReadLastEvent", WorldFunctions::ReadLastEvent},\
{"InitializeEvent", WorldFunctions::InitializeEvent},\
{"ReadLastObjectList", WorldFunctions::ReadLastObjectList},\
{"InitializeObjectList", WorldFunctions::InitializeObjectList},\
\
{"GetObjectChangesSize", WorldFunctions::GetObjectChangesSize},\
{"GetEventAction", WorldFunctions::GetEventAction},\
{"GetEventContainerSubAction", WorldFunctions::GetEventContainerSubAction},\
{"GetObjectListAction", WorldFunctions::GetObjectListAction},\
{"GetObjectListContainerSubAction", WorldFunctions::GetObjectListContainerSubAction},\
\
{"GetObjectRefId", WorldFunctions::GetObjectRefId},\
{"GetObjectRefNumIndex", WorldFunctions::GetObjectRefNumIndex},\
@ -34,9 +34,9 @@
{"GetContainerItemEnchantmentCharge", WorldFunctions::GetContainerItemEnchantmentCharge},\
{"GetContainerItemActionCount", WorldFunctions::GetContainerItemActionCount},\
\
{"SetEventCell", WorldFunctions::SetEventCell},\
{"SetEventAction", WorldFunctions::SetEventAction},\
{"SetEventConsoleCommand", WorldFunctions::SetEventConsoleCommand},\
{"SetObjectListCell", WorldFunctions::SetObjectListCell},\
{"SetObjectListAction", WorldFunctions::SetObjectListAction},\
{"SetObjectListConsoleCommand", WorldFunctions::SetObjectListConsoleCommand},\
\
{"SetObjectRefId", WorldFunctions::SetObjectRefId},\
{"SetObjectRefNumIndex", WorldFunctions::SetObjectRefNumIndex},\
@ -68,7 +68,7 @@
\
{"SetReceivedContainerItemActionCount", WorldFunctions::SetReceivedContainerItemActionCount},\
\
{"AddWorldObject", WorldFunctions::AddWorldObject},\
{"AddObject", WorldFunctions::AddObject},\
{"AddContainerItem", WorldFunctions::AddContainerItem},\
\
{"SendObjectPlace", WorldFunctions::SendObjectPlace},\
@ -92,52 +92,52 @@ class WorldFunctions
public:
/**
* \brief Use the last event received by the server as the one being read.
* \brief Use the last object list received by the server as the one being read.
*
* \return void
*/
static void ReadLastEvent() noexcept;
static void ReadLastObjectList() noexcept;
/**
* \brief Clear the data from the last event sent by the server.
* \brief Clear the data from the last object list sent by the server.
*
* This is used to initialize the sending of new Object packets.
*
* \param pid The player ID to whom the event should be attached.
* \param pid The player ID to whom the object list should be attached.
* \return void
*/
static void InitializeEvent(unsigned short pid) noexcept;
static void InitializeObjectList(unsigned short pid) noexcept;
/**
* \brief Get the number of indexes in the read event's object changes.
* \brief Get the number of indexes in the read object list's object changes.
*
* \return The number of indexes.
*/
static unsigned int GetObjectChangesSize() noexcept;
/**
* \brief Get the action type used in the read event.
* \brief Get the action type used in the read object list.
*
* \return The action type (0 for SET, 1 for ADD, 2 for REMOVE, 3 for REQUEST).
*/
static unsigned char GetEventAction() noexcept;
static unsigned char GetObjectListAction() noexcept;
/**
* \brief Get the container subaction type used in the read event.
* \brief Get the container subaction type used in the read object list.
*
* \return The action type (0 for NONE, 1 for DRAG, 2 for DROP, 3 for TAKE_ALL).
*/
static unsigned char GetEventContainerSubAction() noexcept;
static unsigned char GetObjectListContainerSubAction() noexcept;
/**
* \brief Get the refId of the object at a certain index in the read event's object changes.
* \brief Get the refId of the object at a certain index in the read object list's object changes.
*
* \return The refId.
*/
static const char *GetObjectRefId(unsigned int i) noexcept;
/**
* \brief Get the refNumIndex of the object at a certain index in the read event's object
* \brief Get the refNumIndex of the object at a certain index in the read object list's object
* changes.
*
* \param i The index of the object.
@ -146,7 +146,7 @@ public:
static int GetObjectRefNumIndex(unsigned int i) noexcept;
/**
* \brief Get the mpNum of the object at a certain index in the read event's object changes.
* \brief Get the mpNum of the object at a certain index in the read object list's object changes.
*
* \param i The index of the object.
* \return The mpNum.
@ -154,7 +154,7 @@ public:
static int GetObjectMpNum(unsigned int i) noexcept;
/**
* \brief Get the count of the object at a certain index in the read event's object changes.
* \brief Get the count of the object at a certain index in the read object list's object changes.
*
* \param i The index of the object.
* \return The object count.
@ -162,7 +162,7 @@ public:
static int GetObjectCount(unsigned int i) noexcept;
/**
* \brief Get the charge of the object at a certain index in the read event's object changes.
* \brief Get the charge of the object at a certain index in the read object list's object changes.
*
* \param i The index of the object.
* \return The charge.
@ -170,7 +170,7 @@ public:
static int GetObjectCharge(unsigned int i) noexcept;
/**
* \brief Get the enchantment charge of the object at a certain index in the read event's object changes.
* \brief Get the enchantment charge of the object at a certain index in the read object list's object changes.
*
* \param i The index of the object.
* \return The enchantment charge.
@ -178,7 +178,7 @@ public:
static double GetObjectEnchantmentCharge(unsigned int i) noexcept;
/**
* \brief Get the gold value of the object at a certain index in the read event's object
* \brief Get the gold value of the object at a certain index in the read object list's object
* changes.
*
* This is used solely to get the gold value of gold. It is not used for other objects.
@ -189,7 +189,7 @@ public:
static int GetObjectGoldValue(unsigned int i) noexcept;
/**
* \brief Get the object scale of the object at a certain index in the read event's object
* \brief Get the object scale of the object at a certain index in the read object list's object
* changes.
*
* \param i The index of the object.
@ -198,7 +198,7 @@ public:
static double GetObjectScale(unsigned int i) noexcept;
/**
* \brief Get the object state of the object at a certain index in the read event's object
* \brief Get the object state of the object at a certain index in the read object list's object
* changes.
*
* \param i The index of the object.
@ -207,7 +207,7 @@ public:
static bool GetObjectState(unsigned int i) noexcept;
/**
* \brief Get the door state of the object at a certain index in the read event's object
* \brief Get the door state of the object at a certain index in the read object list's object
* changes.
*
* \param i The index of the object.
@ -216,7 +216,7 @@ public:
static int GetObjectDoorState(unsigned int i) noexcept;
/**
* \brief Get the lock level of the object at a certain index in the read event's object
* \brief Get the lock level of the object at a certain index in the read object list's object
* changes.
*
* \param i The index of the object.
@ -225,7 +225,7 @@ public:
static int GetObjectLockLevel(unsigned int i) noexcept;
/**
* \brief Get the X position of the object at a certain index in the read event's object
* \brief Get the X position of the object at a certain index in the read object list's object
* changes.
*
* \param i The index of the object.
@ -234,7 +234,7 @@ public:
static double GetObjectPosX(unsigned int i) noexcept;
/**
* \brief Get the Y position of the object at a certain index in the read event's object
* \brief Get the Y position of the object at a certain index in the read object list's object
* changes.
*
* \param i The index of the object.
@ -243,7 +243,7 @@ public:
static double GetObjectPosY(unsigned int i) noexcept;
/**
* \brief Get the Z position at a certain index in the read event's object changes.
* \brief Get the Z position at a certain index in the read object list's object changes.
*
* \param i The index of the object.
* \return The Z position.
@ -251,7 +251,7 @@ public:
static double GetObjectPosZ(unsigned int i) noexcept;
/**
* \brief Get the X rotation of the object at a certain index in the read event's object
* \brief Get the X rotation of the object at a certain index in the read object list's object
* changes.
*
* \param i The index of the object.
@ -260,7 +260,7 @@ public:
static double GetObjectRotX(unsigned int i) noexcept;
/**
* \brief Get the Y rotation of the object at a certain index in the read event's object
* \brief Get the Y rotation of the object at a certain index in the read object list's object
* changes.
*
* \param i The index of the object.
@ -269,7 +269,7 @@ public:
static double GetObjectRotY(unsigned int i) noexcept;
/**
* \brief Get the Z rotation of the object at a certain index in the read event's object
* \brief Get the Z rotation of the object at a certain index in the read object list's object
* changes.
*
* \param i The index of the object.
@ -279,7 +279,7 @@ public:
/**
* \brief Get the number of container item indexes of the object at a certain index in the
* read event's object changes.
* read object list's object changes.
*
* \param i The index of the object.
* \return The number of container item indexes.
@ -288,7 +288,7 @@ public:
/**
* \brief Get the refId of the container item at a certain itemIndex in the container changes
* of the object at a certain objectIndex in the read event's object changes.
* of the object at a certain objectIndex in the read object list's object changes.
*
* \param objectIndex The index of the object.
* \param itemIndex The index of the container item.
@ -298,7 +298,7 @@ public:
/**
* \brief Get the item count of the container item at a certain itemIndex in the container
* changes of the object at a certain objectIndex in the read event's object changes.
* changes of the object at a certain objectIndex in the read object list's object changes.
*
* \param objectIndex The index of the object.
* \param itemIndex The index of the container item.
@ -308,7 +308,7 @@ public:
/**
* \brief Get the charge of the container item at a certain itemIndex in the container changes
* of the object at a certain objectIndex in the read event's object changes.
* of the object at a certain objectIndex in the read object list's object changes.
*
* \param objectIndex The index of the object.
* \param itemIndex The index of the container item.
@ -318,7 +318,7 @@ public:
/**
* \brief Get the enchantment charge of the container item at a certain itemIndex in the container changes
* of the object at a certain objectIndex in the read event's object changes.
* of the object at a certain objectIndex in the read object list's object changes.
*
* \param objectIndex The index of the object.
* \param itemIndex The index of the container item.
@ -328,7 +328,7 @@ public:
/**
* \brief Get the action count of the container item at a certain itemIndex in the container
* changes of the object at a certain objectIndex in the read event's object changes.
* changes of the object at a certain objectIndex in the read object list's object changes.
*
* \param objectIndex The index of the object.
* \param itemIndex The index of the container item.
@ -337,7 +337,7 @@ public:
static int GetContainerItemActionCount(unsigned int objectIndex, unsigned int itemIndex) noexcept;
/**
* \brief Set the cell of the temporary event stored on the server.
* \brief Set the cell of the temporary object list stored on the server.
*
* The cell is determined to be an exterior cell if it fits the pattern of a number followed
* by a comma followed by another number.
@ -345,29 +345,29 @@ public:
* \param cellDescription The description of the cell.
* \return void
*/
static void SetEventCell(const char* cellDescription) noexcept;
static void SetObjectListCell(const char* cellDescription) noexcept;
/**
* \brief Set the action type of the temporary event stored on the server.
* \brief Set the action type of the temporary object list stored on the server.
*
* \param action The action type (0 for SET, 1 for ADD, 2 for REMOVE, 3 for REQUEST).
* \return void
*/
static void SetEventAction(unsigned char action) noexcept;
static void SetObjectListAction(unsigned char action) noexcept;
/**
* \brief Set the console command of the temporary event stored on the server.
* \brief Set the console command of the temporary object list stored on the server.
*
* When sent, the command will run once on every object added to the event. If no objects
* When sent, the command will run once on every object added to the object list. If no objects
* have been added, it will run once without any object reference.
*
* \param consoleCommand The console command.
* \return void
*/
static void SetEventConsoleCommand(const char* consoleCommand) noexcept;
static void SetObjectListConsoleCommand(const char* consoleCommand) noexcept;
/**
* \brief Set the refId of the temporary world object stored on the server.
* \brief Set the refId of the temporary object stored on the server.
*
* \param refId The refId.
* \return void
@ -375,7 +375,7 @@ public:
static void SetObjectRefId(const char* refId) noexcept;
/**
* \brief Set the refNumIndex of the temporary world object stored on the server.
* \brief Set the refNumIndex of the temporary object stored on the server.
*
* Every object loaded from .ESM and .ESP data files has a unique refNumIndex which needs to be
* retained to refer to it in packets.
@ -389,7 +389,7 @@ public:
static void SetObjectRefNumIndex(int refNumIndex) noexcept;
/**
* \brief Set the mpNum of the temporary world object stored on the server.
* \brief Set the mpNum of the temporary object stored on the server.
*
* Every object placed or spawned via the server is assigned an mpNum by incrementing the last
* mpNum stored on the server. Scripts should take care to ensure that mpNums are kept unique
@ -404,7 +404,7 @@ public:
static void SetObjectMpNum(int mpNum) noexcept;
/**
* \brief Set the object count of the temporary world object stored on the server.
* \brief Set the object count of the temporary object stored on the server.
*
* This determines the quantity of an object, with the exception of gold.
*
@ -414,7 +414,7 @@ public:
static void SetObjectCount(int count) noexcept;
/**
* \brief Set the charge of the temporary world object stored on the server.
* \brief Set the charge of the temporary object stored on the server.
*
* Object durabilities are set through this value.
*
@ -424,7 +424,7 @@ public:
static void SetObjectCharge(int charge) noexcept;
/**
* \brief Set the enchantment charge of the temporary world object stored on the server.
* \brief Set the enchantment charge of the temporary object stored on the server.
*
* Object durabilities are set through this value.
*
@ -434,7 +434,7 @@ public:
static void SetObjectEnchantmentCharge(double enchantmentCharge) noexcept;
/**
* \brief Set the gold value of the temporary world object stored on the server.
* \brief Set the gold value of the temporary object stored on the server.
*
* This is used solely to set the gold value for gold. It has no effect on other objects.
*
@ -444,7 +444,7 @@ public:
static void SetObjectGoldValue(int goldValue) noexcept;
/**
* \brief Set the scale of the temporary world object stored on the server.
* \brief Set the scale of the temporary object stored on the server.
*
* Objects are smaller or larger than their default size based on their scale.
*
@ -454,7 +454,7 @@ public:
static void SetObjectScale(double scale) noexcept;
/**
* \brief Set the object state of the temporary world object stored on the server.
* \brief Set the object state of the temporary object stored on the server.
*
* Objects are enabled or disabled based on their object state.
*
@ -464,7 +464,7 @@ public:
static void SetObjectState(bool objectState) noexcept;
/**
* \brief Set the lock level of the temporary world object stored on the server.
* \brief Set the lock level of the temporary object stored on the server.
*
* \param lockLevel The lock level.
* \return void
@ -472,7 +472,7 @@ public:
static void SetObjectLockLevel(int lockLevel) noexcept;
/**
* \brief Set the disarm state of the temporary world object stored on the server.
* \brief Set the disarm state of the temporary object stored on the server.
*
* \param disarmState The disarmState.
* \return void
@ -480,7 +480,7 @@ public:
static void SetObjectDisarmState(bool disarmState) noexcept;
/**
* \brief Set the master state of the temporary world object stored on the server.
* \brief Set the master state of the temporary object stored on the server.
*
* This only affects living actors and determines whether they are followers of another
* living actor.
@ -491,7 +491,7 @@ public:
static void SetObjectMasterState(bool masterState) noexcept;
/**
* \brief Set the position of the temporary world object stored on the server.
* \brief Set the position of the temporary object stored on the server.
*
* \param x The X position.
* \param y The Y position.
@ -501,7 +501,7 @@ public:
static void SetObjectPosition(double x, double y, double z) noexcept;
/**
* \brief Set the rotation of the temporary world object stored on the server.
* \brief Set the rotation of the temporary object stored on the server.
*
* \param x The X rotation.
* \param y The Y rotation.
@ -511,7 +511,7 @@ public:
static void SetObjectRotation(double x, double y, double z) noexcept;
/**
* \brief Set the door state of the temporary world object stored on the server.
* \brief Set the door state of the temporary object stored on the server.
*
* Doors are open or closed based on their door state.
*
@ -521,7 +521,7 @@ public:
static void SetObjectDoorState(int doorState) noexcept;
/**
* \brief Set the teleport state of the temporary world object stored on the server.
* \brief Set the teleport state of the temporary object stored on the server.
*
* If a door's teleport state is true, interacting with the door teleports a player to its
* destination. If it's false, it opens and closes like a regular door.
@ -532,7 +532,7 @@ public:
static void SetObjectDoorTeleportState(bool teleportState) noexcept;
/**
* \brief Set the door destination cell of the temporary world object stored on the server.
* \brief Set the door destination cell of the temporary object stored on the server.
*
* The cell is determined to be an exterior cell if it fits the pattern of a number followed
* by a comma followed by another number.
@ -543,7 +543,7 @@ public:
static void SetObjectDoorDestinationCell(const char* cellDescription) noexcept;
/**
* \brief Set the door destination position of the temporary world object stored on the server.
* \brief Set the door destination position of the temporary object stored on the server.
*
* \param x The X position.
* \param y The Y position.
@ -553,7 +553,7 @@ public:
static void SetObjectDoorDestinationPosition(double x, double y, double z) noexcept;
/**
* \brief Set the door destination rotation of the temporary world object stored on the server.
* \brief Set the door destination rotation of the temporary object stored on the server.
*
* Note: Because this sets the rotation a player will have upon using the door, and rotation
* on the Y axis has no effect on players, the Y value has been omitted as an argument.
@ -565,7 +565,7 @@ public:
static void SetObjectDoorDestinationRotation(double x, double z) noexcept;
/**
* \brief Set a player as the object in the temporary world object stored on the server.
* \brief Set a player as the object in the temporary object stored on the server.
* Currently only used for ConsoleCommand packets.
*
* \param pid The pid of the player.
@ -607,7 +607,7 @@ public:
/**
* \brief Set the action count of the container item at a certain itemIndex in the container
* changes of the object at a certain objectIndex in the read event's object changes.
* changes of the object at a certain objectIndex in the read object list's object changes.
*
* When resending a received Container packet, this allows you to correct the amount of items
* removed from a container by a player when it conflicts with what other players have already
@ -621,18 +621,18 @@ public:
static void SetReceivedContainerItemActionCount(unsigned int objectIndex, unsigned int itemIndex, int actionCount) noexcept;
/**
* \brief Add a copy of the server's temporary world object to the server's temporary event.
* \brief Add a copy of the server's temporary object to the server's temporary object list.
*
* In the process, the server's temporary world object will automatically be cleared so a new
* In the process, the server's temporary object will automatically be cleared so a new
* one can be set up.
*
* \return void
*/
static void AddWorldObject() noexcept;
static void AddObject() noexcept;
/**
* \brief Add a copy of the server's temporary container item to the container changes of the
* server's temporary world object.
* server's temporary object.
*
* In the process, the server's temporary container item will automatically be cleared so a new
* one can be set up.
@ -645,7 +645,7 @@ public:
* \brief Send an ObjectPlace packet.
*
* \param broadcast Whether this packet should be sent only to the player for whom the current
* event was initialized or to everyone on the server.
* object list was initialized or to everyone on the server.
*
* \return void
*/
@ -655,7 +655,7 @@ public:
* \brief Send an ObjectSpawn packet.
*
* \param broadcast Whether this packet should be sent only to the player for whom the current
* event was initialized or to everyone on the server.
* object list was initialized or to everyone on the server.
*
* \return void
*/
@ -665,7 +665,7 @@ public:
* \brief Send an ObjectDelete packet.
*
* \param broadcast Whether this packet should be sent only to the player for whom the current
* event was initialized or to everyone on the server.
* object list was initialized or to everyone on the server.
*
* \return void
*/
@ -675,7 +675,7 @@ public:
* \brief Send an ObjectLock packet.
*
* \param broadcast Whether this packet should be sent only to the player for whom the current
* event was initialized or to everyone on the server.
* object list was initialized or to everyone on the server.
*
* \return void
*/
@ -685,7 +685,7 @@ public:
* \brief Send an ObjectTrap packet.
*
* \param broadcast Whether this packet should be sent only to the player for whom the current
* event was initialized or to everyone on the server.
* object list was initialized or to everyone on the server.
*
* \return void
*/
@ -695,7 +695,7 @@ public:
* \brief Send an ObjectScale packet.
*
* \param broadcast Whether this packet should be sent only to the player for whom the current
* event was initialized or to everyone on the server.
* object list was initialized or to everyone on the server.
*
* \return void
*/
@ -705,7 +705,7 @@ public:
* \brief Send an ObjectState packet.
*
* \param broadcast Whether this packet should be sent only to the player for whom the current
* event was initialized or to everyone on the server.
* object list was initialized or to everyone on the server.
*
* \return void
*/
@ -715,7 +715,7 @@ public:
* \brief Send a DoorState packet.
*
* \param broadcast Whether this packet should be sent only to the player for whom the current
* event was initialized or to everyone on the server.
* object list was initialized or to everyone on the server.
*
* \return void
*/
@ -725,7 +725,7 @@ public:
* \brief Send a DoorDestination packet.
*
* \param broadcast Whether this packet should be sent only to the player for whom the current
* event was initialized or to everyone on the server.
* object list was initialized or to everyone on the server.
*
* \return void
*/
@ -735,17 +735,17 @@ public:
* \brief Send a Container packet.
*
* \param broadcast Whether this packet should be sent only to the player for whom the current
* event was initialized or to everyone on the server.
* object list was initialized or to everyone on the server.
*
* \return void
*/
static void SendContainer(bool broadcast = false, bool useLastReadEvent = false) noexcept;
static void SendContainer(bool broadcast = false, bool useLastReadObjectList = false) noexcept;
/**
* \brief Send a ConsoleCommand packet.
*
* \param broadcast Whether this packet should be sent only to the player for whom the current
* event was initialized or to everyone on the server.
* object list was initialized or to everyone on the server.
*
* \return void
*/

@ -10,17 +10,17 @@ using namespace mwmp;
template<class T>
typename BasePacketProcessor<T>::processors_t BasePacketProcessor<T>::processors;
void WorldProcessor::Do(ObjectPacket &packet, Player &player, BaseEvent &event)
void WorldProcessor::Do(ObjectPacket &packet, Player &player, BaseObjectList &objectList)
{
packet.Send(true);
}
bool WorldProcessor::Process(RakNet::Packet &packet, BaseEvent &event) noexcept
bool WorldProcessor::Process(RakNet::Packet &packet, BaseObjectList &objectList) noexcept
{
// Clear our BaseEvent before loading new data in it
event.cell.blank();
event.worldObjects.clear();
event.guid = packet.guid;
// Clear our BaseObjectList before loading new data in it
objectList.cell.blank();
objectList.baseObjects.clear();
objectList.guid = packet.guid;
for (auto &processor : processors)
{
@ -29,14 +29,14 @@ bool WorldProcessor::Process(RakNet::Packet &packet, BaseEvent &event) noexcept
Player *player = Players::getPlayer(packet.guid);
ObjectPacket *myPacket = Networking::get().getObjectPacketController()->GetPacket(packet.data[0]);
myPacket->setEvent(&event);
event.isValid = true;
myPacket->setObjectList(&objectList);
objectList.isValid = true;
if (!processor.second->avoidReading)
myPacket->Read();
if (event.isValid)
processor.second->Do(*myPacket, *player, event);
if (objectList.isValid)
processor.second->Do(*myPacket, *player, objectList);
else
LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "Received %s that failed integrity check and was ignored!", processor.second->strPacketID.c_str());

@ -19,9 +19,9 @@ namespace mwmp
{
public:
virtual void Do(ObjectPacket &packet, Player &player, BaseEvent &event);
virtual void Do(ObjectPacket &packet, Player &player, BaseObjectList &objectList);
static bool Process(RakNet::Packet &packet, BaseEvent &event) noexcept;
static bool Process(RakNet::Packet &packet, BaseObjectList &objectList) noexcept;
};
}

@ -13,16 +13,16 @@ namespace mwmp
BPP_INIT(ID_CONTAINER)
}
void Do(ObjectPacket &packet, Player &player, BaseEvent &event) override
void Do(ObjectPacket &packet, Player &player, BaseObjectList &objectList) override
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());
LOG_APPEND(Log::LOG_INFO, "- action: %i", event.action);
LOG_APPEND(Log::LOG_INFO, "- action: %i", objectList.action);
// Don't have any hardcoded sync, and instead expect Lua scripts to forward
// container packets to ensure their integrity based on what exists in the
// server data
Script::Call<Script::CallbackIdentity("OnContainer")>(player.getId(), event.cell.getDescription().c_str());
Script::Call<Script::CallbackIdentity("OnContainer")>(player.getId(), objectList.cell.getDescription().c_str());
LOG_APPEND(Log::LOG_INFO, "- Finished processing ID_CONTAINER");
}

@ -13,11 +13,11 @@ namespace mwmp
BPP_INIT(ID_DOOR_STATE)
}
void Do(ObjectPacket &packet, Player &player, BaseEvent &event) override
void Do(ObjectPacket &packet, Player &player, BaseObjectList &objectList) override
{
packet.Send(true);
Script::Call<Script::CallbackIdentity("OnDoorState")>(player.getId(), event.cell.getDescription().c_str());
Script::Call<Script::CallbackIdentity("OnDoorState")>(player.getId(), objectList.cell.getDescription().c_str());
}
};
}

@ -13,13 +13,13 @@ namespace mwmp
BPP_INIT(ID_OBJECT_DELETE)
}
void Do(ObjectPacket &packet, Player &player, BaseEvent &event) override
void Do(ObjectPacket &packet, Player &player, BaseObjectList &objectList) override
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());
packet.Send(true);
Script::Call<Script::CallbackIdentity("OnObjectDelete")>(player.getId(), event.cell.getDescription().c_str());
Script::Call<Script::CallbackIdentity("OnObjectDelete")>(player.getId(), objectList.cell.getDescription().c_str());
}
};
}

@ -13,13 +13,13 @@ namespace mwmp
BPP_INIT(ID_OBJECT_LOCK)
}
void Do(ObjectPacket &packet, Player &player, BaseEvent &event) override
void Do(ObjectPacket &packet, Player &player, BaseObjectList &objectList) override
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());
packet.Send(true);
Script::Call<Script::CallbackIdentity("OnObjectLock")>(player.getId(), event.cell.getDescription().c_str());
Script::Call<Script::CallbackIdentity("OnObjectLock")>(player.getId(), objectList.cell.getDescription().c_str());
}
};
}

@ -14,13 +14,13 @@ namespace mwmp
BPP_INIT(ID_OBJECT_PLACE)
}
void Do(ObjectPacket &packet, Player &player, BaseEvent &event) override
void Do(ObjectPacket &packet, Player &player, BaseObjectList &objectList) override
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());
for (unsigned int i = 0; i < event.worldObjectCount; i++)
for (unsigned int i = 0; i < objectList.baseObjectCount; i++)
{
event.worldObjects.at(i).mpNum = mwmp::Networking::getPtr()->incrementMpNum();
objectList.baseObjects.at(i).mpNum = mwmp::Networking::getPtr()->incrementMpNum();
}
// Send this packet back to the original sender with the mpNum generation from above,
@ -28,7 +28,7 @@ namespace mwmp
packet.Send(false);
packet.Send(true);
Script::Call<Script::CallbackIdentity("OnObjectPlace")>(player.getId(), event.cell.getDescription().c_str());
Script::Call<Script::CallbackIdentity("OnObjectPlace")>(player.getId(), objectList.cell.getDescription().c_str());
}
};
}

@ -13,13 +13,13 @@ namespace mwmp
BPP_INIT(ID_OBJECT_SCALE)
}
void Do(ObjectPacket &packet, Player &player, BaseEvent &event) override
void Do(ObjectPacket &packet, Player &player, BaseObjectList &objectList) override
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());
packet.Send(true);
Script::Call<Script::CallbackIdentity("OnObjectScale")>(player.getId(), event.cell.getDescription().c_str());
Script::Call<Script::CallbackIdentity("OnObjectScale")>(player.getId(), objectList.cell.getDescription().c_str());
}
};
}

@ -14,13 +14,13 @@ namespace mwmp
BPP_INIT(ID_OBJECT_SPAWN)
}
void Do(ObjectPacket &packet, Player &player, BaseEvent &event) override
void Do(ObjectPacket &packet, Player &player, BaseObjectList &objectList) override
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());
for (unsigned int i = 0; i < event.worldObjectCount; i++)
for (unsigned int i = 0; i < objectList.baseObjectCount; i++)
{
event.worldObjects.at(i).mpNum = mwmp::Networking::getPtr()->incrementMpNum();
objectList.baseObjects.at(i).mpNum = mwmp::Networking::getPtr()->incrementMpNum();
}
// Send this packet back to the original sender with the mpNum generation from above,
@ -28,7 +28,7 @@ namespace mwmp
packet.Send(false);
packet.Send(true);
Script::Call<Script::CallbackIdentity("OnObjectSpawn")>(player.getId(), event.cell.getDescription().c_str());
Script::Call<Script::CallbackIdentity("OnObjectSpawn")>(player.getId(), objectList.cell.getDescription().c_str());
}
};
}

@ -13,13 +13,13 @@ namespace mwmp
BPP_INIT(ID_OBJECT_STATE)
}
void Do(ObjectPacket &packet, Player &player, BaseEvent &event) override
void Do(ObjectPacket &packet, Player &player, BaseObjectList &objectList) override
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());
packet.Send(true);
Script::Call<Script::CallbackIdentity("OnObjectState")>(player.getId(), event.cell.getDescription().c_str());
Script::Call<Script::CallbackIdentity("OnObjectState")>(player.getId(), objectList.cell.getDescription().c_str());
}
};
}

@ -13,13 +13,13 @@ namespace mwmp
BPP_INIT(ID_OBJECT_TRAP)
}
void Do(ObjectPacket &packet, Player &player, BaseEvent &event) override
void Do(ObjectPacket &packet, Player &player, BaseObjectList &objectList) override
{
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());
packet.Send(true);
Script::Call<Script::CallbackIdentity("OnObjectTrap")>(player.getId(), event.cell.getDescription().c_str());
Script::Call<Script::CallbackIdentity("OnObjectTrap")>(player.getId(), objectList.cell.getDescription().c_str());
}
};
}

@ -97,7 +97,7 @@ add_openmw_dir (mwbase
inputmanager windowmanager statemanager
)
add_openmw_dir (mwmp Main Networking LocalPlayer DedicatedPlayer PlayerList LocalActor DedicatedActor ActorList WorldEvent
add_openmw_dir (mwmp Main Networking LocalPlayer DedicatedPlayer PlayerList LocalActor DedicatedActor ActorList ObjectList
Cell CellController MechanicsHelper RecordHelper GUIController
)

@ -7,7 +7,7 @@
*/
#include "../mwmp/Main.hpp"
#include "../mwmp/Networking.hpp"
#include "../mwmp/WorldEvent.hpp"
#include "../mwmp/ObjectList.hpp"
/*
End of tes3mp addition
*/
@ -189,10 +189,10 @@ namespace MWClass
Send an ID_OBJECT_TRAP packet every time a trap is disarmed
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectTrap(ptr, ptr.getRefData().getPosition(), true);
worldEvent->sendObjectTrap();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectTrap(ptr, ptr.getRefData().getPosition(), true);
objectList->sendObjectTrap();
/*
End of tes3mp addition
*/
@ -205,10 +205,10 @@ namespace MWClass
*/
if (isLocked)
{
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectLock(ptr, 0);
worldEvent->sendObjectLock();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectLock(ptr, 0);
objectList->sendObjectLock();
}
/*
End of tes3mp addition

@ -7,7 +7,7 @@
*/
#include "../mwmp/Main.hpp"
#include "../mwmp/Networking.hpp"
#include "../mwmp/WorldEvent.hpp"
#include "../mwmp/ObjectList.hpp"
/*
End of tes3mp addition
*/
@ -183,10 +183,10 @@ namespace MWClass
Send an ID_OBJECT_TRAP packet every time a trap is disarmed
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectTrap(ptr, ptr.getRefData().getPosition(), true);
worldEvent->sendObjectTrap();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectTrap(ptr, ptr.getRefData().getPosition(), true);
objectList->sendObjectTrap();
/*
End of tes3mp addition
*/
@ -199,10 +199,10 @@ namespace MWClass
*/
if (isLocked)
{
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectLock(ptr, 0);
worldEvent->sendObjectLock();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectLock(ptr, 0);
objectList->sendObjectLock();
}
/*
End of tes3mp addition

@ -12,7 +12,7 @@
#include "../mwmp/Main.hpp"
#include "../mwmp/Networking.hpp"
#include "../mwmp/LocalPlayer.hpp"
#include "../mwmp/WorldEvent.hpp"
#include "../mwmp/ObjectList.hpp"
#include "../mwmp/CellController.hpp"
/*
End of tes3mp addition
@ -112,22 +112,22 @@ namespace MWGui
Send an ID_CONTAINER packet every time an item starts being dragged
from a container
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->cell = *mPtr.getCell()->getCell();
worldEvent->action = mwmp::BaseEvent::REMOVE;
worldEvent->containerSubAction = mwmp::BaseEvent::DRAG;
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->cell = *mPtr.getCell()->getCell();
objectList->action = mwmp::BaseObjectList::REMOVE;
objectList->containerSubAction = mwmp::BaseObjectList::DRAG;
mwmp::WorldObject worldObject = worldEvent->getWorldObject(mPtr);
mwmp::BaseObject baseObject = objectList->getBaseObject(mPtr);
MWWorld::Ptr itemPtr = mModel->getItem(mSelectedItem).mBase;
worldEvent->addContainerItem(worldObject, itemPtr, count);
worldEvent->addObject(worldObject);
objectList->addContainerItem(baseObject, itemPtr, count);
objectList->addObject(baseObject);
mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setEvent(worldEvent);
mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setObjectList(objectList);
mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->Send();
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_CONTAINER about\n- Ptr cellRef: %s, %i\n- cell: %s\n- item: %s, %i",
worldObject.refId.c_str(), worldObject.refNumIndex, worldEvent->cell.getDescription().c_str(),
baseObject.refId.c_str(), baseObject.refNumIndex, objectList->cell.getDescription().c_str(),
itemPtr.getCellRef().getRefId().c_str(), itemPtr.getRefData().getCount());
/*
End of tes3mp addition
@ -158,13 +158,13 @@ namespace MWGui
*/
if (success)
{
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->cell = *mPtr.getCell()->getCell();
worldEvent->action = mwmp::BaseEvent::ADD;
worldEvent->containerSubAction = mwmp::BaseEvent::DROP;
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->cell = *mPtr.getCell()->getCell();
objectList->action = mwmp::BaseObjectList::ADD;
objectList->containerSubAction = mwmp::BaseObjectList::DROP;
mwmp::WorldObject worldObject = worldEvent->getWorldObject(mPtr);
mwmp::BaseObject baseObject = objectList->getBaseObject(mPtr);
MWWorld::Ptr itemPtr = mDragAndDrop->mItem.mBase;
mwmp::ContainerItem containerItem;
containerItem.refId = itemPtr.getCellRef().getRefId();
@ -175,14 +175,14 @@ namespace MWGui
containerItem.charge = itemPtr.getCellRef().getCharge();
containerItem.enchantmentCharge = itemPtr.getCellRef().getEnchantmentCharge();
worldObject.containerItems.push_back(containerItem);
worldEvent->addObject(worldObject);
baseObject.containerItems.push_back(containerItem);
objectList->addObject(baseObject);
mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setEvent(worldEvent);
mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setObjectList(objectList);
mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->Send();
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_CONTAINER about\n- Ptr cellRef: %s, %i\n- cell: %s\n- item: %s, %i, %i",
worldObject.refId.c_str(), worldObject.refNumIndex, worldEvent->cell.getDescription().c_str(),
baseObject.refId.c_str(), baseObject.refNumIndex, objectList->cell.getDescription().c_str(),
containerItem.refId.c_str(), containerItem.count, containerItem.charge);
}
/*
@ -298,19 +298,19 @@ namespace MWGui
Send an ID_CONTAINER packet every time the Take All button is used on
a container
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->cell = *mPtr.getCell()->getCell();
worldEvent->action = mwmp::BaseEvent::REMOVE;
worldEvent->containerSubAction = mwmp::BaseEvent::TAKE_ALL;
worldEvent->addEntireContainer(mPtr);
mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setEvent(worldEvent);
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->cell = *mPtr.getCell()->getCell();
objectList->action = mwmp::BaseObjectList::REMOVE;
objectList->containerSubAction = mwmp::BaseObjectList::TAKE_ALL;
objectList->addEntireContainer(mPtr);
mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->setObjectList(objectList);
mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->Send();
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_CONTAINER about\n- Ptr cellRef: %s, %i-%i\n- cell: %s",
mPtr.getCellRef().getRefId().c_str(), mPtr.getCellRef().getRefNum().mIndex, mPtr.getCellRef().getMpNum(),
worldEvent->cell.getDescription().c_str());
objectList->cell.getDescription().c_str());
/*
End of tes3mp addition
*/
@ -380,10 +380,10 @@ namespace MWGui
*/
if (!mPtr.getClass().isPersistent(mPtr))
{
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectDelete(mPtr);
worldEvent->sendObjectDelete();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectDelete(mPtr);
objectList->sendObjectDelete();
}
/*
End of tes3mp addition

@ -14,7 +14,7 @@
*/
#include "../mwmp/Main.hpp"
#include "../mwmp/Networking.hpp"
#include "../mwmp/WorldEvent.hpp"
#include "../mwmp/ObjectList.hpp"
#include "../mwmp/LocalPlayer.hpp"
#include "../mwworld/cellstore.hpp"
/*
@ -72,10 +72,10 @@ namespace MWGui
Send an ID_OBJECT_PLACE packet every time an object is dropped into the world from
the inventory screen
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectPlace(dropped, true);
worldEvent->sendObjectPlace();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectPlace(dropped, true);
objectList->sendObjectPlace();
/*
End of tes3mp addition
*/

@ -24,7 +24,7 @@
*/
#include "../mwmp/Main.hpp"
#include "../mwmp/Networking.hpp"
#include "../mwmp/WorldEvent.hpp"
#include "../mwmp/ObjectList.hpp"
#include "../mwmp/LocalPlayer.hpp"
#include "../mwworld/cellstore.hpp"
/*
@ -697,10 +697,10 @@ namespace MWGui
Send an ID_PLAYER_INVENTORY packet as well because of the item thus gained
by the player
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectDelete(object);
worldEvent->sendObjectDelete();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectDelete(object);
objectList->sendObjectDelete();
mwmp::Main::get().getLocalPlayer()->sendInventory();
/*
End of tes3mp addition

@ -23,7 +23,7 @@
#include "../mwmp/PlayerList.hpp"
#include "../mwmp/CellController.hpp"
#include "../mwmp/MechanicsHelper.hpp"
#include "../mwmp/WorldEvent.hpp"
#include "../mwmp/ObjectList.hpp"
/*
End of tes3mp addition
*/
@ -1726,10 +1726,10 @@ namespace MWMechanics
Send an ID_OBJECT_DELETE packet every time a summoned creature despawns
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectDelete(ptr);
worldEvent->sendObjectDelete();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectDelete(ptr);
objectList->sendObjectDelete();
/*
End of tes3mp addition
*/

@ -7,7 +7,7 @@
*/
#include "../mwmp/Main.hpp"
#include "../mwmp/Networking.hpp"
#include "../mwmp/WorldEvent.hpp"
#include "../mwmp/ObjectList.hpp"
/*
End of tes3mp addition
*/
@ -73,10 +73,10 @@ namespace MWMechanics
Send an ID_OBJECT_LOCK packet every time an object is unlocked here
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectLock(lock, 0);
worldEvent->sendObjectLock();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectLock(lock, 0);
objectList->sendObjectLock();
/*
End of tes3mp addition
*/
@ -132,10 +132,10 @@ namespace MWMechanics
Send an ID_OBJECT_TRAP packet every time a trap is disarmed
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectTrap(trap, trap.getRefData().getPosition(), true);
worldEvent->sendObjectTrap();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectTrap(trap, trap.getRefData().getPosition(), true);
objectList->sendObjectTrap();
/*
End of tes3mp addition
*/

@ -19,7 +19,7 @@
#include "../mwmp/Networking.hpp"
#include "../mwmp/PlayerList.hpp"
#include "../mwmp/LocalPlayer.hpp"
#include "../mwmp/WorldEvent.hpp"
#include "../mwmp/ObjectList.hpp"
#include "../mwmp/MechanicsHelper.hpp"
/*
End of tes3mp addition
@ -680,10 +680,10 @@ namespace MWMechanics
Send an ID_OBJECT_LOCK packet every time an object is locked here
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectLock(target, static_cast<int>(magnitude));
worldEvent->sendObjectLock();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectLock(target, static_cast<int>(magnitude));
objectList->sendObjectLock();
/*
End of tes3mp addition
*/
@ -714,10 +714,10 @@ namespace MWMechanics
Send an ID_OBJECT_LOCK packet every time an object is unlocked here
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectLock(target, 0);
worldEvent->sendObjectLock();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectLock(target, 0);
objectList->sendObjectLock();
/*
End of tes3mp addition
*/

@ -11,7 +11,7 @@
#include "../mwmp/Main.hpp"
#include "../mwmp/Networking.hpp"
#include "../mwmp/CellController.hpp"
#include "../mwmp/WorldEvent.hpp"
#include "../mwmp/ObjectList.hpp"
/*
End of tes3mp addition
*/
@ -105,10 +105,10 @@ namespace MWMechanics
if (mwmp::Main::get().getCellController()->hasLocalAuthority(*placed.getCell()->getCell()))
{
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectSpawn(placed, mActor);
worldEvent->sendObjectSpawn();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectSpawn(placed, mActor);
objectList->sendObjectSpawn();
}
MWBase::Environment::get().getWorld()->deleteObject(placed);
@ -162,10 +162,10 @@ namespace MWMechanics
Send an ID_OBJECT_DELETE packet every time a summoned creature despawns
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectDelete(ptr);
worldEvent->sendObjectDelete();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectDelete(ptr);
objectList->sendObjectDelete();
/*
End of tes3mp addition
*/

@ -19,7 +19,7 @@
#include "LocalPlayer.hpp"
#include "DedicatedPlayer.hpp"
#include "PlayerList.hpp"
#include "WorldEvent.hpp"
#include "ObjectList.hpp"
#include "CellController.hpp"
using namespace mwmp;
@ -35,8 +35,8 @@ osg::Vec3f MechanicsHelper::getLinearInterpolation(osg::Vec3f start, osg::Vec3f
void MechanicsHelper::spawnLeveledCreatures(MWWorld::CellStore* cellStore)
{
MWWorld::CellRefList<ESM::CreatureLevList> *creatureLevList = cellStore->getCreatureLists();
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
int spawnCount = 0;
@ -53,7 +53,7 @@ void MechanicsHelper::spawnLeveledCreatures(MWWorld::CellStore* cellStore)
manualRef.getPtr().getCellRef().setPosition(ptr.getCellRef().getPosition());
MWWorld::Ptr placed = MWBase::Environment::get().getWorld()->placeObject(manualRef.getPtr(), ptr.getCell(),
ptr.getCellRef().getPosition());
worldEvent->addObjectSpawn(placed);
objectList->addObjectSpawn(placed);
MWBase::Environment::get().getWorld()->deleteObject(placed);
spawnCount++;
@ -61,7 +61,7 @@ void MechanicsHelper::spawnLeveledCreatures(MWWorld::CellStore* cellStore)
}
if (spawnCount > 0)
worldEvent->sendObjectSpawn();
objectList->sendObjectSpawn();
}
Attack *MechanicsHelper::getLocalAttack(const MWWorld::Ptr& ptr)

@ -430,7 +430,7 @@ void Networking::receiveMessage(RakNet::Packet *packet)
}
else if (objectPacketController.ContainsPacket(packet->data[0]))
{
if (!WorldProcessor::Process(*packet, worldEvent))
if (!WorldProcessor::Process(*packet, objectList))
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Unhandled ObjectPacket with identifier %i has arrived", packet->data[0]);
}
}
@ -460,9 +460,9 @@ ActorList *Networking::getActorList()
return &actorList;
}
WorldEvent *Networking::getWorldEvent()
ObjectList *Networking::getObjectList()
{
return &worldEvent;
return &objectList;
}
bool Networking::isConnected()

@ -10,7 +10,7 @@
#include <string>
#include "ActorList.hpp"
#include "WorldEvent.hpp"
#include "ObjectList.hpp"
#include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Controllers/PlayerPacketController.hpp>
@ -44,7 +44,7 @@ namespace mwmp
LocalPlayer *getLocalPlayer();
ActorList *getActorList();
WorldEvent *getWorldEvent();
ObjectList *getObjectList();
private:
bool connected;
@ -57,7 +57,7 @@ namespace mwmp
ObjectPacketController objectPacketController;
ActorList actorList;
WorldEvent worldEvent;
ObjectList objectList;
void receiveMessage(RakNet::Packet *packet);

@ -1,25 +1,25 @@
#ifndef OPENMW_WORLDEVENT_HPP
#define OPENMW_WORLDEVENT_HPP
#include <components/openmw-mp/Base/BaseEvent.hpp>
#include <components/openmw-mp/Base/BaseObject.hpp>
#include "../mwworld/cellstore.hpp"
#include <RakNetTypes.h>
namespace mwmp
{
class Networking;
class WorldEvent : public BaseEvent
class ObjectList : public BaseObjectList
{
public:
WorldEvent();
virtual ~WorldEvent();
ObjectList();
virtual ~ObjectList();
void reset();
void addObject(WorldObject worldObject);
WorldObject getWorldObject(const MWWorld::Ptr& ptr);
void addContainerItem(mwmp::WorldObject& worldObject, const MWWorld::Ptr& itemPtr, int actionCount);
void addObject(BaseObject baseObject);
BaseObject getBaseObject(const MWWorld::Ptr& ptr);
void addContainerItem(mwmp::BaseObject& baseObject, const MWWorld::Ptr& itemPtr, int actionCount);
void addEntireContainer(const MWWorld::Ptr& ptr);
void editContainers(MWWorld::CellStore* cellStore);
@ -47,7 +47,7 @@ namespace mwmp
void playVideo();
void addAllContainers(MWWorld::CellStore* cellStore);
void addRequestedContainers(MWWorld::CellStore* cellStore, const std::vector<WorldObject>& requestObjects);
void addRequestedContainers(MWWorld::CellStore* cellStore, const std::vector<BaseObject>& requestObjects);
void addObjectPlace(const MWWorld::Ptr& ptr, bool droppedByPlayer = false);
void addObjectSpawn(const MWWorld::Ptr& ptr);

@ -8,7 +8,7 @@
#include <components/openmw-mp/Log.hpp>
#include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Packets/Actor/ActorPacket.hpp>
#include "../WorldEvent.hpp"
#include "../ObjectList.hpp"
#include "../ActorList.hpp"
#include "BaseClientPacketProcessor.hpp"

@ -1,7 +1,3 @@
//
// Created by koncord on 16.04.17.
//
#include "WorldProcessor.hpp"
#include "../Main.hpp"
#include "../Networking.hpp"
@ -11,15 +7,15 @@ using namespace mwmp;
template<class T>
typename BasePacketProcessor<T>::processors_t BasePacketProcessor<T>::processors;
bool WorldProcessor::Process(RakNet::Packet &packet, WorldEvent &event)
bool WorldProcessor::Process(RakNet::Packet &packet, ObjectList &objectList)
{
RakNet::BitStream bsIn(&packet.data[1], packet.length, false);
bsIn.Read(guid);
event.guid = guid;
objectList.guid = guid;
ObjectPacket *myPacket = Main::get().getNetworking()->getObjectPacket(packet.data[0]);
myPacket->setEvent(&event);
myPacket->setObjectList(&objectList);
myPacket->SetReadStream(&bsIn);
for (auto &processor: processors)
@ -29,13 +25,13 @@ bool WorldProcessor::Process(RakNet::Packet &packet, WorldEvent &event)
myGuid = Main::get().getLocalPlayer()->guid;
request = packet.length == myPacket->headerSize();
event.isValid = true;
objectList.isValid = true;
if (!request && !processor.second->avoidReading)
myPacket->Read();
if (event.isValid)
processor.second->Do(*myPacket, event);
if (objectList.isValid)
processor.second->Do(*myPacket, objectList);
else
LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "Received %s that failed integrity check and was ignored!", processor.second->strPacketID.c_str());

@ -8,7 +8,7 @@
#include <components/openmw-mp/Log.hpp>
#include <components/openmw-mp/NetworkMessages.hpp>
#include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>
#include "../WorldEvent.hpp"
#include "../ObjectList.hpp"
#include "../LocalPlayer.hpp"
#include "../DedicatedPlayer.hpp"
#include "BaseClientPacketProcessor.hpp"
@ -18,9 +18,9 @@ namespace mwmp
class WorldProcessor : public BasePacketProcessor<WorldProcessor>, public BaseClientPacketProcessor
{
public:
virtual void Do(ObjectPacket &packet, WorldEvent &event) = 0;
virtual void Do(ObjectPacket &packet, ObjectList &objectList) = 0;
static bool Process(RakNet::Packet &packet, WorldEvent &event);
static bool Process(RakNet::Packet &packet, ObjectList &objectList);
};
}

@ -15,13 +15,13 @@ namespace mwmp
class BaseObjectProcessor : public WorldProcessor
{
public:
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
ptrCellStore = Main::get().getCellController()->getCellStore(event.cell);
ptrCellStore = Main::get().getCellController()->getCellStore(objectList.cell);
if (!ptrCellStore) return;
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s about %s", strPacketID.c_str(), event.cell.getDescription().c_str());
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s about %s", strPacketID.c_str(), objectList.cell.getDescription().c_str());
}
protected:
MWWorld::CellStore *ptrCellStore;

@ -13,11 +13,11 @@ namespace mwmp
BPP_INIT(ID_CONSOLE_COMMAND)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, event);
BaseObjectProcessor::Do(packet, objectList);
event.runConsoleCommands(ptrCellStore);
objectList.runConsoleCommands(ptrCellStore);
}
};
}

@ -13,43 +13,43 @@ namespace mwmp
BPP_INIT(ID_CONTAINER)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, event);
BaseObjectProcessor::Do(packet, objectList);
LOG_APPEND(Log::LOG_VERBOSE, "- action: %i, containerSubAction: %i", event.action, event.containerSubAction);
LOG_APPEND(Log::LOG_VERBOSE, "- action: %i, containerSubAction: %i", objectList.action, objectList.containerSubAction);
// If we've received a request for information, comply with it
if (event.action == mwmp::BaseEvent::REQUEST)
if (objectList.action == mwmp::BaseObjectList::REQUEST)
{
if (event.worldObjectCount == 0)
if (objectList.baseObjectCount == 0)
{
LOG_APPEND(Log::LOG_VERBOSE, "- Request had no objects attached, so we are sending all containers in the cell %s",
event.cell.getDescription().c_str());
event.reset();
event.cell = *ptrCellStore->getCell();
event.action = mwmp::BaseEvent::SET;
event.addAllContainers(ptrCellStore);
event.sendContainer();
objectList.cell.getDescription().c_str());
objectList.reset();
objectList.cell = *ptrCellStore->getCell();
objectList.action = mwmp::BaseObjectList::SET;
objectList.addAllContainers(ptrCellStore);
objectList.sendContainer();
}
else
{
LOG_APPEND(Log::LOG_VERBOSE, "- Request was for %i %s", event.worldObjectCount, event.worldObjectCount == 1 ? "object" : "objects");
std::vector<WorldObject> requestObjects = event.worldObjects;
event.reset();
event.cell = *ptrCellStore->getCell();
event.action = mwmp::BaseEvent::SET;
event.addRequestedContainers(ptrCellStore, requestObjects);
if (event.worldObjects.size() > 0)
event.sendContainer();
LOG_APPEND(Log::LOG_VERBOSE, "- Request was for %i %s", objectList.baseObjectCount, objectList.baseObjectCount == 1 ? "object" : "objects");
std::vector<BaseObject> requestObjects = objectList.baseObjects;
objectList.reset();
objectList.cell = *ptrCellStore->getCell();
objectList.action = mwmp::BaseObjectList::SET;
objectList.addRequestedContainers(ptrCellStore, requestObjects);
if (objectList.baseObjects.size() > 0)
objectList.sendContainer();
}
}
// Otherwise, edit containers based on the information received
else
{
LOG_APPEND(Log::LOG_VERBOSE, "- Editing container contents to match those of packet", event.worldObjectCount);
event.editContainers(ptrCellStore);
LOG_APPEND(Log::LOG_VERBOSE, "- Editing container contents to match those of packet", objectList.baseObjectCount);
objectList.editContainers(ptrCellStore);
}
}

@ -13,11 +13,11 @@ namespace mwmp
BPP_INIT(ID_DOOR_DESTINATION)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, event);
BaseObjectProcessor::Do(packet, objectList);
event.setDoorDestinations(ptrCellStore);
objectList.setDoorDestinations(ptrCellStore);
}
};
}

@ -13,11 +13,11 @@ namespace mwmp
BPP_INIT(ID_DOOR_STATE)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, event);
BaseObjectProcessor::Do(packet, objectList);
event.activateDoors(ptrCellStore);
objectList.activateDoors(ptrCellStore);
}
};
}

@ -13,10 +13,10 @@ namespace mwmp
BPP_INIT(ID_MUSIC_PLAY)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str());
event.playMusic();
objectList.playMusic();
}
};
}

@ -13,11 +13,11 @@ namespace mwmp
BPP_INIT(ID_OBJECT_ANIM_PLAY)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, event);
BaseObjectProcessor::Do(packet, objectList);
event.animateObjects(ptrCellStore);
objectList.animateObjects(ptrCellStore);
}
};
}

@ -13,11 +13,11 @@ namespace mwmp
BPP_INIT(ID_OBJECT_ATTACH)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, event);
BaseObjectProcessor::Do(packet, objectList);
//event.attachObjects(ptrCellStore);
//objectList.attachObjects(ptrCellStore);
}
};

@ -13,11 +13,11 @@ namespace mwmp
BPP_INIT(ID_OBJECT_COLLISION)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, event);
BaseObjectProcessor::Do(packet, objectList);
//event.setObjectCollisions(ptrCellStore);
//objectList.setObjectCollisions(ptrCellStore);
}
};

@ -13,11 +13,11 @@ namespace mwmp
BPP_INIT(ID_OBJECT_DELETE)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, event);
BaseObjectProcessor::Do(packet, objectList);
event.deleteObjects(ptrCellStore);
objectList.deleteObjects(ptrCellStore);
}
};
}

@ -13,11 +13,11 @@ namespace mwmp
BPP_INIT(ID_OBJECT_LOCK)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, event);
BaseObjectProcessor::Do(packet, objectList);
event.lockObjects(ptrCellStore);
objectList.lockObjects(ptrCellStore);
}
};
}

@ -13,11 +13,11 @@ namespace mwmp
BPP_INIT(ID_OBJECT_MOVE)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, event);
BaseObjectProcessor::Do(packet, objectList);
event.moveObjects(ptrCellStore);
objectList.moveObjects(ptrCellStore);
}
};
}

@ -13,11 +13,11 @@ namespace mwmp
BPP_INIT(ID_OBJECT_PLACE)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, event);
BaseObjectProcessor::Do(packet, objectList);
event.placeObjects(ptrCellStore);
objectList.placeObjects(ptrCellStore);
}
};

@ -13,11 +13,11 @@ namespace mwmp
BPP_INIT(ID_OBJECT_RESET)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, event);
BaseObjectProcessor::Do(packet, objectList);
//event.resetObjects(ptrCellStore);
//objectList.resetObjects(ptrCellStore);
}
};

@ -13,11 +13,11 @@ namespace mwmp
BPP_INIT(ID_OBJECT_ROTATE)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, event);
BaseObjectProcessor::Do(packet, objectList);
event.rotateObjects(ptrCellStore);
objectList.rotateObjects(ptrCellStore);
}
};
}

@ -13,11 +13,11 @@ namespace mwmp
BPP_INIT(ID_OBJECT_SCALE)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, event);
BaseObjectProcessor::Do(packet, objectList);
event.scaleObjects(ptrCellStore);
objectList.scaleObjects(ptrCellStore);
}
};
}

@ -13,11 +13,11 @@ namespace mwmp
BPP_INIT(ID_OBJECT_SPAWN)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, event);
BaseObjectProcessor::Do(packet, objectList);
event.spawnObjects(ptrCellStore);
objectList.spawnObjects(ptrCellStore);
}
};
}

@ -13,11 +13,11 @@ namespace mwmp
BPP_INIT(ID_OBJECT_STATE)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, event);
BaseObjectProcessor::Do(packet, objectList);
event.setObjectStates(ptrCellStore);
objectList.setObjectStates(ptrCellStore);
}
};
}

@ -13,11 +13,11 @@ namespace mwmp
BPP_INIT(ID_OBJECT_TRAP)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, event);
BaseObjectProcessor::Do(packet, objectList);
event.triggerTrapObjects(ptrCellStore);
objectList.triggerTrapObjects(ptrCellStore);
}
};
}

@ -13,10 +13,10 @@ namespace mwmp
BPP_INIT(ID_SCRIPT_GLOBAL_FLOAT)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str());
//event.setGlobalFloats();
//objectList.setGlobalFloats();
}
};
}

@ -13,10 +13,10 @@ namespace mwmp
BPP_INIT(ID_SCRIPT_GLOBAL_SHORT)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str());
event.setGlobalShorts();
objectList.setGlobalShorts();
}
};
}

@ -13,11 +13,11 @@ namespace mwmp
BPP_INIT(ID_SCRIPT_LOCAL_FLOAT)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, event);
BaseObjectProcessor::Do(packet, objectList);
event.setLocalFloats(ptrCellStore);
objectList.setLocalFloats(ptrCellStore);
}
};
}

@ -13,11 +13,11 @@ namespace mwmp
BPP_INIT(ID_SCRIPT_LOCAL_SHORT)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, event);
BaseObjectProcessor::Do(packet, objectList);
event.setLocalShorts(ptrCellStore);
objectList.setLocalShorts(ptrCellStore);
}
};
}

@ -13,10 +13,10 @@ namespace mwmp
BPP_INIT(ID_SCRIPT_MEMBER_FLOAT)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str());
//event.setMemberFloats();
//objectList.setMemberFloats();
}
};
}

@ -13,10 +13,10 @@ namespace mwmp
BPP_INIT(ID_SCRIPT_MEMBER_SHORT)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str());
event.setMemberShorts();
objectList.setMemberShorts();
}
};
}

@ -13,10 +13,10 @@ namespace mwmp
BPP_INIT(ID_VIDEO_PLAY)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s", strPacketID.c_str());
event.playVideo();
objectList.playVideo();
}
};
}

@ -10,7 +10,7 @@
*/
#include "../mwmp/Main.hpp"
#include "../mwmp/Networking.hpp"
#include "../mwmp/WorldEvent.hpp"
#include "../mwmp/ObjectList.hpp"
/*
End of tes3mp addition
*/
@ -82,10 +82,10 @@ namespace MWScript
*/
if (mwmp::Main::isValidPacketScript(ptr.getClass().getScript(ptr)))
{
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectAnimPlay(ptr, group, mode);
worldEvent->sendObjectAnimPlay();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectAnimPlay(ptr, group, mode);
objectList->sendObjectAnimPlay();
}
/*
End of tes3mp addition

@ -19,7 +19,7 @@
#include "../mwmp/Main.hpp"
#include "../mwmp/Networking.hpp"
#include "../mwmp/LocalPlayer.hpp"
#include "../mwmp/WorldEvent.hpp"
#include "../mwmp/ObjectList.hpp"
/*
End of tes3mp addition
*/
@ -211,10 +211,10 @@ namespace MWScript
*/
if (sendPackets)
{
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addScriptLocalShort(mReference, index, value);
worldEvent->sendScriptLocalShort();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addScriptLocalShort(mReference, index, value);
objectList->sendScriptLocalShort();
}
/*
End of tes3mp addition
@ -245,10 +245,10 @@ namespace MWScript
*/
if (sendPackets && value == (int) value)
{
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addScriptLocalFloat(mReference, index, value);
worldEvent->sendScriptLocalFloat();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addScriptLocalFloat(mReference, index, value);
objectList->sendScriptLocalFloat();
}
/*
End of tes3mp addition
@ -304,10 +304,10 @@ namespace MWScript
*/
if (sendPackets)
{
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addScriptGlobalShort(name, value);
worldEvent->sendScriptGlobalShort();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addScriptGlobalShort(name, value);
objectList->sendScriptGlobalShort();
}
/*
End of tes3mp addition
@ -594,10 +594,10 @@ namespace MWScript
{
if (ref.isInCell() && !ref.getRefData().isEnabled())
{
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectState(ref, true);
worldEvent->sendObjectState();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectState(ref, true);
objectList->sendObjectState();
}
}
/*
@ -622,10 +622,10 @@ namespace MWScript
{
if (ref.isInCell() && ref.getRefData().isEnabled())
{
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectState(ref, false);
worldEvent->sendObjectState();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectState(ref, false);
objectList->sendObjectState();
}
}
/*
@ -685,10 +685,10 @@ namespace MWScript
*/
if (sendPackets && !global)
{
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addScriptMemberShort(id, index, value);
worldEvent->sendScriptMemberShort();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addScriptMemberShort(id, index, value);
objectList->sendScriptMemberShort();
}
/*
End of tes3mp addition

@ -9,7 +9,7 @@
*/
#include "../mwmp/Main.hpp"
#include "../mwmp/Networking.hpp"
#include "../mwmp/WorldEvent.hpp"
#include "../mwmp/ObjectList.hpp"
/*
End of tes3mp addition
*/
@ -103,10 +103,10 @@ namespace MWScript
Send an ID_VIDEO_PLAY packet every time a video is played
through a script
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addVideoPlay(name, allowSkipping);
worldEvent->sendVideoPlay();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addVideoPlay(name, allowSkipping);
objectList->sendVideoPlay();
/*
End of tes3mp addition
*/
@ -213,10 +213,10 @@ namespace MWScript
Send an ID_OBJECT_LOCK packet every time an object is locked
through a script
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectLock(ptr, lockLevel);
worldEvent->sendObjectLock();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectLock(ptr, lockLevel);
objectList->sendObjectLock();
/*
End of tes3mp addition
*/
@ -253,10 +253,10 @@ namespace MWScript
Send an ID_OBJECT_LOCK packet every time an object is unlocked
through a script
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectLock(ptr, 0);
worldEvent->sendObjectLock();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectLock(ptr, 0);
objectList->sendObjectLock();
/*
End of tes3mp addition
*/
@ -733,10 +733,10 @@ namespace MWScript
Send an ID_OBJECT_DELETE packet every time an object is deleted
through a script
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectDelete(ptr);
worldEvent->sendObjectDelete();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectDelete(ptr);
objectList->sendObjectDelete();
/*
End of tes3mp addition
*/

@ -7,7 +7,7 @@
*/
#include "../mwmp/Main.hpp"
#include "../mwmp/Networking.hpp"
#include "../mwmp/WorldEvent.hpp"
#include "../mwmp/ObjectList.hpp"
/*
End of tes3mp addition
*/
@ -87,10 +87,10 @@ namespace MWScript
Send an ID_MUSIC_PLAY packet every time new music is streamed through
a script
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addMusicPlay(sound);
worldEvent->sendMusicPlay();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addMusicPlay(sound);
objectList->sendMusicPlay();
/*
End of tes3mp addition
*/

@ -10,7 +10,7 @@
#include "../mwmp/Networking.hpp"
#include "../mwmp/LocalPlayer.hpp"
#include "../mwmp/PlayerList.hpp"
#include "../mwmp/WorldEvent.hpp"
#include "../mwmp/ObjectList.hpp"
/*
End of tes3mp addition
*/
@ -74,10 +74,10 @@ namespace MWScript
return;
else
{
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectScale(ptr, scale);
worldEvent->sendObjectScale();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectScale(ptr, scale);
objectList->sendObjectScale();
}
}
/*
@ -582,18 +582,18 @@ namespace MWScript
Send an ID_OBJECT_PLACE or ID_OBJECT_SPAWN packet every time an object is placed
in the world through a script
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
if (ptr.getClass().isActor())
{
worldEvent->addObjectSpawn(ptr);
worldEvent->sendObjectSpawn();
objectList->addObjectSpawn(ptr);
objectList->sendObjectSpawn();
}
else
{
worldEvent->addObjectPlace(ptr);
worldEvent->sendObjectPlace();
objectList->addObjectPlace(ptr);
objectList->sendObjectPlace();
}
/*
End of tes3mp addition

@ -7,7 +7,7 @@
*/
#include "../mwmp/Main.hpp"
#include "../mwmp/Networking.hpp"
#include "../mwmp/WorldEvent.hpp"
#include "../mwmp/ObjectList.hpp"
#include "../mwmp/LocalPlayer.hpp"
/*
End of tes3mp addition
@ -40,10 +40,10 @@ namespace MWWorld
Send an ID_PLAYER_INVENTORY packet as well because of the item thus gained
by the player
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectDelete(getTarget());
worldEvent->sendObjectDelete();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectDelete(getTarget());
objectList->sendObjectDelete();
mwmp::Main::get().getLocalPlayer()->sendInventory();
/*
End of tes3mp addition

@ -7,7 +7,7 @@
*/
#include "../mwmp/Main.hpp"
#include "../mwmp/Networking.hpp"
#include "../mwmp/WorldEvent.hpp"
#include "../mwmp/ObjectList.hpp"
/*
End of tes3mp addition
*/
@ -48,8 +48,8 @@ namespace MWWorld
Send an ID_OBJECT_TRAP packet every time a trap is triggered
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
ESM::Position pos;
@ -58,8 +58,8 @@ namespace MWWorld
else
pos = actor.getRefData().getPosition();
worldEvent->addObjectTrap(mTrapSource, pos, false);
worldEvent->sendObjectTrap();
objectList->addObjectTrap(mTrapSource, pos, false);
objectList->sendObjectTrap();
/*
End of tes3mp addition
*/

@ -17,7 +17,7 @@
#include "../mwmp/DedicatedPlayer.hpp"
#include "../mwmp/LocalActor.hpp"
#include "../mwmp/DedicatedActor.hpp"
#include "../mwmp/WorldEvent.hpp"
#include "../mwmp/ObjectList.hpp"
#include "../mwmp/CellController.hpp"
/*
End of tes3mp addition
@ -2421,10 +2421,10 @@ namespace MWWorld
Send an ID_DOOR_STATE packet every time a door is activated
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addDoorState(door, state);
worldEvent->sendDoorState();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addDoorState(door, state);
objectList->sendDoorState();
/*
End of tes3mp addition
*/
@ -2440,10 +2440,10 @@ namespace MWWorld
Send an ID_DOOR_STATE packet every time a door is activated
*/
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addDoorState(door, state);
worldEvent->sendDoorState();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addDoorState(door, state);
objectList->sendDoorState();
/*
End of tes3mp addition
*/
@ -3484,10 +3484,10 @@ namespace MWWorld
*/
MWWorld::Ptr ptr = safePlaceObject(ref.getPtr(), getPlayerPtr(), getPlayerPtr().getCell(), 0, 220.f);
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset();
worldEvent->addObjectSpawn(ptr);
worldEvent->sendObjectSpawn();
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->addObjectSpawn(ptr);
objectList->sendObjectSpawn();
deleteObject(ptr);
/*

@ -150,7 +150,7 @@ add_component_dir (openmw-mp
)
add_component_dir (openmw-mp/Base
BaseActor BaseEvent BasePacketProcessor BasePlayer BaseStructs
BaseActor BaseObjectList BasePacketProcessor BasePlayer BaseStructs
)
add_component_dir (openmw-mp/Controllers

@ -22,7 +22,7 @@ namespace mwmp
}
};
struct WorldObject
struct BaseObject
{
std::string refId;
int refNumIndex;
@ -63,20 +63,20 @@ namespace mwmp
std::vector<ContainerItem> containerItems;
unsigned int containerItemCount;
RakNet::RakNetGUID guid; // only for events that can also affect players
RakNet::RakNetGUID guid; // only for object lists that can also include players
bool isPlayer;
};
class BaseEvent
class BaseObjectList
{
public:
BaseEvent(RakNet::RakNetGUID guid) : guid(guid)
BaseObjectList(RakNet::RakNetGUID guid) : guid(guid)
{
}
BaseEvent()
BaseObjectList()
{
}
@ -99,8 +99,8 @@ namespace mwmp
RakNet::RakNetGUID guid;
std::vector<WorldObject> worldObjects;
unsigned int worldObjectCount;
std::vector<BaseObject> baseObjects;
unsigned int baseObjectCount;
ESM::Cell cell;
std::string consoleCommand;

@ -20,10 +20,10 @@ ObjectPacket::~ObjectPacket()
}
void ObjectPacket::setEvent(BaseEvent *event)
void ObjectPacket::setObjectList(BaseObjectList *objectList)
{
this->event = event;
guid = event->guid;
this->objectList = objectList;
guid = objectList->guid;
}
void ObjectPacket::Packet(RakNet::BitStream *bs, bool send)
@ -31,16 +31,16 @@ void ObjectPacket::Packet(RakNet::BitStream *bs, bool send)
if (!PacketHeader(bs, send))
return;
WorldObject worldObject;
for (unsigned int i = 0; i < event->worldObjectCount; i++)
BaseObject baseObject;
for (unsigned int i = 0; i < objectList->baseObjectCount; i++)
{
if (send)
worldObject = event->worldObjects.at(i);
baseObject = objectList->baseObjects.at(i);
Object(worldObject, send);
Object(baseObject, send);
if (!send)
event->worldObjects.push_back(worldObject);
objectList->baseObjects.push_back(baseObject);
}
}
@ -49,30 +49,30 @@ bool ObjectPacket::PacketHeader(RakNet::BitStream *bs, bool send)
BasePacket::Packet(bs, send);
if (send)
event->worldObjectCount = (unsigned int)(event->worldObjects.size());
objectList->baseObjectCount = (unsigned int)(objectList->baseObjects.size());
else
event->worldObjects.clear();
objectList->baseObjects.clear();
RW(event->worldObjectCount, send);
RW(objectList->baseObjectCount, send);
if (event->worldObjectCount > maxObjects)
if (objectList->baseObjectCount > maxObjects)
{
event->isValid = false;
objectList->isValid = false;
return false;
}
if (hasCellData)
{
RW(event->cell.mData, send, 1);
RW(event->cell.mName, send, 1);
RW(objectList->cell.mData, send, 1);
RW(objectList->cell.mName, send, 1);
}
return true;
}
void ObjectPacket::Object(WorldObject &worldObject, bool send)
void ObjectPacket::Object(BaseObject &baseObject, bool send)
{
RW(worldObject.refId, send);
RW(worldObject.refNumIndex, send);
RW(worldObject.mpNum, send);
RW(baseObject.refId, send);
RW(baseObject.refNumIndex, send);
RW(baseObject.mpNum, send);
}

@ -5,7 +5,7 @@
#include <RakNetTypes.h>
#include <BitStream.h>
#include <PacketPriority.h>
#include <components/openmw-mp/Base/BaseEvent.hpp>
#include <components/openmw-mp/Base/BaseObject.hpp>
#include <components/openmw-mp/Packets/BasePacket.hpp>
@ -19,14 +19,14 @@ namespace mwmp
~ObjectPacket();
void setEvent(BaseEvent *event);
void setObjectList(BaseObjectList *objectList);
virtual void Packet(RakNet::BitStream *bs, bool send);
protected:
virtual void Object(WorldObject &worldObject, bool send);
virtual void Object(BaseObject &baseObject, bool send);
bool PacketHeader(RakNet::BitStream *bs, bool send);
BaseEvent *event;
BaseObjectList *objectList;
static const int maxObjects = 3000;
bool hasCellData;
};

@ -13,22 +13,22 @@ void PacketConsoleCommand::Packet(RakNet::BitStream *bs, bool send)
if (!PacketHeader(bs, send))
return;
RW(event->consoleCommand, send);
RW(objectList->consoleCommand, send);
WorldObject worldObject;
for (unsigned int i = 0; i < event->worldObjectCount; i++)
BaseObject baseObject;
for (unsigned int i = 0; i < objectList->baseObjectCount; i++)
{
if (send)
worldObject = event->worldObjects.at(i);
baseObject = objectList->baseObjects.at(i);
RW(worldObject.isPlayer, send);
RW(baseObject.isPlayer, send);
if (worldObject.isPlayer)
RW(worldObject.guid, send);
if (baseObject.isPlayer)
RW(baseObject.guid, send);
else
Object(worldObject, send);
Object(baseObject, send);
if (!send)
event->worldObjects.push_back(worldObject);
objectList->baseObjects.push_back(baseObject);
}
}

@ -15,36 +15,36 @@ void PacketContainer::Packet(RakNet::BitStream *bs, bool send)
if (!PacketHeader(bs, send))
return;
RW(event->action, send);
RW(event->containerSubAction, send);
RW(objectList->action, send);
RW(objectList->containerSubAction, send);
WorldObject worldObject;
for (unsigned int i = 0; i < event->worldObjectCount; i++)
BaseObject baseObject;
for (unsigned int i = 0; i < objectList->baseObjectCount; i++)
{
if (send)
{
worldObject = event->worldObjects.at(i);
worldObject.containerItemCount = (unsigned int) (worldObject.containerItems.size());
baseObject = objectList->baseObjects.at(i);
baseObject.containerItemCount = (unsigned int) (baseObject.containerItems.size());
}
else
worldObject.containerItems.clear();
baseObject.containerItems.clear();
Object(worldObject, send);
Object(baseObject, send);
RW(worldObject.containerItemCount, send);
RW(baseObject.containerItemCount, send);
if (worldObject.containerItemCount > maxObjects || worldObject.refId.empty() || (worldObject.refNumIndex != 0 && worldObject.mpNum != 0))
if (baseObject.containerItemCount > maxObjects || baseObject.refId.empty() || (baseObject.refNumIndex != 0 && baseObject.mpNum != 0))
{
event->isValid = false;
objectList->isValid = false;
return;
}
ContainerItem containerItem;
for (unsigned int j = 0; j < worldObject.containerItemCount; j++)
for (unsigned int j = 0; j < baseObject.containerItemCount; j++)
{
if (send)
containerItem = worldObject.containerItems.at(j);
containerItem = baseObject.containerItems.at(j);
RW(containerItem.refId, send);
RW(containerItem.count, send);
@ -53,9 +53,9 @@ void PacketContainer::Packet(RakNet::BitStream *bs, bool send)
RW(containerItem.actionCount, send);
if (!send)
worldObject.containerItems.push_back(containerItem);
baseObject.containerItems.push_back(containerItem);
}
if (!send)
event->worldObjects.push_back(worldObject);
objectList->baseObjects.push_back(baseObject);
}
}

@ -9,19 +9,19 @@ PacketDoorDestination::PacketDoorDestination(RakNet::RakPeerInterface *peer) : O
hasCellData = true;
}
void PacketDoorDestination::Object(WorldObject &worldObject, bool send)
void PacketDoorDestination::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(worldObject, send);
ObjectPacket::Object(baseObject, send);
RW(worldObject.teleportState, send);
RW(baseObject.teleportState, send);
if (worldObject.teleportState)
if (baseObject.teleportState)
{
RW(worldObject.destinationCell.mData, send, 1);
RW(worldObject.destinationCell.mName, send, 1);
RW(baseObject.destinationCell.mData, send, 1);
RW(baseObject.destinationCell.mName, send, 1);
RW(worldObject.destinationPosition.pos, send, 1);
RW(worldObject.destinationPosition.rot[0], send, 1);
RW(worldObject.destinationPosition.rot[2], send, 1);
RW(baseObject.destinationPosition.pos, send, 1);
RW(baseObject.destinationPosition.rot[0], send, 1);
RW(baseObject.destinationPosition.rot[2], send, 1);
}
}

@ -10,7 +10,7 @@ namespace mwmp
public:
PacketDoorDestination(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send);
virtual void Object(BaseObject &baseObject, bool send);
};
}

@ -9,8 +9,8 @@ PacketDoorState::PacketDoorState(RakNet::RakPeerInterface *peer) : ObjectPacket(
hasCellData = true;
}
void PacketDoorState::Object(WorldObject &worldObject, bool send)
void PacketDoorState::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(worldObject, send);
RW(worldObject.doorState, send);
ObjectPacket::Object(baseObject, send);
RW(baseObject.doorState, send);
}

@ -10,7 +10,7 @@ namespace mwmp
public:
PacketDoorState(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send);
virtual void Object(BaseObject &baseObject, bool send);
};
}

@ -8,7 +8,7 @@ PacketMusicPlay::PacketMusicPlay(RakNet::RakPeerInterface *peer) : ObjectPacket(
packetID = ID_MUSIC_PLAY;
}
void PacketMusicPlay::Object(WorldObject &worldObject, bool send)
void PacketMusicPlay::Object(BaseObject &baseObject, bool send)
{
RW(worldObject.filename, send);
RW(baseObject.filename, send);
}

@ -10,7 +10,7 @@ namespace mwmp
public:
PacketMusicPlay(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send);
virtual void Object(BaseObject &baseObject, bool send);
};
}

@ -9,9 +9,9 @@ PacketObjectAnimPlay::PacketObjectAnimPlay(RakNet::RakPeerInterface *peer) : Obj
hasCellData = true;
}
void PacketObjectAnimPlay::Object(WorldObject &worldObject, bool send)
void PacketObjectAnimPlay::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(worldObject, send);
RW(worldObject.animGroup, send);
RW(worldObject.animMode, send);
ObjectPacket::Object(baseObject, send);
RW(baseObject.animGroup, send);
RW(baseObject.animMode, send);
}

@ -10,7 +10,7 @@ namespace mwmp
public:
PacketObjectAnimPlay(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send);
virtual void Object(BaseObject &baseObject, bool send);
};
}

@ -9,8 +9,8 @@ PacketObjectAttach::PacketObjectAttach(RakNet::RakPeerInterface *peer) : ObjectP
hasCellData = true;
}
void PacketObjectAttach::Object(WorldObject &worldObject, bool send)
void PacketObjectAttach::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(worldObject, send);
ObjectPacket::Object(baseObject, send);
// Placeholder
}

@ -10,7 +10,7 @@ namespace mwmp
public:
PacketObjectAttach(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send);
virtual void Object(BaseObject &baseObject, bool send);
};
}

@ -9,8 +9,8 @@ PacketObjectCollision::PacketObjectCollision(RakNet::RakPeerInterface *peer) : O
hasCellData = true;
}
void PacketObjectCollision::Object(WorldObject &worldObject, bool send)
void PacketObjectCollision::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(worldObject, send);
ObjectPacket::Object(baseObject, send);
// Placeholder
}

@ -10,7 +10,7 @@ namespace mwmp
public:
PacketObjectCollision(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send);
virtual void Object(BaseObject &baseObject, bool send);
};
}

@ -9,8 +9,8 @@ PacketObjectLock::PacketObjectLock(RakNet::RakPeerInterface *peer) : ObjectPacke
hasCellData = true;
}
void PacketObjectLock::Object(WorldObject &worldObject, bool send)
void PacketObjectLock::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(worldObject, send);
RW(worldObject.lockLevel, send);
ObjectPacket::Object(baseObject, send);
RW(baseObject.lockLevel, send);
}

@ -10,7 +10,7 @@ namespace mwmp
public:
PacketObjectLock(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send);
virtual void Object(BaseObject &baseObject, bool send);
};
}

@ -9,8 +9,8 @@ PacketObjectMove::PacketObjectMove(RakNet::RakPeerInterface *peer) : ObjectPacke
hasCellData = true;
}
void PacketObjectMove::Object(WorldObject &worldObject, bool send)
void PacketObjectMove::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(worldObject, send);
RW(worldObject.position.pos, send);
ObjectPacket::Object(baseObject, send);
RW(baseObject.position.pos, send);
}

@ -10,7 +10,7 @@ namespace mwmp
public:
PacketObjectMove(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send);
virtual void Object(BaseObject &baseObject, bool send);
};
}

@ -9,13 +9,13 @@ PacketObjectPlace::PacketObjectPlace(RakNet::RakPeerInterface *peer) : ObjectPac
hasCellData = true;
}
void PacketObjectPlace::Object(WorldObject &worldObject, bool send)
void PacketObjectPlace::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(worldObject, send);
RW(worldObject.count, send);
RW(worldObject.charge, send);
RW(worldObject.enchantmentCharge, send);
RW(worldObject.goldValue, send);
RW(worldObject.position, send);
RW(worldObject.droppedByPlayer, send);
ObjectPacket::Object(baseObject, send);
RW(baseObject.count, send);
RW(baseObject.charge, send);
RW(baseObject.enchantmentCharge, send);
RW(baseObject.goldValue, send);
RW(baseObject.position, send);
RW(baseObject.droppedByPlayer, send);
}

@ -10,7 +10,7 @@ namespace mwmp
public:
PacketObjectPlace(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send);
virtual void Object(BaseObject &baseObject, bool send);
};
}

@ -9,8 +9,8 @@ PacketObjectReset::PacketObjectReset(RakNet::RakPeerInterface *peer) : ObjectPac
hasCellData = true;
}
void PacketObjectReset::Object(WorldObject &worldObject, bool send)
void PacketObjectReset::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(worldObject, send);
ObjectPacket::Object(baseObject, send);
// Placeholder
}

@ -10,7 +10,7 @@ namespace mwmp
public:
PacketObjectReset(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send);
virtual void Object(BaseObject &baseObject, bool send);
};
}

@ -9,10 +9,10 @@ PacketObjectRotate::PacketObjectRotate(RakNet::RakPeerInterface *peer) : ObjectP
hasCellData = true;
}
void PacketObjectRotate::Object(WorldObject &worldObject, bool send)
void PacketObjectRotate::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(worldObject, send);
RW(worldObject.position.rot[0], send);
RW(worldObject.position.rot[1], send);
RW(worldObject.position.rot[2], send);
ObjectPacket::Object(baseObject, send);
RW(baseObject.position.rot[0], send);
RW(baseObject.position.rot[1], send);
RW(baseObject.position.rot[2], send);
}

@ -10,7 +10,7 @@ namespace mwmp
public:
PacketObjectRotate(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send);
virtual void Object(BaseObject &baseObject, bool send);
};
}

@ -9,8 +9,8 @@ PacketObjectScale::PacketObjectScale(RakNet::RakPeerInterface *peer) : ObjectPac
hasCellData = true;
}
void PacketObjectScale::Object(WorldObject &worldObject, bool send)
void PacketObjectScale::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(worldObject, send);
RW(worldObject.scale, send);
ObjectPacket::Object(baseObject, send);
RW(baseObject.scale, send);
}

@ -10,7 +10,7 @@ namespace mwmp
public:
PacketObjectScale(RakNet::RakPeerInterface *peer);
virtual void Object(WorldObject &worldObject, bool send);
virtual void Object(BaseObject &baseObject, bool send);
};
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save