namespace HSchool.Protocol; /// Wire-format constants shared by the server and the browser client. public static class ProtocolConstants { /// Bumped on every breaking change to the binary layout. public const byte Version = 9; /// Upper bound for a single WebSocket frame accepted by the server. public const int MaxMessageSize = 8 * 1024; /// Hello locale byte: Russian. Any other value that is not is treated as this. public const byte LocaleRussian = 0; /// Hello locale byte: English. Same value the catalog HTTP API takes as lang=en. public const byte LocaleEnglish = 1; /// Catalog locale string matching the Hello byte. Unknown bytes fall back to Russian. public static string CatalogLocale(byte locale) => locale == LocaleEnglish ? "en" : "ru"; }