mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 22:23:50 +00:00
b5922d18fd
# Conflicts: # apps/openmw-mp/Networking.cpp # apps/openmw-mp/Script/Functions/Objects.cpp # apps/openmw-mp/Script/Functions/Objects.hpp # apps/openmw-mp/processors/ObjectProcessor.cpp # apps/openmw-mp/processors/object/ProcessorContainer.hpp # apps/openmw-mp/processors/object/ProcessorDoorState.hpp # apps/openmw-mp/processors/object/ProcessorMusicPlay.hpp # apps/openmw-mp/processors/object/ProcessorObjectAnimPlay.hpp # apps/openmw-mp/processors/object/ProcessorObjectDelete.hpp # apps/openmw-mp/processors/object/ProcessorObjectLock.hpp # apps/openmw-mp/processors/object/ProcessorObjectMove.hpp # apps/openmw-mp/processors/object/ProcessorObjectPlace.hpp # apps/openmw-mp/processors/object/ProcessorObjectRotate.hpp # apps/openmw-mp/processors/object/ProcessorObjectScale.hpp # apps/openmw-mp/processors/object/ProcessorObjectSpawn.hpp # apps/openmw-mp/processors/object/ProcessorObjectState.hpp # apps/openmw-mp/processors/object/ProcessorObjectTrap.hpp # apps/openmw-mp/processors/object/ProcessorScriptGlobalFloat.hpp # apps/openmw-mp/processors/object/ProcessorScriptGlobalShort.hpp # apps/openmw-mp/processors/object/ProcessorScriptLocalFloat.hpp # apps/openmw-mp/processors/object/ProcessorScriptLocalShort.hpp # apps/openmw-mp/processors/object/ProcessorScriptMemberFloat.hpp # apps/openmw-mp/processors/object/ProcessorScriptMemberShort.hpp # apps/openmw-mp/processors/object/ProcessorVideoPlay.hpp # apps/openmw/mwmp/Networking.cpp # apps/openmw/mwmp/processors/object/BaseObjectProcessor.hpp # apps/openmw/mwmp/processors/object/ProcessorMusicPlay.hpp # apps/openmw/mwmp/processors/object/ProcessorScriptGlobalFloat.hpp # apps/openmw/mwmp/processors/object/ProcessorScriptGlobalShort.hpp # apps/openmw/mwmp/processors/object/ProcessorScriptMemberFloat.hpp # apps/openmw/mwmp/processors/object/ProcessorScriptMemberShort.hpp # apps/openmw/mwmp/processors/object/ProcessorVideoPlay.hpp
37 lines
1.2 KiB
C++
37 lines
1.2 KiB
C++
#ifndef OPENMW_PROCESSORCONTAINER_HPP
|
|
#define OPENMW_PROCESSORCONTAINER_HPP
|
|
|
|
#include <apps/openmw-mp/Object.hpp>
|
|
#include "../ObjectProcessor.hpp"
|
|
|
|
|
|
namespace mwmp
|
|
{
|
|
class ProcessorContainer final: public ObjectProcessor
|
|
{
|
|
public:
|
|
ProcessorContainer()
|
|
{
|
|
BPP_INIT(ID_CONTAINER)
|
|
}
|
|
|
|
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) 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(objectList);
|
|
|
|
Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_CONTAINER>(player, containers);
|
|
|
|
LOG_APPEND(Log::LOG_INFO, "- Finished processing ID_CONTAINER");
|
|
}
|
|
};
|
|
}
|
|
|
|
#endif //OPENMW_PROCESSORCONTAINER_HPP
|