2017-05-29 01:43:52 +00:00
|
|
|
#ifndef OPENMW_PROCESSOROBJECTSPAWN_HPP
|
|
|
|
#define OPENMW_PROCESSOROBJECTSPAWN_HPP
|
|
|
|
|
2018-05-15 19:07:06 +00:00
|
|
|
#include "../ObjectProcessor.hpp"
|
2017-05-29 01:43:52 +00:00
|
|
|
#include <apps/openmw-mp/Networking.hpp>
|
|
|
|
|
|
|
|
namespace mwmp
|
|
|
|
{
|
2018-05-15 19:07:06 +00:00
|
|
|
class ProcessorObjectSpawn : public ObjectProcessor
|
2017-05-29 01:43:52 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
ProcessorObjectSpawn()
|
|
|
|
{
|
|
|
|
BPP_INIT(ID_OBJECT_SPAWN)
|
|
|
|
}
|
|
|
|
|
2018-05-12 21:42:24 +00:00
|
|
|
void Do(ObjectPacket &packet, Player &player, BaseObjectList &objectList) override
|
2017-05-29 01:43:52 +00:00
|
|
|
{
|
2019-08-19 18:39:33 +00:00
|
|
|
LOG_MESSAGE_SIMPLE(TimedLog::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str());
|
2017-05-29 01:43:52 +00:00
|
|
|
|
2018-05-12 21:42:24 +00:00
|
|
|
for (unsigned int i = 0; i < objectList.baseObjectCount; i++)
|
2017-05-29 01:43:52 +00:00
|
|
|
{
|
2018-05-12 21:42:24 +00:00
|
|
|
objectList.baseObjects.at(i).mpNum = mwmp::Networking::getPtr()->incrementMpNum();
|
2017-05-29 01:43:52 +00:00
|
|
|
}
|
|
|
|
|
2018-05-12 21:42:24 +00:00
|
|
|
Script::Call<Script::CallbackIdentity("OnObjectSpawn")>(player.getId(), objectList.cell.getDescription().c_str());
|
2017-05-29 01:43:52 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //OPENMW_PROCESSOROBJECTSPAWN_HPP
|