From afa704ce95a345f27f3d2718b67be42fab02d2fd Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sat, 14 Sep 2019 13:09:01 +0300 Subject: [PATCH] [Server] Add OnScriptGlobalShort event --- apps/openmw-mp/Script/ScriptFunctions.hpp | 3 ++- .../processors/object/ProcessorScriptGlobalShort.hpp | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/openmw-mp/Script/ScriptFunctions.hpp b/apps/openmw-mp/Script/ScriptFunctions.hpp index fbb12dfbd..a69c7f5c0 100644 --- a/apps/openmw-mp/Script/ScriptFunctions.hpp +++ b/apps/openmw-mp/Script/ScriptFunctions.hpp @@ -207,7 +207,8 @@ public: {"OnGUIAction", Callback()}, {"OnWorldKillCount", Callback()}, {"OnWorldMap", Callback()}, - {"OnWorldWeather", Callback() }, + {"OnWorldWeather", Callback()}, + {"OnScriptGlobalShort", Callback()}, {"OnMpNumIncrement", Callback()}, {"OnRequestDataFileList", Callback<>()} }; diff --git a/apps/openmw-mp/processors/object/ProcessorScriptGlobalShort.hpp b/apps/openmw-mp/processors/object/ProcessorScriptGlobalShort.hpp index bd59f452c..88e8cf037 100644 --- a/apps/openmw-mp/processors/object/ProcessorScriptGlobalShort.hpp +++ b/apps/openmw-mp/processors/object/ProcessorScriptGlobalShort.hpp @@ -12,6 +12,13 @@ namespace mwmp { BPP_INIT(ID_SCRIPT_GLOBAL_SHORT) } + + void Do(ObjectPacket &packet, Player &player, BaseObjectList &objectList) override + { + LOG_MESSAGE_SIMPLE(TimedLog::LOG_INFO, "Received %s from %s", strPacketID.c_str(), player.npc.mName.c_str()); + + Script::Call(player.getId()); + } }; }