Skip to content

Latest commit

 

History

History
523 lines (380 loc) · 21.6 KB

File metadata and controls

523 lines (380 loc) · 21.6 KB

Changelog

[Unreleased]

v1.10.0

Added

  • New Endpoints (Pawn Social): Added PawnSocialController with a full suite of social endpoints: GET /api/v1/game/defs/interactions, GET /api/v1/pawns/interactions, GET /api/v1/pawns/interactions/log, GET /api/v1/pawns/opinions, GET /api/v1/pawns/relations, POST /api/v1/pawns/interactions/force, POST /api/v1/pawns/relations/add, and DELETE /api/v1/pawns/relations/remove. (by @Ilya)
  • New Endpoints (Learning / Tutorial): Added LearningController exposing the in-game learning helper: GET /api/v1/client/learning/defs, GET /api/v1/client/learning/all, GET /api/v1/client/learning/active, GET /api/v1/client/learning/concept, and POST /api/v1/client/learning/mark-learned. (by @Ilya)
  • New Endpoints (Camera): Added POST /api/v1/camera/screenshot for async base64-encoded screenshot capture with dynamic resizing, POST /api/v1/camera/screenshot/native to save a high-quality screenshot directly to disk, and POST /api/v1/camera/follow/pawn to jump the camera to a pawn by ID. (by @Ilya, @jkbennitt)
  • New Endpoints (UI): Added GET /api/v1/ui/alerts to retrieve all active right-hand screen alerts, GET /api/v1/ui/windows to list open windows and their force-pause state, and POST /api/v1/ui/window/close to programmatically dismiss windows by type name. (by @Ilya, @jkbennitt)
  • New Endpoints (Mod Management): Added GET /api/v1/mods/list, GET /api/v1/mods/info, and GET /api/v1/mods/preview to query active mod metadata and retrieve mod preview images as base64. (by @Ilya)
  • New Endpoint (Things): Added POST /api/v1/things/set-forbidden to set the forbidden status on one or more things by ID or position. (by @jkbennitt)
  • New Endpoint (Builder): Added POST /api/v1/builder/check-zone to validate whether a zone can be placed at a given set of coordinates before committing to creation. (by @Yuri)
  • New SSE Event: Added dialog_option_selected event via WindowsHook, published whenever a player selects an option in a Dialog_NodeTree dialog, including the option label and dialog context. (by @jkbennitt)
  • Core — GameThreadDispatcher: Added a reusable GameThreadDispatcher utility for safely marshalling coroutine-based work onto the main Unity thread from async HTTP handlers, replacing scattered ad-hoc threading boilerplate. (by @Ilya)
  • Settings Window: Added git commit hash display to the mod settings window for easier build identification. (by @Ilya)

Changed

  • DDD Architecture Refactor: Controllers are now organized into domain-scoped folders (Client/, Colony/, Pawns/, System/, World/, AI/) aligning the file structure with the domain map in CLAUDE.md. (by @Ilya)
  • Removed Threading Boilerplate: Deleted redundant GameThreadUtility class; all callers migrated to the new GameThreadDispatcher. (by @Ilya)
  • Documentation: Restructured API reference into domain-based pages (game.md, pawns.md, map.md, things.md, ui.md, system.md) and added a compact LLM-oriented reference (llms-compact.md). (by @Ilya)
  • Developer Tooling (Bruno): Expanded the Bruno API collection with request configs for all new endpoints (social interactions, learning, camera, alerts, mod management, set-forbidden, check-zone). (by @Ilya, @Yuri)
  • Developer Tooling (IDE): Added .editorconfig and VS Code workspace settings (settings.json, tasks.json, launch.json) to enforce code standards across the project. (by @Ilya)

Fixed

  • Growing Zone Clarity: Growing zone creation now returns a specific error message explaining why it failed (cells already occupied by another zone vs. out-of-bounds) instead of a silent null result. Also accepts plant labels (e.g. "rice") in addition to defNames (e.g. "Plant_Rice"). (by @jkbennitt)
  • Camera Follow Map Scope: Fixed POST /api/v1/camera/follow/pawn to restrict its pawn search to the current map only, preventing erroneous matches against pawns on the world map or other maps. (by @Ilya)

v1.9.0

