Merge pull request #423 from TES3MP/0.6.3 while resolving conflicts

Conflicts:
	apps/openmw-mp/Networking.cpp
	apps/openmw-mp/Script/Functions/World.cpp
	apps/openmw-mp/Script/Functions/World.hpp
	apps/openmw-mp/processors/WorldProcessor.cpp
	apps/openmw-mp/processors/WorldProcessor.hpp
	apps/openmw-mp/processors/world/ProcessorContainer.hpp
	apps/openmw-mp/processors/world/ProcessorDoorState.hpp
	apps/openmw-mp/processors/world/ProcessorObjectDelete.hpp
	apps/openmw-mp/processors/world/ProcessorObjectLock.hpp
	apps/openmw-mp/processors/world/ProcessorObjectPlace.hpp
	apps/openmw-mp/processors/world/ProcessorObjectScale.hpp
	apps/openmw-mp/processors/world/ProcessorObjectSpawn.hpp
	apps/openmw-mp/processors/world/ProcessorObjectState.hpp
	apps/openmw-mp/processors/world/ProcessorObjectTrap.hpp
	apps/openmw/mwgui/container.cpp
	apps/openmw/mwmp/Networking.cpp
	apps/openmw/mwmp/ObjectList.cpp
	apps/openmw/mwmp/ObjectList.hpp
	apps/openmw/mwmp/processors/world/ProcessorContainer.hpp
	components/CMakeLists.txt
	components/openmw-mp/Base/BaseObject.hpp
	components/openmw-mp/Packets/Object/ObjectPacket.cpp
	components/openmw-mp/Packets/Object/PacketConsoleCommand.cpp
	components/openmw-mp/Packets/Object/PacketContainer.cpp
	components/openmw-mp/Packets/Object/PacketDoorState.hpp
	components/openmw-mp/Packets/Object/PacketMusicPlay.hpp
	components/openmw-mp/Packets/Object/PacketObjectAnimPlay.hpp
	components/openmw-mp/Packets/Object/PacketObjectLock.hpp
	components/openmw-mp/Packets/Object/PacketObjectMove.hpp
	components/openmw-mp/Packets/Object/PacketObjectPlace.hpp
	components/openmw-mp/Packets/Object/PacketObjectRotate.hpp
	components/openmw-mp/Packets/Object/PacketObjectScale.hpp
	components/openmw-mp/Packets/Object/PacketObjectSpawn.hpp
	components/openmw-mp/Packets/Object/PacketObjectState.hpp
	components/openmw-mp/Packets/Object/PacketObjectTrap.hpp
	components/openmw-mp/Packets/Object/PacketScriptGlobalShort.hpp
	components/openmw-mp/Packets/Object/PacketScriptLocalFloat.hpp
	components/openmw-mp/Packets/Object/PacketScriptLocalShort.hpp
	components/openmw-mp/Packets/Object/PacketScriptMemberShort.hpp
	components/openmw-mp/Packets/Object/PacketVideoPlay.hpp
sol2-server-rewrite
David Cernat 7 years ago
commit d4dbfdfdb6

