GetPlayerWeatherSync: Difference between revisions
Complete Lua function catalog |
Complete upcoming 0.1.9 documentation: weather, crafting UI, world removal, doors and ladders; preserve release status |
||
| Line 38: | Line 38: | ||
[[Category:Server Functions]] | [[Category:Server Functions]] | ||
[[Category:World Functions]] | [[Category:World Functions]] | ||
<!-- weather019:start --> | |||
== Extended weather from 0.1.9 == | |||
'''Available from 0.1.9 (upcoming; not yet publicly released). Not included in public 0.1.8. Use matching updated clients and server.''' | |||
This existing API retains its call shape; the catalog is extended, not restricted to five names. See [[Weather]] and [[Weather catalog]]. Server target/revision and client acknowledgement are not proof of the final rendered image. The new presets still require in-game visual qualification; use compatible clients and test late join, indoor areas and returning to ordinary weather. | |||
<!-- weather019:end --> | |||
Revision as of 20:56, 19 October 2026
getPlayerWeatherSync
Returns the latest world-environment acknowledgement received from one client.
Syntax
string status, string weather, int revision, int ageMs, int flags, int minuteOfDay = getPlayerWeatherSync(int playerId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player identifier to inspect. |
Returns
Returns six values: synchronization status, client weather, acknowledged revision, acknowledgement ageMs, applied-state bit flags, and client minuteOfDay. Status can be ok, pending, outdated, mismatch, time-mismatch, incomplete, stale, or not-connected.
Examples
Inspect whether a player has applied the current weather:
local status, weather, revision, ageMs, flags, minuteOfDay =
getPlayerWeatherSync(playerId)
outputDebugString(string.format(
"Player %d: %s, %s, revision %d, ACK age %d ms",
playerId, status, weather, revision, ageMs))
Notes
- Available only in server-side resource scripts.
- For an unknown player, the function returns not-connected, an empty weather string, revision 0, age -1, flags 0, and minute -1.
- Acknowledgement flags are a bitmask: 1 means received, 2 means time applied, and 4 means weather applied.
- This is a diagnostic read. Weather remains server-authoritative.
Extended weather from 0.1.9
Available from 0.1.9 (upcoming; not yet publicly released). Not included in public 0.1.8. Use matching updated clients and server.
This existing API retains its call shape; the catalog is extended, not restricted to five names. See Weather and Weather catalog. Server target/revision and client acknowledgement are not proof of the final rendered image. The new presets still require in-game visual qualification; use compatible clients and test late join, indoor areas and returning to ordinary weather.