Feat: Hybrid Architecture Phase 1
- Implemented Game Server (game-server.js) with Socket.io - Added JSON Schemas for Campaigns and Missions - Updated Docker configurations for multi-service setup - Refactored main.js to allow local network connections - Removed legacy code (main_old.js) - Updated dependencies
This commit is contained in:
51
src/schemas/CampaignSchema.js
Normal file
51
src/schemas/CampaignSchema.js
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* @typedef {Object} LootTableEntry
|
||||
* @property {string} itemId - ID of the item
|
||||
* @property {number} weight - Probability weight
|
||||
* @property {number} [minLevel] - Minimum level required
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} CampaignMissionNode
|
||||
* @property {string} id - Unique ID of the mission reference
|
||||
* @property {string} missionId - ID of the mission template to use
|
||||
* @property {string} title - Display title for this step
|
||||
* @property {string[]} [next] - IDs of potential next missions (for branching)
|
||||
* @property {Object} [requirements] - Requirements to unlock
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} Campaign
|
||||
* @property {string} id - Unique Campaign ID
|
||||
* @property {string} title - Display Title
|
||||
* @property {string} description - Brief description
|
||||
* @property {string} author - Author name
|
||||
* @property {string} version - Version string (e.g. "1.0.0")
|
||||
* @property {CampaignMissionNode[]} missions - Graph of missions
|
||||
* @property {Object.<string, LootTableEntry[]>} lootTables - Global loot tables
|
||||
*/
|
||||
|
||||
export const CampaignSchema = {
|
||||
type: "object",
|
||||
required: ["id", "title", "missions"],
|
||||
properties: {
|
||||
id: { type: "string" },
|
||||
title: { type: "string" },
|
||||
description: { type: "string" },
|
||||
author: { type: "string" },
|
||||
version: { type: "string" },
|
||||
missions: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
required: ["id", "missionId"],
|
||||
properties: {
|
||||
id: { type: "string" },
|
||||
missionId: { type: "string" },
|
||||
title: { type: "string" },
|
||||
next: { type: "array", items: { type: "string" } }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user