2021-12-05 17:54:36 +00:00
|
|
|
#include "PropertyManagementComponent.h"
|
|
|
|
|
|
|
|
#include <sstream>
|
|
|
|
|
2022-07-05 06:00:10 +00:00
|
|
|
#include "MissionComponent.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
#include "EntityManager.h"
|
|
|
|
#include "PropertyDataMessage.h"
|
|
|
|
#include "UserManager.h"
|
|
|
|
#include "GameMessages.h"
|
|
|
|
#include "Character.h"
|
|
|
|
#include "CDClientDatabase.h"
|
|
|
|
#include "dZoneManager.h"
|
|
|
|
#include "Game.h"
|
|
|
|
#include "Item.h"
|
|
|
|
#include "Database.h"
|
2024-01-05 12:31:22 +00:00
|
|
|
#include "ObjectIDManager.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
#include "RocketLaunchpadControlComponent.h"
|
|
|
|
#include "PropertyEntranceComponent.h"
|
2022-12-18 15:46:04 +00:00
|
|
|
#include "InventoryComponent.h"
|
2022-07-05 06:00:10 +00:00
|
|
|
#include "eMissionTaskType.h"
|
2023-04-25 18:17:40 +00:00
|
|
|
#include "eObjectBits.h"
|
2024-01-12 17:39:51 +00:00
|
|
|
#include "CharacterComponent.h"
|
2024-01-13 09:40:56 +00:00
|
|
|
#include "PlayerManager.h"
|
2024-05-21 05:39:56 +00:00
|
|
|
#include "ItemComponent.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-05-21 05:39:56 +00:00
|
|
|
#include <ranges>
|
2021-12-05 17:54:36 +00:00
|
|
|
#include <vector>
|
|
|
|
#include "CppScripts.h"
|
|
|
|
|
|
|
|
PropertyManagementComponent* PropertyManagementComponent::instance = nullptr;
|
|
|
|
|
|
|
|
PropertyManagementComponent::PropertyManagementComponent(Entity* parent) : Component(parent) {
|
|
|
|
this->owner = LWOOBJID_EMPTY;
|
|
|
|
this->templateId = 0;
|
|
|
|
this->propertyId = LWOOBJID_EMPTY;
|
|
|
|
this->models = {};
|
|
|
|
this->propertyName = "";
|
|
|
|
this->propertyDescription = "";
|
|
|
|
this->privacyOption = PropertyPrivacyOption::Private;
|
|
|
|
this->originalPrivacyOption = PropertyPrivacyOption::Private;
|
|
|
|
|
|
|
|
instance = this;
|
|
|
|
|
2023-07-17 22:55:33 +00:00
|
|
|
const auto& worldId = Game::zoneManager->GetZone()->GetZoneID();
|
2021-12-05 17:54:36 +00:00
|
|
|
const auto zoneId = worldId.GetMapID();
|
|
|
|
const auto cloneId = worldId.GetCloneID();
|
|
|
|
|
2023-11-18 00:47:18 +00:00
|
|
|
auto query = CDClientDatabase::CreatePreppedStmt("SELECT id FROM PropertyTemplate WHERE mapID = ?;");
|
|
|
|
|
|
|
|
query.bind(1, static_cast<int32_t>(zoneId));
|
2022-01-13 03:48:27 +00:00
|
|
|
|
|
|
|
auto result = query.execQuery();
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-04-14 04:41:51 +00:00
|
|
|
if (result.eof() || result.fieldIsNull("id")) {
|
2021-12-05 17:54:36 +00:00
|
|
|
return;
|
|
|
|
}
|
2022-07-25 02:26:51 +00:00
|
|
|
|
2024-04-14 04:41:51 +00:00
|
|
|
templateId = result.getIntField("id");
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-11-18 00:47:18 +00:00
|
|
|
auto propertyInfo = Database::Get()->GetPropertyInfo(zoneId, cloneId);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-11-18 00:47:18 +00:00
|
|
|
if (propertyInfo) {
|
|
|
|
this->propertyId = propertyInfo->id;
|
|
|
|
this->owner = propertyInfo->ownerId;
|
2023-04-25 18:17:40 +00:00
|
|
|
GeneralUtils::SetBit(this->owner, eObjectBits::CHARACTER);
|
|
|
|
GeneralUtils::SetBit(this->owner, eObjectBits::PERSISTENT);
|
2023-11-18 00:47:18 +00:00
|
|
|
this->clone_Id = propertyInfo->cloneId;
|
|
|
|
this->propertyName = propertyInfo->name;
|
|
|
|
this->propertyDescription = propertyInfo->description;
|
|
|
|
this->privacyOption = static_cast<PropertyPrivacyOption>(propertyInfo->privacyOption);
|
|
|
|
this->rejectionReason = propertyInfo->rejectionReason;
|
|
|
|
this->moderatorRequested = propertyInfo->modApproved == 0 && rejectionReason == "" && privacyOption == PropertyPrivacyOption::Public;
|
|
|
|
this->LastUpdatedTime = propertyInfo->lastUpdatedTime;
|
|
|
|
this->claimedTime = propertyInfo->claimedTime;
|
|
|
|
this->reputation = propertyInfo->reputation;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
Load();
|
2022-07-25 02:26:51 +00:00
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
LWOOBJID PropertyManagementComponent::GetOwnerId() const {
|
|
|
|
return owner;
|
|
|
|
}
|
|
|
|
|
|
|
|
Entity* PropertyManagementComponent::GetOwner() const {
|
2023-07-15 20:56:33 +00:00
|
|
|
return Game::entityManager->GetEntity(owner);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PropertyManagementComponent::SetOwner(Entity* value) {
|
|
|
|
owner = value->GetObjectID();
|
|
|
|
}
|
|
|
|
|
|
|
|
std::vector<NiPoint3> PropertyManagementComponent::GetPaths() const {
|
2023-07-17 22:55:33 +00:00
|
|
|
const auto zoneId = Game::zoneManager->GetZone()->GetWorldID();
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-01-13 03:48:27 +00:00
|
|
|
auto query = CDClientDatabase::CreatePreppedStmt(
|
|
|
|
"SELECT path FROM PropertyTemplate WHERE mapID = ?;");
|
2023-12-28 04:18:20 +00:00
|
|
|
query.bind(1, static_cast<int>(zoneId));
|
2022-01-13 03:48:27 +00:00
|
|
|
|
|
|
|
auto result = query.execQuery();
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
std::vector<NiPoint3> paths{};
|
2022-07-25 02:26:51 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
if (result.eof()) {
|
|
|
|
return paths;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::vector<float> points;
|
2022-07-25 02:26:51 +00:00
|
|
|
|
2024-04-14 04:41:51 +00:00
|
|
|
std::istringstream stream(result.getStringField("path"));
|
2021-12-05 17:54:36 +00:00
|
|
|
std::string token;
|
|
|
|
|
|
|
|
while (std::getline(stream, token, ' ')) {
|
|
|
|
try {
|
|
|
|
auto value = std::stof(token);
|
|
|
|
|
|
|
|
points.push_back(value);
|
|
|
|
} catch (std::invalid_argument& exception) {
|
2023-10-21 23:31:55 +00:00
|
|
|
LOG("Failed to parse value (%s): (%s)!", token.c_str(), exception.what());
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (auto i = 0u; i < points.size(); i += 3) {
|
|
|
|
paths.emplace_back(points[i], points[i + 1], points[i + 2]);
|
|
|
|
}
|
|
|
|
|
|
|
|
return paths;
|
|
|
|
}
|
|
|
|
|
|
|
|
PropertyPrivacyOption PropertyManagementComponent::GetPrivacyOption() const {
|
|
|
|
return privacyOption;
|
|
|
|
}
|
|
|
|
|
2022-07-25 02:26:51 +00:00
|
|
|
void PropertyManagementComponent::SetPrivacyOption(PropertyPrivacyOption value) {
|
2021-12-05 17:54:36 +00:00
|
|
|
if (owner == LWOOBJID_EMPTY) return;
|
|
|
|
|
|
|
|
if (value == static_cast<PropertyPrivacyOption>(3)) // Client sends 3 for private for some reason, but expects 0 in return?
|
|
|
|
{
|
|
|
|
value = PropertyPrivacyOption::Private;
|
|
|
|
}
|
|
|
|
|
2022-03-31 03:33:37 +00:00
|
|
|
if (value == PropertyPrivacyOption::Public && privacyOption != PropertyPrivacyOption::Public) {
|
|
|
|
rejectionReason = "";
|
|
|
|
moderatorRequested = true;
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
privacyOption = value;
|
|
|
|
|
2023-11-18 00:47:18 +00:00
|
|
|
IProperty::Info info;
|
|
|
|
info.id = propertyId;
|
|
|
|
info.privacyOption = static_cast<uint32_t>(privacyOption);
|
|
|
|
info.rejectionReason = rejectionReason;
|
|
|
|
info.modApproved = 0;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-11-18 00:47:18 +00:00
|
|
|
Database::Get()->UpdatePropertyModerationInfo(info);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
2024-05-21 11:06:55 +00:00
|
|
|
void PropertyManagementComponent::UpdatePropertyDetails(UpdatePropertyWithFilterCheck& update) {
|
2021-12-05 17:54:36 +00:00
|
|
|
if (owner == LWOOBJID_EMPTY) return;
|
|
|
|
|
2024-05-21 05:39:56 +00:00
|
|
|
if (update.isProperty) {
|
|
|
|
propertyName = update.name;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-05-21 05:39:56 +00:00
|
|
|
propertyDescription = update.description;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-05-21 05:39:56 +00:00
|
|
|
IProperty::Info info;
|
|
|
|
info.id = propertyId;
|
|
|
|
info.name = propertyName;
|
|
|
|
info.description = propertyDescription;
|
|
|
|
|
|
|
|
Database::Get()->UpdatePropertyDetails(info);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-05-21 05:39:56 +00:00
|
|
|
OnQueryPropertyData(GetOwner(), UNASSIGNED_SYSTEM_ADDRESS);
|
|
|
|
} else {
|
|
|
|
auto* entity = Game::entityManager->GetEntity(update.worldId);
|
|
|
|
if (!entity) return;
|
|
|
|
|
2024-05-21 11:06:55 +00:00
|
|
|
if (update.name.empty()) {
|
|
|
|
entity->EraseVar(u"userModelName");
|
|
|
|
} else {
|
|
|
|
entity->SetVar<std::string>(u"userModelName", update.name);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (update.description.empty()) {
|
|
|
|
entity->EraseVar(u"userModelDesc");
|
|
|
|
} else {
|
|
|
|
entity->SetVar<std::string>(u"userModelDesc", update.description);
|
|
|
|
}
|
|
|
|
|
2024-05-21 05:39:56 +00:00
|
|
|
auto* owner = GetOwner();
|
|
|
|
if (!owner) return;
|
|
|
|
|
|
|
|
GameMessages::SendSetName(update.worldId, GeneralUtils::ASCIIToUTF16(update.name), owner->GetSystemAddress());
|
|
|
|
auto* itemComponent = entity->GetComponent<ItemComponent>();
|
|
|
|
if (itemComponent) {
|
|
|
|
itemComponent->UpdateDescription(GeneralUtils::ASCIIToUTF16(update.description));
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-05-21 05:39:56 +00:00
|
|
|
Game::entityManager->SerializeEntity(entity);
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
2022-03-31 04:58:59 +00:00
|
|
|
bool PropertyManagementComponent::Claim(const LWOOBJID playerId) {
|
2021-12-05 17:54:36 +00:00
|
|
|
if (owner != LWOOBJID_EMPTY) {
|
2022-03-31 04:58:59 +00:00
|
|
|
return false;
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
2023-07-15 20:56:33 +00:00
|
|
|
auto* entity = Game::entityManager->GetEntity(playerId);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-03-30 07:33:31 +00:00
|
|
|
auto character = entity->GetCharacter();
|
2022-03-31 04:58:59 +00:00
|
|
|
if (!character) return false;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-07-17 22:55:33 +00:00
|
|
|
auto* zone = Game::zoneManager->GetZone();
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
const auto& worldId = zone->GetZoneID();
|
2022-03-31 04:58:59 +00:00
|
|
|
const auto propertyZoneId = worldId.GetMapID();
|
|
|
|
const auto propertyCloneId = worldId.GetCloneID();
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-03-31 04:58:59 +00:00
|
|
|
const auto playerCloneId = character->GetPropertyCloneID();
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-03-31 04:58:59 +00:00
|
|
|
// If we are not on our clone do not allow us to claim the property
|
|
|
|
if (propertyCloneId != playerCloneId) return false;
|
|
|
|
|
2022-11-12 14:44:13 +00:00
|
|
|
std::string name = zone->GetZoneName();
|
|
|
|
std::string description = "";
|
|
|
|
|
|
|
|
auto prop_path = zone->GetPath(m_Parent->GetVarAsString(u"propertyName"));
|
|
|
|
|
2024-05-21 05:39:56 +00:00
|
|
|
if (prop_path) {
|
2022-11-12 14:44:13 +00:00
|
|
|
if (!prop_path->property.displayName.empty()) name = prop_path->property.displayName;
|
|
|
|
description = prop_path->property.displayDesc;
|
|
|
|
}
|
|
|
|
|
2022-03-31 04:58:59 +00:00
|
|
|
SetOwnerId(playerId);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
propertyId = ObjectIDManager::GenerateRandomObjectID();
|
2022-03-31 04:58:59 +00:00
|
|
|
|
2023-11-18 00:47:18 +00:00
|
|
|
IProperty::Info info;
|
|
|
|
info.id = propertyId;
|
|
|
|
info.ownerId = character->GetID();
|
|
|
|
info.cloneId = playerCloneId;
|
|
|
|
info.name = name;
|
|
|
|
info.description = description;
|
|
|
|
|
|
|
|
Database::Get()->InsertNewProperty(info, templateId, worldId);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-07-17 22:55:33 +00:00
|
|
|
auto* zoneControlObject = Game::zoneManager->GetZoneControlObject();
|
2024-03-07 01:49:29 +00:00
|
|
|
if (zoneControlObject) zoneControlObject->GetScript()->OnZonePropertyRented(zoneControlObject, entity);
|
2022-03-31 04:58:59 +00:00
|
|
|
return true;
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
2022-07-25 02:26:51 +00:00
|
|
|
void PropertyManagementComponent::OnStartBuilding() {
|
2021-12-05 17:54:36 +00:00
|
|
|
auto* ownerEntity = GetOwner();
|
|
|
|
|
|
|
|
if (ownerEntity == nullptr) return;
|
|
|
|
|
2024-01-13 09:40:56 +00:00
|
|
|
const auto players = PlayerManager::GetAllPlayers();
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
LWOMAPID zoneId = 1100;
|
|
|
|
|
2023-07-15 20:56:33 +00:00
|
|
|
const auto entrance = Game::entityManager->GetEntitiesByComponent(eReplicaComponentType::PROPERTY_ENTRANCE);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
originalPrivacyOption = privacyOption;
|
|
|
|
|
|
|
|
SetPrivacyOption(PropertyPrivacyOption::Private); // Cant visit player which is building
|
|
|
|
|
|
|
|
if (!entrance.empty()) {
|
|
|
|
auto* rocketPad = entrance[0]->GetComponent<RocketLaunchpadControlComponent>();
|
|
|
|
|
|
|
|
if (rocketPad != nullptr) {
|
|
|
|
zoneId = rocketPad->GetDefaultZone();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (auto* player : players) {
|
|
|
|
if (player == ownerEntity) continue;
|
|
|
|
|
2024-01-12 17:39:51 +00:00
|
|
|
auto* characterComponent = player->GetComponent<CharacterComponent>();
|
|
|
|
if (characterComponent) characterComponent->SendToZone(zoneId);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
2022-07-06 08:30:13 +00:00
|
|
|
auto inventoryComponent = ownerEntity->GetComponent<InventoryComponent>();
|
|
|
|
|
|
|
|
// Push equipped items
|
|
|
|
if (inventoryComponent) inventoryComponent->PushEquippedItems();
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PropertyManagementComponent::OnFinishBuilding() {
|
|
|
|
auto* ownerEntity = GetOwner();
|
|
|
|
|
|
|
|
if (ownerEntity == nullptr) return;
|
|
|
|
|
|
|
|
SetPrivacyOption(originalPrivacyOption);
|
|
|
|
|
|
|
|
UpdateApprovedStatus(false);
|
2022-03-31 05:51:09 +00:00
|
|
|
|
|
|
|
Save();
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const NiPoint3 position, NiQuaternion rotation) {
|
2023-10-21 23:31:55 +00:00
|
|
|
LOG("Placing model <%f, %f, %f>", position.x, position.y, position.z);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
auto* entity = GetOwner();
|
|
|
|
|
|
|
|
if (entity == nullptr) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
|
|
|
|
|
|
|
|
if (inventoryComponent == nullptr) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto* item = inventoryComponent->FindItemById(id);
|
|
|
|
|
|
|
|
if (item == nullptr) {
|
2023-10-21 23:31:55 +00:00
|
|
|
LOG("Failed to find item with id %d", id);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
NiQuaternion originalRotation = rotation;
|
|
|
|
|
|
|
|
const auto modelLOT = item->GetLot();
|
|
|
|
|
2024-01-29 07:53:12 +00:00
|
|
|
if (rotation != NiQuaternionConstant::IDENTITY) {
|
2021-12-05 17:54:36 +00:00
|
|
|
rotation = { rotation.w, rotation.z, rotation.y, rotation.x };
|
|
|
|
}
|
|
|
|
|
|
|
|
if (item->GetLot() == 6662) {
|
|
|
|
LWOOBJID spawnerID = item->GetSubKey();
|
|
|
|
|
|
|
|
EntityInfo info;
|
|
|
|
info.lot = 14;
|
|
|
|
info.pos = {};
|
|
|
|
info.rot = {};
|
|
|
|
info.spawner = nullptr;
|
|
|
|
info.spawnerID = spawnerID;
|
|
|
|
info.spawnerNodeID = 0;
|
|
|
|
|
|
|
|
for (auto* setting : item->GetConfig()) {
|
|
|
|
info.settings.push_back(setting->Copy());
|
|
|
|
}
|
|
|
|
|
2023-07-15 20:56:33 +00:00
|
|
|
Entity* newEntity = Game::entityManager->CreateEntity(info);
|
2021-12-05 17:54:36 +00:00
|
|
|
if (newEntity != nullptr) {
|
2023-07-15 20:56:33 +00:00
|
|
|
Game::entityManager->ConstructEntity(newEntity);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-19 21:51:35 +00:00
|
|
|
// Make sure the propMgmt doesn't delete our model after the server dies
|
|
|
|
// Trying to do this after the entity is constructed. Shouldn't really change anything but
|
|
|
|
// There was an issue with builds not appearing since it was placed above ConstructEntity.
|
2021-12-05 17:54:36 +00:00
|
|
|
PropertyManagementComponent::Instance()->AddModel(newEntity->GetObjectID(), spawnerID);
|
|
|
|
}
|
|
|
|
|
|
|
|
item->SetCount(item->GetCount() - 1);
|
|
|
|
return;
|
|
|
|
}
|
2022-07-25 02:26:51 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
auto* node = new SpawnerNode();
|
|
|
|
|
|
|
|
node->position = position;
|
|
|
|
node->rotation = rotation;
|
2024-05-25 04:17:56 +00:00
|
|
|
for (const auto config : item->GetConfig()) {
|
|
|
|
node->config.push_back(config->Copy());
|
|
|
|
}
|
2024-05-21 05:39:56 +00:00
|
|
|
|
|
|
|
item->SetCount(item->GetCount() - 1);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-01-05 12:31:22 +00:00
|
|
|
ObjectIDManager::RequestPersistentID([this, node, modelLOT, entity, position, rotation, originalRotation](uint32_t persistentId) {
|
2021-12-05 17:54:36 +00:00
|
|
|
SpawnerInfo info{};
|
|
|
|
|
|
|
|
info.templateID = modelLOT;
|
|
|
|
info.nodes = { node };
|
|
|
|
info.templateScale = 1.0f;
|
|
|
|
info.activeOnLoad = true;
|
|
|
|
info.amountMaintained = 1;
|
|
|
|
info.respawnTime = 10;
|
|
|
|
|
|
|
|
info.emulated = true;
|
2023-07-15 20:56:33 +00:00
|
|
|
info.emulator = Game::entityManager->GetZoneControlEntity()->GetObjectID();
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-04-25 18:17:40 +00:00
|
|
|
info.spawnerID = persistentId;
|
|
|
|
GeneralUtils::SetBit(info.spawnerID, eObjectBits::CLIENT);
|
2022-07-25 02:26:51 +00:00
|
|
|
|
2023-07-17 22:55:33 +00:00
|
|
|
const auto spawnerId = Game::zoneManager->MakeSpawner(info);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-07-17 22:55:33 +00:00
|
|
|
auto* spawner = Game::zoneManager->GetSpawner(spawnerId);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-05-21 11:06:55 +00:00
|
|
|
// If empty, insert the default config data since it doesn't exist yet
|
2024-05-21 11:27:17 +00:00
|
|
|
|
|
|
|
if (!node->HasVar(u"modelBehaviors")) {
|
|
|
|
node->config.push_back(new LDFData<LWOOBJID>(u"modelBehaviors", 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!node->HasVar(u"userModelID")) {
|
|
|
|
node->config.push_back(new LDFData<LWOOBJID>(u"userModelID", info.spawnerID));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!node->HasVar(u"modelType")) {
|
|
|
|
node->config.push_back(new LDFData<int>(u"modelType", 2));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!node->HasVar(u"propertyObjectID")) {
|
|
|
|
node->config.push_back(new LDFData<bool>(u"propertyObjectID", true));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!node->HasVar(u"componentWhitelist")) {
|
|
|
|
node->config.push_back(new LDFData<int>(u"componentWhitelist", 1));
|
2024-05-21 11:06:55 +00:00
|
|
|
}
|
2022-07-19 21:51:35 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
auto* model = spawner->Spawn();
|
|
|
|
|
|
|
|
models.insert_or_assign(model->GetObjectID(), spawnerId);
|
|
|
|
|
|
|
|
GameMessages::SendPlaceModelResponse(entity->GetObjectID(), entity->GetSystemAddress(), position, m_Parent->GetObjectID(), 14, originalRotation);
|
|
|
|
|
|
|
|
GameMessages::SendUGCEquipPreCreateBasedOnEditMode(entity->GetObjectID(), entity->GetSystemAddress(), 0, spawnerId);
|
|
|
|
|
|
|
|
GameMessages::SendGetModelsOnProperty(entity->GetObjectID(), GetModels(), UNASSIGNED_SYSTEM_ADDRESS);
|
|
|
|
|
2023-07-15 20:56:33 +00:00
|
|
|
Game::entityManager->GetZoneControlEntity()->OnZonePropertyModelPlaced(entity);
|
2021-12-05 17:54:36 +00:00
|
|
|
});
|
2022-02-05 12:08:40 +00:00
|
|
|
// Progress place model missions
|
|
|
|
auto missionComponent = entity->GetComponent<MissionComponent>();
|
|
|
|
if (missionComponent != nullptr) missionComponent->Progress(eMissionTaskType::PLACE_MODEL, 0);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int deleteReason) {
|
2023-10-21 23:31:55 +00:00
|
|
|
LOG("Delete model: (%llu) (%i)", id, deleteReason);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
auto* entity = GetOwner();
|
|
|
|
|
|
|
|
if (entity == nullptr) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
|
|
|
|
|
|
|
|
if (inventoryComponent == nullptr) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-11-16 01:32:17 +00:00
|
|
|
auto* model = Game::entityManager->GetEntity(id);
|
|
|
|
|
|
|
|
if (model == nullptr) {
|
|
|
|
LOG("Failed to find model entity");
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (model->GetLOT() == 14 && deleteReason == 0) {
|
|
|
|
LOG("User is trying to pick up a BBB model, but this is not implemented, so we return to prevent the user from losing the model");
|
|
|
|
|
|
|
|
GameMessages::SendUGCEquipPostDeleteBasedOnEditMode(entity->GetObjectID(), entity->GetSystemAddress(), LWOOBJID_EMPTY, 0);
|
|
|
|
|
|
|
|
// Need this to pop the user out of their current state
|
|
|
|
GameMessages::SendPlaceModelResponse(entity->GetObjectID(), entity->GetSystemAddress(), entity->GetPosition(), m_Parent->GetObjectID(), 14, entity->GetRotation());
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
const auto index = models.find(id);
|
|
|
|
|
|
|
|
if (index == models.end()) {
|
2023-10-21 23:31:55 +00:00
|
|
|
LOG("Failed to find model");
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const auto spawnerId = index->second;
|
2022-07-25 02:26:51 +00:00
|
|
|
|
2023-07-17 22:55:33 +00:00
|
|
|
auto* spawner = Game::zoneManager->GetSpawner(spawnerId);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
models.erase(id);
|
2022-07-25 02:26:51 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
if (spawner == nullptr) {
|
2023-10-21 23:31:55 +00:00
|
|
|
LOG("Failed to find spawner");
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
2023-07-15 20:56:33 +00:00
|
|
|
Game::entityManager->DestructEntity(model);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-10-21 23:31:55 +00:00
|
|
|
LOG("Deleting model LOT %i", model->GetLOT());
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
if (model->GetLOT() == 14) {
|
|
|
|
//add it to the inv
|
|
|
|
std::vector<LDFBaseData*> settings;
|
|
|
|
|
|
|
|
//fill our settings with BBB gurbage
|
2024-05-21 11:06:55 +00:00
|
|
|
LDFBaseData* ldfBlueprintID = new LDFData<LWOOBJID>(u"blueprintID", model->GetVar<LWOOBJID>(u"blueprintID"));
|
2021-12-05 17:54:36 +00:00
|
|
|
LDFBaseData* userModelDesc = new LDFData<std::u16string>(u"userModelDesc", u"A cool model you made!");
|
|
|
|
LDFBaseData* userModelHasBhvr = new LDFData<bool>(u"userModelHasBhvr", false);
|
|
|
|
LDFBaseData* userModelID = new LDFData<LWOOBJID>(u"userModelID", model->GetVar<LWOOBJID>(u"userModelID"));
|
|
|
|
LDFBaseData* userModelMod = new LDFData<bool>(u"userModelMod", false);
|
|
|
|
LDFBaseData* userModelName = new LDFData<std::u16string>(u"userModelName", u"My Cool Model");
|
|
|
|
LDFBaseData* propertyObjectID = new LDFData<bool>(u"userModelOpt", true);
|
|
|
|
LDFBaseData* modelType = new LDFData<int>(u"userModelPhysicsType", 2);
|
|
|
|
|
|
|
|
settings.push_back(ldfBlueprintID);
|
|
|
|
settings.push_back(userModelDesc);
|
|
|
|
settings.push_back(userModelHasBhvr);
|
|
|
|
settings.push_back(userModelID);
|
|
|
|
settings.push_back(userModelMod);
|
|
|
|
settings.push_back(userModelName);
|
|
|
|
settings.push_back(propertyObjectID);
|
|
|
|
settings.push_back(modelType);
|
|
|
|
|
2023-05-02 22:39:21 +00:00
|
|
|
inventoryComponent->AddItem(6662, 1, eLootSourceType::DELETION, eInventoryType::MODELS_IN_BBB, settings, LWOOBJID_EMPTY, false, false, spawnerId);
|
2021-12-05 17:54:36 +00:00
|
|
|
auto* item = inventoryComponent->FindItemBySubKey(spawnerId);
|
|
|
|
|
|
|
|
if (item == nullptr) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (deleteReason == 0) {
|
|
|
|
//item->Equip();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (deleteReason == 0 || deleteReason == 2) {
|
|
|
|
GameMessages::SendUGCEquipPostDeleteBasedOnEditMode(entity->GetObjectID(), entity->GetSystemAddress(), item->GetId(), item->GetCount());
|
|
|
|
}
|
|
|
|
|
|
|
|
GameMessages::SendGetModelsOnProperty(entity->GetObjectID(), GetModels(), UNASSIGNED_SYSTEM_ADDRESS);
|
|
|
|
|
2024-01-29 07:53:12 +00:00
|
|
|
GameMessages::SendPlaceModelResponse(entity->GetObjectID(), entity->GetSystemAddress(), NiPoint3Constant::ZERO, LWOOBJID_EMPTY, 16, NiQuaternionConstant::IDENTITY);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
if (spawner != nullptr) {
|
2023-07-17 22:55:33 +00:00
|
|
|
Game::zoneManager->RemoveSpawner(spawner->m_Info.spawnerID);
|
2021-12-05 17:54:36 +00:00
|
|
|
} else {
|
2023-05-02 22:39:21 +00:00
|
|
|
model->Smash(LWOOBJID_EMPTY, eKillType::SILENT);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
item->SetCount(0, true, false, false);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
2022-07-25 02:26:51 +00:00
|
|
|
|
2024-05-21 05:39:56 +00:00
|
|
|
inventoryComponent->AddItem(model->GetLOT(), 1, eLootSourceType::DELETION, INVALID, model->GetSettings(), LWOOBJID_EMPTY, false);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-05-21 11:30:43 +00:00
|
|
|
// figure out how to get the actual item we picked up instead of just the first lot we find
|
2021-12-05 17:54:36 +00:00
|
|
|
auto* item = inventoryComponent->FindItemByLot(model->GetLOT());
|
|
|
|
|
|
|
|
if (item == nullptr) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (deleteReason) {
|
|
|
|
case 0: // Pickup
|
|
|
|
{
|
|
|
|
item->Equip();
|
|
|
|
|
|
|
|
GameMessages::SendUGCEquipPostDeleteBasedOnEditMode(entity->GetObjectID(), entity->GetSystemAddress(), item->GetId(), item->GetCount());
|
2023-07-15 20:56:33 +00:00
|
|
|
Game::entityManager->GetZoneControlEntity()->OnZonePropertyModelPickedUp(entity);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 1: // Return to inv
|
|
|
|
{
|
2023-07-15 20:56:33 +00:00
|
|
|
Game::entityManager->GetZoneControlEntity()->OnZonePropertyModelRemoved(entity);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 2: // Break apart
|
|
|
|
{
|
|
|
|
item->SetCount(item->GetCount() - 1);
|
|
|
|
|
2024-01-11 04:57:41 +00:00
|
|
|
LOG("DLU currently does not support breaking apart brick by brick models.");
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
{
|
2023-10-21 23:31:55 +00:00
|
|
|
LOG("Invalid delete reason");
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
}
|
2022-07-25 02:26:51 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
GameMessages::SendGetModelsOnProperty(entity->GetObjectID(), GetModels(), UNASSIGNED_SYSTEM_ADDRESS);
|
|
|
|
|
2024-01-29 07:53:12 +00:00
|
|
|
GameMessages::SendPlaceModelResponse(entity->GetObjectID(), entity->GetSystemAddress(), NiPoint3Constant::ZERO, LWOOBJID_EMPTY, 16, NiQuaternionConstant::IDENTITY);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
if (spawner != nullptr) {
|
2023-07-17 22:55:33 +00:00
|
|
|
Game::zoneManager->RemoveSpawner(spawner->m_Info.spawnerID);
|
2021-12-05 17:54:36 +00:00
|
|
|
} else {
|
2023-05-02 22:39:21 +00:00
|
|
|
model->Smash(LWOOBJID_EMPTY, eKillType::SILENT);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void PropertyManagementComponent::UpdateApprovedStatus(const bool value) {
|
|
|
|
if (owner == LWOOBJID_EMPTY) return;
|
2022-07-25 02:26:51 +00:00
|
|
|
|
2023-11-18 00:47:18 +00:00
|
|
|
IProperty::Info info;
|
|
|
|
info.id = propertyId;
|
|
|
|
info.modApproved = value;
|
|
|
|
info.privacyOption = static_cast<uint32_t>(privacyOption);
|
|
|
|
info.rejectionReason = "";
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-11-18 00:47:18 +00:00
|
|
|
Database::Get()->UpdatePropertyModerationInfo(info);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PropertyManagementComponent::Load() {
|
|
|
|
if (propertyId == LWOOBJID_EMPTY) {
|
|
|
|
return;
|
|
|
|
}
|
2022-07-25 02:26:51 +00:00
|
|
|
|
2023-11-18 00:47:18 +00:00
|
|
|
auto propertyModels = Database::Get()->GetPropertyModels(propertyId);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-11-18 00:47:18 +00:00
|
|
|
for (const auto& databaseModel : propertyModels) {
|
2021-12-05 17:54:36 +00:00
|
|
|
auto* node = new SpawnerNode();
|
|
|
|
|
2023-11-18 00:47:18 +00:00
|
|
|
node->position = databaseModel.position;
|
|
|
|
node->rotation = databaseModel.rotation;
|
2022-07-25 02:26:51 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
SpawnerInfo info{};
|
|
|
|
|
2023-11-18 00:47:18 +00:00
|
|
|
info.templateID = databaseModel.lot;
|
2021-12-05 17:54:36 +00:00
|
|
|
info.nodes = { node };
|
|
|
|
info.templateScale = 1.0f;
|
|
|
|
info.activeOnLoad = true;
|
|
|
|
info.amountMaintained = 1;
|
|
|
|
info.respawnTime = 10;
|
|
|
|
|
|
|
|
//info.emulated = true;
|
2023-07-15 20:56:33 +00:00
|
|
|
//info.emulator = Game::entityManager->GetZoneControlEntity()->GetObjectID();
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-11-18 00:47:18 +00:00
|
|
|
info.spawnerID = databaseModel.id;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
//BBB property models need to have extra stuff set for them:
|
2023-11-18 00:47:18 +00:00
|
|
|
if (databaseModel.lot == 14) {
|
|
|
|
LWOOBJID blueprintID = databaseModel.ugcId;
|
2023-04-25 18:17:40 +00:00
|
|
|
GeneralUtils::SetBit(blueprintID, eObjectBits::CHARACTER);
|
|
|
|
GeneralUtils::SetBit(blueprintID, eObjectBits::PERSISTENT);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2024-05-21 11:27:17 +00:00
|
|
|
if (!node->HasVar(u"blueprintID")) node->config.push_back(new LDFData<LWOOBJID>(u"blueprintID", blueprintID));
|
2022-07-19 21:51:35 +00:00
|
|
|
} else {
|
2024-05-21 11:27:17 +00:00
|
|
|
if (!node->HasVar(u"modelBehaviors")) node->config.push_back(new LDFData<LWOOBJID>(u"modelBehaviors", 0));
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
2024-05-21 11:27:17 +00:00
|
|
|
if (!node->HasVar(u"modelType")) node->config.push_back(new LDFData<int>(u"modelType", 2));
|
|
|
|
if (!node->HasVar(u"componentWhitelist")) node->config.push_back(new LDFData<int>(u"componentWhitelist", 1));
|
|
|
|
if (!node->HasVar(u"propertyObjectID")) node->config.push_back(new LDFData<bool>(u"propertyObjectID", true));
|
|
|
|
if (!node->HasVar(u"userModelID")) node->config.push_back(new LDFData<LWOOBJID>(u"userModelID", databaseModel.id));
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-07-17 22:55:33 +00:00
|
|
|
const auto spawnerId = Game::zoneManager->MakeSpawner(info);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-07-17 22:55:33 +00:00
|
|
|
auto* spawner = Game::zoneManager->GetSpawner(spawnerId);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
auto* model = spawner->Spawn();
|
|
|
|
|
|
|
|
models.insert_or_assign(model->GetObjectID(), spawnerId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void PropertyManagementComponent::Save() {
|
|
|
|
if (propertyId == LWOOBJID_EMPTY) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-11-18 00:47:18 +00:00
|
|
|
auto present = Database::Get()->GetPropertyModels(propertyId);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
std::vector<LWOOBJID> modelIds;
|
2022-07-25 02:26:51 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
for (const auto& pair : models) {
|
|
|
|
const auto id = pair.second;
|
|
|
|
|
|
|
|
modelIds.push_back(id);
|
|
|
|
|
2023-07-15 20:56:33 +00:00
|
|
|
auto* entity = Game::entityManager->GetEntity(pair.first);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
if (entity == nullptr) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
const auto position = entity->GetPosition();
|
|
|
|
const auto rotation = entity->GetRotation();
|
|
|
|
|
|
|
|
if (std::find(present.begin(), present.end(), id) == present.end()) {
|
2023-11-18 00:47:18 +00:00
|
|
|
IPropertyContents::Model model;
|
|
|
|
model.id = id;
|
|
|
|
model.lot = entity->GetLOT();
|
|
|
|
model.position = position;
|
|
|
|
model.rotation = rotation;
|
|
|
|
model.ugcId = 0;
|
|
|
|
|
|
|
|
Database::Get()->InsertNewPropertyModel(propertyId, model, "Objects_" + std::to_string(model.lot) + "_name");
|
2021-12-05 17:54:36 +00:00
|
|
|
} else {
|
2023-11-18 00:47:18 +00:00
|
|
|
Database::Get()->UpdateModelPositionRotation(id, position, rotation);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-18 00:47:18 +00:00
|
|
|
for (auto model : present) {
|
|
|
|
if (std::find(modelIds.begin(), modelIds.end(), model.id) != modelIds.end()) {
|
2021-12-05 17:54:36 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2023-11-18 00:47:18 +00:00
|
|
|
Database::Get()->RemoveModel(model.id);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-25 02:26:51 +00:00
|
|
|
void PropertyManagementComponent::AddModel(LWOOBJID modelId, LWOOBJID spawnerId) {
|
2021-12-05 17:54:36 +00:00
|
|
|
models[modelId] = spawnerId;
|
|
|
|
}
|
|
|
|
|
|
|
|
PropertyManagementComponent* PropertyManagementComponent::Instance() {
|
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
|
2022-03-31 03:33:37 +00:00
|
|
|
void PropertyManagementComponent::OnQueryPropertyData(Entity* originator, const SystemAddress& sysAddr, LWOOBJID author) {
|
2021-12-05 17:54:36 +00:00
|
|
|
if (author == LWOOBJID_EMPTY) {
|
|
|
|
author = m_Parent->GetObjectID();
|
|
|
|
}
|
|
|
|
|
2023-07-17 22:55:33 +00:00
|
|
|
const auto& worldId = Game::zoneManager->GetZone()->GetZoneID();
|
2021-12-05 17:54:36 +00:00
|
|
|
const auto zoneId = worldId.GetMapID();
|
2023-11-18 00:47:18 +00:00
|
|
|
const auto cloneId = worldId.GetCloneID();
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-10-21 23:31:55 +00:00
|
|
|
LOG("Getting property info for %d", zoneId);
|
2021-12-05 17:54:36 +00:00
|
|
|
GameMessages::PropertyDataMessage message = GameMessages::PropertyDataMessage(zoneId);
|
|
|
|
|
|
|
|
const auto isClaimed = GetOwnerId() != LWOOBJID_EMPTY;
|
|
|
|
|
|
|
|
LWOOBJID ownerId = GetOwnerId();
|
2023-11-18 00:47:18 +00:00
|
|
|
std::string ownerName;
|
|
|
|
auto charInfo = Database::Get()->GetCharacterInfo(ownerId);
|
|
|
|
if (charInfo) ownerName = charInfo->name;
|
2021-12-05 17:54:36 +00:00
|
|
|
std::string name = "";
|
|
|
|
std::string description = "";
|
|
|
|
uint64_t claimed = 0;
|
|
|
|
char privacy = 0;
|
2022-07-25 02:26:51 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
if (isClaimed) {
|
|
|
|
name = propertyName;
|
|
|
|
description = propertyDescription;
|
|
|
|
claimed = claimedTime;
|
|
|
|
privacy = static_cast<char>(this->privacyOption);
|
2022-03-31 03:33:37 +00:00
|
|
|
if (moderatorRequested) {
|
2023-11-18 00:47:18 +00:00
|
|
|
auto moderationInfo = Database::Get()->GetPropertyInfo(zoneId, cloneId);
|
|
|
|
if (moderationInfo->rejectionReason != "") {
|
2022-03-31 03:33:37 +00:00
|
|
|
moderatorRequested = false;
|
2023-11-18 00:47:18 +00:00
|
|
|
rejectionReason = moderationInfo->rejectionReason;
|
|
|
|
} else if (moderationInfo->rejectionReason == "" && moderationInfo->modApproved == 1) {
|
2022-03-31 03:33:37 +00:00
|
|
|
moderatorRequested = false;
|
|
|
|
rejectionReason = "";
|
|
|
|
} else {
|
|
|
|
moderatorRequested = true;
|
|
|
|
rejectionReason = "";
|
|
|
|
}
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
2022-03-30 06:49:04 +00:00
|
|
|
message.moderatorRequested = moderatorRequested;
|
|
|
|
message.reputation = reputation;
|
|
|
|
message.LastUpdatedTime = LastUpdatedTime;
|
2021-12-05 17:54:36 +00:00
|
|
|
message.OwnerId = ownerId;
|
|
|
|
message.OwnerName = ownerName;
|
|
|
|
message.Name = name;
|
|
|
|
message.Description = description;
|
|
|
|
message.ClaimedTime = claimed;
|
|
|
|
message.PrivacyOption = privacy;
|
2022-03-30 06:49:04 +00:00
|
|
|
message.cloneId = clone_Id;
|
|
|
|
message.rejectionReason = rejectionReason;
|
2021-12-05 17:54:36 +00:00
|
|
|
message.Paths = GetPaths();
|
|
|
|
|
|
|
|
SendDownloadPropertyData(author, message, UNASSIGNED_SYSTEM_ADDRESS);
|
2022-03-31 03:33:37 +00:00
|
|
|
// send rejection here?
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
2022-07-25 02:26:51 +00:00
|
|
|
void PropertyManagementComponent::OnUse(Entity* originator) {
|
2021-12-05 17:54:36 +00:00
|
|
|
OnQueryPropertyData(originator, UNASSIGNED_SYSTEM_ADDRESS);
|
|
|
|
GameMessages::SendOpenPropertyManagment(m_Parent->GetObjectID(), originator->GetSystemAddress());
|
|
|
|
}
|
|
|
|
|
|
|
|
void PropertyManagementComponent::SetOwnerId(const LWOOBJID value) {
|
|
|
|
owner = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::map<LWOOBJID, LWOOBJID>& PropertyManagementComponent::GetModels() const {
|
|
|
|
return models;
|
|
|
|
}
|