mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
The NexusDashboard-parity dashboard (dDashboardServer) and everything built on it on the experimental branch: accounts, characters, properties and moderation tools, permissions shared with in-game slash commands, economy reports, World 3D and property 3D views with client scenery, scheduled events (features, vanity changes, live events, announcements, restarts), vanity files and events, the CDClient browser, the message inspector with saved captures, chat filter tools, community challenges, live ops, the AI moderator helper, and the server-side changes they need. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
62 lines
2.3 KiB
C++
62 lines
2.3 KiB
C++
#ifndef __IPLAYERPOSITIONS__H__
|
|
#define __IPLAYERPOSITIONS__H__
|
|
|
|
#include <cstdint>
|
|
#include <optional>
|
|
#include <vector>
|
|
|
|
#include "dCommonVars.h"
|
|
#include "json.hpp"
|
|
|
|
/**
|
|
* Where players were: position samples the dashboard takes every few seconds from the positions world servers report,
|
|
* for replaying movement on the 3D world view (staff only, kept for position_history_days). Also the per-day map
|
|
* event cells behind the heat map timelapse.
|
|
*/
|
|
class IPlayerPositions {
|
|
public:
|
|
struct PositionSample {
|
|
int64_t time{};
|
|
LWOOBJID characterId{};
|
|
uint32_t zoneId{};
|
|
uint32_t instanceId{};
|
|
uint32_t cloneId{};
|
|
float x{};
|
|
float y{};
|
|
float z{};
|
|
};
|
|
|
|
// Adds a batch in one transaction; a character's second sample in the same second replaces the first
|
|
virtual void InsertPositionSamples(const std::vector<PositionSample>& samples) = 0;
|
|
|
|
/**
|
|
* Samples in a zone between from and to (instance 0: every instance), ordered by character and time. With
|
|
* bucketSeconds > 1 each character gets one sample per bucket and instance (its average position, at the bucket's
|
|
* first time). At most `limit` rows.
|
|
*/
|
|
virtual std::vector<PositionSample> GetPositionSamples(uint32_t zoneId, uint32_t instanceId, int64_t from, int64_t to, int64_t bucketSeconds, uint32_t limit) = 0;
|
|
|
|
struct PositionInstance {
|
|
uint32_t zoneId{};
|
|
uint32_t instanceId{};
|
|
uint32_t cloneId{};
|
|
int64_t first{};
|
|
int64_t last{};
|
|
uint32_t players{};
|
|
};
|
|
|
|
// World instances with samples between from and to (zone 0: every zone), with their first and last sample and players seen
|
|
virtual std::vector<PositionInstance> GetPositionInstances(uint32_t zoneId, int64_t from, int64_t to) = 0;
|
|
|
|
virtual uint32_t PrunePositionSamples(int64_t beforeTime) = 0;
|
|
|
|
// Map events of a kind (IEconomyLedger::eMapEvent) per day and cell for a zone (one clone, or every instance):
|
|
// [{day, x, z, events}], by day, at most `limit`
|
|
virtual nlohmann::json GetMapCellsPerDay(uint32_t zoneId, std::optional<uint32_t> cloneId, uint8_t kind, uint32_t fromDay, uint32_t toDay, uint32_t limit) = 0;
|
|
|
|
// Characters seen in a zone's clone (a property) between from and to: [{character_id, name, first, last}], latest first
|
|
virtual nlohmann::json GetCloneVisitors(uint32_t zoneId, uint32_t cloneId, int64_t from, int64_t to, uint32_t limit) = 0;
|
|
};
|
|
|
|
#endif //!__IPLAYERPOSITIONS__H__
|