Added

  • New Endpoints (Game Lifecycle): Added POST /api/v1/game/main-menu and POST /api/v1/game/quit to control the game session, including cross-thread safety. (by @Ilya)
  • New Endpoints (Bills & Production): Added a new BillController providing full CRUD operations for managing work table bills, querying available recipes, and fetching active work tables. (by @Yuri)
  • New Endpoints (Pawn & Medical): Added POST /api/v1/pawn/job, POST /api/v1/pawn/medical/tend, and POST /api/v1/pawn/medical/bed-rest for advanced pawn control and job assignment. (by @jkbennitt)
  • New Endpoints (Map & Buildings): Added POST /api/v1/map/building/power to toggle power on flickable buildings, and POST /api/v1/map/zone/growing to designate plant zones. (by @jkbennitt)
  • New Endpoints (Stockpiles): Added full CRUD operations and advanced filtering for Stockpile zone management. (by @Yuri)
  • New Endpoint (Research): Added POST /api/v1/research/target to set the active research project programmatically. (by @jkbennitt)
  • New Endpoint (Discovery): Added GET /api/v1/dev/endpoints to programmatically list all registered API routes and their metadata. (by @Ilya)
  • API Enhancements: Added JobDefs to the /def/all endpoint and introduced global query filtering for endpoint result data. (by @Ilya)
  • Developer Tooling (Bruno): Introduced a comprehensive Bruno API testing collection, complete with generator scripts, environments, and CRUD test suites. (by @Yuri)
  • Expanded API Conventions: Vastly expanded api_conventions.md to document response envelopes, HTTP status logic, snake_case rules, coordinate systems, and thread-safety models. (by @jkbennitt, @Ilya)
  • Documentation Automation: Created a Python bump_version.py script and Jinja macros to automatically sync versions and calculate endpoint counts across the project's markdown and YAML files. Add Russian translation to API endpoints. (by @Ilya)
  • Documentation Translation: Add Russian translation to API endpoints. (by @Ilya)

Changed

  • Thread-Safe Save/Load: Refactored GameSave and GameLoad endpoints to safely queue operations on the main Unity thread. Added support for Permadeath filename constraints and a bypass for mod-mismatch dialogs. (by @Ilya)
  • Growing Zone Coordinates: The growing zone creation endpoint now accepts Rect coordinates (PointA/PointB) instead of individual cell lists to match standard designation patterns. (by @jkbennitt)
  • Dynamic Versioning: RIMAPI_Settings.cs now pulls the mod version dynamically from About.xml via LoadedModManager, eliminating hardcoded version strings in C#. (by @Ilya)
  • Metadata: Added Harmony to the mod dependencies list and updated the documentation URL in About.xml. (by @Ilya)
  • Codebase Formatting: Refactored project files to default to 4-space tabs for consistency. (by @Ilya)

Fixed

  • Bulk Work Priorities NRE: Fixed a NullReferenceException and 500 Internal Server Error when processing unmapped JSON keys or empty payloads in the colonist priorities endpoint. (by @Ilya)
  • Growing Zone 500 Error: Fixed a crash that occurred when attempting to create a growing zone where all designated cells were already occupied by existing zones. (by @jkbennitt)
  • Pawn Edit Routing & Logic: Fixed a 404 routing error for /api/v1/pawn/edit/basic in compiled release builds, and resolved a bug where partial name updates were ignored. (by @Ilya)
  • Empty POST Body Crashes: Fixed core routing logic so missing payloads or Content-Length headers safely initialize an empty DTO instead of throwing a generic NullReferenceException. (by @Ilya)

v1.8.2

Documentation Infrastructure (Refactor)

  • Migrated from a single API YAML file to a modular, folder-based structure.
  • Multi-Language Support — Added dedicated localization folders (ja/, ru/) with fallback logic to ensure translated pages remain functional even if specific endpoints aren't yet translated.
  • Automated Validation — Introduced a Python-based sanity checker (mkdocs_check_api.py) that cross-references C# [Route] attributes against YAML documentation to prevent "documentation drift".
  • Auto-Fixer Tools — Added a synchronization script (mkdocs_fix_yaml_methods.py) that automatically updates YAML HTTP methods to match the C# source of truth.
  • Visual Enhancements — Implemented a tagging system (e.g., UI, Map, Pawn) with custom CSS badges to help users filter endpoints by category.

Developer Workflow & CI/CD

  • GitHub Actions Integration — Integrated the formatting, fixing, and validation scripts into the deployment pipeline to guarantee documentation accuracy on every push to master.
  • Improved Repository Hygiene — Optimized .gitignore to prevent Python bytecode (.pyc) and C# build artifacts from bloating the repository.

Bug Fixes & API Refinement

  • Unique Endpoint Routing — Refactored ImageController to use unique paths for GET and POST actions (e.g., /api/v1/item/change/image), resolving documentation collisions and improving REST clarity.

