mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
Property worlds now give their property reputation for the time other people spend on it, which fills the property lists and the news screen's Today's Top Properties. Visitors are counted per account; the owner's account, accounts linked to it and staff don't count. A visit earns nothing for the first property_reputation_min_visit seconds (WorldConfig's propertyReputationDelay), then each active minute (the visitor moved) earns reputationPerMinute times a multiplier, for a capped number of minutes per visit. Repeat visitors earn less the more recent days they already gave reputation, and each visitor and each property have a daily cap. Every parameter is a setting; what each account gave each property per day is kept in property_reputation_visits. The rules are pure functions with unit tests. Fixes #636 Fixes #637 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 lines
604 B
SQL
13 lines
604 B
SQL
/* Property reputation: what each visitor account gave each property per UTC day (days since the Unix epoch), for the
|
|
per-visitor and per-property daily caps and to count repeat visitors (see dCommon/PropertyReputationRules.h).
|
|
properties.reputation holds the total. */
|
|
CREATE TABLE IF NOT EXISTS property_reputation_visits (
|
|
property_id BIGINT NOT NULL,
|
|
account_id INT NOT NULL,
|
|
day INT NOT NULL,
|
|
points BIGINT NOT NULL DEFAULT 0,
|
|
seconds BIGINT NOT NULL DEFAULT 0,
|
|
PRIMARY KEY (property_id, account_id, day),
|
|
INDEX property_reputation_visits_day (property_id, day)
|
|
);
|