Add standalone BMH and FLTD to OBW converter (by Codex)
This commit is contained in:
1 parent
310e3e2464
commit
9bff07828a
23 files changed
+1928
-4
No files matched your search
@@ -13,6 +13,7 @@ OpenBMH is a C++20 engine with graphical and console frontends. The implementati
|
||||
| `src/cli` | Command language, structured protocol, console windows and multi-client seat routing |
|
||||
| `src/audio` | Bank decoding, synthesis, playback and cues, without authority to change gameplay |
|
||||
| `src/launch` | Locating user data, archive extraction, edition normalisation and file selection |
|
||||
| `src/import` | Standalone legacy-to-OBW conversion; no game-state ownership or OBW engine integration |
|
||||
|
||||
`bmhcore` contains the format and game layers. `bmhui`, `openbmh_audio` and the application session provide reusable pieces above it. Frontends should translate actions and display results; they should not introduce independent transfer, calendar or financial rules.
|
||||
|
||||
|
||||
+8
-3
@@ -1,6 +1,6 @@
|
||||
# OBW: OpenBMH world, save and pack format (concept, format version 1.0)
|
||||
|
||||
Status: **concept** for roadmap 0.2 (open data and typed state) with preparation for 0.4 (scalable interface, content packs). Nothing here is implemented yet; the legacy formats in this directory remain authoritative for the current engine.
|
||||
Status: **concept with an initial standalone converter** for roadmap 0.2 (open data and typed state), with preparation for 0.4 (scalable interface, content packs). `openbmh_import` implements the guarded `legacy-database-v1` conversion profile described in [import.md](obw/import.md). Its intermediate files cannot yet start a career. The legacy formats remain authoritative for the current engine; an OBW engine adapter and save conversion are not implemented.
|
||||
|
||||
## 1. Goals and non-goals
|
||||
|
||||
@@ -112,6 +112,8 @@ Fields and directories whose name starts with `x-` belong to extensions (`x-matc
|
||||
|
||||
Each format version is published as JSON Schema (draft 2020-12) under `docs/formats/obw/schema/<major>.<minor>/`, one file per table. The schemas are the machine-readable specification and the basis of the validator (§10).
|
||||
|
||||
The initial schemas describe the `legacy-database-v1` intermediate conversion profile only; save, pack, theme and complete playable-world schemas are still planned. This profile uses `requires` to prevent a partial conversion being mistaken for a complete world. Optional fields and unknown extensions remain allowed.
|
||||
|
||||
## 4. Identifiers and names
|
||||
|
||||
- Every entity has a stable string id `<type>:<key>`, e.g. `nation:de`, `club:0042`, `player:01873`, `comp:de-1`, `stadium:0042`. Keys are opaque: they never encode a real name, so a world and a pack can be published independently.
|
||||
@@ -161,7 +163,8 @@ Teams without a squad (`foreign`, or `national` in a world that does not simulat
|
||||
|---|---|---|---|
|
||||
| `id` | string | R | |
|
||||
| `name` | object | R | `{"first": "...", "last": "...", "known_as": "..."}`, each a plain string; `known_as` optional |
|
||||
| `born` | date | R | Age is derived from the in-game date |
|
||||
| `born` | date | R unless `age_at_start` | Age is derived from the in-game date |
|
||||
| `age_at_start` | object | Alternative to `born` | `{"years": 22, "on": "2026-07-01"}` when a legacy database gives an age but no exact birth date. Never invent a birthday. A consumer must explicitly support this precision. |
|
||||
| `nationalities` | array | R | Nation ids, first entry is the sporting nationality (national-team eligibility) |
|
||||
| `positions` | array | R | `gk`, `def`, `mid`, `fwd` in the classic set; finer positions in later attribute sets |
|
||||
| `foot` | enum | O | `left`, `right`, `both` |
|
||||
@@ -348,7 +351,7 @@ Edition detection is the one the launcher already performs (`src/launch/game_dat
|
||||
|
||||
### 8.2 Mapping per edition
|
||||
|
||||
Every edition has a mapping table in the importer (to be published with it as `docs/formats/obw/import.md`):
|
||||
The first standalone converter and its coverage are documented in [the edition mapping](obw/import.md). The full intended mapping is:
|
||||
|
||||
| Legacy league | German editions | Football Limited | OBW |
|
||||
|---|---|---|---|
|
||||
@@ -363,6 +366,8 @@ Cups, European cups, the indoor tournament, the English FA Cup with its qualifyi
|
||||
|
||||
### 8.3 Fidelity
|
||||
|
||||
The initial `legacy-database-v1` converter preserves database seeds and source tables without starting a career. It does not yet satisfy the engine equivalence criteria below; those require the 0.2 adapter. Its manifest explicitly marks it non-playable, and its import report lists unresolved areas. Unmapped world data lives in `x-legacy/`; `state/x-legacy.json` is reserved for converted saves.
|
||||
|
||||
- A new career imported from an installation must produce the same first season in the engine as the legacy start (same fixtures, same participants), verified by the regression runs.
|
||||
- A converted `.FBM` must continue with the same results as the legacy save for a fixed number of turns.
|
||||
- Values the typed model does not yet understand go to `state/x-legacy.json` with their legacy name, so nothing is lost while the model grows area by area.
|
||||
|
||||
@@ -19,7 +19,7 @@ Unless a page says otherwise, integer fields are little endian. Legacy strings u
|
||||
| Audio containers | `S/2000` through `S/2003` | [SOUND](SOUND.md) | `src/audio/container.cpp`, `original.cpp` |
|
||||
| Executable data | German LE and English X-32 images | [LE](LE.md), [executable layout](EXECUTABLE_LAYOUT.md) | `src/formats/le.cpp`, `src/launch/fltd.cpp` |
|
||||
| IFF crest template | `WAPPEN.LBM` | [WAPPEN](WAPPEN.md) | Not loaded by OpenBMH |
|
||||
| OpenBMH world, save and pack (concept) | `*.obw`, `*.obs`, `*.obp`, `*.obt` | [OBW](OBW.md) | Planned for 0.2 |
|
||||
| OpenBMH world, save and pack | `*.obw`, `*.obs`, `*.obp`, `*.obt` | [OBW](OBW.md), [initial importer](obw/import.md) | `src/import` converts installation data; game integration/save support planned for 0.2 |
|
||||
|
||||
German and English editions can share a physical format while differing in text, league contents, executable layout and currency. Select the edition through the supplied installation; do not rename files or patch a save header to simulate another version. Original English V2.20 save import is a separate compatibility limitation from English installation support.
|
||||
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
# Legacy installation importer (first version)
|
||||
|
||||
`openbmh_import` converts a locally supplied German BMH installation or English
|
||||
Football Limited installation into an OBW ZIP, or an unpacked OBW directory.
|
||||
It is a separate tool: neither game frontend nor the engine reads OBW yet.
|
||||
Integration into the game belongs to version 0.2.
|
||||
|
||||
## Build and use
|
||||
|
||||
Configure the project as described in [BUILDING](../../BUILDING.md), then build
|
||||
the additional target:
|
||||
|
||||
```sh
|
||||
cmake --build build --config Release --target openbmh_import
|
||||
./build/openbmh_import --data "path/to/game" --output "season.obw" \
|
||||
--start-date 2026-07-01 --title "My imported season"
|
||||
```
|
||||
|
||||
With a Visual Studio multi-configuration build, use
|
||||
`build\Release\openbmh_import.exe`. On Linux and macOS, the executable is in
|
||||
`build/openbmh_import`. To inspect or edit the JSON directly:
|
||||
|
||||
```sh
|
||||
./build/openbmh_import --data "path/to/FLTD.EXE" --output "season-directory" \
|
||||
--start-date 1995-07-01 --directory
|
||||
```
|
||||
|
||||
`--data` accepts an installation directory, a parent containing exactly one
|
||||
installation, or its `BMH.EXE`/`FLTD.EXE`. File discovery ignores case. An
|
||||
installation containing both executables requires naming the executable.
|
||||
Only the executable, master database and text database are required; absent
|
||||
graphics, audio or desktop files do not prevent conversion. Source ZIP/7z
|
||||
archives and individual `.FBM` saves are not input formats for this first tool.
|
||||
|
||||
The reference date is explicit because a master database records ages without
|
||||
an unambiguous season year. It must be July 1, from 1900 through 9998. The tool
|
||||
does not use the computer's current date. It refuses existing output paths,
|
||||
including symlinks. Output is assembled in a sibling staging directory and
|
||||
published after validation; the output parent must already exist.
|
||||
Do not run competing writers against the same destination.
|
||||
|
||||
Runtime packages for 0.1 retain their existing products. The source build has
|
||||
the extra importer; `cmake --install build --component ImportTools` installs it
|
||||
separately. Installing it does not enable OBW in the game.
|
||||
|
||||
## Conversion profile and coverage
|
||||
|
||||
The manifest declares format `1.0`, `kind: world`, provenance `import:bmh-de`
|
||||
or `import:fltd`, and `content_license: local-import-only`. Crucially,
|
||||
`requires: ["import:legacy-database-v1"]` and `x-import.playable: false`
|
||||
identify an **intermediate conversion**, not a fully initialized playable world.
|
||||
A reader which does not support this profile must refuse it. Future conversion
|
||||
passes can complete its mappings without needing to reopen the original database.
|
||||
|
||||
Every core table uses the `schema`/`items` envelope, including `rules` and
|
||||
`calendar`. The schemas under [schema/1.0](schema/1.0) describe this first
|
||||
conversion profile; complete save/pack/theme schemas and engine playability
|
||||
validation remain future work.
|
||||
|
||||
| Source | Exported data |
|
||||
|---|---|
|
||||
| `M3D.MAN` / `M3E.MAN` | Named clubs, national teams, nations, all 2,574 players, master squad assignments, stadium name pool |
|
||||
| Player words and bonus bytes | Position, age, nationality including the high bonus bit, form/technique/condition, seven skills, bonus and derived display strength |
|
||||
| Executable, through existing loaders | Nine league sizes/tiers/participants, original fixture pairings, promotion-ladder inputs, 366 source calendar words, training-camp prices/quality and credit factors |
|
||||
| `TEXTD.BLK` / `TEXTE.BLK` | Local `de-original` / `en-original` gettext layer and an indexed text table with raw bytes |
|
||||
| Unmapped master fields | Named hexadecimal tables, original name pools, original player words, badge/kit selectors, squad words and flags |
|
||||
| Source master database | Exact file bytes in `x-legacy/source-database.json`, hexadecimal, for lossless later re-mapping |
|
||||
|
||||
`x-legacy/import-report.json` records warnings and outstanding mappings. Staff,
|
||||
contracts and finance tables are empty: their initialized values are created
|
||||
by career setup, rather than supplied as complete records by the master database.
|
||||
Stadium names are exported without invented owners or capacities. Squad rows are
|
||||
preserved as legacy rows, not claimed to be shirt numbers. A source player name
|
||||
is kept whole in `name.last`; the importer does not guess first/last-name splits.
|
||||
|
||||
Exact birth dates are unknown. A player instead carries
|
||||
`age_at_start: {"years": 22, "on": "2026-07-01"}`. This is an explicit alternative
|
||||
to `born`, not an assumed birthday. Attribute scales are the stored scales:
|
||||
form, technique, condition and bonus 0–127; skills 0–3; display strength 0–99.
|
||||
`bmh-classic@1` in `world/rules.json` declares those scales and marks strength as
|
||||
derived. These are master seeds, before career initialization varies ratings,
|
||||
rewrites nationality fields or shuffles league participants. No career is
|
||||
started and no random stream is consumed during import.
|
||||
|
||||
### Identifiers and edition mappings
|
||||
|
||||
Ids derive from source identity slots, not names: `club:00000`, `player:00000`,
|
||||
`stadium:00000`. National teams use `nt:<nation key>`. Recognized geographic
|
||||
aliases get ISO nation keys (England/Scotland/Wales/Northern Ireland use private
|
||||
football-association keys). Unrecognized or duplicate labels get
|
||||
`nation:x-legacy-<index>` with confederation `other` and a warning. Foreign clubs
|
||||
whose nation has not been decoded refer to `nation:x-legacy-unassigned`.
|
||||
The source index always remains in `x-legacy`.
|
||||
|
||||
| Source leagues | German | Football Limited |
|
||||
|---|---|---|
|
||||
| 0, 1 | Tiers 1, 2; 18 clubs each | Tiers 1, 2; 20 clubs each |
|
||||
| 2, 3 | Parallel tier 3, ids ending `-3-a` / `-3-b`; 18 each | Tiers 3, 4; 20 each |
|
||||
| 4 | Tier 4; 18 clubs | Tier 5; 10 clubs, `played: false`, no fixture generator |
|
||||
| 5–8 | Four 12-club leagues, using nation slots 1–4 | Same, with the English database's nation-slot order |
|
||||
| 138–167 | Named amateur-pool slots | Only named slots become entities; unnamed slots remain in the source data |
|
||||
| 168–356 | Foreign teams without squads | Same |
|
||||
| 357–418 | National teams / nationality labels | Same |
|
||||
|
||||
Foreign strength bytes encode a band and style flags, not a 0–255 rating. They
|
||||
stay in `x-legacy.strength_code` until a typed interpretation is implemented.
|
||||
Fixture tables store home/away **draw-position pairs**, not final shuffled
|
||||
career fixtures. Calendar words remain source day offsets; competition options
|
||||
and weekday alignment have not run. Promotion and European-place bytes are
|
||||
retained as inputs, without pretending that cup qualifications have been mapped.
|
||||
|
||||
The existing executable loaders apply OpenBMH's supported rule profile, and the
|
||||
English loader translates FLTD data into the common address space. The manifest
|
||||
records `rule_profile: openbmh-supported`; this tool does **not** claim an
|
||||
unmodified dump of every original edition's rules. No executable is included in
|
||||
the OBW file.
|
||||
|
||||
### Text and rights
|
||||
|
||||
Text follows the existing ISO 646-DE substitutions. Extended bytes are preserved
|
||||
as Latin-1 Unicode code points and original hexadecimal bytes; control/layout
|
||||
codes remain available in the legacy text table. The local gettext catalogue
|
||||
uses stable `legacy.text.<index>` message ids with `legacy-text` context. It is
|
||||
a preservation layer, not a completed translation of the modern interface.
|
||||
|
||||
Imported names and texts retain their original ownership. Keep the resulting
|
||||
world on your machine; the importer does not grant permission to distribute it.
|
||||
The public repository contains only implementation, schemas and synthetic tests.
|
||||
|
||||
## Validation and remaining work
|
||||
|
||||
The tool checks required documents, table versions, duplicate identities,
|
||||
cross-table team/nation references, stage participant counts, fixture rows,
|
||||
source squad ownership and supported edition sizes before publishing output.
|
||||
Malformed/truncated input is an error; it does not substitute synthetic game
|
||||
content. `obw_import_tests` covers synthetic German/English mappings, legacy
|
||||
reader input, archive/directory round trips and rejected inputs.
|
||||
|
||||
Still to implement: full cup definitions/qualification and dated calendars,
|
||||
complete rule mappings, initialized finances/contracts/staff/stadiums, asset
|
||||
conversion, `.FBM` to `.obs`, a general OBW reader/validator and the 0.2 engine
|
||||
adapter. First-season equivalence and save continuation regressions only become
|
||||
possible when that adapter exists; the first converter does not claim them.
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://raw.githubusercontent.com/Weyoune/openbmh/main/docs/formats/obw/schema/1.0/calendar.json",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"schema": {
|
||||
"const": "calendar@1.0"
|
||||
},
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^calendar:[a-zA-Z0-9._-]+$"
|
||||
},
|
||||
"season_start": {
|
||||
"const": "07-01"
|
||||
},
|
||||
"series": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"legacy_calendar_bit": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"maximum": 31
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"legacy_calendar_bit"
|
||||
],
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"season_start",
|
||||
"series"
|
||||
],
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"schema",
|
||||
"items"
|
||||
],
|
||||
"additionalProperties": true,
|
||||
"$comment": "SPDX-License-Identifier: GPL-3.0-only; initial legacy-database-v1 conversion profile."
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://raw.githubusercontent.com/Weyoune/openbmh/main/docs/formats/obw/schema/1.0/clubs.json",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"schema": {
|
||||
"const": "clubs@1.0"
|
||||
},
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "common.json#/$defs/team_id"
|
||||
},
|
||||
"type": {
|
||||
"enum": [
|
||||
"club",
|
||||
"national",
|
||||
"amateur",
|
||||
"foreign"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"$ref": "common.json#/$defs/localized"
|
||||
},
|
||||
"nation": {
|
||||
"$ref": "common.json#/$defs/nation_id"
|
||||
},
|
||||
"stadium": {
|
||||
"type": "string",
|
||||
"pattern": "^stadium:[a-zA-Z0-9._-]+$"
|
||||
},
|
||||
"strength": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"type",
|
||||
"name",
|
||||
"nation"
|
||||
],
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"schema",
|
||||
"items"
|
||||
],
|
||||
"additionalProperties": true,
|
||||
"$comment": "SPDX-License-Identifier: GPL-3.0-only; initial legacy-database-v1 conversion profile."
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://raw.githubusercontent.com/Weyoune/openbmh/main/docs/formats/obw/schema/1.0/common.json",
|
||||
"$defs": {
|
||||
"localized": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"default": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"default"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"nation_id": {
|
||||
"type": "string",
|
||||
"pattern": "^nation:[a-zA-Z0-9._-]+$"
|
||||
},
|
||||
"team_id": {
|
||||
"type": "string",
|
||||
"pattern": "^(club|nt):[a-zA-Z0-9._-]+$"
|
||||
},
|
||||
"person_id": {
|
||||
"type": "string",
|
||||
"pattern": "^(player|staff):[a-zA-Z0-9._-]+$"
|
||||
},
|
||||
"date": {
|
||||
"type": "string",
|
||||
"format": "date",
|
||||
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
|
||||
},
|
||||
"attributes": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"$comment": "SPDX-License-Identifier: GPL-3.0-only; initial legacy-database-v1 conversion profile."
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://raw.githubusercontent.com/Weyoune/openbmh/main/docs/formats/obw/schema/1.0/competitions.json",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"schema": {
|
||||
"const": "competitions@1.0"
|
||||
},
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^comp:[a-zA-Z0-9._-]+$"
|
||||
},
|
||||
"name": {
|
||||
"$ref": "common.json#/$defs/localized"
|
||||
},
|
||||
"type": {
|
||||
"const": "league"
|
||||
},
|
||||
"nation": {
|
||||
"$ref": "common.json#/$defs/nation_id"
|
||||
},
|
||||
"tier": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"played": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"stages": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"format": {
|
||||
"const": "league"
|
||||
},
|
||||
"teams": {
|
||||
"type": "integer",
|
||||
"minimum": 4,
|
||||
"maximum": 24
|
||||
},
|
||||
"legs": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"generator": {
|
||||
"type": "string"
|
||||
},
|
||||
"matchdays": {
|
||||
"type": "string"
|
||||
},
|
||||
"slots": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"teams": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "common.json#/$defs/team_id"
|
||||
},
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"teams"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"minItems": 1
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"format",
|
||||
"teams",
|
||||
"legs",
|
||||
"slots"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"minItems": 1
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"name",
|
||||
"type",
|
||||
"nation",
|
||||
"tier",
|
||||
"played",
|
||||
"stages"
|
||||
],
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"schema",
|
||||
"items"
|
||||
],
|
||||
"additionalProperties": true,
|
||||
"$comment": "SPDX-License-Identifier: GPL-3.0-only; initial legacy-database-v1 conversion profile."
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://raw.githubusercontent.com/Weyoune/openbmh/main/docs/formats/obw/schema/1.0/contracts.json",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"schema": {
|
||||
"const": "contracts@1.0"
|
||||
},
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^contract:[a-zA-Z0-9._-]+$"
|
||||
},
|
||||
"person": {
|
||||
"$ref": "common.json#/$defs/person_id"
|
||||
},
|
||||
"team": {
|
||||
"$ref": "common.json#/$defs/team_id"
|
||||
},
|
||||
"salary": {
|
||||
"type": "integer"
|
||||
},
|
||||
"start": {
|
||||
"$ref": "common.json#/$defs/date"
|
||||
},
|
||||
"end": {
|
||||
"$ref": "common.json#/$defs/date"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"person",
|
||||
"team"
|
||||
],
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"schema",
|
||||
"items"
|
||||
],
|
||||
"additionalProperties": true,
|
||||
"$comment": "SPDX-License-Identifier: GPL-3.0-only; initial legacy-database-v1 conversion profile."
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://raw.githubusercontent.com/Weyoune/openbmh/main/docs/formats/obw/schema/1.0/finance.json",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"schema": {
|
||||
"const": "finance@1.0"
|
||||
},
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^finance:[a-zA-Z0-9._-]+$"
|
||||
},
|
||||
"team": {
|
||||
"$ref": "common.json#/$defs/team_id"
|
||||
},
|
||||
"balance": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"team"
|
||||
],
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"schema",
|
||||
"items"
|
||||
],
|
||||
"additionalProperties": true,
|
||||
"$comment": "SPDX-License-Identifier: GPL-3.0-only; initial legacy-database-v1 conversion profile."
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://raw.githubusercontent.com/Weyoune/openbmh/main/docs/formats/obw/schema/1.0/manifest.json",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"format": {
|
||||
"const": "openbmh-world"
|
||||
},
|
||||
"format_version": {
|
||||
"const": "1.0"
|
||||
},
|
||||
"kind": {
|
||||
"const": "world"
|
||||
},
|
||||
"min_reader": {
|
||||
"const": "1.0"
|
||||
},
|
||||
"title": {
|
||||
"$ref": "common.json#/$defs/localized"
|
||||
},
|
||||
"generator": {
|
||||
"type": "string"
|
||||
},
|
||||
"provenance": {
|
||||
"enum": [
|
||||
"import:bmh-de",
|
||||
"import:fltd"
|
||||
]
|
||||
},
|
||||
"content_license": {
|
||||
"const": "local-import-only"
|
||||
},
|
||||
"currency": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "string"
|
||||
},
|
||||
"minor_units": {
|
||||
"const": 0
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"code",
|
||||
"minor_units"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"start_date": {
|
||||
"$ref": "common.json#/$defs/date"
|
||||
},
|
||||
"languages": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"minItems": 1
|
||||
},
|
||||
"limits": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"leagues": {
|
||||
"const": 32
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"leagues"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"requires": {
|
||||
"const": [
|
||||
"import:legacy-database-v1"
|
||||
]
|
||||
},
|
||||
"extensions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"version": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"version"
|
||||
],
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"x-import": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"profile": {
|
||||
"const": "legacy-database-v1"
|
||||
},
|
||||
"playable": {
|
||||
"const": false
|
||||
},
|
||||
"rule_profile": {
|
||||
"const": "openbmh-supported"
|
||||
},
|
||||
"default_attribute_set": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"profile",
|
||||
"playable",
|
||||
"rule_profile"
|
||||
],
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"format",
|
||||
"format_version",
|
||||
"kind",
|
||||
"min_reader",
|
||||
"title",
|
||||
"generator",
|
||||
"provenance",
|
||||
"content_license",
|
||||
"currency",
|
||||
"start_date",
|
||||
"languages",
|
||||
"limits",
|
||||
"requires",
|
||||
"extensions",
|
||||
"x-import"
|
||||
],
|
||||
"additionalProperties": true,
|
||||
"$comment": "SPDX-License-Identifier: GPL-3.0-only; initial legacy-database-v1 conversion profile."
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://raw.githubusercontent.com/Weyoune/openbmh/main/docs/formats/obw/schema/1.0/nations.json",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"schema": {
|
||||
"const": "nations@1.0"
|
||||
},
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^nation:[a-zA-Z0-9._-]+$"
|
||||
},
|
||||
"name": {
|
||||
"$ref": "common.json#/$defs/localized"
|
||||
},
|
||||
"confederation": {
|
||||
"enum": [
|
||||
"uefa",
|
||||
"conmebol",
|
||||
"caf",
|
||||
"afc",
|
||||
"concacaf",
|
||||
"ofc",
|
||||
"other"
|
||||
]
|
||||
},
|
||||
"national_team": {
|
||||
"type": "string",
|
||||
"pattern": "^nt:[a-zA-Z0-9._-]+$"
|
||||
},
|
||||
"playable": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"name",
|
||||
"confederation"
|
||||
],
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"schema",
|
||||
"items"
|
||||
],
|
||||
"additionalProperties": true,
|
||||
"$comment": "SPDX-License-Identifier: GPL-3.0-only; initial legacy-database-v1 conversion profile."
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://raw.githubusercontent.com/Weyoune/openbmh/main/docs/formats/obw/schema/1.0/players.json",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"schema": {
|
||||
"const": "players@1.0"
|
||||
},
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^player:[a-zA-Z0-9._-]+$"
|
||||
},
|
||||
"name": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"first": {
|
||||
"type": "string"
|
||||
},
|
||||
"last": {
|
||||
"type": "string"
|
||||
},
|
||||
"known_as": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"first",
|
||||
"last"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"born": {
|
||||
"$ref": "common.json#/$defs/date"
|
||||
},
|
||||
"age_at_start": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"years": {
|
||||
"type": "integer",
|
||||
"minimum": 16,
|
||||
"maximum": 47
|
||||
},
|
||||
"on": {
|
||||
"$ref": "common.json#/$defs/date"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"years",
|
||||
"on"
|
||||
],
|
||||
"additionalProperties": true
|
||||
},
|
||||
"nationalities": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "common.json#/$defs/nation_id"
|
||||
},
|
||||
"minItems": 1
|
||||
},
|
||||
"positions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"enum": [
|
||||
"gk",
|
||||
"def",
|
||||
"mid",
|
||||
"fwd"
|
||||
]
|
||||
},
|
||||
"minItems": 1
|
||||
},
|
||||
"attribute_set": {
|
||||
"const": "bmh-classic@1"
|
||||
},
|
||||
"attributes": {
|
||||
"$ref": "common.json#/$defs/attributes"
|
||||
},
|
||||
"team": {
|
||||
"$ref": "common.json#/$defs/team_id"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"name",
|
||||
"nationalities",
|
||||
"positions",
|
||||
"attribute_set",
|
||||
"attributes"
|
||||
],
|
||||
"additionalProperties": true,
|
||||
"oneOf": [
|
||||
{
|
||||
"required": [
|
||||
"born"
|
||||
],
|
||||
"not": {
|
||||
"required": [
|
||||
"age_at_start"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"required": [
|
||||
"age_at_start"
|
||||
],
|
||||
"not": {
|
||||
"required": [
|
||||
"born"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"schema",
|
||||
"items"
|
||||
],
|
||||
"additionalProperties": true,
|
||||
"$comment": "SPDX-License-Identifier: GPL-3.0-only; initial legacy-database-v1 conversion profile."
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://raw.githubusercontent.com/Weyoune/openbmh/main/docs/formats/obw/schema/1.0/rules.json",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"schema": {
|
||||
"const": "rules@1.0"
|
||||
},
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"type"
|
||||
],
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"schema",
|
||||
"items"
|
||||
],
|
||||
"additionalProperties": true,
|
||||
"$comment": "SPDX-License-Identifier: GPL-3.0-only; initial legacy-database-v1 conversion profile."
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://raw.githubusercontent.com/Weyoune/openbmh/main/docs/formats/obw/schema/1.0/stadiums.json",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"schema": {
|
||||
"const": "stadiums@1.0"
|
||||
},
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^stadium:[a-zA-Z0-9._-]+$"
|
||||
},
|
||||
"name": {
|
||||
"$ref": "common.json#/$defs/localized"
|
||||
},
|
||||
"owner": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "common.json#/$defs/team_id"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"capacity": {
|
||||
"type": "object"
|
||||
},
|
||||
"facilities": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"name"
|
||||
],
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"schema",
|
||||
"items"
|
||||
],
|
||||
"additionalProperties": true,
|
||||
"$comment": "SPDX-License-Identifier: GPL-3.0-only; initial legacy-database-v1 conversion profile."
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://raw.githubusercontent.com/Weyoune/openbmh/main/docs/formats/obw/schema/1.0/staff.json",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"schema": {
|
||||
"const": "staff@1.0"
|
||||
},
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^staff:[a-zA-Z0-9._-]+$"
|
||||
},
|
||||
"name": {
|
||||
"$ref": "common.json#/$defs/localized"
|
||||
},
|
||||
"role": {
|
||||
"type": "string"
|
||||
},
|
||||
"team": {
|
||||
"$ref": "common.json#/$defs/team_id"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"name",
|
||||
"role"
|
||||
],
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"schema",
|
||||
"items"
|
||||
],
|
||||
"additionalProperties": true,
|
||||
"$comment": "SPDX-License-Identifier: GPL-3.0-only; initial legacy-database-v1 conversion profile."
|
||||
}
|
||||
Reference in new issue
Block a user