[Server] Add OnActorAI event and remove autosync for ActorAI packets

remotes/1728160796594174844/tmp_0.7.0-alpha
David Cernat 7 years ago
parent 8f745df055
commit 837c5369c0

@ -85,12 +85,13 @@ set(SERVER_HEADER
source_group(tes3mp-server FILES ${SERVER} ${SERVER_HEADER})
set(PROCESSORS_ACTOR
processors/actor/ProcessorActorAnimFlags.hpp processors/actor/ProcessorActorAnimPlay.hpp
processors/actor/ProcessorActorAttack.hpp processors/actor/ProcessorActorCellChange.hpp
processors/actor/ProcessorActorDeath.hpp processors/actor/ProcessorActorEquipment.hpp
processors/actor/ProcessorActorInteraction.hpp processors/actor/ProcessorActorList.hpp
processors/actor/ProcessorActorPosition.hpp processors/actor/ProcessorActorSpeech.hpp
processors/actor/ProcessorActorStatsDynamic.hpp processors/actor/ProcessorActorTest.hpp
processors/actor/ProcessorActorAI.hpp processors/actor/ProcessorActorAnimFlags.hpp
processors/actor/ProcessorActorAnimPlay.hpp processors/actor/ProcessorActorAttack.hpp
processors/actor/ProcessorActorCellChange.hpp processors/actor/ProcessorActorDeath.hpp
processors/actor/ProcessorActorEquipment.hpp processors/actor/ProcessorActorInteraction.hpp
processors/actor/ProcessorActorList.hpp processors/actor/ProcessorActorPosition.hpp
processors/actor/ProcessorActorSpeech.hpp processors/actor/ProcessorActorStatsDynamic.hpp
processors/actor/ProcessorActorTest.hpp
)
source_group(tes3mp-server\\processors\\actor FILES ${PROCESSORS_ACTOR})

@ -192,6 +192,7 @@ public:
{"OnVideoPlay", Function<void, unsigned short, const char*>()},
{"OnActorList", Function<void, unsigned short, const char*>()},
{"OnActorEquipment", Function<void, unsigned short, const char*>()},
{"OnActorAI", Function<void, unsigned short, const char*>()},
{"OnActorDeath", Function<void, unsigned short, const char*>()},
{"OnActorCellChange", Function<void, unsigned short, const char*>()},
{"OnActorTest", Function<void, unsigned short, const char*>()},

@ -15,11 +15,12 @@ namespace mwmp
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)
serverCell->sendToLoaded(&packet, &actorList);
if (serverCell != nullptr)
{
Script::Call<Script::CallbackIdentity("OnActorAI")>(player.getId(), actorList.cell.getDescription().c_str());
}
}
};
}

Loading…
Cancel
Save