mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 05:27:19 +00:00
Merge pull request #461 from EmosewaMC/mailboxSpecialCase
Addressed special case in GameMessage for interacting with a mailbox
This commit is contained in:
commit
a49f9dc586
@ -4992,17 +4992,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) {
|
||||
|
@ -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")
|
||||
|
12
dScripts/MailBoxServer.cpp
Normal file
12
dScripts/MailBoxServer.cpp
Normal file
@ -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;
|
||||
}
|
15
dScripts/MailBoxServer.h
Normal file
15
dScripts/MailBoxServer.h
Normal file
@ -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;
|
||||
};
|
Loading…
Reference in New Issue
Block a user