mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 19:03:43 +00:00
Live sent the launchpad's FireEventClientSide("RocketEquipped") to every
client in the zone: 1,196 of 1,265 captured were other players'
launches. On each client it starts that player's launch
(LWORocketLaunchComponentCommon::msgFireEventClientSide sends
BeginLaunch to the sender), so others see the rocket take off; DLU sent
it only to the launcher. param1 is the property clone for property
launches (7 of 7 equal the clone in the following TransferToZone) and
param2 the picked world of a LUP entrance (0-3, one pad only).
The capture notes read the RocketEquipped and ChangeObjectWorldState
seen before LEVEL_LOAD_COMPLETE as the arriving player's own rocket:
all 21 are other players launching (their sender is never the loading
player), so arrival itself is left as it is.
Check: with two players at a launchpad, launch one: the other sees the
rocket launch animation; launch to a property and to a LUP world and
land in the right place.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
39 lines
1.4 KiB
C++
39 lines
1.4 KiB
C++
#include "MultiZoneEntranceComponent.h"
|
|
#include "PropertyMessages.h"
|
|
#include "RocketLaunchpadControlComponent.h"
|
|
#include "InventoryComponent.h"
|
|
#include "CharacterComponent.h"
|
|
|
|
MultiZoneEntranceComponent::MultiZoneEntranceComponent(Entity* parent, const int32_t componentID) : Component(parent, componentID) {
|
|
m_Parent = parent;
|
|
std::string zoneString = GeneralUtils::UTF16ToWTF8(m_Parent->GetVar<std::u16string>(u"MultiZoneIDs"));
|
|
std::stringstream ss(zoneString);
|
|
for (int i; ss >> i;) {
|
|
m_LUPWorlds.push_back(i);
|
|
if (ss.peek() == ';')
|
|
ss.ignore();
|
|
}
|
|
}
|
|
|
|
MultiZoneEntranceComponent::~MultiZoneEntranceComponent() {}
|
|
|
|
void MultiZoneEntranceComponent::OnUse(Entity* originator) {
|
|
auto* const characterComponent = originator->GetComponent<CharacterComponent>();
|
|
if (!characterComponent) return;
|
|
|
|
auto* rocket = characterComponent->RocketEquip(originator);
|
|
if (!rocket) return;
|
|
|
|
// the LUP world menu is just the property menu, the client knows how to handle it
|
|
GameMessages::PropertyEntranceBegin msg;
|
|
msg.target = m_Parent->GetObjectID();
|
|
msg.Send(originator->GetSystemAddress());
|
|
}
|
|
|
|
void MultiZoneEntranceComponent::OnSelectWorld(Entity* originator, uint32_t index) {
|
|
auto* rocketLaunchpadControlComponent = m_Parent->GetComponent<RocketLaunchpadControlComponent>();
|
|
if (!rocketLaunchpadControlComponent || index >= m_LUPWorlds.size()) return;
|
|
|
|
rocketLaunchpadControlComponent->Launch(originator, m_LUPWorlds[index], 0, static_cast<int32_t>(index));
|
|
}
|