mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
Off unless property_rent_enabled is on. Each property world's rent comes from its PropertyTemplate row (minimumPrice every rentDuration x durationType; Block Yard is free), unless the new Property Rent dashboard page sets another price or period (property_rent_manage). Rent is taken from the owner's coins shortly after their character loads, with a mail receipt; unpaid rent is mailed and, after property_rent_grace_days, makes the property private until it is paid, like live. The property management component refuses public or best friends privacy while rent is overdue and a property world that loads overdue makes itself private. Property game messages are unchanged. Fixes #943 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
35 lines
1.1 KiB
C++
35 lines
1.1 KiB
C++
#ifndef __PROPERTYRENT__H__
|
|
#define __PROPERTYRENT__H__
|
|
|
|
#include <cstdint>
|
|
#include <optional>
|
|
|
|
#include "dCommonVars.h"
|
|
#include "HotPropertySlots.h"
|
|
#include "PropertyRentRules.h"
|
|
|
|
class Entity;
|
|
|
|
/**
|
|
* Property rent in this world (issue #943; the rules are in PropertyRentRules.h). Off unless property_rent_enabled
|
|
* is on.
|
|
*/
|
|
namespace PropertyRent {
|
|
bool Enabled();
|
|
|
|
// The PropertyTemplate row a property world uses (see HotPropertySlots::WorldTemplate); nullptr when it has none
|
|
const HotPropertySlots::TemplateRow* WorldTemplate(uint32_t mapId);
|
|
|
|
// The world's rent: the template's, or the dashboard's price and period for it. nullopt: free
|
|
std::optional<PropertyRentRules::Rate> RateFor(uint32_t mapId);
|
|
|
|
// Charge the rent of every property the player owns that is due (a few seconds after their character loads, so
|
|
// the client shows the coins and the mail), and make unpaid ones private once the grace period is over
|
|
void OnOwnerLoaded(Entity* player);
|
|
|
|
// Whether the property's rent is overdue, so it has to stay private
|
|
bool IsOverdue(LWOOBJID propertyId, uint32_t mapId);
|
|
}
|
|
|
|
#endif //!__PROPERTYRENT__H__
|