Share player stats with master server

Send the per player stats with the player event updates to the master
server and expose it to the Web UI and ctl interfaces.
This commit is contained in:
Hornwitser committed 2022-07-12 23:03:50 +02:00
1 parent deb6842a4d
commit 0245ccd16c
12 files changed
+400 -34

No files matched your search

+10
View File
@@ -3,6 +3,7 @@
const libSchema = require("../schema");
const libErrors = require("../errors");
const { logger } = require("../logging");
const PlayerStats = require("../PlayerStats");
class MissingLinkHandlerError extends Error {
constructor(type, source, target) {
@@ -795,6 +796,14 @@ const userProperties = {
"is_whitelisted": { type: "boolean" },
"instances": { type: "array", items: { type: "integer" }},
"is_deleted": { type: "boolean" },
"player_stats": PlayerStats.jsonSchema,
"instance_stats": {
type: "array",
items: {
type: "array",
items: [{ type: "integer" }, PlayerStats.jsonSchema],
},
},
};
messages.getUser = new Request({
@@ -1325,6 +1334,7 @@ messages.playerEvent = new Event({
"type": { type: "string", enum: ["join", "leave"] },
"name": { type: "string" },
"reason": { type: "string" },
"stats": PlayerStats.jsonSchema,
},
});