Sample outdoor weather from the climate preset so people can freeze and the clock can show it.

Protocol v8 adds tenths of a °C and precipitation to the clock frame; warmth drains from insulation versus place temperature.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-20 03:49:40 +03:00
co-authored by Cursor
parent d8f4958167
commit 8e7ab46e79
40 changed files with 1008 additions and 39 deletions
+14 -2
View File
@@ -13,7 +13,7 @@ public static class ProtocolCodec
/// Largest <em>fixed-size</em> frame this codec produces. Variable map snapshots and
/// presence frames use <see cref="ProtocolConstants.MaxMessageSize"/> instead.
/// </summary>
public const int MaxFrameSize = 24;
public const int MaxFrameSize = 27;
public static int WriteHello(Span<byte> destination, in ClientHelloMessage message)
{
@@ -99,6 +99,8 @@ public static class ProtocolCodec
writer.WriteByte(message.SpeedIndex);
writer.WriteByte(message.SkipAllowed ? (byte)1 : (byte)0);
writer.WriteInt64(message.SkipTargetUnixMs);
writer.WriteInt16(message.TemperatureTenths);
writer.WriteByte(message.Precipitation);
return writer.Position;
}
@@ -317,7 +319,17 @@ public static class ProtocolCodec
var speedIndex = reader.ReadByte();
var skipAllowed = reader.ReadByte() != 0;
var skipTarget = reader.ReadInt64();
return new ServerClockMessage(schoolId, gameTime, running, speedIndex, skipAllowed, skipTarget);
var temperatureTenths = reader.ReadInt16();
var precipitation = reader.ReadByte();
return new ServerClockMessage(
schoolId,
gameTime,
running,
speedIndex,
skipAllowed,
skipTarget,
temperatureTenths,
precipitation);
}
public static ServerSchoolGoneMessage ReadSchoolGone(ReadOnlySpan<byte> source)