@ -202,7 +202,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()) if (players.empty())
return; return;
@ -220,9 +220,9 @@ void Cell::sendToLoaded(mwmp::ObjectPacket *objectPacket, mwmp::BaseEvent *baseE
for (auto &pl : plList) 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 // Send the packet to this eligible guid
objectPacket->Send(pl->guid); objectPacket->Send(pl->guid);

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

@ -4,7 +4,7 @@
#include <deque> #include <deque>
#include <string> #include <string>
#include <components/esm/records.hpp> #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/Actor/ActorPacket.hpp>
#include <components/openmw-mp/Packets/Object/ObjectPacket.hpp> #include <components/openmw-mp/Packets/Object/ObjectPacket.hpp>

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

@ -56,7 +56,7 @@ namespace mwmp
LuaState &getState() {return luaState;} LuaState &getState() {return luaState;}
BaseActorList *getLastActorList(); BaseActorList *getLastActorList();
BaseEvent *getLastEvent(); BaseObjectList *getLastObjectList();
int getCurrentMpNum(); int getCurrentMpNum();
void setCurrentMpNum(int value); void setCurrentMpNum(int value);
@ -90,7 +90,7 @@ namespace mwmp
std::unique_ptr<MasterClient> mclient; std::unique_ptr<MasterClient> mclient;
BaseActorList baseActorList; BaseActorList baseActorList;
BaseEvent baseEvent; BaseObjectList baseObjectList;
std::unique_ptr<PlayerPacketController> playerPacketController; std::unique_ptr<PlayerPacketController> playerPacketController;
std::unique_ptr<ActorPacketController> actorPacketController; std::unique_ptr<ActorPacketController> actorPacketController;

@ -331,11 +331,11 @@ void ObjectController::Init(LuaState &lua)
} }
shared_ptr<vector<shared_ptr<Object>>> ObjectController::copyObjects(mwmp::BaseEvent &event) shared_ptr<vector<shared_ptr<Object>>> ObjectController::copyObjects(mwmp::BaseObjectList &objectList)
{ {
auto objects = make_shared<vector<shared_ptr<Object>>>(); auto objects = make_shared<vector<shared_ptr<Object>>>();
for (auto &obj : event.worldObjects) for (auto &obj : objectList.baseObjects)
{ {
auto object = new Object; auto object = new Object;
object->copied = true; object->copied = true;
@ -345,11 +345,11 @@ shared_ptr<vector<shared_ptr<Object>>> ObjectController::copyObjects(mwmp::BaseE
return objects; return objects;
} }
shared_ptr<vector<shared_ptr<Container>>> ObjectController::copyContainers(mwmp::BaseEvent &event) shared_ptr<vector<shared_ptr<Container>>> ObjectController::copyContainers(mwmp::BaseObjectList &objectList)
{ {
auto containers = make_shared<vector<shared_ptr<Container>>>(); auto containers = make_shared<vector<shared_ptr<Container>>>();
for (auto &obj : event.worldObjects) for (auto &obj : objectList.baseObjects)
{ {
auto container = new Container; auto container = new Container;
container->copied = true; container->copied = true;
@ -374,14 +374,14 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
OBJECT_PLACE, OBJECT_PLACE,
LAST LAST
}; };
mwmp::BaseEvent events[Type::LAST]; mwmp::BaseObjectList objectLists[Type::LAST];
bool changed[Type::LAST]; bool changed[Type::LAST];
for (auto &e : events) for (auto &objectList : objectLists)
{ {
e.action = mwmp::BaseEvent::Action::Set; objectList.action = mwmp::BaseObjectList::Action::Set;
e.guid = player->guid; objectList.guid = player->guid;
e.cell = cell; objectList.cell = cell;
} }
@ -394,47 +394,47 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
if (object->changedDoorState && validNewObjOrCopy) if (object->changedDoorState && validNewObjOrCopy)
{ {
changed[Type::DOOR_STATE] = true; changed[Type::DOOR_STATE] = true;
events[Type::DOOR_STATE].worldObjects.push_back(object->object); objectLists[Type::DOOR_STATE].baseObjects.push_back(object->object);
} }
if (object->changedDoorDestination && validNewObjOrCopy) if (object->changedDoorDestination && validNewObjOrCopy)
{ {
changed[Type::DOOR_DESTINATION] = true; changed[Type::DOOR_DESTINATION] = true;
events[Type::DOOR_DESTINATION].worldObjects.push_back(object->object); objectLists[Type::DOOR_DESTINATION].baseObjects.push_back(object->object);
} }
if (object->changedObjectState && validNewObjOrCopy) if (object->changedObjectState && validNewObjOrCopy)
{ {
changed[Type::OBJECT_STATE] = true; changed[Type::OBJECT_STATE] = true;
events[Type::OBJECT_STATE].worldObjects.push_back(object->object); objectLists[Type::OBJECT_STATE].baseObjects.push_back(object->object);
} }
if (object->changedObjectScale && validNewObjOrCopy) if (object->changedObjectScale && validNewObjOrCopy)
{ {
changed[Type::OBJECT_SCALE] = true; changed[Type::OBJECT_SCALE] = true;
events[Type::OBJECT_SCALE].worldObjects.push_back(object->object); objectLists[Type::OBJECT_SCALE].baseObjects.push_back(object->object);
} }
if (object->changedObjectTrap && validNewObjOrCopy) if (object->changedObjectTrap && validNewObjOrCopy)
{ {
changed[Type::OBJECT_TRAP] = true; changed[Type::OBJECT_TRAP] = true;
events[Type::OBJECT_TRAP].worldObjects.push_back(object->object); objectLists[Type::OBJECT_TRAP].baseObjects.push_back(object->object);
} }
if (object->changedObjectLock && validNewObjOrCopy) if (object->changedObjectLock && validNewObjOrCopy)
{ {
changed[Type::OBJECT_LOCK] = true; changed[Type::OBJECT_LOCK] = true;
events[Type::OBJECT_LOCK].worldObjects.push_back(object->object); objectLists[Type::OBJECT_LOCK].baseObjects.push_back(object->object);
} }
if (object->changedObjectDelete && validNewObjOrCopy) if (object->changedObjectDelete && validNewObjOrCopy)
{ {
changed[Type::OBJECT_DELETE] = true; changed[Type::OBJECT_DELETE] = true;
events[Type::OBJECT_DELETE].worldObjects.push_back(object->object); objectLists[Type::OBJECT_DELETE].baseObjects.push_back(object->object);
} }
if (object->changedObjectSpawn && validNewObjOrCopy) if (object->changedObjectSpawn && validNewObjOrCopy)
{ {
changed[Type::OBJECT_SPAWN] = true; changed[Type::OBJECT_SPAWN] = true;
events[Type::OBJECT_SPAWN].worldObjects.push_back(object->object); objectLists[Type::OBJECT_SPAWN].baseObjects.push_back(object->object);
} }
if (object->changedObjectPlace && validNewObjOrCopy) if (object->changedObjectPlace && validNewObjOrCopy)
{ {
changed[Type::OBJECT_PLACE] = true; changed[Type::OBJECT_PLACE] = true;
events[Type::OBJECT_PLACE].worldObjects.push_back(object->object); objectLists[Type::OBJECT_PLACE].baseObjects.push_back(object->object);
} }
} }
@ -443,8 +443,8 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
if (changed[Type::DOOR_STATE]) if (changed[Type::DOOR_STATE])
{ {
auto packet = worldCtrl->GetPacket(ID_DOOR_STATE); auto packet = worldCtrl->GetPacket(ID_DOOR_STATE);
auto &event = events[Type::DOOR_STATE]; auto &objectList = objectLists[Type::DOOR_STATE];
packet->setEvent(&event); packet->setObjectList(&objectList);
packet->Send(false); packet->Send(false);
if (broadcast) if (broadcast)
@ -453,8 +453,8 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
if (changed[Type::DOOR_DESTINATION]) if (changed[Type::DOOR_DESTINATION])
{ {
auto packet = worldCtrl->GetPacket(ID_DOOR_DESTINATION); auto packet = worldCtrl->GetPacket(ID_DOOR_DESTINATION);
auto &event = events[Type::DOOR_DESTINATION]; auto &objectList = objectLists[Type::DOOR_DESTINATION];
packet->setEvent(&event); packet->setObjectList(&objectList);
packet->Send(false); packet->Send(false);
if (broadcast) if (broadcast)
@ -463,8 +463,8 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
if (changed[Type::OBJECT_STATE]) if (changed[Type::OBJECT_STATE])
{ {
auto packet = worldCtrl->GetPacket(ID_OBJECT_STATE); auto packet = worldCtrl->GetPacket(ID_OBJECT_STATE);
auto &event = events[Type::OBJECT_STATE]; auto &objectList = objectLists[Type::OBJECT_STATE];
packet->setEvent(&event); packet->setObjectList(&objectList);
packet->Send(false); packet->Send(false);
if (broadcast) if (broadcast)
@ -473,8 +473,8 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
if (changed[Type::OBJECT_SCALE]) if (changed[Type::OBJECT_SCALE])
{ {
auto packet = worldCtrl->GetPacket(ID_OBJECT_SCALE); auto packet = worldCtrl->GetPacket(ID_OBJECT_SCALE);
auto &event = events[Type::OBJECT_SCALE]; auto &objectList = objectLists[Type::OBJECT_SCALE];
packet->setEvent(&event); packet->setObjectList(&objectList);
packet->Send(false); packet->Send(false);
if (broadcast) if (broadcast)
@ -483,8 +483,8 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
if (changed[Type::OBJECT_TRAP]) if (changed[Type::OBJECT_TRAP])
{ {
auto packet = worldCtrl->GetPacket(ID_OBJECT_TRAP); auto packet = worldCtrl->GetPacket(ID_OBJECT_TRAP);
auto &event = events[Type::OBJECT_TRAP]; auto &objectList = objectLists[Type::OBJECT_TRAP];
packet->setEvent(&event); packet->setObjectList(&objectList);
packet->Send(false); packet->Send(false);
if (broadcast) if (broadcast)
@ -493,8 +493,8 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
if (changed[Type::OBJECT_LOCK]) if (changed[Type::OBJECT_LOCK])
{ {
auto packet = worldCtrl->GetPacket(ID_OBJECT_LOCK); auto packet = worldCtrl->GetPacket(ID_OBJECT_LOCK);
auto &event = events[Type::OBJECT_LOCK]; auto &objectList = objectLists[Type::OBJECT_LOCK];
packet->setEvent(&event); packet->setObjectList(&objectList);
packet->Send(false); packet->Send(false);
if (broadcast) if (broadcast)
@ -503,8 +503,8 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
if (changed[Type::OBJECT_DELETE]) if (changed[Type::OBJECT_DELETE])
{ {
auto packet = worldCtrl->GetPacket(ID_OBJECT_DELETE); auto packet = worldCtrl->GetPacket(ID_OBJECT_DELETE);
auto &event = events[Type::OBJECT_DELETE]; auto &objectList = objectLists[Type::OBJECT_DELETE];
packet->setEvent(&event); packet->setObjectList(&objectList);
packet->Send(false); packet->Send(false);
if (broadcast) if (broadcast)
@ -513,8 +513,8 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
if (changed[Type::OBJECT_SCALE]) if (changed[Type::OBJECT_SCALE])
{ {
auto packet = worldCtrl->GetPacket(ID_OBJECT_SPAWN); auto packet = worldCtrl->GetPacket(ID_OBJECT_SPAWN);
auto &event = events[Type::OBJECT_SCALE]; auto &objectList = objectLists[Type::OBJECT_SCALE];
packet->setEvent(&event); packet->setObjectList(&objectList);
packet->Send(false); packet->Send(false);
if (broadcast) if (broadcast)
@ -523,8 +523,8 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
if (changed[Type::OBJECT_PLACE]) if (changed[Type::OBJECT_PLACE])
{ {
auto packet = worldCtrl->GetPacket(ID_OBJECT_PLACE); auto packet = worldCtrl->GetPacket(ID_OBJECT_PLACE);
auto &event = events[Type::OBJECT_PLACE]; auto &objectList = objectLists[Type::OBJECT_PLACE];
packet->setEvent(&event); packet->setObjectList(&objectList);
packet->Send(false); packet->Send(false);
if (broadcast) if (broadcast)
@ -536,16 +536,16 @@ void ObjectController::sendConsoleCommand(shared_ptr<Player> player, shared_ptr<
const ESM::Cell &cell, const std::string &consoleCommand, bool broadcast) const ESM::Cell &cell, const std::string &consoleCommand, bool broadcast)
{ {
mwmp::BaseEvent event; mwmp::BaseObjectList objectList;
event.cell = cell; objectList.cell = cell;
event.consoleCommand = consoleCommand; objectList.consoleCommand = consoleCommand;
event.guid = player->guid; objectList.guid = player->guid;
for (auto &object : *objects) for (auto &object : *objects)
event.worldObjects.push_back(object->object); objectList.baseObjects.push_back(object->object);
auto packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONSOLE_COMMAND); auto packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONSOLE_COMMAND);
packet->setEvent(&event); packet->setObjectList(&objectList);
packet->Send(false); packet->Send(false);
if (broadcast) if (broadcast)
@ -556,20 +556,20 @@ void ObjectController::sendContainers(shared_ptr<Player> player, shared_ptr<vect
const ESM::Cell &cell, bool broadcast) const ESM::Cell &cell, bool broadcast)
{ {
mwmp::BaseEvent event; mwmp::BaseObjectList objectList;
event.cell = cell; objectList.cell = cell;
event.action = mwmp::BaseEvent::Action::Set; objectList.action = mwmp::BaseObjectList::Action::Set;
event.guid = player->guid; objectList.guid = player->guid;
for (auto &object : *objects) for (auto &object : *objects)
{ {
bool validNewObjOrCopy = (!object->copied && object->changedBase) || object->copied; bool validNewObjOrCopy = (!object->copied && object->changedBase) || object->copied;
if (object->changed && validNewObjOrCopy) if (object->changed && validNewObjOrCopy)
event.worldObjects.push_back(object->object); objectList.baseObjects.push_back(object->object);
} }
auto packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONTAINER); auto packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONTAINER);
packet->setEvent(&event); packet->setObjectList(&objectList);
packet->Send(false); packet->Send(false);
if (broadcast) if (broadcast)
@ -578,12 +578,12 @@ void ObjectController::sendContainers(shared_ptr<Player> player, shared_ptr<vect
void ObjectController::requestContainers(shared_ptr<Player> player) void ObjectController::requestContainers(shared_ptr<Player> player)
{ {
mwmp::BaseEvent event; mwmp::BaseObjectList objectList;
event.action = mwmp::BaseEvent::Action::Request; objectList.action = mwmp::BaseObjectList::Action::Request;
event.guid = player->guid; objectList.guid = player->guid;
event.cell = player->cell; objectList.cell = player->cell;
auto packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONTAINER); auto packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONTAINER);
packet->setEvent(&event); packet->setObjectList(&objectList);
packet->Send(event.guid); packet->Send(objectList.guid);
} }

@ -1,11 +1,7 @@
//
// Created by koncord on 26.08.17.
//
#pragma once #pragma once
#include <tuple> #include <tuple>
#include <components/openmw-mp/Base/BaseEvent.hpp> #include <components/openmw-mp/Base/BaseObject.hpp>
#include <memory> #include <memory>
class LuaState; class LuaState;
@ -30,7 +26,7 @@ public:
//void setEventCell(const std::string &cellDescription); //void setEventCell(const std::string &cellDescription);
mwmp::WorldObject object; mwmp::BaseObject object;
bool changedBase; bool changedBase;
bool copied; bool copied;
}; };
@ -118,8 +114,8 @@ public:
static void Init(LuaState &lua); static void Init(LuaState &lua);
public: public:
std::shared_ptr<std::vector<std::shared_ptr<Object>>> copyObjects(mwmp::BaseEvent &event); std::shared_ptr<std::vector<std::shared_ptr<Object>>> copyObjects(mwmp::BaseObjectList &objectList);
std::shared_ptr<std::vector<std::shared_ptr<Container>>> copyContainers(mwmp::BaseEvent &event); std::shared_ptr<std::vector<std::shared_ptr<Container>>> copyContainers(mwmp::BaseObjectList &objectList);
void sendObjects(std::shared_ptr<Player> player, std::shared_ptr<std::vector<std::shared_ptr<Object>>> objects, void sendObjects(std::shared_ptr<Player> player, std::shared_ptr<std::vector<std::shared_ptr<Object>>> objects,
const ESM::Cell &cell, bool broadcast = false); const ESM::Cell &cell, bool broadcast = false);

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

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

@ -15,17 +15,17 @@ namespace mwmp
BPP_INIT(ID_CONTAINER) BPP_INIT(ID_CONTAINER)
} }
void Do(ObjectPacket &packet, const std::shared_ptr<Player> &player, BaseEvent &event) override void Do(ObjectPacket &packet, const std::shared_ptr<Player> &player, BaseObjectList &objectList) override
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str()); 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", (int) event.action); LOG_APPEND(Log::LOG_INFO, "- action: %i", (int) objectList.action);
// Don't have any hardcoded sync, and instead expect Lua scripts to forward // 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 // container packets to ensure their integrity based on what exists in the
// server data // server data
auto objCtrl = Networking::get().getState().getObjectCtrl(); auto objCtrl = Networking::get().getState().getObjectCtrl();
auto containers = objCtrl.copyContainers(event); auto containers = objCtrl.copyContainers(objectList);
Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_CONTAINER>(player, containers); Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_CONTAINER>(player, containers);

@ -13,16 +13,16 @@ namespace mwmp
BPP_INIT(ID_DOOR_STATE) BPP_INIT(ID_DOOR_STATE)
} }
void Do(ObjectPacket &packet, const std::shared_ptr<Player> &player, BaseEvent &event) override void Do(ObjectPacket &packet, const std::shared_ptr<Player> &player, BaseObjectList &objectList) override
{ {
packet.Send(true); packet.Send(true);
auto objCtrl = Networking::get().getState().getObjectCtrl(); auto objCtrl = Networking::get().getState().getObjectCtrl();
auto objects = objCtrl.copyObjects(event); auto objects = objCtrl.copyObjects(objectList);
Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_DOOR_STATE>(player, objects); Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_DOOR_STATE>(player, objects);
objCtrl.sendObjects(player, objects, event.cell); objCtrl.sendObjects(player, objects, objectList.cell);
} }
}; };
} }

@ -13,18 +13,18 @@ namespace mwmp
BPP_INIT(ID_OBJECT_DELETE) BPP_INIT(ID_OBJECT_DELETE)
} }
void Do(ObjectPacket &packet, const std::shared_ptr<Player> &player, BaseEvent &event) override void Do(ObjectPacket &packet, const std::shared_ptr<Player> &player, BaseObjectList &objectList) override
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str());
packet.Send(true); packet.Send(true);
auto objCtrl = Networking::get().getState().getObjectCtrl(); auto objCtrl = Networking::get().getState().getObjectCtrl();
auto objects = objCtrl.copyObjects(event); auto objects = objCtrl.copyObjects(objectList);
Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_OBJECT_DELETE>(player.get(), objects); Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_OBJECT_DELETE>(player.get(), objects);
objCtrl.sendObjects(player, objects, event.cell); objCtrl.sendObjects(player, objects, objectList.cell);
} }
}; };
} }

