1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 21:49:55 +00:00
openmw-tes3mp/apps/openmw-mp/processors/object/ProcessorObjectDelete.hpp
David Cernat 524363702c Merge pull request #451 from TES3MP/0.6.3 while resolving conflicts
# Conflicts:
#	apps/openmw-mp/Networking.cpp
#	apps/openmw-mp/main.cpp
#	apps/openmw-mp/processors/object/ProcessorObjectDelete.hpp
2018-06-21 22:31:10 +03:00

28 lines
860 B
C++

#ifndef OPENMW_PROCESSOROBJECTDELETE_HPP
#define OPENMW_PROCESSOROBJECTDELETE_HPP
#include "../ObjectProcessor.hpp"
namespace mwmp
{
class ProcessorObjectDelete final: public ObjectProcessor
{
public:
ProcessorObjectDelete()
{
BPP_INIT(ID_OBJECT_DELETE)
}
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());
auto objCtrl = Networking::get().getState().getObjectCtrl();
auto objects = objCtrl.copyObjects(objectList);
Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_OBJECT_DELETE>(player.get(), objects);
}
};
}
#endif //OPENMW_PROCESSOROBJECTDELETE_HPP