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())
return;
@ -220,9 +220,9 @@ void Cell::sendToLoaded(mwmp::ObjectPacket *objectPacket, mwmp::BaseEvent *baseE
for (auto &pl : plList)
{
if (pl->guid == baseEvent->guid) continue;
if (pl->guid == baseObjectList->guid) continue;
objectPacket->setEvent(baseEvent);
objectPacket->setObjectList(baseObjectList);
// Send the packet to this eligible guid
objectPacket->Send(pl->guid);

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

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

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

@ -56,7 +56,7 @@ namespace mwmp
LuaState &getState() {return luaState;}
BaseActorList *getLastActorList();
BaseEvent *getLastEvent();
BaseObjectList *getLastObjectList();
int getCurrentMpNum();
void setCurrentMpNum(int value);
@ -90,7 +90,7 @@ namespace mwmp
std::unique_ptr<MasterClient> mclient;
BaseActorList baseActorList;
BaseEvent baseEvent;
BaseObjectList baseObjectList;
std::unique_ptr<PlayerPacketController> playerPacketController;
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>>>();
for (auto &obj : event.worldObjects)
for (auto &obj : objectList.baseObjects)
{
auto object = new Object;
object->copied = true;
@ -345,11 +345,11 @@ shared_ptr<vector<shared_ptr<Object>>> ObjectController::copyObjects(mwmp::BaseE
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>>>();
for (auto &obj : event.worldObjects)
for (auto &obj : objectList.baseObjects)
{
auto container = new Container;
container->copied = true;
@ -374,14 +374,14 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
OBJECT_PLACE,
LAST
};
mwmp::BaseEvent events[Type::LAST];
mwmp::BaseObjectList objectLists[Type::LAST];
bool changed[Type::LAST];
for (auto &e : events)
for (auto &objectList : objectLists)
{
e.action = mwmp::BaseEvent::Action::Set;
e.guid = player->guid;
e.cell = cell;
objectList.action = mwmp::BaseObjectList::Action::Set;
objectList.guid = player->guid;
objectList.cell = cell;
}
@ -394,47 +394,47 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
if (object->changedDoorState && validNewObjOrCopy)
{
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)
{
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)
{
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)
{
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)
{
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)
{
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)
{
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)
{
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)
{
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])
{
auto packet = worldCtrl->GetPacket(ID_DOOR_STATE);
auto &event = events[Type::DOOR_STATE];
packet->setEvent(&event);
auto &objectList = objectLists[Type::DOOR_STATE];
packet->setObjectList(&objectList);
packet->Send(false);
if (broadcast)
@ -453,8 +453,8 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
if (changed[Type::DOOR_DESTINATION])
{
auto packet = worldCtrl->GetPacket(ID_DOOR_DESTINATION);
auto &event = events[Type::DOOR_DESTINATION];
packet->setEvent(&event);
auto &objectList = objectLists[Type::DOOR_DESTINATION];
packet->setObjectList(&objectList);
packet->Send(false);
if (broadcast)
@ -463,8 +463,8 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
if (changed[Type::OBJECT_STATE])
{
auto packet = worldCtrl->GetPacket(ID_OBJECT_STATE);
auto &event = events[Type::OBJECT_STATE];
packet->setEvent(&event);
auto &objectList = objectLists[Type::OBJECT_STATE];
packet->setObjectList(&objectList);
packet->Send(false);
if (broadcast)
@ -473,8 +473,8 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
if (changed[Type::OBJECT_SCALE])
{
auto packet = worldCtrl->GetPacket(ID_OBJECT_SCALE);
auto &event = events[Type::OBJECT_SCALE];
packet->setEvent(&event);
auto &objectList = objectLists[Type::OBJECT_SCALE];
packet->setObjectList(&objectList);
packet->Send(false);
if (broadcast)
@ -483,8 +483,8 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
if (changed[Type::OBJECT_TRAP])
{
auto packet = worldCtrl->GetPacket(ID_OBJECT_TRAP);
auto &event = events[Type::OBJECT_TRAP];
packet->setEvent(&event);
auto &objectList = objectLists[Type::OBJECT_TRAP];
packet->setObjectList(&objectList);
packet->Send(false);
if (broadcast)
@ -493,8 +493,8 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
if (changed[Type::OBJECT_LOCK])
{
auto packet = worldCtrl->GetPacket(ID_OBJECT_LOCK);
auto &event = events[Type::OBJECT_LOCK];
packet->setEvent(&event);
auto &objectList = objectLists[Type::OBJECT_LOCK];
packet->setObjectList(&objectList);
packet->Send(false);
if (broadcast)
@ -503,8 +503,8 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
if (changed[Type::OBJECT_DELETE])
{
auto packet = worldCtrl->GetPacket(ID_OBJECT_DELETE);
auto &event = events[Type::OBJECT_DELETE];
packet->setEvent(&event);
auto &objectList = objectLists[Type::OBJECT_DELETE];
packet->setObjectList(&objectList);
packet->Send(false);
if (broadcast)
@ -513,8 +513,8 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
if (changed[Type::OBJECT_SCALE])
{
auto packet = worldCtrl->GetPacket(ID_OBJECT_SPAWN);
auto &event = events[Type::OBJECT_SCALE];
packet->setEvent(&event);
auto &objectList = objectLists[Type::OBJECT_SCALE];
packet->setObjectList(&objectList);
packet->Send(false);
if (broadcast)
@ -523,8 +523,8 @@ void ObjectController::sendObjects(shared_ptr<Player> player, shared_ptr<vector<
if (changed[Type::OBJECT_PLACE])
{
auto packet = worldCtrl->GetPacket(ID_OBJECT_PLACE);
auto &event = events[Type::OBJECT_PLACE];
packet->setEvent(&event);
auto &objectList = objectLists[Type::OBJECT_PLACE];
packet->setObjectList(&objectList);
packet->Send(false);
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)
{
mwmp::BaseEvent event;
event.cell = cell;
event.consoleCommand = consoleCommand;
event.guid = player->guid;
mwmp::BaseObjectList objectList;
objectList.cell = cell;
objectList.consoleCommand = consoleCommand;
objectList.guid = player->guid;
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);
packet->setEvent(&event);
packet->setObjectList(&objectList);
packet->Send(false);
if (broadcast)
@ -556,20 +556,20 @@ void ObjectController::sendContainers(shared_ptr<Player> player, shared_ptr<vect
const ESM::Cell &cell, bool broadcast)
{
mwmp::BaseEvent event;
event.cell = cell;
event.action = mwmp::BaseEvent::Action::Set;
event.guid = player->guid;
mwmp::BaseObjectList objectList;
objectList.cell = cell;
objectList.action = mwmp::BaseObjectList::Action::Set;
objectList.guid = player->guid;
for (auto &object : *objects)
{
bool validNewObjOrCopy = (!object->copied && object->changedBase) || object->copied;
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);
packet->setEvent(&event);
packet->setObjectList(&objectList);
packet->Send(false);
if (broadcast)
@ -578,12 +578,12 @@ void ObjectController::sendContainers(shared_ptr<Player> player, shared_ptr<vect
void ObjectController::requestContainers(shared_ptr<Player> player)
{
mwmp::BaseEvent event;
event.action = mwmp::BaseEvent::Action::Request;
event.guid = player->guid;
event.cell = player->cell;
mwmp::BaseObjectList objectList;
objectList.action = mwmp::BaseObjectList::Action::Request;
objectList.guid = player->guid;
objectList.cell = player->cell;
auto packet = mwmp::Networking::get().getObjectPacketController()->GetPacket(ID_CONTAINER);
packet->setEvent(&event);
packet->Send(event.guid);
packet->setObjectList(&objectList);
packet->Send(objectList.guid);
}

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

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

@ -18,9 +18,9 @@ namespace mwmp
{
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)
}
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_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
// container packets to ensure their integrity based on what exists in the
// server data
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);

@ -13,16 +13,16 @@ namespace mwmp
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);
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);
objCtrl.sendObjects(player, objects, event.cell);
objCtrl.sendObjects(player, objects, objectList.cell);
}
};
}

@ -13,18 +13,18 @@ namespace mwmp
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());
packet.Send(true);
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);
objCtrl.sendObjects(player, objects, event.cell);
objCtrl.sendObjects(player, objects, objectList.cell);
}
};
}

@ -13,18 +13,18 @@ namespace mwmp
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());
packet.Send(true);
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);
objCtrl.sendObjects(player, objects, event.cell);
objCtrl.sendObjects(player, objects, objectList.cell);
}
};
}

