Enhance school creation and map management features by updating the API to support mod packs and map layouts. Introduce a new map snapshot protocol for efficient data handling during school sessions. Revise documentation to reflect these changes, including updates to the protocol and architecture documents. Improve UI components for mod selection and map editing, ensuring a better user experience. Update tests to validate new functionalities and ensure robustness.
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
namespace HSchool.Protocol;
|
||||
|
||||
/// <summary>First frame from the client; carries nothing but the version handshake.</summary>
|
||||
public readonly record struct ClientHelloMessage(byte ProtocolVersion);
|
||||
/// <summary>
|
||||
/// First frame from the client. <paramref name="Locale"/> is <see cref="ProtocolConstants.LocaleRussian"/>
|
||||
/// or <see cref="ProtocolConstants.LocaleEnglish"/> — the same language the catalog HTTP API uses.
|
||||
/// </summary>
|
||||
public readonly record struct ClientHelloMessage(byte ProtocolVersion, byte Locale);
|
||||
|
||||
/// <summary>Round-trip probe; the server mirrors <paramref name="ClientTimeMs"/> back untouched.</summary>
|
||||
public readonly record struct ClientPingMessage(long ClientTimeMs);
|
||||
@@ -37,3 +40,21 @@ public readonly record struct ServerClockMessage(
|
||||
|
||||
/// <summary>The open school no longer exists (deleted from another tab); the client returns to the menu.</summary>
|
||||
public readonly record struct ServerSchoolGoneMessage(int SchoolId);
|
||||
|
||||
/// <summary>
|
||||
/// Tree node in a map snapshot. Kind is <c>0</c> territory, <c>1</c> building, <c>2</c> floor, <c>3</c> room.
|
||||
/// <paramref name="ParentId"/> is empty for the yard.
|
||||
/// </summary>
|
||||
public sealed record MapSnapshotNode(
|
||||
byte Kind,
|
||||
string Id,
|
||||
string ParentId,
|
||||
string Name,
|
||||
IReadOnlyList<string> Items,
|
||||
IReadOnlyList<string> Positions);
|
||||
|
||||
/// <summary>
|
||||
/// One school's map, labelled in the Hello locale. Sent once when that school is opened, not every tick.
|
||||
/// People and in-place activities are omitted — the client keeps those sections empty.
|
||||
/// </summary>
|
||||
public sealed record ServerMapSnapshotMessage(int SchoolId, IReadOnlyList<MapSnapshotNode> Nodes);
|
||||
|
||||
Reference in New Issue
Block a user