v1.8.1

New Features & Enhancements

  • Add Mod Configuration endpoint - [POST] /api/v1/mods/configure allows programmatic updating of the active mod list, enforcing exact load order, and optionally restarting the game to apply changes.
  • Add server IP property to settings

Bug Fixes

  • Fix SSE Heartbeat Crash - Resolved a NullReferenceException in SseService that caused console spam when Server-Sent Event heartbeats attempted to access the game tick manager while the player was on the main menu.
  • Removed Harmony library from mod pack

v1.8.0

New Features & Enhancements

  • Add fog grid retrieve test & visualize - New functionality for fog grid testing and visualization
  • Update SSE debugger - Enhanced Server-Sent Events debugging capabilities
  • Update CacheStatistics with more details - Improved cache monitoring and statistics
  • Add new caravan path endpoint - /api/v1/world/caravan/path
  • Add new item endpoints:
    • /api/v1/item/recipes
    • /api/v1/item/sources
  • Add new trade endpoints - /api/v1/traders/defs
  • Add new incident endpoints:
    • /api/v1/incidents/top
    • /api/v1/incident/chance
  • Add new map endpoints:
    • /api/v1/map/ore
    • /api/v1/map/fog-grid
  • Add GetFactionIcon endpoint - New endpoint for retrieving faction icons
  • Update GetResearchProgress - Now shows "none" instead of error when no research is in progress
  • Add new hooks:
    • MapEventsHook
    • FogGridHook

API Changes & Refactoring

  • Move cache endpoints from GameController - Added new ServerCacheController for better organization
  • Refactor mod settings - Improved settings management structure
  • Change POST endpoint for run-in-background:
    • OLD: [POST] /api/v1/game/settings/run-in-background
    • NEW: [POST] /api/v1/game/settings/toggle/run-in-background
  • Update caching in GameController - Improved cache management
  • Refactor models directory - Better code organization
  • Update PawnController caching - Fixed caching issues in pawn controller
  • Fix ColonistService - Resolved issues with colonist service functionality
  • Update services and helpers - General improvements and maintenance

Bug Fixes

  • Fix caching - Resolved various caching issues

v1.7.0

Fix #40 issue by sypher01: patch On_Gui to handle server requests caused unclickable interface

Update mod settings window

New Endpoints

GlobalMapController API:

  • GET Add /api/v1/world/grid
  • GET Add /api/v1/world/player/settlements
  • GET Add /api/v1/world/tile/coordinates
  • GET Add /api/v1/world/grid/area
  • GET Add /api/v1/world/tile/details

GameController API:

  • GET Add /api/v1/game/settings/run-in-background
  • POST Add /api/v1/game/settings/run-in-background

v1.6.1

Fix SSE in browsers: remove dublicate header "Allow-Origin" for SSE service

Add Game State hooks

  • game_loaded
  • new_game_created
  • exit_to_menu
  • game_saved
  • settings_changed

Small fixes

v1.6.0

New Features

  • Added Builder API for copy/paste operations and blueprint placement
  • Added Lord management API for creating lords
  • Added Order API for area designation
  • Added Overlay API for in-game announcements
  • Added Window API for message and dialog windows
  • Added Pawn Info API for retrieving pawn details and inventory
  • Added Pawn Spawn API for spawning new pawns
  • Enhanced Pawn Edit API with granular endpoints for different pawn attributes
  • Expanded Map API with destruction, repair, and drop pod functionality
  • Enhanced Faction API with goodwill management

New Endpoints

Builder API:

  • POST /api/v1/builder/copy - Copy area
  • POST /api/v1/builder/paste - Paste area
  • POST /api/v1/builder/blueprint - Place blueprints

Faction API:

  • POST /api/v1/faction/goodwill - Set faction goodwill

Lord API:

  • POST /api/v1/lords/create - Create lord

Map API:

  • POST /api/v1/map/destroy/corpses - Destroy corpses
  • POST /api/v1/map/destroy/forbidden - Destroy forbidden items
  • POST /api/v1/map/destroy/rect - Destroy things in rectangle
  • POST /api/v1/map/repair/positions - Repair at positions
  • POST /api/v1/map/repair/rect - Repair in rectangle
  • POST /api/v1/map/droppod - Spawn drop pod

Order API:

  • POST /api/v1/order/designate/area - Designate area

Overlay API:

  • POST /api/v1/ui/announce - Show announcement