@ -14,11 +14,11 @@ namespace mwmp
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());
for (auto & object : event.worldObjects)
for (auto & object : objectList.baseObjects)
object.mpNum = mwmp::Networking::getPtr()->incrementMpNum();
// Send this packet back to the original sender with the mpNum generation from above,
@ -27,11 +27,11 @@ namespace mwmp
packet.Send(true);
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);
objCtrl.sendObjects(player, objects, event.cell);
objCtrl.sendObjects(player, objects, objectList.cell);
}
};
}

@ -13,18 +13,18 @@ namespace mwmp
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());
packet.Send(true);
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);
objCtrl.sendObjects(player, objects, event.cell);
objCtrl.sendObjects(player, objects, objectList.cell);
}
};
}

@ -14,11 +14,11 @@ namespace mwmp
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());
for (auto & object : event.worldObjects)
for (auto & object : objectList.baseObjects)
object.mpNum = mwmp::Networking::getPtr()->incrementMpNum();
// Send this packet back to the original sender with the mpNum generation from above,
@ -27,11 +27,11 @@ namespace mwmp
packet.Send(true);
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);
objCtrl.sendObjects(player, objects, event.cell);
objCtrl.sendObjects(player, objects, objectList.cell);
}
};
}

@ -13,18 +13,18 @@ namespace mwmp
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());
packet.Send(true);
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);
objCtrl.sendObjects(player, objects, event.cell);
objCtrl.sendObjects(player, objects, objectList.cell);
}
};
}

