From 5ffb57d92ca5fb50d1854d56a6d68bf12376c701 Mon Sep 17 00:00:00 2001 From: EmosewaMC <39972741+EmosewaMC@users.noreply.github.com> Date: Sun, 20 Feb 2022 19:51:21 -0800 Subject: [PATCH 1/3] Removed special case from GM --- dGame/dGameMessages/GameMessages.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/dGame/dGameMessages/GameMessages.cpp b/dGame/dGameMessages/GameMessages.cpp index c327ab83..d89d3cf3 100644 --- a/dGame/dGameMessages/GameMessages.cpp +++ b/dGame/dGameMessages/GameMessages.cpp @@ -4980,17 +4980,6 @@ void GameMessages::HandleRequestUse(RakNet::BitStream* inStream, Entity* entity, missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_MISSION_INTERACTION, interactedObject->GetLOT(), interactedObject->GetObjectID()); missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_NON_MISSION_INTERACTION, interactedObject->GetLOT(), interactedObject->GetObjectID()); - - //Do mail stuff: - if (interactedObject->GetLOT() == 3964) { - AMFStringValue* value = new AMFStringValue(); - value->SetStringValue("Mail"); - - AMFArrayValue args; - args.InsertValue("state", value); - GameMessages::SendUIMessageServerToSingleClient(entity, sysAddr, "pushGameState", &args); - delete value; - } } void GameMessages::HandlePlayEmote(RakNet::BitStream* inStream, Entity* entity) { From 6905120ac64ad98eb37a349be8053ac29a517530 Mon Sep 17 00:00:00 2001 From: EmosewaMC <39972741+EmosewaMC@users.noreply.github.com> Date: Sun, 20 Feb 2022 19:51:35 -0800 Subject: [PATCH 2/3] Added MailBoxServer files --- dScripts/MailBoxServer.cpp | 12 ++++++++++++ dScripts/MailBoxServer.h | 15 +++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 dScripts/MailBoxServer.cpp create mode 100644 dScripts/MailBoxServer.h diff --git a/dScripts/MailBoxServer.cpp b/dScripts/MailBoxServer.cpp new file mode 100644 index 00000000..3e4e9687 --- /dev/null +++ b/dScripts/MailBoxServer.cpp @@ -0,0 +1,12 @@ +#include "MailBoxServer.h" +#include "AMFFormat.h" +#include "GameMessages.h" + +void MailBoxServer::OnUse(Entity* self, Entity* user) { + AMFStringValue* value = new AMFStringValue(); + value->SetStringValue("Mail"); + AMFArrayValue args; + args.InsertValue("state", value); + GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), "pushGameState", &args); + delete value; +} \ No newline at end of file diff --git a/dScripts/MailBoxServer.h b/dScripts/MailBoxServer.h new file mode 100644 index 00000000..9cd93e24 --- /dev/null +++ b/dScripts/MailBoxServer.h @@ -0,0 +1,15 @@ +#pragma once + +#include "CppScripts.h" + +class MailBoxServer : public CppScripts::Script { +public: + /** + * When a mailbox is interacted with, this method updates the player game state + * to be in a mailbox. + * + * @param self The object that owns this script. + * @param user The user that interacted with this Entity. + */ + void OnUse(Entity* self, Entity* user) override; +}; \ No newline at end of file From 55def02c8f4f99f4554380c35fbca41478eda0ab Mon Sep 17 00:00:00 2001 From: EmosewaMC <39972741+EmosewaMC@users.noreply.github.com> Date: Sun, 20 Feb 2022 19:51:54 -0800 Subject: [PATCH 3/3] Added script to CppScripts --- dScripts/CppScripts.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dScripts/CppScripts.cpp b/dScripts/CppScripts.cpp index ca8f95cc..3b9ce5f9 100644 --- a/dScripts/CppScripts.cpp +++ b/dScripts/CppScripts.cpp @@ -162,6 +162,7 @@ #include "GrowingFlower.h" #include "BaseFootRaceManager.h" #include "PropertyPlatform.h" +#include "MailBoxServer.h" // Racing Scripts #include "RaceImagineCrateServer.h" @@ -580,6 +581,8 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr script = new PropertyPlatform(); else if (scriptName == "scripts\\02_server\\Map\\VE\\L_VE_BRICKSAMPLE_SERVER.lua") return new VeBricksampleServer(); + else if (scriptName == "scripts\\02_server\\Map\\General\\L_MAIL_BOX_SERVER.lua") + script = new MailBoxServer(); //Racing: else if (scriptName == "scripts\\ai\\RACING\\OBJECTS\\RACE_IMAGINE_CRATE_SERVER.lua")