From f9feaf05f032681100e77e6df0f04adb7915f93f Mon Sep 17 00:00:00 2001 From: David Cernat Date: Wed, 25 Jan 2017 05:30:25 +0200 Subject: [PATCH] [Server] Add script callbacks for object placement and deletion --- apps/openmw-mp/Networking.cpp | 12 ++++++++++++ apps/openmw-mp/Script/Functions/Quests.hpp | 1 + apps/openmw-mp/Script/ScriptFunctions.hpp | 2 ++ 3 files changed, 15 insertions(+) diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index 97c22b7a2..668c7d09d 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -418,6 +418,12 @@ void Networking::processWorldPacket(RakNet::Packet *packet) myPacket->Read(event); myPacket->Send(event, true); + Script::Call( + player->getId(), + event->cellRef.mRefID.c_str(), + event->cellRef.mRefNum.mIndex, + event->cell.getDescription().c_str()); + break; } @@ -435,6 +441,12 @@ void Networking::processWorldPacket(RakNet::Packet *packet) myPacket->Send(event, true); + Script::Call( + player->getId(), + event->cellRef.mRefID.c_str(), + event->cellRef.mRefNum.mIndex, + event->cell.getDescription().c_str()); + break; } diff --git a/apps/openmw-mp/Script/Functions/Quests.hpp b/apps/openmw-mp/Script/Functions/Quests.hpp index 656bfb83d..d8fa18286 100644 --- a/apps/openmw-mp/Script/Functions/Quests.hpp +++ b/apps/openmw-mp/Script/Functions/Quests.hpp @@ -4,6 +4,7 @@ #define QUESTAPI \ {"GetJournalChangesSize", QuestFunctions::GetJournalChangesSize},\ \ + {"AddJournalEntry", QuestFunctions::AddJournalEntry},\ {"AddJournalIndex", QuestFunctions::AddJournalIndex},\ \ {"GetJournalItemQuest", QuestFunctions::GetJournalItemQuest},\ diff --git a/apps/openmw-mp/Script/ScriptFunctions.hpp b/apps/openmw-mp/Script/ScriptFunctions.hpp index 17a26d24c..50c973e69 100644 --- a/apps/openmw-mp/Script/ScriptFunctions.hpp +++ b/apps/openmw-mp/Script/ScriptFunctions.hpp @@ -114,6 +114,8 @@ public: {"OnPlayerChangeInventory", Function()}, {"OnPlayerChangeSpellbook", Function()}, {"OnPlayerChangeJournal", Function()}, + {"OnObjectPlace", Function()}, + {"OnObjectDelete", Function()}, {"OnPlayerSendMessage", Function()}, {"OnPlayerEndCharGen", Function()}, {"OnGUIAction", Function()}