@ -13,18 +13,18 @@ namespace mwmp
BPP_INIT(ID_OBJECT_LOCK) BPP_INIT(ID_OBJECT_LOCK)
} }
void Do(ObjectPacket &packet, const std::shared_ptr<Player> &player, BaseEvent &event) override void Do(ObjectPacket &packet, const std::shared_ptr<Player> &player, BaseObjectList &objectList) override
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str());
packet.Send(true); packet.Send(true);
auto objCtrl = Networking::get().getState().getObjectCtrl(); auto objCtrl = Networking::get().getState().getObjectCtrl();
auto objects = objCtrl.copyObjects(event); auto objects = objCtrl.copyObjects(objectList);
Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_OBJECT_LOCK>(player.get(), objects); Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_OBJECT_LOCK>(player.get(), objects);
objCtrl.sendObjects(player, objects, event.cell); objCtrl.sendObjects(player, objects, objectList.cell);
} }
}; };
} }

@ -14,11 +14,11 @@ namespace mwmp
BPP_INIT(ID_OBJECT_PLACE) BPP_INIT(ID_OBJECT_PLACE)
} }
void Do(ObjectPacket &packet, const std::shared_ptr<Player> &player, BaseEvent &event) override void Do(ObjectPacket &packet, const std::shared_ptr<Player> &player, BaseObjectList &objectList) override
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str());
for (auto & object : event.worldObjects) for (auto & object : objectList.baseObjects)
object.mpNum = mwmp::Networking::getPtr()->incrementMpNum(); object.mpNum = mwmp::Networking::getPtr()->incrementMpNum();
// Send this packet back to the original sender with the mpNum generation from above, // Send this packet back to the original sender with the mpNum generation from above,
@ -27,11 +27,11 @@ namespace mwmp
packet.Send(true); packet.Send(true);
auto objCtrl = Networking::get().getState().getObjectCtrl(); auto objCtrl = Networking::get().getState().getObjectCtrl();
auto objects = objCtrl.copyObjects(event); auto objects = objCtrl.copyObjects(objectList);
Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_OBJECT_PLACE>(player.get(), objects); Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_OBJECT_PLACE>(player.get(), objects);
objCtrl.sendObjects(player, objects, event.cell); objCtrl.sendObjects(player, objects, objectList.cell);
} }
}; };
} }

