Mod API levels: server mods' players functions are level 1; the registry's lockfile

Main gained players.online, tell and broadcast (#1833) after 0.2.69, so
they take level 1 with render.set-minimap. horizon-mod-registry's own
Cargo.lock picks up wasmparser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-26 11:46:27 +01:00
parent 0a9a7c0d06
commit b12c89650e
3 changed files with 30 additions and 3 deletions
+24
View File
@@ -401,6 +401,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
dependencies = [
"foldhash",
"serde",
"serde_core",
]
[[package]]
@@ -442,6 +444,7 @@ dependencies = [
"serde_json",
"sha2",
"toml",
"wasmparser",
"zip",
]
@@ -649,6 +652,8 @@ checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855"
dependencies = [
"equivalent",
"hashbrown",
"serde",
"serde_core",
]
[[package]]
@@ -921,6 +926,12 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "semver"
version = "1.0.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"
[[package]]
name = "serde"
version = "1.0.229"
@@ -1326,6 +1337,19 @@ dependencies = [
"wit-bindgen",
]
[[package]]
name = "wasmparser"
version = "0.254.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c5ff8685b587722894b6f25958fc608d315b93b8d23647bfb567664e7006d757"
dependencies = [
"bitflags",
"hashbrown",
"indexmap",
"semver",
"serde",
]
[[package]]
name = "webpki-roots"
version = "0.26.11"
+5 -2
View File
@@ -10,10 +10,10 @@
pub const LEVEL: u32 = 1;
/// Every function the game offers mods, as `interface.function`, with its
/// level. Level 0 is the contract of Horizon 0.2.67 and 0.2.68. A new
/// level. Level 0 is the contract of Horizon 0.2.67 to 0.2.69. A new
/// function takes the next level and raises [`LEVEL`] (the `api_reference`
/// test fails until it is listed here).
pub const FUNCTIONS: [(&str, u32); 29] = [
pub const FUNCTIONS: [(&str, u32); 32] = [
("log.write", 0),
("game.get-player", 0),
("game.get-clock", 0),
@@ -43,6 +43,9 @@ pub const FUNCTIONS: [(&str, u32); 29] = [
("render.frame-stats", 0),
("render.set-zoom", 0),
("render.set-minimap", 1),
("players.online", 1),
("players.tell", 1),
("players.broadcast", 1),
];
/// A function's level; None for one this Horizon doesn't have.
+1 -1
View File
@@ -38,7 +38,7 @@ don't import it); faster, or fixing behaviour to what the reference already says
A new WIT function doesn't break older mods, but a mod that calls it can't run on a Horizon from before it. So every
function the game offers mods has an **API level**, the one it arrived at (`crates/horizon-mods/src/api_level.rs`):
level 0 is the contract of Horizon 0.2.67 and 0.2.68, level 1 adds `render.set-minimap`. A mod needs the level of
level 0 is the contract of Horizon 0.2.67 to 0.2.69, level 1 adds `render.set-minimap` and server mods' `players`. A mod needs the level of
the newest function it imports (a component imports only the functions it calls). The level is read from the file,
never declared: