1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-26 12:09:41 +00:00
openmw-tes3mp/apps/openmw-mp/processors/world/ProcessorContainer.hpp
David Cernat f50637bdd4 Merge pull request #401 from TES3MP/0.6.3 while resolving conflicts
# Conflicts:
#	apps/openmw-mp/processors/world/ProcessorContainer.hpp
#	apps/openmw/mwmp/WorldEvent.cpp
2018-04-03 02:17:12 +03:00

37 lines
1.2 KiB
C++

#ifndef OPENMW_PROCESSORCONTAINER_HPP
#define OPENMW_PROCESSORCONTAINER_HPP
#include <apps/openmw-mp/Object.hpp>
#include "../WorldProcessor.hpp"
namespace mwmp
{
class ProcessorContainer final: public WorldProcessor
{
public:
ProcessorContainer()
{
BPP_INIT(ID_CONTAINER)
}
void Do(WorldPacket &packet, const std::shared_ptr<Player> &player, BaseEvent &event) 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);
// 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);
Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_CONTAINER>(player, containers);
LOG_APPEND(Log::LOG_INFO, "- Finished processing ID_CONTAINER");
}
};
}
#endif //OPENMW_PROCESSORCONTAINER_HPP