@ -13,18 +13,18 @@ namespace mwmp
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());
packet.Send(true);
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);
objCtrl.sendObjects(player, objects, event.cell);
objCtrl.sendObjects(player, objects, objectList.cell);
}
};
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -13,43 +13,43 @@ namespace mwmp
BPP_INIT(ID_CONTAINER)
}
virtual void Do(ObjectPacket &packet, WorldEvent &event)
virtual void Do(ObjectPacket &packet, ObjectList &objectList)
{
BaseObjectProcessor::Do(packet, event);
BaseObjectProcessor::Do(packet, objectList);
LOG_APPEND(Log::LOG_VERBOSE, "- action: %i, containerSubAction: %i", (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 (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",
event.cell.getDescription().c_str());
event.reset();
event.cell = *ptrCellStore->getCell();
event.action = BaseEvent::Action::Set;
event.addAllContainers(ptrCellStore);
event.sendContainer();
objectList.cell.getDescription().c_str());
objectList.reset();
objectList.cell = *ptrCellStore->getCell();
objectList.action = BaseObjectList::Action::Set;
objectList.addAllContainers(ptrCellStore);
objectList.sendContainer();
}
else
{
LOG_APPEND(Log::LOG_VERBOSE, "- Request was for %i %s", event.worldObjects.size(), event.worldObjects.size() == 1 ? "object" : "objects");
std::vector<WorldObject> requestObjects = event.worldObjects;
event.reset();
event.cell = *ptrCellStore->getCell();
event.action = mwmp::BaseEvent::Action::Set;
event.addRequestedContainers(ptrCellStore, requestObjects);
if (event.worldObjects.size() > 0)
event.sendContainer();
LOG_APPEND(Log::LOG_VERBOSE, "- Request was for %i %s", objectList.baseObjects.size(), objectList.baseObjects.size() == 1 ? "object" : "objects");
std::vector<BaseObject> requestObjects = objectList.baseObjects;
objectList.reset();
objectList.cell = *ptrCellStore->getCell();
objectList.action = mwmp::BaseObjectList::Action::Set;
objectList.addRequestedContainers(ptrCellStore, requestObjects);
if (objectList.baseObjects.size() > 0)
objectList.sendContainer();
}
}
// Otherwise, edit containers based on the information received
else
{
LOG_APPEND(Log::LOG_VERBOSE, "- Editing container contents to match those of packet");
event.editContainers(ptrCellStore);
objectList.editContainers(ptrCellStore);
}
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -10,7 +10,7 @@ namespace mwmp
public:
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;
}
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:
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;
}
void PacketObjectAnimPlay::Object(WorldObject &worldObject, bool send)
void PacketObjectAnimPlay::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(worldObject, send);
RW(worldObject.animGroup, send);
RW(worldObject.animMode, send);
ObjectPacket::Object(baseObject, send);
RW(baseObject.animGroup, send);
RW(baseObject.animMode, send);
}

@ -10,7 +10,7 @@ namespace mwmp
public:
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;
}
void PacketObjectAttach::Object(WorldObject &worldObject, bool send)
void PacketObjectAttach::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(worldObject, send);
ObjectPacket::Object(baseObject, send);
// Placeholder
}

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

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

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

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

@ -10,7 +10,7 @@ namespace mwmp
public:
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;
}
void PacketObjectMove::Object(WorldObject &worldObject, bool send)
void PacketObjectMove::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(worldObject, send);
RW(worldObject.position.pos, send);
ObjectPacket::Object(baseObject, send);
RW(baseObject.position.pos, send);
}

@ -10,7 +10,7 @@ namespace mwmp
public:
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;
}
void PacketObjectPlace::Object(WorldObject &worldObject, bool send)
void PacketObjectPlace::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(worldObject, send);
RW(worldObject.count, send);
RW(worldObject.charge, send);
RW(worldObject.enchantmentCharge, send);
RW(worldObject.goldValue, send);
RW(worldObject.position, send);
RW(worldObject.droppedByPlayer, send);
ObjectPacket::Object(baseObject, send);
RW(baseObject.count, send);
RW(baseObject.charge, send);
RW(baseObject.enchantmentCharge, send);
RW(baseObject.goldValue, send);
RW(baseObject.position, send);
RW(baseObject.droppedByPlayer, send);
}

@ -10,7 +10,7 @@ namespace mwmp
public:
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;
}
void PacketObjectReset::Object(WorldObject &worldObject, bool send)
void PacketObjectReset::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(worldObject, send);
ObjectPacket::Object(baseObject, send);
// Placeholder
}

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

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

@ -10,7 +10,7 @@ namespace mwmp
public:
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;
}
void PacketObjectScale::Object(WorldObject &worldObject, bool send)
void PacketObjectScale::Object(BaseObject &baseObject, bool send)
{
ObjectPacket::Object(worldObject, send);
RW(worldObject.scale, send);
ObjectPacket::Object(baseObject, send);
RW(baseObject.scale, send);
}

@ -10,7 +10,7 @@ namespace mwmp
public:
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