@@ -5578,7 +5578,7 @@ Utilities
5578
5578
* It's possible that multiple Luanti instances are running at the same
5579
5579
time, which may lead to corruption if you are not careful.
5580
5580
* ` core.is_singleplayer() `
5581
- * ` core.features ` : Table containing API feature flags
5581
+ * ` core.features ` : Table containing * server-side * API feature flags
5582
5582
5583
5583
``` lua
5584
5584
{
@@ -5693,6 +5693,7 @@ Utilities
5693
5693
```
5694
5694
5695
5695
* ` core.has_feature(arg) ` : returns ` boolean, missing_features `
5696
+ * checks for * server-side* feature availability
5696
5697
* ` arg ` : string or table in format ` {foo=true, bar=true} `
5697
5698
* ` missing_features ` : ` {foo=true, bar=true} `
5698
5699
* ` core.get_player_information(player_name) ` : Table containing information
@@ -5714,17 +5715,40 @@ Utilities
5714
5715
min_jitter = 0.01 , -- minimum packet time jitter
5715
5716
max_jitter = 0.5 , -- maximum packet time jitter
5716
5717
avg_jitter = 0.03 , -- average packet time jitter
5718
+
5719
+ -- The version information is provided by the client and may be spoofed
5720
+ -- or inconsistent in engine forks. You must not use this for checking
5721
+ -- feature availability of clients. Instead, do use the fields
5722
+ -- `protocol_version` and `formspec_version` where it matters.
5723
+ -- Use `core.protocol_versions` to map Luanti versions to protocol versions.
5724
+ -- This version string is only suitable for analysis purposes.
5725
+ version_string = " 0.4.9-git" , -- full version string
5726
+
5717
5727
-- the following information is available in a debug build only!!!
5718
5728
-- DO NOT USE IN MODS
5719
5729
-- serialization_version = 26, -- serialization version used by client
5720
5730
-- major = 0, -- major version number
5721
5731
-- minor = 4, -- minor version number
5722
5732
-- patch = 10, -- patch version number
5723
- -- version_string = "0.4.9-git", -- full version string
5724
5733
-- state = "Active" -- current client state
5725
5734
}
5726
5735
```
5727
5736
5737
+ * ` core.protocol_versions ` :
5738
+ * Table mapping Luanti versions to corresponding protocol versions for modder convenience.
5739
+ * For example, to check whether a client has at least the feature set
5740
+ of Luanti 5.8.0 or newer, you could do:
5741
+ ` core.get_player_information(player_name).protocol_version >= core.protocol_versions["5.8.0"] `
5742
+ * (available since 5.11)
5743
+
5744
+ ``` lua
5745
+ {
5746
+ [version string ] = protocol version at time of release
5747
+ -- every major and minor version has an entry
5748
+ -- patch versions only for the first release whose protocol version is not already present in the table
5749
+ }
5750
+ ```
5751
+
5728
5752
* ` core.get_player_window_information(player_name) ` :
5729
5753
5730
5754
``` lua
0 commit comments