@ -13,18 +13,18 @@ namespace mwmp
BPP_INIT(ID_OBJECT_SCALE) BPP_INIT(ID_OBJECT_SCALE)
} }
void Do(ObjectPacket &packet, const std::shared_ptr<Player> &player, BaseEvent &event) override void Do(ObjectPacket &packet, const std::shared_ptr<Player> &player, BaseObjectList &objectList) override
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str());
packet.Send(true); packet.Send(true);
auto objCtrl = Networking::get().getState().getObjectCtrl(); auto objCtrl = Networking::get().getState().getObjectCtrl();
auto objects = objCtrl.copyObjects(event); auto objects = objCtrl.copyObjects(objectList);
Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_OBJECT_SCALE>(player.get(), objects); Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_OBJECT_SCALE>(player.get(), objects);
objCtrl.sendObjects(player, objects, event.cell); objCtrl.sendObjects(player, objects, objectList.cell);
} }
}; };
} }

@ -14,11 +14,11 @@ namespace mwmp
BPP_INIT(ID_OBJECT_SPAWN) BPP_INIT(ID_OBJECT_SPAWN)
} }
void Do(ObjectPacket &packet, const std::shared_ptr<Player> &player, BaseEvent &event) override void Do(ObjectPacket &packet, const std::shared_ptr<Player> &player, BaseObjectList &objectList) override
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str());
for (auto & object : event.worldObjects) for (auto & object : objectList.baseObjects)
object.mpNum = mwmp::Networking::getPtr()->incrementMpNum(); object.mpNum = mwmp::Networking::getPtr()->incrementMpNum();
// Send this packet back to the original sender with the mpNum generation from above, // Send this packet back to the original sender with the mpNum generation from above,
@ -27,11 +27,11 @@ namespace mwmp
packet.Send(true); packet.Send(true);
auto objCtrl = Networking::get().getState().getObjectCtrl(); auto objCtrl = Networking::get().getState().getObjectCtrl();
auto objects = objCtrl.copyObjects(event); auto objects = objCtrl.copyObjects(objectList);
Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_OBJECT_SCALE>(player.get(), objects); Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_OBJECT_SCALE>(player.get(), objects);
objCtrl.sendObjects(player, objects, event.cell); objCtrl.sendObjects(player, objects, objectList.cell);
} }
}; };
} }

