[General] Implement ActorSpellsActive packet, part 1
The packet can now set the active spells of DedicatedActors.pull/593/head
parent
f6887559f6
commit
bf0a42fdad
@ -0,0 +1,31 @@
|
||||
#ifndef OPENMW_PROCESSORACTORSPELLSACTIVE_HPP
|
||||
#define OPENMW_PROCESSORACTORSPELLSACTIVE_HPP
|
||||
|
||||
#include "../ActorProcessor.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorActorSpellsActive : public ActorProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorActorSpellsActive()
|
||||
{
|
||||
BPP_INIT(ID_ACTOR_SPELLS_ACTIVE)
|
||||
}
|
||||
|
||||
void Do(ActorPacket &packet, Player &player, BaseActorList &actorList) override
|
||||
{
|
||||
// Send only to players who have the cell loaded
|
||||
Cell *serverCell = CellController::get()->getCell(&actorList.cell);
|
||||
|
||||
if (serverCell != nullptr && *serverCell->getAuthority() == actorList.guid)
|
||||
{
|
||||
Script::Call<Script::CallbackIdentity("OnActorSpellsActive")>(player.getId(), actorList.cell.getDescription().c_str());
|
||||
|
||||
serverCell->sendToLoaded(&packet, &actorList);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORACTORSPELLSACTIVE_HPP
|
@ -0,0 +1,25 @@
|
||||
#ifndef OPENMW_PROCESSORACTORSPELLSACTIVE_HPP
|
||||
#define OPENMW_PROCESSORACTORSPELLSACTIVE_HPP
|
||||
|
||||
#include "../ActorProcessor.hpp"
|
||||
#include "apps/openmw/mwmp/Main.hpp"
|
||||
#include "apps/openmw/mwmp/CellController.hpp"
|
||||
|
||||
namespace mwmp
|
||||
{
|
||||
class ProcessorActorSpellsActive final: public ActorProcessor
|
||||
{
|
||||
public:
|
||||
ProcessorActorSpellsActive()
|
||||
{
|
||||
BPP_INIT(ID_ACTOR_SPELLS_ACTIVE);
|
||||
}
|
||||
|
||||
virtual void Do(ActorPacket &packet, ActorList &actorList)
|
||||
{
|
||||
Main::get().getCellController()->readSpellsActive(actorList);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //OPENMW_PROCESSORACTORSPELLSACTIVE_HPP
|
Loading…
Reference in New Issue