From 7f0549fc4f1c9e4749389095009ffab6ce076cfd Mon Sep 17 00:00:00 2001 From: David Cernat Date: Fri, 6 Jul 2018 23:37:57 +0300 Subject: [PATCH] [Server] Remove hardcoded sync for VideoPlay and add OnVideoPlay event --- apps/openmw-mp/Script/ScriptFunctions.hpp | 1 + apps/openmw-mp/processors/object/ProcessorVideoPlay.hpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/apps/openmw-mp/Script/ScriptFunctions.hpp b/apps/openmw-mp/Script/ScriptFunctions.hpp index b52271e00..52296e532 100644 --- a/apps/openmw-mp/Script/ScriptFunctions.hpp +++ b/apps/openmw-mp/Script/ScriptFunctions.hpp @@ -337,6 +337,7 @@ public: {"OnObjectLock", Function()}, {"OnObjectScale", Function()}, {"OnObjectTrap", Function()}, + {"OnVideoPlay", Function()}, {"OnActorList", Function()}, {"OnActorEquipment", Function()}, {"OnActorDeath", Function()}, diff --git a/apps/openmw-mp/processors/object/ProcessorVideoPlay.hpp b/apps/openmw-mp/processors/object/ProcessorVideoPlay.hpp index 55a59fbac..da0f02ca4 100644 --- a/apps/openmw-mp/processors/object/ProcessorVideoPlay.hpp +++ b/apps/openmw-mp/processors/object/ProcessorVideoPlay.hpp @@ -12,6 +12,13 @@ namespace mwmp { BPP_INIT(ID_VIDEO_PLAY) } + + void Do(ObjectPacket &packet, Player &player, BaseObjectList &objectList) override + { + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str()); + + Script::Call(player.getId(), objectList.cell.getDescription().c_str()); + } }; }