@ -13,18 +13,18 @@ namespace mwmp
BPP_INIT(ID_OBJECT_STATE) BPP_INIT(ID_OBJECT_STATE)
} }
void Do(ObjectPacket &packet, const std::shared_ptr<Player> &player, BaseEvent &event) override void Do(ObjectPacket &packet, const std::shared_ptr<Player> &player, BaseObjectList &objectList) override
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str());
packet.Send(true); packet.Send(true);
auto objCtrl = Networking::get().getState().getObjectCtrl(); auto objCtrl = Networking::get().getState().getObjectCtrl();
auto objects = objCtrl.copyObjects(event); auto objects = objCtrl.copyObjects(objectList);
Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_OBJECT_STATE>(player.get(), objects); Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_OBJECT_STATE>(player.get(), objects);
objCtrl.sendObjects(player, objects, event.cell); objCtrl.sendObjects(player, objects, objectList.cell);
} }
}; };
} }

@ -13,18 +13,18 @@ namespace mwmp
BPP_INIT(ID_OBJECT_TRAP) BPP_INIT(ID_OBJECT_TRAP)
} }
void Do(ObjectPacket &packet, const std::shared_ptr<Player> &player, BaseEvent &event) override void Do(ObjectPacket &packet, const std::shared_ptr<Player> &player, BaseObjectList &objectList) override
{ {
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str()); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player->npc.mName.c_str());
packet.Send(true); packet.Send(true);
auto objCtrl = Networking::get().getState().getObjectCtrl(); auto objCtrl = Networking::get().getState().getObjectCtrl();
auto objects = objCtrl.copyObjects(event); auto objects = objCtrl.copyObjects(objectList);
Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_OBJECT_TRAP>(player.get(), objects); Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_OBJECT_TRAP>(player.get(), objects);
objCtrl.sendObjects(player, objects, event.cell); objCtrl.sendObjects(player, objects, objectList.cell);
} }
}; };
} }

@ -97,7 +97,7 @@ add_openmw_dir (mwbase
inputmanager windowmanager statemanager 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 Cell CellController MechanicsHelper RecordHelper GUIController
) )

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

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

