Documentation
¶
Overview ¶
Selection-hotkey API. TA:Kingdoms ships its keyboard table as a root keys.tdf ([CUSTOMKEYS]: key token → command string, e.g. "CTRL_R = SelectUnits BALLISTIC"); Total Annihilation hardcoded the equivalent table in its executable, with units self-declaring membership through literal CTRL_x Category tokens. This endpoint serves whatever keys.tdf the session VFS resolves; when the game ships none (TA) it returns 404 and the client falls back to the game adapter's built-in default table.
Package studio implements KBot Studio — a web-based map editor for Total Annihilation and TA: Kingdoms. It mounts a VFS over a TA install (or the active kbot context), serves a browser UI, and bundles the user's work into a downloadable HPI archive when they hit save.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AssetQueue ¶
type AssetQueue struct {
// contains filtered or unexported fields
}
AssetQueue is a heap-backed priority queue serviced by a fixed pool of worker goroutines. Submit / Run are safe for concurrent use.
func (*AssetQueue) Run ¶
func (q *AssetQueue) Run(key string, run func())
Run enqueues a HIGH-priority job and blocks until it finishes. Concurrent Run calls for the same key share one execution via singleflight, so a stampede of browser tabs asking for the same section preview only renders once.
Live HTTP handlers call this — the queue jumps a job ahead of any pending preload work, the singleflight dedupes against any other in-flight request, and the caller resumes once the cache has been populated.
func (*AssetQueue) Submit ¶
func (q *AssetQueue) Submit(priority int, run func())
Submit enqueues a fire-and-forget job at the given priority. The caller doesn't wait for completion — workers eventually pick it up in priority order.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session holds all per-workspace state for a Studio instance. Each open workspace (or read-only context) gets its own Session: its own VFS, renderer, game host, and the asset caches that are keyed by VFS path (and would otherwise collide between workspaces that share a path but differ in content).
A Session was previously a set of package-level globals; it is now a value so the hub can serve many workspaces from one process.
type WorkspaceManager ¶
type WorkspaceManager struct {
// contains filtered or unexported fields
}
WorkspaceManager owns the set of live Studio sessions, keyed by a URL-safe id. The hub serves a picker at "/", a small JSON API under "/api/hub/", and routes "/workspaces/<id>/..." to the matching session (its API mux, or the editor SPA for navigations).