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:
2025-12-28 20:44:40 +01:00
parent 57f6312a5a
commit b6ca14dfa2
10 changed files with 2309 additions and 721 deletions

View 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" } }
}
}
}
}
};