Pawn Edit API (Enhanced):

  • POST /api/v1/pawn/edit/basic - Edit basic pawn info
  • POST /api/v1/pawn/edit/health - Edit pawn health
  • POST /api/v1/pawn/edit/needs - Edit pawn needs
  • POST /api/v1/pawn/edit/skills - Edit pawn skills
  • POST /api/v1/pawn/edit/traits - Edit pawn traits
  • POST /api/v1/pawn/edit/inventory - Edit pawn inventory
  • POST /api/v1/pawn/edit/apparel - Edit pawn apparel
  • POST /api/v1/pawn/edit/status - Edit pawn status
  • POST /api/v1/pawn/edit/position - Edit pawn position
  • POST /api/v1/pawn/edit/faction - Edit pawn faction

Pawn Info API:

  • GET /api/v1/pawns/map - Get pawns on map
  • GET /api/v1/pawns/details - Get pawn details
  • GET /api/v1/pawns/inventory - Get pawn inventory

Pawn Spawn API:

  • POST /api/v1/pawn/spawn - Spawn pawn

Window API:

  • POST /api/v1/ui/message - Show message
  • POST /api/v1/ui/dialog - Show dialog

v1.5.0

Impliment API server launch at game menu screen (previously lauched when game map loaded).

Fix GetColonist, GetColonistDetailed output when colonist with Id not found to display error.

Add new endpoints:

[POST] /api/v1/item/spawn [POST] /api/v1/game/save [POST] /api/v1/game/load [POST] /api/v1/game/start/devquick [POST] /api/v1/game/start [GET] /api/v1/game/settings

Update README.

v1.4.1

Fix UI blinking during texture make readable

v1.4.0

Author: IlyaChichkov

Add new endpoints:

[POST] /api/v1/game/speed [POST] /api/v1/game/select-area [GET] /api/v1/map/things-at

Author: braasdas

This patch implements high-performance endpoints and data optimizations required for a real-time "Live Optical View" web interface. The primary goals were reducing network bandwidth (via RLE compression) and minimizing game thread impact (via caching).

  1. NEW API ENDPOINTS

[GET] /api/v1/map/terrain

  • Purpose: Fetches the entire map's terrain and floor grid.
  • Optimization: Uses custom Run-Length Encoding (RLE) to compress the grid data. This reduces payload size by ~90% for typical maps, making full map transmission viable over the network.

[GET] /api/v1/colonists/positions

  • Purpose: A lightweight endpoint returning only Pawn ID, MapID, X, and Z coordinates.
  • Optimization: Designed for high-frequency polling (e.g., 10-60Hz). Implements 0.1s server-side caching to prevent flooding the main game thread.

[GET] /api/v1/terrain/image

  • Purpose: Fetches the texture/icon for specific terrain or floor defs (e.g., "SandstoneTile", "CarpetRed").
  • Why: Required for the client to reconstruct the map visually.

[GET] /api/v1/map/plants

  • Purpose: Fast retrieval of all vegetation (trees, crops). separated from general "things" to allow different polling rates.

[GET] /api/v1/map/things/radius

  • Purpose: Efficiently queries items/buildings only within a specific circle. Useful for culling or "fog of war" logic.
  1. LOGIC & HELPER IMPROVEMENTS

TextureHelper.cs (Major Fixes)

  • Problem: Many buildings (Walls, Vents, Coolers) do not have a standard uiIcon.
  • Fix: Added deep lookup logic to check graphicData, graphic.MatSingle, and graphic.MatSouth. This ensures almost all buildings now return a valid base64 image.
  • Added fallback case-insensitive search for DefNames to handle minor typo/mod inconsistencies.

MapHelper.cs

  • Added the RLE compression logic for the Terrain/Floor grids.
  • Separated "Natural Terrain" (soil, stone) from "Constructed Floors" (wood, tile) into two distinct layers for better rendering control.

ResourcesHelper.cs

  • Updated BuildingDto and ItemsDto to include Rotation and Size (x, z).
  • Why: Critical for the client to correctly orient non-square objects (e.g., Beds, Tables) which were previously rendering as 1x1 squares or unrotated images.
  1. NEW DATA MODELS

  • MapTerrainDto: Handles the compressed grid arrays and palette lookups.
  • PawnPositionDto: Minimalist structure for the fast position endpoint.

These changes are largely additive and designed to run alongside existing logic without breaking current endpoints. The modifications to TextureHelper are strictly improvements to robustness and should benefit the entire API.

v1.3.0

Add examples and description for endpoints in documentation

Insert them into auto generated api.md by macroses from api.yml

Add option to use json body for endpoints that accept parameters:

  • /api/v1/dev/console
  • /api/v1/colonist/time-assignment