@ -12,7 +12,7 @@
#include "../mwmp/Main.hpp" #include "../mwmp/Main.hpp"
#include "../mwmp/Networking.hpp" #include "../mwmp/Networking.hpp"
#include "../mwmp/LocalPlayer.hpp" #include "../mwmp/LocalPlayer.hpp"
#include "../mwmp/WorldEvent.hpp" #include "../mwmp/ObjectList.hpp"
#include "../mwmp/CellController.hpp" #include "../mwmp/CellController.hpp"
/* /*
End of tes3mp addition End of tes3mp addition
@ -112,23 +112,23 @@ namespace MWGui
Send an ID_CONTAINER packet every time an item starts being dragged Send an ID_CONTAINER packet every time an item starts being dragged
from a container from a container
*/ */
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
worldEvent->reset(); objectList->reset();
worldEvent->cell = *mPtr.getCell()->getCell(); objectList->cell = *mPtr.getCell()->getCell();
worldEvent->action = mwmp::BaseEvent::Action::Remove; objectList->action = mwmp::BaseObjectList::Action::Remove;
worldEvent->containerSubAction = mwmp::BaseEvent::ContainerSubAction::Drag; objectList->containerSubAction = mwmp::BaseObjectList::ContainerSubAction::Drag;
mwmp::WorldObject worldObject = worldEvent->getWorldObject(mPtr); mwmp::BaseObject baseObject = objectList->getBaseObject(mPtr);
MWWorld::Ptr itemPtr = mModel->getItem(mSelectedItem).mBase; MWWorld::Ptr itemPtr = mModel->getItem(mSelectedItem).mBase;
worldEvent->addContainerItem(worldObject, itemPtr, count); objectList->addContainerItem(baseObject, itemPtr, count);
worldEvent->worldObjects.push_back(std::move(worldObject)); objectList->baseObjects.push_back(std::move(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(); 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", 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()); itemPtr.getCellRef().getRefId().c_str(), itemPtr.getRefData().getCount());
/* /*
End of tes3mp addition End of tes3mp addition
@ -159,13 +159,13 @@ namespace MWGui
*/ */
if (success) if (success)
{ {
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
worldEvent->reset(); objectList->reset();
worldEvent->cell = *mPtr.getCell()->getCell(); objectList->cell = *mPtr.getCell()->getCell();
worldEvent->action = mwmp::BaseEvent::Action::Add; objectList->action = mwmp::BaseObjectList::Action::Add;
worldEvent->containerSubAction = mwmp::BaseEvent::ContainerSubAction::Drop; objectList->containerSubAction = mwmp::BaseObjectList::ContainerSubAction::Drop;
mwmp::WorldObject worldObject = worldEvent->getWorldObject(mPtr); mwmp::BaseObject baseObject = objectList->getBaseObject(mPtr);
MWWorld::Ptr itemPtr = mDragAndDrop->mItem.mBase; MWWorld::Ptr itemPtr = mDragAndDrop->mItem.mBase;
mwmp::ContainerItem containerItem; mwmp::ContainerItem containerItem;
containerItem.refId = itemPtr.getCellRef().getRefId(); containerItem.refId = itemPtr.getCellRef().getRefId();
@ -176,14 +176,14 @@ namespace MWGui
containerItem.charge = itemPtr.getCellRef().getCharge(); containerItem.charge = itemPtr.getCellRef().getCharge();
containerItem.enchantmentCharge = itemPtr.getCellRef().getEnchantmentCharge(); containerItem.enchantmentCharge = itemPtr.getCellRef().getEnchantmentCharge();
worldObject.containerItems.push_back(std::move(containerItem)); baseObject.containerItems.push_back(std::move(containerItem));
worldEvent->worldObjects.push_back(std::move(worldObject)); objectList->baseObjects.push_back(std::move(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(); 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", 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); containerItem.refId.c_str(), containerItem.count, containerItem.charge);
} }
/* /*
@ -299,19 +299,19 @@ namespace MWGui
Send an ID_CONTAINER packet every time the Take All button is used on Send an ID_CONTAINER packet every time the Take All button is used on
a container a container
*/ */
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
worldEvent->reset(); objectList->reset();
worldEvent->cell = *mPtr.getCell()->getCell(); objectList->cell = *mPtr.getCell()->getCell();
worldEvent->action = mwmp::BaseEvent::Action::Remove; objectList->action = mwmp::BaseObjectList::Action::Remove;
worldEvent->containerSubAction = mwmp::BaseEvent::ContainerSubAction::TakeAll; objectList->containerSubAction = mwmp::BaseObjectList::ContainerSubAction::TakeAll;
worldEvent->addEntireContainer(mPtr); objectList->addEntireContainer(mPtr);
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(); 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", 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(), 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 End of tes3mp addition
*/ */
@ -381,10 +381,10 @@ namespace MWGui
*/ */
if (!mPtr.getClass().isPersistent(mPtr)) if (!mPtr.getClass().isPersistent(mPtr))
{ {
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
worldEvent->reset(); objectList->reset();
worldEvent->addObjectDelete(mPtr); objectList->addObjectDelete(mPtr);
worldEvent->sendObjectDelete(); objectList->sendObjectDelete();
} }
/* /*
End of tes3mp addition End of tes3mp addition

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

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

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

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

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

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

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

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

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

@ -1,24 +1,24 @@
#ifndef OPENMW_WORLDEVENT_HPP #ifndef OPENMW_WORLDEVENT_HPP
#define 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 "../mwworld/cellstore.hpp"
#include <RakNetTypes.h> #include <RakNetTypes.h>
namespace mwmp namespace mwmp
{ {
class Networking; class Networking;
class WorldEvent : public BaseEvent class ObjectList : public BaseObjectList
{ {
public: public:
WorldEvent(); ObjectList();
virtual ~WorldEvent(); virtual ~ObjectList();
void reset(); void reset();
WorldObject getWorldObject(const MWWorld::Ptr& ptr); BaseObject getBaseObject(const MWWorld::Ptr& ptr);
void addContainerItem(mwmp::WorldObject& worldObject, const MWWorld::Ptr& itemPtr, int actionCount); void addContainerItem(mwmp::BaseObject& baseObject, const MWWorld::Ptr& itemPtr, int actionCount);
void addEntireContainer(const MWWorld::Ptr& ptr); void addEntireContainer(const MWWorld::Ptr& ptr);
void editContainers(MWWorld::CellStore* cellStore); void editContainers(MWWorld::CellStore* cellStore);
@ -46,7 +46,7 @@ namespace mwmp
void playVideo(); void playVideo();
void addAllContainers(MWWorld::CellStore* cellStore); 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 addObjectPlace(const MWWorld::Ptr& ptr, bool droppedByPlayer = false);
void addObjectSpawn(const MWWorld::Ptr& ptr); void addObjectSpawn(const MWWorld::Ptr& ptr);

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

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

@ -13,11 +13,11 @@ namespace mwmp
BPP_INIT(ID_CONSOLE_COMMAND) 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) 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", (int) event.action, (int) event.containerSubAction); LOG_APPEND(Log::LOG_VERBOSE, "- action: %i, containerSubAction: %i", (int) objectList.action, (int) objectList.containerSubAction);
// If we've received a request for information, comply with it // If we've received a request for information, comply with it
if (event.action == mwmp::BaseEvent::Action::Request) if (objectList.action == mwmp::BaseObjectList::Action::Request)
{ {
if (event.worldObjects.size() == 0) if (objectList.baseObjects.size() == 0)
{ {
LOG_APPEND(Log::LOG_VERBOSE, "- Request had no objects attached, so we are sending all containers in the cell %s", 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()); objectList.cell.getDescription().c_str());
event.reset(); objectList.reset();
event.cell = *ptrCellStore->getCell(); objectList.cell = *ptrCellStore->getCell();
event.action = BaseEvent::Action::Set; objectList.action = BaseObjectList::Action::Set;
event.addAllContainers(ptrCellStore); objectList.addAllContainers(ptrCellStore);
event.sendContainer(); objectList.sendContainer();
} }
else else
{ {
LOG_APPEND(Log::LOG_VERBOSE, "- Request was for %i %s", event.worldObjects.size(), event.worldObjects.size() == 1 ? "object" : "objects"); LOG_APPEND(Log::LOG_VERBOSE, "- Request was for %i %s", objectList.baseObjects.size(), objectList.baseObjects.size() == 1 ? "object" : "objects");
std::vector<WorldObject> requestObjects = event.worldObjects; std::vector<BaseObject> requestObjects = objectList.baseObjects;
event.reset(); objectList.reset();
event.cell = *ptrCellStore->getCell(); objectList.cell = *ptrCellStore->getCell();
event.action = mwmp::BaseEvent::Action::Set; objectList.action = mwmp::BaseObjectList::Action::Set;
event.addRequestedContainers(ptrCellStore, requestObjects); objectList.addRequestedContainers(ptrCellStore, requestObjects);
if (event.worldObjects.size() > 0) if (objectList.baseObjects.size() > 0)
event.sendContainer(); objectList.sendContainer();
} }
} }
// Otherwise, edit containers based on the information received // Otherwise, edit containers based on the information received
else else
{ {
LOG_APPEND(Log::LOG_VERBOSE, "- Editing container contents to match those of packet"); LOG_APPEND(Log::LOG_VERBOSE, "- Editing container contents to match those of packet");
event.editContainers(ptrCellStore); objectList.editContainers(ptrCellStore);
} }
} }

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

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

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

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

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

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

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

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

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

@ -22,7 +22,7 @@ namespace mwmp
} }
}; };
struct WorldObject struct BaseObject
{ {
std::string refId; std::string refId;
unsigned refNumIndex; unsigned refNumIndex;
@ -63,20 +63,20 @@ namespace mwmp
std::vector<ContainerItem> containerItems; std::vector<ContainerItem> containerItems;
unsigned int containerItemCount; 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; bool isPlayer;
}; };
class BaseEvent class BaseObjectList
{ {
public: public:
BaseEvent(RakNet::RakNetGUID guid) : guid(guid) BaseObjectList(RakNet::RakNetGUID guid) : guid(guid)
{ {
} }
BaseEvent() BaseObjectList()
{ {
} }
@ -99,7 +99,7 @@ namespace mwmp
RakNet::RakNetGUID guid; RakNet::RakNetGUID guid;
std::vector<WorldObject> worldObjects; std::vector<BaseObject> baseObjects;
ESM::Cell cell; ESM::Cell cell;
std::string consoleCommand; std::string consoleCommand;

@ -15,10 +15,10 @@ ObjectPacket::ObjectPacket(RakNet::RakPeerInterface *peer) : BasePacket(peer)
this->peer = peer; this->peer = peer;
} }
void ObjectPacket::setEvent(BaseEvent *event) void ObjectPacket::setObjectList(BaseObjectList *objectList)
{ {
this->event = event; this->objectList = objectList;
guid = event->guid; guid = objectList->guid;
} }
void ObjectPacket::Packet(RakNet::BitStream *bs, bool send) void ObjectPacket::Packet(RakNet::BitStream *bs, bool send)
@ -26,9 +26,9 @@ void ObjectPacket::Packet(RakNet::BitStream *bs, bool send)
if (!PacketHeader(bs, send)) if (!PacketHeader(bs, send))
return; return;
for (auto &&worldObject : event->worldObjects) for (auto &&baseObject : objectList->baseObjects)
{ {
Object(worldObject, send); Object(baseObject, send);
} }
} }
@ -36,37 +36,37 @@ bool ObjectPacket::PacketHeader(RakNet::BitStream *bs, bool send)
{ {
BasePacket::Packet(bs, send); BasePacket::Packet(bs, send);
uint32_t worldObjectCount; uint32_t baseObjectCount;
if (send) if (send)
worldObjectCount = (uint32_t) (event->worldObjects.size()); baseObjectCount = (uint32_t) (objectList->baseObjects.size());
RW(worldObjectCount, send); RW(baseObjectCount, send);
if (worldObjectCount > maxObjects) if (baseObjectCount > maxObjects)
{ {
event->isValid = false; objectList->isValid = false;
return false; return false;
} }
if (!send) if (!send)
{ {
event->worldObjects.clear(); objectList->baseObjects.clear();
event->worldObjects.resize(worldObjectCount); objectList->baseObjects.resize(baseObjectCount);
} }
if (hasCellData) if (hasCellData)
{ {
RW(event->cell.mData, send, true); RW(objectList->cell.mData, send, true);
RW(event->cell.mName, send, true); RW(objectList->cell.mName, send, true);
} }
return true; return true;
} }
void ObjectPacket::Object(WorldObject &worldObject, bool send) void ObjectPacket::Object(BaseObject &baseObject, bool send)
{ {
RW(worldObject.refId, send); RW(baseObject.refId, send);
RW(worldObject.refNumIndex, send); RW(baseObject.refNumIndex, send);
RW(worldObject.mpNum, send); RW(baseObject.mpNum, send);
} }

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

@ -13,16 +13,16 @@ void PacketConsoleCommand::Packet(RakNet::BitStream *bs, bool send)
if (!PacketHeader(bs, send)) if (!PacketHeader(bs, send))
return; return;
RW(event->consoleCommand, send); RW(objectList->consoleCommand, send);
WorldObject worldObject; BaseObject baseObject;
for (auto &&worldObject : event->worldObjects) for (auto &&baseObject : objectList->baseObjects)
{ {
RW(worldObject.isPlayer, send); RW(baseObject.isPlayer, send);
if (worldObject.isPlayer) if (baseObject.isPlayer)
RW(worldObject.guid, send); RW(baseObject.guid, send);
else else
Object(worldObject, send); Object(baseObject, send);
} }
} }

@ -15,34 +15,34 @@ void PacketContainer::Packet(RakNet::BitStream *bs, bool send)
if (!PacketHeader(bs, send)) if (!PacketHeader(bs, send))
return; return;
RW(event->action, send); RW(objectList->action, send);
RW(event->containerSubAction, send); RW(objectList->containerSubAction, send);
for (auto &&worldObject : event->worldObjects) for (auto &&baseObject : objectList->baseObjects)
{ {
Object(worldObject, send); Object(baseObject, send);
if (send) if (send)
{ {
worldObject.containerItemCount = (unsigned int) (worldObject.containerItems.size()); baseObject.containerItemCount = (unsigned int) (baseObject.containerItems.size());
} }
RW(worldObject.containerItemCount, send); RW(baseObject.containerItemCount, send);
if (!send) if (!send)
{ {
worldObject.containerItems.clear(); baseObject.containerItems.clear();
worldObject.containerItems.resize(worldObject.containerItemCount); baseObject.containerItems.resize(baseObject.containerItemCount);
} }
if (worldObject.containerItemCount > maxObjects || worldObject.refId.empty() if (baseObject.containerItemCount > maxObjects || baseObject.refId.empty()
|| (worldObject.refNumIndex != 0 && worldObject.mpNum != 0)) || (baseObject.refNumIndex != 0 && baseObject.mpNum != 0))
{ {
event->isValid = false; objectList->isValid = false;
return; return;
} }
for (auto &&containerItem: worldObject.containerItems) for (auto &&containerItem: baseObject.containerItems)
{ {
RW(containerItem.refId, send); RW(containerItem.refId, send);
RW(containerItem.count, send); RW(containerItem.count, send);

@ -9,19 +9,19 @@ PacketDoorDestination::PacketDoorDestination(RakNet::RakPeerInterface *peer) : O
hasCellData = true; 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(baseObject.destinationCell.mData, send, 1);
RW(worldObject.destinationCell.mName, send, 1); RW(baseObject.destinationCell.mName, send, 1);
RW(worldObject.destinationPosition.pos, send, 1); RW(baseObject.destinationPosition.pos, send, 1);
RW(worldObject.destinationPosition.rot[0], send, 1); RW(baseObject.destinationPosition.rot[0], send, 1);
RW(worldObject.destinationPosition.rot[2], send, 1); RW(baseObject.destinationPosition.rot[2], send, 1);
} }
} }

@ -10,7 +10,7 @@ namespace mwmp
public: public:
PacketDoorDestination(RakNet::RakPeerInterface *peer); 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; hasCellData = true;
} }
void PacketDoorState::Object(WorldObject &worldObject, bool send) void PacketDoorState::Object(BaseObject &baseObject, bool send)
{ {
ObjectPacket::Object(worldObject, send); ObjectPacket::Object(baseObject, send);
RW(worldObject.doorState, send); RW(baseObject.doorState, send);
} }

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

@ -8,7 +8,7 @@ PacketMusicPlay::PacketMusicPlay(RakNet::RakPeerInterface *peer) : ObjectPacket(
packetID = ID_MUSIC_PLAY; 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: public:
explicit PacketMusicPlay(RakNet::RakPeerInterface *peer); explicit PacketMusicPlay(RakNet::RakPeerInterface *peer);
void Object(WorldObject &worldObject, bool send) override; void Object(BaseObject &baseObject, bool send) override;
}; };
} }

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

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

@ -9,8 +9,8 @@ PacketObjectAttach::PacketObjectAttach(RakNet::RakPeerInterface *peer) : ObjectP
hasCellData = true; 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 // Placeholder
} }

@ -10,7 +10,7 @@ namespace mwmp
public: public:
PacketObjectAttach(RakNet::RakPeerInterface *peer); 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; 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 // Placeholder
} }

@ -10,7 +10,7 @@ namespace mwmp
public: public:
PacketObjectCollision(RakNet::RakPeerInterface *peer); 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; hasCellData = true;
} }
void PacketObjectLock::Object(WorldObject &worldObject, bool send) void PacketObjectLock::Object(BaseObject &baseObject, bool send)
{ {
ObjectPacket::Object(worldObject, send); ObjectPacket::Object(baseObject, send);
RW(worldObject.lockLevel, send); RW(baseObject.lockLevel, send);
} }

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

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

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

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

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

@ -9,8 +9,8 @@ PacketObjectReset::PacketObjectReset(RakNet::RakPeerInterface *peer) : ObjectPac
hasCellData = true; 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 // Placeholder
} }

@ -10,7 +10,7 @@ namespace mwmp
public: public:
PacketObjectReset(RakNet::RakPeerInterface *peer); 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; hasCellData = true;
} }
void PacketObjectRotate::Object(WorldObject &worldObject, bool send) void PacketObjectRotate::Object(BaseObject &baseObject, bool send)
{ {
ObjectPacket::Object(worldObject, send); ObjectPacket::Object(baseObject, send);
RW(worldObject.position.rot[0], send); RW(baseObject.position.rot[0], send);
RW(worldObject.position.rot[1], send); RW(baseObject.position.rot[1], send);
RW(worldObject.position.rot[2], send); RW(baseObject.position.rot[2], send);
} }

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

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

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

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

Loading…
Cancel
Save