Protocol/Packets/RoomInfoPacket.cs

Network packet class representing room metadata for the protocol. Declares JSON-serializable properties like version, tags, permissions, games, checksums, seed name and time, and overrides Command to "RoomInfo".

Networking
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace APLib.Protocol.Packets;

public sealed class RoomInfoPacket : APPacket
{
	[JsonPropertyName( "cmd" )]
	public override string Command => "RoomInfo";
	
	[JsonPropertyName( "version" )]
	public NetworkVersion Version { get; set; }
	
	[JsonPropertyName( "generator_version" )]
	public NetworkVersion GeneratorVersion { get; set; }
	
	[JsonPropertyName( "tags" )]
	public string[] Tags { get; set; }
	
	[JsonPropertyName( "password" )]
	public bool PasswordRequired { get; set; }
	
	[JsonPropertyName( "permissions" )]
	public Dictionary<string, int> Permissions { get; set; }
	
	[JsonPropertyName( "hint_cost" )]
	public int HintCost { get; set; }
	
	[JsonPropertyName( "location_check_points" )]
	public int LocationCheckPoints { get; set; }
	
	[JsonPropertyName( "games" )]
	public string[] Games { get; set; }
	
	[JsonPropertyName( "datapackage_checksums" )]
	public Dictionary<string, string> DatapackageChecksums { get; set; }
	
	[JsonPropertyName( "seed_name" )]
	public string SeedName { get; set; }
	
	[JsonPropertyName( "time" )]
	public double Time { get; set; }
}