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