config validation & cmake server build setup#59
Merged
FreddyMSchubert merged 8 commits intodevfrom Aug 30, 2025
Merged
Conversation
Member
FreddyMSchubert
commented
Aug 30, 2025
- 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.
Contributor
There was a problem hiding this comment.
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.
Member
Author
|
@PaulicStudios Please leave a review |
PaulicStudios
approved these changes
Aug 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.