Skip to content

config validation & cmake server build setup#59

Merged
FreddyMSchubert merged 8 commits intodevfrom
10-config-validation
Aug 30, 2025
Merged

config validation & cmake server build setup#59
FreddyMSchubert merged 8 commits intodevfrom
10-config-validation

Conversation

@FreddyMSchubert
Copy link
Copy Markdown
Member

  • JSON Schema validation as implemented by this cpp lib.
  • Build setup rework, now server uses CMake to handle dependencies well. It's good and works well.
  • Rename main root Makefile compilation rules: Now we have "make dev" and "make prod".
  • Change server args to include the data folder directly. This will require pipeline tweaks. @PaulicStudios
  • many stuffs

…er expected replay version fix & better error message
- Added JSON schema validation for server and game configuration files to ensure proper structure and data integrity.
- Updated the `Config` class to include a data folder path, which is now required as an argument when starting the server.
- Modified the `parseServerConfig` and `parseGameConfig` functions to validate their respective JSON configurations against defined schemas.
- Improved error handling for unit cooldown values and core position validation, ensuring the server exits on critical configuration errors.
- Adjusted the `JigsawWorldGenerator` to correctly reference the data folder path for loading templates.
- Updated command-line argument parsing in `main.cpp` to accommodate the new data folder path requirement.
@FreddyMSchubert FreddyMSchubert self-assigned this Aug 30, 2025
Copilot AI review requested due to automatic review settings August 30, 2025 14:03
@FreddyMSchubert FreddyMSchubert added server Related to the functionality of the game server, including gameplay stuff workflow labels Aug 30, 2025
@FreddyMSchubert FreddyMSchubert linked an issue Aug 30, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements JSON Schema validation for config files and transitions the server build system from manual Makefile to CMake for better dependency management. The changes ensure config validation at runtime, improve the build process, and update version compatibility between server and visualizer components.

  • Adds JSON Schema validation for server and game configuration files using a C++ JSON schema validator library
  • Replaces manual Makefile compilation with CMake build system for automated dependency handling
  • Updates replay version from 1.2.1 to 1.2.0 and synchronizes version expectations across components

Reviewed Changes

Copilot reviewed 24 out of 26 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
visualizer/src/ts/replay_loader/replayLoader.ts Updates expected replay version and improves error message with version details
server/src/main.cpp Adds data folder path parameter and adjusts argument parsing logic
server/src/game/ReplayEncoder.cpp Updates replay version constant to match visualizer expectations
server/src/config/Config.cpp Implements JSON schema validation and refactors data folder path handling
server/src/config/worldgen/JigsawWorldGenerator/JigsawWorldGenerator.cpp Updates data folder path access to use new Config method
server/inc/config/Config.h Adds data folder path management methods and removes field from ServerConfig
server/data/config-schemas/*.json Defines comprehensive JSON schemas for server and game configuration validation
server/CMakeLists.txt Implements new CMake build configuration with dependency management
server/Makefile Simplifies Makefile to use CMake backend with dev/prod build targets
Makefile Updates root Makefile to use new build targets and pass data folder parameter

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread server/src/action/CreateAction.cpp
Comment thread server/inc/object/Object.h
Comment thread server/src/config/Config.cpp
@FreddyMSchubert
Copy link
Copy Markdown
Member Author

@PaulicStudios Please leave a review

@FreddyMSchubert FreddyMSchubert merged commit 64de1d2 into dev Aug 30, 2025
8 checks passed
@FreddyMSchubert FreddyMSchubert deleted the 10-config-validation branch August 30, 2025 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

server Related to the functionality of the game server, including gameplay stuff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSON Schema config validation

3 participants