130 lines
7.1 KiB
JSON
130 lines
7.1 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "Protocol",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"intent": {"$ref": "#/definitions/Intent"},
|
|
"snapshot": {"$ref": "#/definitions/Snapshot"}
|
|
},
|
|
"required": ["intent", "snapshot"],
|
|
"definitions": {
|
|
"Vec3": {
|
|
"type": "object", "additionalProperties": false,
|
|
"properties": {"x": {"type": "number"}, "y": {"type": "number"}, "z": {"type": "number"}},
|
|
"required": ["x", "y", "z"]
|
|
},
|
|
"Intent": {
|
|
"type": "object", "additionalProperties": false,
|
|
"properties": {
|
|
"op": {"type": "string"}, "seq": {"type": "integer"},
|
|
"x": {"type": "number"}, "z": {"type": "number"}, "target": {"type": "string"}, "slot": {"type": "string"}
|
|
},
|
|
"required": ["op", "seq", "x", "z", "target", "slot"]
|
|
},
|
|
"Entity": {
|
|
"type": "object", "additionalProperties": false,
|
|
"properties": {
|
|
"id": {"type": "string"}, "kind": {"type": "string"}, "name": {"type": "string"},
|
|
"position": {"$ref": "#/definitions/Vec3"},
|
|
"hp": {"type": "number"}, "maxHp": {"type": "number"},
|
|
"state": {"type": "string"}
|
|
},
|
|
"required": ["id", "kind", "name", "position", "hp", "maxHp", "state"]
|
|
},
|
|
"Character": {
|
|
"type": "object", "additionalProperties": false,
|
|
"properties": {
|
|
"entity": {"$ref": "#/definitions/Entity"},
|
|
"inventory": {"type": "object", "additionalProperties": {"type": "integer"}},
|
|
"skills": {"type": "object", "additionalProperties": {"type": "integer"}},
|
|
"level": {"type": "integer"}, "experience": {"type": "integer"},
|
|
"experienceToNextLevel": {"type": "integer"}, "statPoints": {"type": "integer"},
|
|
"titles": {"type": "array", "items": {"$ref": "#/definitions/TitleAward"}},
|
|
"allocatedStats": {"type": "object", "additionalProperties": {"type": "integer"}},
|
|
"stats": {"type": "object", "additionalProperties": {"$ref": "#/definitions/StatValue"}},
|
|
"mana": {"type": "number"}, "stamina": {"type": "number"}, "carryWeight": {"type": "number"},
|
|
"pendingVitalChoices": {"type": "integer"}, "healthChoices": {"type": "integer"}, "manaChoices": {"type": "integer"},
|
|
"items": {"type": "array", "items": {"$ref": "#/definitions/ItemInstance"}},
|
|
"equipment": {"type": "object", "additionalProperties": {"type": "string"}},
|
|
"playedSeconds": {"type": "number"}, "remainingSeconds": {"type": "number"},
|
|
"kills": {"type": "integer"}, "ack": {"type": "integer"},
|
|
"hasKeystone": {"type": "boolean"}
|
|
},
|
|
"required": ["entity", "inventory", "skills", "level", "experience", "experienceToNextLevel", "statPoints", "titles", "allocatedStats", "stats", "mana", "stamina", "carryWeight", "pendingVitalChoices", "healthChoices", "manaChoices", "items", "equipment", "playedSeconds", "remainingSeconds", "kills", "ack", "hasKeystone"]
|
|
},
|
|
"TitleEffects": {
|
|
"type": "object", "additionalProperties": false,
|
|
"properties": {"damage": {"type": "number"}, "moveSpeed": {"type": "number"}, "modifiers": {"type": "array", "items": {"$ref": "#/definitions/StatModifier"}}},
|
|
"required": ["damage", "moveSpeed", "modifiers"]
|
|
},
|
|
"StatModifier": {
|
|
"type": "object", "additionalProperties": false,
|
|
"properties": {"stat": {"type": "string"}, "flat": {"type": "number"}, "percent": {"type": "number"}},
|
|
"required": ["stat", "flat", "percent"]
|
|
},
|
|
"StatValue": {
|
|
"type": "object", "additionalProperties": false,
|
|
"properties": {"base": {"type": "number"}, "flat": {"type": "number"}, "percent": {"type": "number"}, "final": {"type": "number"}},
|
|
"required": ["base", "flat", "percent", "final"]
|
|
},
|
|
"ItemRequirements": {
|
|
"type": "object", "additionalProperties": false,
|
|
"properties": {"level": {"type": "integer"}, "stats": {"type": "object", "additionalProperties": {"type": "number"}}, "titles": {"type": "array", "items": {"type": "string"}}},
|
|
"required": ["level", "stats", "titles"]
|
|
},
|
|
"ItemInstance": {
|
|
"type": "object", "additionalProperties": false,
|
|
"properties": {
|
|
"id": {"type": "string"}, "definitionId": {"type": "string"}, "name": {"type": "string"}, "description": {"type": "string"}, "slot": {"type": "string"}, "weight": {"type": "number"},
|
|
"requirements": {"$ref": "#/definitions/ItemRequirements"}, "modifiers": {"type": "array", "items": {"$ref": "#/definitions/StatModifier"}},
|
|
"equippable": {"type": "boolean"}, "requirementMessage": {"type": "string"}
|
|
},
|
|
"required": ["id", "definitionId", "name", "description", "slot", "weight", "requirements", "modifiers", "equippable", "requirementMessage"]
|
|
},
|
|
"TitleAward": {
|
|
"type": "object", "additionalProperties": false,
|
|
"properties": {
|
|
"id": {"type": "string"}, "name": {"type": "string"}, "description": {"type": "string"},
|
|
"scope": {"type": "string"}, "worldId": {"type": "string"}, "earnedAt": {"type": "string"},
|
|
"effects": {"$ref": "#/definitions/TitleEffects"}
|
|
},
|
|
"required": ["id", "name", "description", "scope", "worldId", "earnedAt", "effects"]
|
|
},
|
|
"Chunk": {
|
|
"type": "object", "additionalProperties": false,
|
|
"properties": {
|
|
"key": {"type": "string"}, "x": {"type": "integer"}, "z": {"type": "integer"},
|
|
"size": {"type": "number"}, "resolution": {"type": "integer"},
|
|
"heights": {"type": "array", "items": {"type": "number"}},
|
|
"biome": {"type": "string"}, "resources": {"type": "array", "items": {"$ref": "#/definitions/Entity"}}
|
|
},
|
|
"required": ["key", "x", "z", "size", "resolution", "heights", "biome", "resources"]
|
|
},
|
|
"WorldInfo": {
|
|
"type": "object", "additionalProperties": false,
|
|
"properties": {
|
|
"id": {"type": "string"}, "seed": {"type": "integer"}, "phase": {"type": "string"},
|
|
"ageSeconds": {"type": "number"}, "bossInSeconds": {"type": "number"},
|
|
"collapseInSeconds": {"type": "number"}, "safeRadius": {"type": "number"},
|
|
"radius": {"type": "number"}, "online": {"type": "integer"}, "capacity": {"type": "integer"},
|
|
"bossHp": {"type": "number"}, "bossMaxHp": {"type": "number"}
|
|
},
|
|
"required": ["id", "seed", "phase", "ageSeconds", "bossInSeconds", "collapseInSeconds", "safeRadius", "radius", "online", "capacity", "bossHp", "bossMaxHp"]
|
|
},
|
|
"Snapshot": {
|
|
"type": "object", "additionalProperties": false,
|
|
"properties": {
|
|
"type": {"type": "string"}, "version": {"type": "integer"}, "tick": {"type": "integer"},
|
|
"world": {"$ref": "#/definitions/WorldInfo"}, "self": {"$ref": "#/definitions/Character"},
|
|
"entities": {"type": "array", "items": {"$ref": "#/definitions/Entity"}},
|
|
"chunks": {"type": "array", "items": {"$ref": "#/definitions/Chunk"}},
|
|
"chunkKeys": {"type": "array", "items": {"type": "string"}},
|
|
"unavailableResources": {"type": "array", "items": {"type": "string"}},
|
|
"message": {"type": "string"}
|
|
},
|
|
"required": ["type", "version", "tick", "world", "self", "entities", "chunks", "chunkKeys", "unavailableResources", "message"]
|
|
}
|
|
}
|
|
}
|