{"TotalCount":1156,"Files":[{"Ident":"notpointless.chomnr_sbox_superuser","Path":"Code/SboxSuperuser/Api/AdminChatResultEvent.cs","FileName":"AdminChatResultEvent.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":446326,"IsPrivate":false,"Code":"namespace SboxSuperuser;\n\n/// \u003Csummary\u003EPrivate client notification from a verified host reply; it grants no command authority.\u003C/summary\u003E\npublic sealed class AdminChatResultEvent\n{\n\t/// \u003Csummary\u003EGets the request ID associated with this reply.\u003C/summary\u003E\n\tpublic Guid RequestId { get; }\n\n\t/// \u003Csummary\u003EGets immutable caller-safe status, message and structured fields.\u003C/summary\u003E\n\tpublic CommandResult Result { get; }\n\n\t/// \u003Csummary\u003ESet true when a custom view rendered this result to avoid duplicate default chatbox display.\u003C/summary\u003E\n\tpublic bool SuppressDefaultDisplay { get; set; }\n\n\tinternal AdminChatResultEvent( Guid requestId, CommandResult result )\n\t{\n\t\tRequestId = requestId;\n\t\tResult = result;\n\t}\n}\n"},{"Ident":"notpointless.chomnr_sbox_superuser","Path":"Code/SboxSuperuser/Api/AdminMenuWindowRow.cs","FileName":"AdminMenuWindowRow.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":446326,"IsPrivate":false,"Code":"namespace SboxSuperuser;\n\n/// \u003Csummary\u003EA module\u0027s window in the admin menu, filtered to what the viewer may use.\u003C/summary\u003E\npublic sealed class AdminMenuWindowRow\n{\n\t/// \u003Csummary\u003EThe module that added it.\u003C/summary\u003E\n\tpublic string ModuleId { get; init; } = \u0022\u0022;\n\n\t/// \u003Csummary\u003EThe window title, also its entry in its menu.\u003C/summary\u003E\n\tpublic string Title { get; init; } = \u0022\u0022;\n\n\t/// \u003Csummary\u003EThe menu bar tab it is listed under: Modules, Moderation, Server, or a tab of the module\u0027s own.\u003C/summary\u003E\n\tpublic string Menu { get; init; } = AdminMenuWindow.DefaultMenu;\n\n\t/// \u003Csummary\u003EThe window\u0027s contents, top to bottom.\u003C/summary\u003E\n\tpublic AdminMenuElementRow[] Elements { get; init; } = Array.Empty\u003CAdminMenuElementRow\u003E();\n}\n"},{"Ident":"notpointless.chomnr_sbox_superuser","Path":"Code/SboxSuperuser/Api/IAdminRestrictions.cs","FileName":"IAdminRestrictions.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":446326,"IsPrivate":false,"Code":"namespace SboxSuperuser;\n\n/// \u003Csummary\u003EHost-only module capability registered with RegisterService\u0026lt;IAdminRestrictions\u0026gt;; participates in player actions and active restrictions.\u003C/summary\u003E\npublic interface IAdminRestrictions\n{\n\t/// \u003Csummary\u003EDeclares up to 16 restriction types. Commands must belong to the registering module.\u003C/summary\u003E\n\tIReadOnlyList\u003CAdminRestrictionType\u003E Types { get; }\n\t/// \u003Csummary\u003EReturns up to 512 active records for one type; throw when storage is unavailable instead of reporting an empty list.\u003C/summary\u003E\n\tIReadOnlyList\u003CAdminModerationRow\u003E ReadActive( string kind );\n}\n\n/// \u003Csummary\u003ENames a module\u0027s restriction and existing permission-checked apply/restore commands.\u003C/summary\u003E\npublic sealed record AdminRestrictionType( string Kind, string Label, string ApplyCommand, string RestoreCommand, string ReadPermission );\n\n/// \u003Csummary\u003EA host-filtered player action supplied by a module; executing it still rechecks authority.\u003C/summary\u003E\npublic sealed class AdminPlayerActionRow\n{\n\tpublic string Label { get; init; }\n\tpublic string Command { get; init; }\n\tpublic bool Restore { get; init; }\n}\n"},{"Ident":"notpointless.chomnr_sbox_superuser","Path":"Code/SboxSuperuser/Api/ICommandServices.cs","FileName":"ICommandServices.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":446326,"IsPrivate":false,"Code":"namespace SboxSuperuser;\n\n/// \u003Csummary\u003EHost-approved game capabilities; implementations must expose only explicitly approved services.\u003C/summary\u003E\npublic interface ICommandServices\n{\n\t/// \u003Csummary\u003EReturns an approved service, or null when unavailable; never constructs a fallback implementation.\u003C/summary\u003E\n\tT GetService\u003CT\u003E() where T : class;\n}\n"},{"Ident":"notpointless.chomnr_sbox_superuser","Path":"Code/SboxSuperuser/Api/NativeCommandBindingDescriptor.cs","FileName":"NativeCommandBindingDescriptor.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":446326,"IsPrivate":false,"Code":"using SboxSuperuser.Engine.Commands;\nusing SboxSuperuser.Engine.NativeSettings;\n\nnamespace SboxSuperuser;\n\n/// \u003Csummary\u003EAn allowlisted native command with typed dispatcher metadata; native submission has no success acknowledgment.\u003C/summary\u003E\npublic sealed class NativeCommandBindingDescriptor\n{\n\t/// \u003Csummary\u003EGets the validated framework descriptor, owned by superuser.settings.\u003C/summary\u003E\n\tpublic CommandDescriptor Command { get; }\n\t/// \u003Csummary\u003EGets the exact native name passed separately from typed arguments.\u003C/summary\u003E\n\tpublic string NativeName { get; }\n\t/// \u003Csummary\u003EGets the explicit execution scope.\u003C/summary\u003E\n\tpublic string Scope =\u003E \u0022Host\u0022;\n\n\t/// \u003Csummary\u003EDeclares a native command; player targets, durations and optional native parameters are deliberately unsupported.\u003C/summary\u003E\n\tpublic NativeCommandBindingDescriptor( string key, string nativeName, string description, string permission,\n\t\tIEnumerable\u003CCommandArgumentDescriptor\u003E arguments = null )\n\t{\n\t\tNativeName = NativeValue.Name( nativeName );\n\t\tCommand = new CommandDescriptor( \u0022native.\u0022 \u002B NativeValue.Key( key ), description, permission, \u0022superuser.settings\u0022, arguments );\n\t\tCommandMetadata.Validate( Command );\n\t\tif ( Command.Arguments.Any( argument =\u003E argument.IsOptional || argument.Kind is CommandArgumentKind.Player or CommandArgumentKind.Duration ) )\n\t\t\tthrow new ArgumentException( \u0022Native bindings require explicit scalar arguments.\u0022, nameof( arguments ) );\n\t}\n}\n"},{"Ident":"notpointless.chomnr_sbox_superuser","Path":"Code/SboxSuperuser/Api/StyledRun.cs","FileName":"StyledRun.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":446326,"IsPrivate":false,"Code":"namespace SboxSuperuser;\n\n/// \u003Csummary\u003EA stretch of a styled line in one style.\u003C/summary\u003E\npublic readonly struct StyledRun\n{\n\tinternal StyledRun( string text, Color color, float space, bool bold, bool italic )\n\t{\n\t\tText = text;\n\t\tColor = color;\n\t\tSpace = space;\n\t\tBold = bold;\n\t\tItalic = italic;\n\t}\n\n\t/// \u003Csummary\u003EThe text to draw.\u003C/summary\u003E\n\tpublic string Text { get; }\n\n\t/// \u003Csummary\u003EIts color, alpha included.\u003C/summary\u003E\n\tpublic Color Color { get; }\n\n\t/// \u003Csummary\u003EEmpty space before it, in letter widths.\u003C/summary\u003E\n\tpublic float Space { get; }\n\n\t/// \u003Csummary\u003EWhether it is bold.\u003C/summary\u003E\n\tpublic bool Bold { get; }\n\n\t/// \u003Csummary\u003EWhether it is slanted.\u003C/summary\u003E\n\tpublic bool Italic { get; }\n}\n"},{"Ident":"notpointless.chomnr_sbox_superuser","Path":"Code/SboxSuperuser/Core/Commands/CommandRootName.cs","FileName":"CommandRootName.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":446326,"IsPrivate":false,"Code":"namespace SboxSuperuser.Core.Commands;\n\ninternal static class CommandRootName\n{\n\tinternal static string Validate( string name )\n\t{\n\t\tif ( string.IsNullOrEmpty( name ) || name.Length \u003E 32 || name[ 0 ] is not (\u003E= \u0027a\u0027 and \u003C= \u0027z\u0027)\n\t\t\t|| name.Any( value =\u003E value is not (\u003E= \u0027a\u0027 and \u003C= \u0027z\u0027 or \u003E= \u00270\u0027 and \u003C= \u00279\u0027 or \u0027_\u0027) ) )\n\t\t{\n\t\t\tthrow new ArgumentException( \u0022Root names require 1\u201332 lowercase letters, digits or underscores, starting with a letter.\u0022, nameof( name ) );\n\t\t}\n\n\t\tif ( name is \u0022superuser\u0022 or \u0022superuser_request\u0022 )\n\t\t{\n\t\t\tthrow new ArgumentException( \u0022This name is reserved for the fixed native transport.\u0022, nameof( name ) );\n\t\t}\n\n\t\treturn name;\n\t}\n}\n"},{"Ident":"notpointless.chomnr_sbox_superuser","Path":"Code/SboxSuperuser/Core/Commands/ScalarConversion.cs","FileName":"ScalarConversion.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":446326,"IsPrivate":false,"Code":"using System.Globalization;\n\nnamespace SboxSuperuser.Core.Commands;\n\ninternal static class ScalarConversion\n{\n\tinternal static bool Integer( string text, double? minimum, double? maximum, out long value )\n\t{\n\t\treturn long.TryParse( text, NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture, out value )\n\t\t\t\u0026\u0026 (!minimum.HasValue || AtLeast( value, minimum.Value ))\n\t\t\t\u0026\u0026 (!maximum.HasValue || AtMost( value, maximum.Value ));\n\t}\n\n\tprivate static bool AtLeast( long value, double bound ) =\u003E bound \u003C= long.MinValue\n\t\t|| bound \u003C 9223372036854775808d \u0026\u0026 value \u003E= (long)Math.Ceiling( bound );\n\n\tprivate static bool AtMost( long value, double bound ) =\u003E bound \u003E= 9223372036854775808d\n\t\t|| bound \u003E= long.MinValue \u0026\u0026 value \u003C= (long)Math.Floor( bound );\n\n\tinternal static bool Number( string text, double? minimum, double? maximum, out double value )\n\t{\n\t\treturn double.TryParse( text, NumberStyles.AllowLeadingSign | NumberStyles.AllowDecimalPoint | NumberStyles.AllowExponent,\n\t\t\tCultureInfo.InvariantCulture, out value ) \u0026\u0026 double.IsFinite( value )\n\t\t\t\u0026\u0026 (!minimum.HasValue || value \u003E= minimum.Value) \u0026\u0026 (!maximum.HasValue || value \u003C= maximum.Value);\n\t}\n\n\tinternal static bool Boolean( string text, out bool value )\n\t{\n\t\tvalue = string.Equals( text, \u0022true\u0022, StringComparison.OrdinalIgnoreCase );\n\t\treturn value || string.Equals( text, \u0022false\u0022, StringComparison.OrdinalIgnoreCase );\n\t}\n\n\tinternal static bool Duration( string text, out TimeSpan? value )\n\t{\n\t\tvalue = null;\n\t\tif ( string.Equals( text, \u0022permanent\u0022, StringComparison.OrdinalIgnoreCase ) )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( string.IsNullOrEmpty( text ) || text.Length \u003C 2 || text[ 0 ] == \u00270\u0027\n\t\t\t|| !long.TryParse( text.Substring( 0, text.Length - 1 ), NumberStyles.None, CultureInfo.InvariantCulture, out var amount ) || amount \u003C= 0 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tvar ticks = char.ToLowerInvariant( text[ text.Length - 1 ] ) switch\n\t\t{\n\t\t\t\u0027s\u0027 =\u003E TimeSpan.TicksPerSecond,\n\t\t\t\u0027m\u0027 =\u003E TimeSpan.TicksPerMinute,\n\t\t\t\u0027h\u0027 =\u003E TimeSpan.TicksPerHour,\n\t\t\t\u0027d\u0027 =\u003E TimeSpan.TicksPerDay,\n\t\t\t\u0027w\u0027 =\u003E 7 * TimeSpan.TicksPerDay,\n\t\t\t_ =\u003E 0\n\t\t};\n\t\tif ( ticks == 0 || amount \u003E long.MaxValue / ticks )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tvalue = TimeSpan.FromTicks( amount * ticks );\n\t\treturn true;\n\t}\n}\n"},{"Ident":"notpointless.chomnr_sbox_superuser","Path":"Code/SboxSuperuser/Core/Effects/EffectColor.cs","FileName":"EffectColor.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":446326,"IsPrivate":false,"Code":"using System.Globalization;\n\nnamespace SboxSuperuser.Core.Effects;\n\n/// \u003Csummary\u003EAn RGBA color with channels from 0 to 1, as effect scripts produce them.\u003C/summary\u003E\ninternal readonly record struct EffectColor( float R, float G, float B, float A = 1 )\n{\n\tinternal static readonly EffectColor White = new( 1, 1, 1 );\n\n\t/// \u003Csummary\u003EParses #rgb, #rrggbb or #rrggbbaa; returns false for anything else.\u003C/summary\u003E\n\tinternal static bool TryParseHex( string text, out EffectColor color )\n\t{\n\t\tcolor = White;\n\t\tif ( string.IsNullOrEmpty( text ) || text[ 0 ] != \u0027#\u0027 ) return false;\n\t\tvar hex = text.Substring( 1 );\n\t\tif ( hex.Length == 3 ) hex = string.Concat( hex.Select( digit =\u003E new string( digit, 2 ) ) );\n\t\tif ( hex.Length is not (6 or 8) || !uint.TryParse( hex, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out var value ) ) return false;\n\t\tif ( hex.Length == 6 ) value = (value \u003C\u003C 8) | 0xFF;\n\t\tcolor = new EffectColor( ((value \u003E\u003E 24) \u0026 0xFF) / 255f, ((value \u003E\u003E 16) \u0026 0xFF) / 255f, ((value \u003E\u003E 8) \u0026 0xFF) / 255f, (value \u0026 0xFF) / 255f );\n\t\treturn true;\n\t}\n\n\tinternal static EffectColor FromBytes( double r, double g, double b, double a = 255 ) =\u003E\n\t\tnew( Channel( r / 255 ), Channel( g / 255 ), Channel( b / 255 ), Channel( a / 255 ) );\n\n\t/// \u003Csummary\u003EHue in degrees (wraps), saturation and value from 0 to 1.\u003C/summary\u003E\n\tinternal static EffectColor FromHsv( double hue, double saturation, double value )\n\t{\n\t\thue = double.IsFinite( hue ) ? ((hue % 360) \u002B 360) % 360 / 60 : 0;\n\t\tdouble v = Channel( value );\n\t\tvar chroma = v * Channel( saturation );\n\t\tvar x = chroma * (1 - Math.Abs( hue % 2 - 1 ));\n\t\tvar m = v - chroma;\n\t\t(double r, double g, double b) = (int)hue switch\n\t\t{\n\t\t\t0 =\u003E (chroma, x, 0d),\n\t\t\t1 =\u003E (x, chroma, 0d),\n\t\t\t2 =\u003E (0d, chroma, x),\n\t\t\t3 =\u003E (0d, x, chroma),\n\t\t\t4 =\u003E (x, 0d, chroma),\n\t\t\t_ =\u003E (chroma, 0d, x)\n\t\t};\n\t\treturn new EffectColor( (float)(r \u002B m), (float)(g \u002B m), (float)(b \u002B m) );\n\t}\n\n\tinternal EffectColor Mix( EffectColor other, double amount )\n\t{\n\t\tvar t = Channel( amount );\n\t\treturn new EffectColor( R \u002B (other.R - R) * t, G \u002B (other.G - G) * t, B \u002B (other.B - B) * t, A \u002B (other.A - A) * t );\n\t}\n\n\tinternal EffectColor WithAlpha( double alpha ) =\u003E this with { A = Channel( alpha ) };\n\n\tinternal string ToHex()\n\t{\n\t\tstatic int Byte( float channel ) =\u003E (int)MathF.Round( channel * 255 );\n\t\tvar rgb = $\u0022#{Byte( R ):X2}{Byte( G ):X2}{Byte( B ):X2}\u0022;\n\t\treturn A \u003E= 1 ? rgb : rgb \u002B Byte( A ).ToString( \u0022X2\u0022, CultureInfo.InvariantCulture );\n\t}\n\n\tprivate static float Channel( double value ) =\u003E (float)Math.Clamp( double.IsFinite( value ) ? value : 0, 0, 1 );\n}\n"},{"Ident":"notpointless.chomnr_sbox_superuser","Path":"Code/SboxSuperuser/Core/Effects/EffectInput.cs","FileName":"EffectInput.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":446326,"IsPrivate":false,"Code":"namespace SboxSuperuser.Core.Effects;\n\n/// \u003Csummary\u003EEverything one part of a line gives its effect: the text to style plus the shared clock and player data.\u003C/summary\u003E\ninternal readonly record struct EffectInput( string Text, string Part, double Time, int Seed, EffectValue Palette, string Name, string Prefix );\n"},{"Ident":"notpointless.chomnr_sbox_superuser","Path":"Code/SboxSuperuser/Core/Effects/EffectType.cs","FileName":"EffectType.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":446326,"IsPrivate":false,"Code":"namespace SboxSuperuser.Core.Effects;\n\n/// \u003Csummary\u003EWhat the checker knows about a value before the script runs; a null kind means \u0022only known at run time\u0022.\u003C/summary\u003E\ninternal readonly record struct EffectType( EffectValueKind? Kind, EffectValueKind? Item = null )\n{\n\tinternal static readonly EffectType Unknown = new( null );\n\n\tinternal static EffectType Of( EffectValueKind kind ) =\u003E new( kind );\n\n\tinternal bool IsNumeric =\u003E Kind is EffectValueKind.Number or EffectValueKind.Bool;\n\n\tinternal EffectType Merge( EffectType other ) =\u003E this == other ? this\n\t\t: IsNumeric \u0026\u0026 other.IsNumeric ? Of( EffectValueKind.Number ) : Unknown;\n}\n"},{"Ident":"notpointless.chomnr_sbox_superuser","Path":"Code/SboxSuperuser/Core/Permissions/GroupDefinition.cs","FileName":"GroupDefinition.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":446326,"IsPrivate":false,"Code":"using SboxSuperuser.Core.Contracts;\n\nnamespace SboxSuperuser.Core.Permissions;\n\ninternal sealed class GroupDefinition\n{\n\tinternal string Id { get; }\n\tinternal IReadOnlyList\u003Cstring\u003E Parents { get; }\n\tinternal IReadOnlyDictionary\u003Cstring, int\u003E Entries { get; }\n\tinternal int ProtectionLevel { get; }\n\n\tinternal GroupDefinition( string id, IEnumerable\u003Cstring\u003E parents,\n\t\tIEnumerable\u003CKeyValuePair\u003Cstring, int\u003E\u003E entries, int protectionLevel )\n\t{\n\t\tId = ContractGuard.Key( id, nameof( id ) );\n\t\tif ( id == \u0022owner\u0022 || protectionLevel is \u003C 0 or \u003E TargetProtection.MaximumGroupLevel )\n\t\t{\n\t\t\tthrow new ArgumentException( $\u0022Owner is reserved; group protection must be between 0 and {TargetProtection.MaximumGroupLevel}.\u0022 );\n\t\t}\n\n\t\tParents = PolicyEntries.Groups( parents );\n\t\tEntries = PolicyEntries.Snapshot( entries );\n\t\tProtectionLevel = protectionLevel;\n\t}\n}\n"},{"Ident":"notpointless.chomnr_sbox_superuser","Path":"Code/SboxSuperuser/Core/Permissions/PolicyEntries.cs","FileName":"PolicyEntries.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":446326,"IsPrivate":false,"Code":"using System.Collections.ObjectModel;\nusing SboxSuperuser.Core.Contracts;\n\nnamespace SboxSuperuser.Core.Permissions;\n\ninternal static class PolicyEntries\n{\n\tinternal static IReadOnlyDictionary\u003Cstring, int\u003E Snapshot( IEnumerable\u003CKeyValuePair\u003Cstring, int\u003E\u003E entries )\n\t{\n\t\tvar seen = new HashSet\u003Cstring\u003E( StringComparer.Ordinal );\n\t\tvar result = new Dictionary\u003Cstring, int\u003E( StringComparer.Ordinal );\n\t\tforeach ( var entry in entries ?? Array.Empty\u003CKeyValuePair\u003Cstring, int\u003E\u003E() )\n\t\t{\n\t\t\tContractGuard.Key( entry.Key, nameof( entries ) );\n\t\t\tif ( !seen.Add( entry.Key ) || entry.Value is \u003C 0 or \u003E 2 )\n\t\t\t{\n\t\t\t\tthrow new ArgumentException( \u0022Permission entries must be unique and have an explicit valid effect.\u0022, nameof( entries ) );\n\t\t\t}\n\n\t\t\t// Unset is removal, never an explicit deny that would shadow inherited entries.\n\t\t\tif ( entry.Value != 0 )\n\t\t\t{\n\t\t\t\tresult.Add( entry.Key, entry.Value );\n\t\t\t}\n\t\t}\n\n\t\treturn new ReadOnlyDictionary\u003Cstring, int\u003E( result );\n\t}\n\n\tinternal static IReadOnlyList\u003Cstring\u003E Groups( IEnumerable\u003Cstring\u003E groups )\n\t{\n\t\tvar result = new List\u003Cstring\u003E();\n\t\tvar seen = new HashSet\u003Cstring\u003E( StringComparer.Ordinal );\n\t\tforeach ( var group in groups ?? Array.Empty\u003Cstring\u003E() )\n\t\t{\n\t\t\tContractGuard.Key( group, nameof( groups ) );\n\t\t\tif ( group == \u0022owner\u0022 || !seen.Add( group ) )\n\t\t\t{\n\t\t\t\tthrow new ArgumentException( \u0022Group references must be unique; owner membership is reserved.\u0022, nameof( groups ) );\n\t\t\t}\n\n\t\t\tresult.Add( group );\n\t\t}\n\n\t\treturn result.AsReadOnly();\n\t}\n}\n"},{"Ident":"notpointless.chomnr_sbox_superuser","Path":"Code/SboxSuperuser/Core/Storage/StoredRevision.cs","FileName":"StoredRevision.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":446326,"IsPrivate":false,"Code":"namespace SboxSuperuser.Core.Storage;\n\ninternal sealed record StoredRevision( Guid GenerationId, int SchemaVersion, long Revision, string PayloadJson );\n"},{"Ident":"notpointless.chomnr_sbox_superuser","Path":"Code/SboxSuperuser/Core/Votes/VoteTally.cs","FileName":"VoteTally.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":446326,"IsPrivate":false,"Code":"namespace SboxSuperuser.Core.Votes;\n\n/// \u003Csummary\u003EHow a vote is decided.\u003C/summary\u003E\ninternal enum VoteRule\n{\n\t/// \u003Csummary\u003EAn option wins only with more than half of everyone connected, voted or not.\u003C/summary\u003E\n\tMajorityOfServer,\n\n\t/// \u003Csummary\u003EThe option with the most votes wins, at least one; staff-forced votes use this.\u003C/summary\u003E\n\tMostVotes\n}\n\n/// \u003Csummary\u003EThe decided outcome: the winning option\u0027s index, or null when nothing won.\u003C/summary\u003E\ninternal sealed record VoteOutcome( int? Winner, string Reason );\n\n/// \u003Csummary\u003E\n/// One vote\u0027s ballots. Only players present when it started may vote, each once, and they may change their mind\n/// until it ends; anyone who leaves is no longer counted, so they neither help nor block a majority.\n/// \u003C/summary\u003E\ninternal sealed class VoteTally\n{\n\tinternal const int MaximumOptions = 9;\n\n\tprivate readonly Dictionary\u003Cstring, int\u003E _ballots = new( StringComparer.Ordinal );\n\tprivate readonly List\u003Cstring\u003E _eligible;\n\n\tinternal string Question { get; }\n\tinternal IReadOnlyList\u003Cstring\u003E Options { get; }\n\tinternal VoteRule Rule { get; }\n\tinternal IReadOnlyList\u003Cstring\u003E Eligible =\u003E _eligible;\n\n\tinternal VoteTally( string question, IReadOnlyList\u003Cstring\u003E options, IEnumerable\u003Cstring\u003E eligible, VoteRule rule )\n\t{\n\t\tif ( string.IsNullOrWhiteSpace( question ) ) throw new ArgumentException( \u0022A vote needs a question.\u0022, nameof( question ) );\n\t\tif ( options is null || options.Count \u003C 2 || options.Count \u003E MaximumOptions || options.Any( string.IsNullOrWhiteSpace ) )\n\t\t\tthrow new ArgumentException( $\u0022A vote needs 2 to {MaximumOptions} options.\u0022, nameof( options ) );\n\t\tQuestion = question;\n\t\tOptions = options.ToArray();\n\t\tRule = rule;\n\t\t_eligible = eligible.Distinct( StringComparer.Ordinal ).ToList();\n\t}\n\n\t/// \u003Csummary\u003ERecords or changes a ballot; false for players who can\u0027t vote here or options that don\u0027t exist.\u003C/summary\u003E\n\tinternal bool Cast( string voter, int option )\n\t{\n\t\tif ( option \u003C 0 || option \u003E= Options.Count || !_eligible.Contains( voter ) ) return false;\n\t\t_ballots[ voter ] = option;\n\t\treturn true;\n\t}\n\n\t/// \u003Csummary\u003EThe voter\u0027s chosen option, or null before they vote.\u003C/summary\u003E\n\tinternal int? BallotOf( string voter ) =\u003E _ballots.TryGetValue( voter, out var option ) ? option : null;\n\n\tinternal void Leave( string voter )\n\t{\n\t\t_eligible.Remove( voter );\n\t\t_ballots.Remove( voter );\n\t}\n\n\tinternal int Count( int option ) =\u003E _ballots.Values.Count( ballot =\u003E ballot == option );\n\n\t/// \u003Csummary\u003EVotes an option needs to win outright under the majority rule.\u003C/summary\u003E\n\tinternal int Needed =\u003E _eligible.Count / 2 \u002B 1;\n\n\t/// \u003Csummary\u003EWhether the result can no longer change, so the vote can end early.\u003C/summary\u003E\n\tinternal bool IsSettled =\u003E Rule == VoteRule.MajorityOfServer \u0026\u0026 Enumerable.Range( 0, Options.Count ).Any( option =\u003E Count( option ) \u003E= Needed )\n\t\t|| _ballots.Count == _eligible.Count;\n\n\tinternal VoteOutcome Decide()\n\t{\n\t\tvar counts = Enumerable.Range( 0, Options.Count ).Select( Count ).ToArray();\n\t\tvar best = counts.Max();\n\t\tif ( best == 0 ) return new VoteOutcome( null, \u0022Nobody voted.\u0022 );\n\t\tvar leaders = Enumerable.Range( 0, counts.Length ).Where( option =\u003E counts[ option ] == best ).ToArray();\n\t\tif ( Rule == VoteRule.MajorityOfServer )\n\t\t\treturn best \u003E= Needed ? new VoteOutcome( leaders[ 0 ], $\u0022{Options[ leaders[ 0 ] ]} won with {best} of {_eligible.Count}.\u0022 )\n\t\t\t\t: new VoteOutcome( null, $\u0022No option reached {Needed} of {_eligible.Count} players.\u0022 );\n\t\treturn leaders.Length == 1 ? new VoteOutcome( leaders[ 0 ], $\u0022{Options[ leaders[ 0 ] ]} won with {best} votes.\u0022 )\n\t\t\t: new VoteOutcome( null, \u0022The vote was tied.\u0022 );\n\t}\n}\n"},{"Ident":"notpointless.chomnr_sbox_superuser","Path":"Code/SboxSuperuser/Engine/Admin/HostAdminQueries.Administration.cs","FileName":"HostAdminQueries.Administration.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":446326,"IsPrivate":false,"Code":"namespace SboxSuperuser.Engine.Admin;\n\ninternal sealed partial class HostAdminQueries\n{\n\tprivate const string SecurityPermission = \u0022admin.security.manage\u0022;\n\n\tprivate bool IsOwner( ActorIdentity actor ) =\u003E actor.Kind == ActorKind.Player \u0026\u0026 _policy.IsOwner( actor.SubjectId );\n\n\t// Module IDs and states match \u0022admin modules list\u0022, and the status rows match \u0022admin diagnostics\u0022; both are owner-only.\n\tprivate AdminReply ReadAbout( Guid id, ActorIdentity actor )\n\t{\n\t\tvar owner = IsOwner( actor );\n\t\treturn new AdminReply\n\t\t{\n\t\t\tRequestId = id, Status = CommandStatus.Success, Message = \u0022About Superuser.\u0022, ModulesAllowed = owner,\n\t\t\tModules = owner\n\t\t\t\t? _modules().Select( status =\u003E new AdminModuleRow\n\t\t\t\t{\n\t\t\t\t\tId = status.Descriptor.Id, ApiVersion = status.Descriptor.ApiVersion,\n\t\t\t\t\tState = status.State.ToString(), Message = status.Message\n\t\t\t\t} ).OrderBy( row =\u003E row.Id, StringComparer.Ordinal ).ToArray()\n\t\t\t\t: Array.Empty\u003CAdminModuleRow\u003E(),\n\t\t\tData = owner ? _diagnostics().ToDictionary( pair =\u003E pair.Key, pair =\u003E pair.Value ) : new Dictionary\u003Cstring, string\u003E()\n\t\t};\n\t}\n\n\t// Same visibility as \u0022admin commands\u0022: permitted commands, with security management limited to owners.\n\tprivate AdminReply ReadCommands( Guid id, ActorIdentity actor, Func\u003Cstring, bool\u003E can )\n\t{\n\t\tvar owner = IsOwner( actor );\n\t\tvar rows = _commands()\n\t\t\t.Where( command =\u003E can( command.Permission ) \u0026\u0026 (command.Permission != SecurityPermission || owner) )\n\t\t\t.Select( command =\u003E new AdminCommandRow\n\t\t\t{\n\t\t\t\tName = command.Name, Description = command.Description, ModuleId = command.ModuleId,\n\t\t\t\tMutation = command.ExecutionPolicy == CommandExecutionPolicy.Mutation,\n\t\t\t\tArguments = command.Arguments.Select( argument =\u003E new AdminCommandArgumentRow\n\t\t\t\t{\n\t\t\t\t\tName = argument.Name, Description = argument.Description, Kind = argument.Kind,\n\t\t\t\t\tOptional = argument.IsOptional, Remainder = argument.IsRemainder,\n\t\t\t\t\tMinimum = argument.Minimum, Maximum = argument.Maximum, Choices = argument.Choices.ToArray()\n\t\t\t\t} ).ToArray()\n\t\t\t} ).ToArray();\n\t\treturn new AdminReply { RequestId = id, Status = CommandStatus.Success, Message = \u0022Permitted commands.\u0022, Commands = rows };\n\t}\n\n\tprivate const string ChatPermission = \u0022admin.chat.read\u0022;\n\n\t// Chat lines come from memory only and were already public; reading them still needs its own permission.\n\tprivate AdminReply ReadChat( Guid id, AdminQuery query, Func\u003Cstring, bool\u003E can )\n\t{\n\t\tif ( !can( ChatPermission ) ) return Failure( id, CommandStatus.Denied, \u0022Reading recent chat requires admin.chat.read.\u0022 );\n\t\treturn new AdminReply\n\t\t{\n\t\t\tRequestId = id, Status = CommandStatus.Success, Message = \u0022Recent chat.\u0022,\n\t\t\tChat = _chat.Read( query.Search ).Select( line =\u003E new AdminChatRow\n\t\t\t{\n\t\t\t\tSteamId = line.SteamId, Name = line.Name, Message = line.Message, CreatedUtc = line.CreatedUtc\n\t\t\t} ).ToArray()\n\t\t};\n\t}\n\n\t// Policy edits are owner-only commands, so only owners see the policy they would edit.\n\tprivate AdminReply ReadPermissions( Guid id, ActorIdentity actor )\n\t{\n\t\tvar policy = IsOwner( actor ) ? _policy.ReadPolicy( actor ) : null;\n\t\tif ( policy is null ) return Failure( id, CommandStatus.Denied, \u0022Only owners can view and edit permissions.\u0022 );\n\n\t\tstatic string[] With( IReadOnlyDictionary\u003Cstring, int\u003E entries, PermissionEffect effect ) =\u003E entries\n\t\t\t.Where( entry =\u003E entry.Value == (int)effect ).Select( entry =\u003E entry.Key ).Order( StringComparer.Ordinal ).ToArray();\n\n\t\treturn new AdminReply\n\t\t{\n\t\t\tRequestId = id, Status = CommandStatus.Success, Message = \u0022Permission policy.\u0022,\n\t\t\tGroups = policy.Groups.Values.OrderBy( group =\u003E group.Id, StringComparer.Ordinal ).Select( group =\u003E new AdminGroupRow\n\t\t\t{\n\t\t\t\tId = group.Id, Parents = group.Parents.ToArray(), Protection = group.ProtectionLevel,\n\t\t\t\tAllowed = With( group.Entries, PermissionEffect.Allow ), Denied = With( group.Entries, PermissionEffect.Deny ),\n\t\t\t\tMembers = policy.Users.Values.Where( user =\u003E user.Groups.Contains( group.Id ) )\n\t\t\t\t\t.Select( user =\u003E user.SteamId ).Order( StringComparer.Ordinal ).ToArray()\n\t\t\t} ).ToArray(),\n\t\t\tUsers = policy.Users.Values.OrderBy( user =\u003E user.SteamId, StringComparer.Ordinal ).Select( user =\u003E new AdminUserRow\n\t\t\t{\n\t\t\t\tSteamId = user.SteamId, Groups = user.Groups.ToArray(),\n\t\t\t\tAllowed = With( user.Entries, PermissionEffect.Allow ), Denied = With( user.Entries, PermissionEffect.Deny )\n\t\t\t} ).ToArray(),\n\t\t\tPermissionKeys = _policy.RegisteredPermissions.Order( StringComparer.Ordinal ).ToArray()\n\t\t};\n\t}\n}\n"},{"Ident":"notpointless.chomnr_sbox_superuser","Path":"Code/SboxSuperuser/Engine/Admin/MenuSettingsStore.cs","FileName":"MenuSettingsStore.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":446326,"IsPrivate":false,"Code":"using Sandbox;\nusing SboxSuperuser.Core.Menu;\n\nnamespace SboxSuperuser.Engine.Admin;\n\n/// \u003Csummary\u003EKeeps the local player\u0027s admin menu layout and preferences in FileSystem.Data so they survive a restart.\u003C/summary\u003E\ninternal static class MenuSettingsStore\n{\n\tprivate const string Folder = \u0022superuser\u0022;\n\tprivate const string LayoutPath = \u0022superuser/menu-layout.json\u0022;\n\tprivate const string PreferencesPath = \u0022superuser/menu-preferences.json\u0022;\n\n\t/// \u003Csummary\u003EReturns the saved layout, or null when there is none or it cannot be read.\u003C/summary\u003E\n\tinternal static MenuLayout LoadLayout() =\u003E Load( LayoutPath, MenuLayout.MaximumCharacters, MenuLayout.Parse, \u0022layout\u0022 );\n\n\t/// \u003Csummary\u003EReturns the saved preferences, or null when there are none or they cannot be read.\u003C/summary\u003E\n\tinternal static MenuPreferences LoadPreferences() =\u003E Load( PreferencesPath, MenuPreferences.MaximumCharacters, MenuPreferences.Parse, \u0022preferences\u0022 );\n\n\tinternal static void SaveLayout( MenuLayout layout ) =\u003E Save( LayoutPath, layout.Write(), \u0022layout\u0022 );\n\n\tinternal static void SavePreferences( MenuPreferences preferences ) =\u003E Save( PreferencesPath, preferences.Write(), \u0022preferences\u0022 );\n\n\tprivate static T Load\u003CT\u003E( string path, int maximumCharacters, Func\u003Cstring, T\u003E parse, string label ) where T : class\n\t{\n\t\ttry\n\t\t{\n\t\t\tif ( !FileSystem.Data.FileExists( path ) ) return null;\n\t\t\tif ( FileSystem.Data.FileSize( path ) \u003E maximumCharacters ) throw new ArgumentException( \u0022Menu settings exceed the byte limit.\u0022 );\n\t\t\treturn parse( FileSystem.Data.ReadAllText( path ) );\n\t\t}\n\t\tcatch ( Exception error )\n\t\t{\n\t\t\tLog.Warning( $\u0022[Superuser] Saved admin menu {label} ignored; defaults are used. type={error.GetType().Name}.\u0022 );\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tprivate static void Save( string path, string json, string label )\n\t{\n\t\ttry\n\t\t{\n\t\t\tFileSystem.Data.CreateDirectory( Folder );\n\t\t\tFileSystem.Data.WriteAllText( path, json );\n\t\t}\n\t\tcatch ( Exception error )\n\t\t{\n\t\t\tLog.Warning( $\u0022[Superuser] Admin menu {label} not saved. type={error.GetType().Name}.\u0022 );\n\t\t}\n\t}\n}\n"},{"Ident":"notpointless.chomnr_sbox_superuser","Path":"Code/SboxSuperuser/Engine/Bodies/PlayerBodies.cs","FileName":"PlayerBodies.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":446326,"IsPrivate":false,"Code":"using Sandbox;\n\nnamespace SboxSuperuser.Engine.Bodies;\n\n/// \u003Csummary\u003EFinds the PlayerController a connected Steam ID controls in the active scene.\u003C/summary\u003E\ninternal static class PlayerBodies\n{\n\tinternal static Connection Connection( string steamId ) =\u003E\n\t\tSandbox.Connection.All.FirstOrDefault( connection =\u003E connection.IsActive \u0026\u0026 connection.SteamId.ToString() == steamId );\n\n\tinternal static PlayerController Find( string steamId )\n\t{\n\t\tif ( Connection( steamId ) is not { } owner || Game.ActiveScene is not { } scene ) return null;\n\t\treturn scene.GetAllComponents\u003CPlayerController\u003E().FirstOrDefault( controller =\u003E controller.Network.OwnerId == owner.Id );\n\t}\n\n\t/// \u003Csummary\u003EThe resolved body, or a NotFound result explaining why there is none.\u003C/summary\u003E\n\tinternal static bool TryFind( string steamId, out PlayerController controller, out CommandResult missing )\n\t{\n\t\tcontroller = Find( steamId );\n\t\tmissing = controller is null\n\t\t\t? new CommandResult( CommandStatus.NotFound, Connection( steamId ) is null ? \u0022That player is not connected.\u0022 : \u0022That player has no body right now.\u0022 )\n\t\t\t: null;\n\t\treturn controller is not null;\n\t}\n}\n"},{"Ident":"notpointless.chomnr_sbox_superuser","Path":"Code/SboxSuperuser/Engine/CommandDiscovery/IHandlerSignature.cs","FileName":"IHandlerSignature.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":446326,"IsPrivate":false,"Code":"using Sandbox;\n\nnamespace SboxSuperuser.Engine.CommandDiscovery;\n\ninternal interface IHandlerSignature\n{\n\tvoid Validate( MethodDescription method );\n}\n"},{"Ident":"notpointless.chomnr_sbox_superuser","Path":"Code/SboxSuperuser/Engine/Commands/AdministrationCommands.Votes.cs","FileName":"AdministrationCommands.Votes.cs","PackageType":"library","CodeKind":"Game","AssetVersionId":446326,"IsPrivate":false,"Code":"using SboxSuperuser.Core.Moderation;\nusing SboxSuperuser.Core.Votes;\nusing SboxSuperuser.Engine.Votes;\n\nnamespace SboxSuperuser.Engine.Commands;\n\ninternal sealed partial class AdministrationCommands\n{\n\tinternal const string ForceMapVotePermission = \u0022admin.votes.mapforce\u0022;\n\tprivate const string ForceWord = \u0022force\u0022;\n\tprivate static readonly string[] YesNo = { \u0022Yes\u0022, \u0022No\u0022 };\n\n\tprivate void RegisterVotes( VoteSession votes, Func\u003Cstring, CommandResult\u003E changeMap )\n\t{\n\t\tRegister( \u0022vote\u0022, \u0022Ask everyone a question; options are separated by spaces, Yes and No when there are none\u0022, \u0022admin.votes.vote\u0022,\n\t\t\tnew[] { Text( \u0022question\u0022, \u0022The question, quoted when it has spaces\u0022 ), new CommandArgumentDescriptor( \u0022options\u0022, \u0022Up to 9 one-word options\u0022,\n\t\t\t\tCommandArgumentKind.String, isOptional: true, isRemainder: true ) },\n\t\t\tasync (context, arguments) =\u003E\n\t\t\t{\n\t\t\t\tvar options = arguments.Contains( \u0022options\u0022 ) ? arguments.Get\u003Cstring\u003E( \u0022options\u0022 ).Split( \u0027 \u0027, StringSplitOptions.RemoveEmptyEntries ) : YesNo;\n\t\t\t\tvar outcome = await votes.RunAsync( arguments.Get\u003Cstring\u003E( \u0022question\u0022 ), options, VoteRule.MajorityOfServer );\n\t\t\t\treturn Decided( outcome, null );\n\t\t\t}, mutation: true );\n\t\tRegister( \u0022votekick\u0022, \u0022Ask everyone whether to kick a player; it passes with more than half of the server\u0022, \u0022admin.votes.kick\u0022,\n\t\t\tnew[] { Punishable(), Reason() }, (context, arguments) =\u003E VoteToModerateAsync( votes, context, \u0022votekick\u0022, \u0022admin.votes.kick\u0022,\n\t\t\t\tModerationKind.Kick, arguments.Get\u003CPlayerReference\u003E( \u0022user\u0022 ).SteamId, arguments.Get\u003Cstring\u003E( \u0022reason\u0022 ), null ), mutation: true );\n\t\tRegister( \u0022voteban\u0022, \u0022Ask everyone whether to ban a player; it passes with more than half of the server\u0022, \u0022admin.votes.ban\u0022,\n\t\t\tnew[] { Punishable(), new CommandArgumentDescriptor( \u0022duration\u0022, \u0022Explicit positive duration such as 30m, 2h, 7d, or permanent\u0022,\n\t\t\t\tCommandArgumentKind.Duration, audit: CommandArgumentAudit.SafeValue ), Reason() },\n\t\t\t(context, arguments) =\u003E VoteToModerateAsync( votes, context, \u0022voteban\u0022, \u0022admin.votes.ban\u0022, ModerationKind.Ban,\n\t\t\t\targuments.Get\u003CPlayerReference\u003E( \u0022user\u0022 ).SteamId, arguments.Get\u003Cstring\u003E( \u0022reason\u0022 ), arguments.Get\u003CCommandDuration\u003E( \u0022duration\u0022 ) ), mutation: true );\n\t\tRegister( \u0022votemap\u0022, \u0022Ask everyone to change the map; with several maps they choose. \u0027votemap force \u003Cmaps\u003E\u0027 lets the most votes win\u0022,\n\t\t\t\u0022admin.votes.map\u0022, new[] { new CommandArgumentDescriptor( \u0022maps\u0022, \u0022One or more map idents, or force followed by maps\u0022,\n\t\t\t\tCommandArgumentKind.String, isRemainder: true ) },\n\t\t\t(context, arguments) =\u003E VoteMapAsync( votes, changeMap, context, arguments.Get\u003Cstring\u003E( \u0022maps\u0022 ) ), mutation: true );\n\t\tRegister( \u0022stopvote\u0022, \u0022End the current vote now and decide it on the ballots so far\u0022, \u0022admin.votes.stop\u0022,\n\t\t\tArray.Empty\u003CCommandArgumentDescriptor\u003E(), (_, _) =\u003E Task.FromResult( votes.Stop()\n\t\t\t\t? new CommandResult( CommandStatus.Success, \u0022Vote stopped.\u0022 ) : NoVote() ), mutation: true );\n\t\tRegister( \u0022veto\u0022, \u0022Cancel the current vote; nothing it asked for happens\u0022, \u0022admin.votes.veto\u0022,\n\t\t\tArray.Empty\u003CCommandArgumentDescriptor\u003E(), (_, _) =\u003E Task.FromResult( votes.Veto()\n\t\t\t\t? new CommandResult( CommandStatus.Success, \u0022Vote vetoed.\u0022 ) : NoVote() ), mutation: true );\n\t}\n\n\t/// \u003Csummary\u003EKicks or bans through the same path as the commands, with the vote\u0027s own permission, once Yes wins.\u003C/summary\u003E\n\tprivate async Task\u003CCommandResult\u003E VoteToModerateAsync( VoteSession votes, CommandContext context, string command, string permission,\n\t\tModerationKind kind, string target, string reason, CommandDuration duration )\n\t{\n\t\tvar verb = kind == ModerationKind.Ban ? \u0022Ban\u0022 : \u0022Kick\u0022;\n\t\tvar outcome = await votes.RunAsync( $\u0022{verb} {_playerName( target )}{(duration is null ? \u0022\u0022 : \u0022 \u0022 \u002B Core.Messages.MessageCatalog.Phrase( duration.Value ))}? {reason}\u0022, YesNo, VoteRule.MajorityOfServer );\n\t\tif ( outcome?.Winner != 0 ) return Decided( outcome, null );\n\t\treturn await ModerateAsync( context, command, permission, kind, target, $\u0022Vote: {reason}\u0022, duration );\n\t}\n\n\tprivate async Task\u003CCommandResult\u003E VoteMapAsync( VoteSession votes, Func\u003Cstring, CommandResult\u003E changeMap, CommandContext context, string text )\n\t{\n\t\tvar maps = text.Split( \u0027 \u0027, StringSplitOptions.RemoveEmptyEntries ).ToList();\n\t\tvar forced = maps.Count \u003E 0 \u0026\u0026 string.Equals( maps[ 0 ], ForceWord, StringComparison.OrdinalIgnoreCase );\n\t\tif ( forced )\n\t\t{\n\t\t\tif ( !_dispatcher.CanUse( context, ForceMapVotePermission ) ) return new CommandResult( CommandStatus.Denied, $\u0022Forcing a map vote needs {ForceMapVotePermission}.\u0022 );\n\t\t\tmaps.RemoveAt( 0 );\n\t\t}\n\t\tif ( maps.Count is 0 or \u003E VoteTally.MaximumOptions ) return new CommandResult( CommandStatus.InvalidArguments, $\u0022Give 1 to {VoteTally.MaximumOptions} maps.\u0022 );\n\t\tif ( _mapAllowed is not null \u0026\u0026 maps.FirstOrDefault( map =\u003E !_mapAllowed( map ) ) is { } banned )\n\t\t\treturn new CommandResult( CommandStatus.Denied, $\u0022{banned} is banned on this server.\u0022 );\n\t\t// One map is a yes or no question; several maps are the choices themselves.\n\t\tvar single = maps.Count == 1;\n\t\tvar outcome = await votes.RunAsync( single ? $\u0022Change the map to {maps[ 0 ]}?\u0022 : \u0022Which map next?\u0022, single ? YesNo : maps,\n\t\t\tforced ? VoteRule.MostVotes : VoteRule.MajorityOfServer );\n\t\tif ( outcome?.Winner is not { } winner || single \u0026\u0026 winner != 0 ) return Decided( outcome, null );\n\t\tvar map = single ? maps[ 0 ] : maps[ winner ];\n\t\tvar changed = changeMap?.Invoke( map ) ?? new CommandResult( CommandStatus.Unsupported, \u0022This game can\u0027t change maps.\u0022 );\n\t\treturn changed.Status == CommandStatus.Success ? new CommandResult( CommandStatus.Success, $\u0022{outcome.Reason} Changing to {map}.\u0022 ) : changed;\n\t}\n\n\tprivate static CommandResult Decided( VoteOutcome outcome, string action ) =\u003E outcome is null\n\t\t? new CommandResult( CommandStatus.Conflict, \u0022Another vote is already running; wait for it to finish.\u0022 )\n\t\t: new CommandResult( CommandStatus.Success, outcome.Reason \u002B (action is null ? \u0022\u0022 : \u0022 \u0022 \u002B action) );\n\n\tprivate static CommandResult NoVote() =\u003E new( CommandStatus.NoChange, \u0022No vote is running.\u0022 );\n\n\tprivate static CommandArgumentDescriptor Punishable() =\u003E new( \u0022user\u0022, \u0022Exact Steam ID or unique online name\u0022, CommandArgumentKind.Player,\n\t\ttargetPolicy: CommandTargetPolicy.PunitiveOnlinePlayer, audit: CommandArgumentAudit.SafeValue );\n\n\tprivate static CommandArgumentDescriptor Reason() =\u003E new( \u0022reason\u0022, \u0022Printable reason, at most 256 characters\u0022, CommandArgumentKind.String, isRemainder: true );\n}\n"}]}