Move mailbox closing to its script (#740)

This commit is contained in:
David Markowitz 2022-08-18 19:42:52 -07:00 committed by GitHub
parent c05562a227
commit ceb374591f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 6 deletions

View File

@ -4745,12 +4745,6 @@ void GameMessages::HandleFireEventServerSide(RakNet::BitStream* inStream, Entity
return;
}
if (args == u"toggleMail") {
AMFArrayValue args;
args.InsertValue("visible", new AMFFalseValue());
GameMessages::SendUIMessageServerToSingleClient(entity, sysAddr, "ToggleMail", &args);
}
// This should probably get it's own "ServerEvents" system or something at some point
if (args == u"ZonePlayer") {
// Should probably check to make sure they're using a launcher at some point before someone makes a hack that lets you testmap

View File

@ -9,3 +9,11 @@ void MailBoxServer::OnUse(Entity* self, Entity* user) {
args.InsertValue("state", value);
GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), "pushGameState", &args);
}
void MailBoxServer::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) {
if (args == "toggleMail") {
AMFArrayValue args;
args.InsertValue("visible", new AMFFalseValue());
GameMessages::SendUIMessageServerToSingleClient(sender, sender->GetSystemAddress(), "ToggleMail", &args);
}
}

View File

@ -12,4 +12,5 @@ public:
* @param user The user that interacted with this Entity.
*/
void OnUse(Entity* self, Entity* user) override;
void OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) override;
};