Add new endpoints: [GET]

  • /api/v1/world/caravans
  • /api/v1/world/settlements
  • /api/v1/world/caravans
  • /api/v1/world/tile

[POST]

  • /api/v1/pawn/edit

Fixes:

  • TraitDefDto empty label, description
  • /api/v1/colonist/body/image returned GetColonistInventory
  • change "throw new Exception" to "return ApiResult.Fail"
  • /api/v1/dev/console didn't have message parameter

v1.2.2

Fix GetItemImageByName

v1.2.1

Remove /api/v1/pawn/portrait/image endpoint duplicate Fix screen blinking when get rendered texture

v1.2.0

Add endpoint:

[GET]

  • /api/v1/def/all [POST]
  • /api/v1/game/send/letter

Change endpoint path:

  • /api/v1/building/info -> /api/v1/map/building/info
  • /api/v1/change/weather -> /api/v1/map/weather/change

v1.1.0

Add endpoint:

[GET]

  • /api/v1/faction/player
  • /api/v1/faction/
  • /api/v1/faction/def
  • /api/v1/faction/relations-with
  • /api/v1/faction/relations [POST]
  • /api/v1/faction/change/goodwill
  • /api/v1/change/weather

Add caching service

Test performance of GET /colonists/detailed endpoint no/with caching, results:

  • Speed acceleration of 16-21%
  • Improved stability (0 vs 9 failures)
  • Reduction of peak delays by 72%

Fix: Add endpoints from v0.5.6

  • /api/v1/resources/storages/summary
  • /api/v1/select
  • /api/v1/trait-def
  • /api/v1/time-assignments
  • /api/v1/colonist/time-assignment
  • /api/v1/outfits
  • /api/v1/work-list
  • /api/v1/colonist/work-priority
  • /api/v1/colonists/work-priority
  • /api/v1/jobs/make/equip

Thanks to @braasdas and his RatLab mod

v1.0.0

Complete architectural rewrite to use dependency injection (DI) container system

Updates:

  • Added automatic service discovery and lifetime management (singleton/transient)
  • Introduced constructor injection for all service dependencies
  • Added automatic extension discovery via reflection scanning
  • Implemented attribute-based routing with automatic controller registration
  • Added support auto-routed controllers
  • Created documentation service with auto-generated API documentation

v0.5.6

Fix /api/v1/resources/stored

v0.5.5

Add endpoint: [GET]

  • /api/v1/materials-atlas [POST]
  • /api/v1/dev/console
  • /api/v1/materials-atlas/clear
  • /api/v1/stuff/color
  • /api/v1/item/image

Minor fixes

v0.5.4

Add SSE broadcast:

  • message_received
  • letter_received
  • make_recipe_product
  • unfinished_destroyed
  • date_changed

Updated SSE broadcast:

  • colonist_ate

Add endpoint:

  • /api/v1/map/rooms
  • /api/v1/time-assignments
  • /api/v1/colonist/time-assignment
  • /api/v1/outfits

SSE service refactoring & fixes Update debug logging class Fix loggingLevel config value wasn't save in Scribe_Values Add example script for colony food analysis

v0.5.3

Add endpoint:

  • /api/v1/jobs/make/equip
  • /api/v1/pawn/portrait/image
  • /api/v1/colonist/work-priority
  • /api/v1/colonists/work-priority
  • /api/v1/work-list

Optimize resources Dto Update BaseController CORS header handling

v0.5.2

Add endpoint:

  • /api/v1/resources/stored

Update resources Dto

v0.5.1

Update skills Dto

v0.5.0

Add more endpoints [POST]

  • /api/v1/deselect
  • /api/v1/deselect
  • /api/v1/deselect
  • /api/v1/select
  • /api/v1/open-tab

[GET]

  • /api/v1/map/zones
  • /api/v1/map/buildings
  • /api/v1/building/info

Update headiffs data in

  • /api/v1/colonists/detailed
  • /api/v1/colonist/detailed

Add SSE endpoint:

  • 'colonist_ate'

Add SSE client for testing

v0.4.4

Add camera stream (default: localhost:5001) Add camera stream endpoints to start, stop, setup, get status

v0.4.3

Add quests and incidents endpoints Add pawn opinion about pawn endpoint Update colonist detailed data

Steam version updated

v0.4.0

Update research endpoints Improved dashboard example: https://github.com/IlyaChichkov/rimapi-dashboard

v0.3.0

Update mod settings

v0.2.0

Update README, Licence, Github CI/CD Fix exception handling

v0.1.0

Add basic endpoints Add docs