mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
Converts the property messages to NetGameMsgs in PropertyMessages.{h,cpp}.
Sent: OpenPropertyVendor, OpenPropertyManagement, DownloadPropertyData
(replaces PropertyDataMessage, now with the client's PropertyData field
names), PropertyRentalResponse, PropertyEntranceBegin,
PropertySelectQuery (replaces PropertySelectQueryProperty with the
client's PropertyInfo), GetModelsOnProperty, PlaceModelResponse and
HandleUGCEquipPre/PostDeleteBasedOnEditMode. Received, registered in
GameMessageHandler's map: SetPropertyAccess,
UpdatePropertyOrModelForFilterCheck, QueryPropertyData,
PropertyEditorBegin/End, PropertyContentsFromClient,
ZonePropertyModelEquipped/Rotated, PlacePropertyModel,
UpdateModelFromClient, DeleteModelFromClient, ControlBehaviors,
PropertyEntranceSync, EnterProperty1, UpdatePropertyPerformanceCost,
ReportOffensiveModel/Property and GetHotPropertyData. The news screen's
NewsSendHotPropertiesInfoToClient moves here with the top properties
lookup; the dashboard's player reports now take the decoded text.
Handlers keep their logic and hand the work to PropertyManagementComponent,
PropertyVendorComponent, PropertyEntranceComponent and
MultiZoneEntranceComponent as before. Messages whose payload DLU ignored
(PropertyEditorBegin, PropertyContentsFromClient, ZonePropertyModel*)
now read it with the client's layout. The never-called
SendZonePropertyModelEquipped (which wrote no default flags) is gone.
No wire change and no change in recipients. Verified byte for byte
against a frozen verbatim copy of the old functions, PropertyDataMessage
and PropertySelectQueryProperty over an input grid (to one client and
broadcast), received messages compared with the old handlers' read
sequences with every truncated payload rejected, hand computed golden
bytes, round trips and a mutation check. Layouts confirmed against the
1.10.64 client in Ghidra. Known wire bug kept as is: PlaceModelResponse
writes response where the client reads a rotation quaternion
(PlaceModelResponse::Deserialize 0x00dc0170).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
79 lines
2.7 KiB
C++
79 lines
2.7 KiB
C++
#pragma once
|
|
|
|
#include <map>
|
|
|
|
#include "Component.h"
|
|
#include "Entity.h"
|
|
#include "EntityManager.h"
|
|
#include "GameMessages.h"
|
|
#include "PropertyMessages.h"
|
|
#include "eReplicaComponentType.h"
|
|
|
|
/**
|
|
* Represents the launch pad that's used to select and browse properties
|
|
*/
|
|
class PropertyEntranceComponent final : public Component {
|
|
public:
|
|
explicit PropertyEntranceComponent(Entity* parent, const int32_t componentID);
|
|
static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::PROPERTY_ENTRANCE;
|
|
|
|
/**
|
|
* Handles an OnUse request for some other entity, rendering the property browse menu
|
|
* @param entity the entity that triggered the event
|
|
*/
|
|
void OnUse(Entity* entity) override;
|
|
|
|
/**
|
|
* Handles the event triggered when the entity selects a property to visit and makes the entity to there
|
|
* @param entity the entity that triggered the event
|
|
* @param index the index of the property property
|
|
* @param returnToZone whether or not the entity wishes to go back to the launch zone
|
|
* @param sysAddr the address to send gamemessage responses to
|
|
*/
|
|
void OnEnterProperty(Entity* entity, uint32_t index, bool returnToZone, const SystemAddress& sysAddr);
|
|
|
|
/**
|
|
* Handles a request for information on available properties when an entity lands on the property
|
|
* @param entity the entity that triggered the event
|
|
* @param includeNullAddress unused
|
|
* @param includeNullDescription unused
|
|
* @param playerOwn only query properties owned by the entity
|
|
* @param updateUi unused
|
|
* @param numResults unused
|
|
* @param lReputationTime unused
|
|
* @param sortMethod unused
|
|
* @param startIndex the minimum index to start the query off
|
|
* @param filterText property names to search for
|
|
* @param sysAddr the address to send gamemessage responses to
|
|
*/
|
|
void OnPropertyEntranceSync(Entity* entity, bool includeNullAddress, bool includeNullDescription, bool playerOwn, bool updateUi, int32_t numResults, int32_t lReputationTime, int32_t sortMethod, int32_t startIndex, std::string filterText, const SystemAddress& sysAddr);
|
|
|
|
/**
|
|
* Returns the name of this property
|
|
* @return the name of this property
|
|
*/
|
|
[[nodiscard]] std::string GetPropertyName() const { return m_PropertyName; };
|
|
|
|
/**
|
|
* Returns the map ID for this property
|
|
* @return the map ID for this property
|
|
*/
|
|
[[nodiscard]] LWOMAPID GetMapID() const noexcept { return m_MapID; };
|
|
|
|
private:
|
|
/**
|
|
* Cache of property information that was queried for property launched, indexed by property ID
|
|
*/
|
|
std::map<LWOOBJID, std::vector<GameMessages::PropertySelectQuery::PropertyInfo>> propertyQueries;
|
|
|
|
/**
|
|
* The custom name for this property
|
|
*/
|
|
std::string m_PropertyName;
|
|
|
|
/**
|
|
* The base map ID for this property (Avant Grove, etc).
|
|
*/
|
|
LWOMAPID m_MapID;
|
|
};
|