Class GuildRankDefaults
The rank ladder a guild is seeded with, and the mapping from the legacy GuildRank enum to the permission flags that reproduce its behaviour exactly.
public static class GuildRankDefaults
- Inheritance
-
GuildRankDefaults
- Inherited Members
Remarks
Ranks are stored per guild as rows in guild_rank, keyed by an ORDER byte. The order
byte is the same value character_guild.rank has always held, so no membership row is
rewritten by the move to flags: a member whose stored rank was 2 was an Officer
before and holds rank order 2 afterwards. That is the whole reason the ladder is
anchored at the legacy numbers rather than renumbered into something tidier.
Higher order = more senior. The LEADER is whichever rank row carries the highest order in that guild, which is LeaderRankOrder for every guild that has not added ranks. "Cannot act on someone at or above your rank" is a comparison on this byte.
The permission sets below are not a design opinion. They are a transcription of what the
enum-based checks actually allowed, taken site by site from the pre-change
GuildSystem: invite was Leader || Officer; kick was >= Officer;
MOTD and notice were >= Officer; rank change, leadership transfer and disband
were == Leader. Existing leaders therefore lose nothing and existing members gain
nothing.
Fields
DefaultLeaderRankOrder
Rank order held by the default top rank of a freshly seeded guild.
public const byte DefaultLeaderRankOrder = 3
Field Value
Remarks
Not a constant the permission checks consult. Leadership is "the highest order row that exists in this guild", read from the database, precisely so that a guild which adds ranks does not end up with a leader seat defined by a number in this file.
LeaderPermissions
Permissions the seeded top rank holds: everything.
public const GuildPermissions LeaderPermissions = All
Field Value
LeaderRankName
Default display name of the seeded top rank.
public const string LeaderRankName = "Leader"
Field Value
LeaderRankOrder
Alias kept for readability at call sites that mean "the seeded top rank".
public const byte LeaderRankOrder = 3
Field Value
MaxRankNameLength
Maximum length of a rank name.
public const int MaxRankNameLength = 24
Field Value
Remarks
Matches character varying(24) on guild_rank.name.
MaxRankOrder
Highest legal rank order. Leaves room above the seeded ladder for guilds that add ranks.
public const byte MaxRankOrder = 200
Field Value
MaxRanksPerGuild
Most rank rows one guild may define.
public const int MaxRanksPerGuild = 12
Field Value
MemberPermissions
Permissions the seeded lowest rank holds: none.
public const GuildPermissions MemberPermissions = None
Field Value
MemberRankName
Default display name of the seeded lowest rank.
public const string MemberRankName = "Member"
Field Value
MemberRankOrder
Rank order held by the default lowest rank.
public const byte MemberRankOrder = 1
Field Value
MinRankOrder
Lowest legal rank order. Zero means "no rank", i.e. not in a guild.
public const byte MinRankOrder = 1
Field Value
OfficerPermissions
Permissions the seeded middle rank holds — the exact set the old
Rank >= GuildRank.Officer checks granted.
public const GuildPermissions OfficerPermissions = Invite | Kick | EditMessageOfTheDay | EditNotice | ManageApplications | EditRecruitment | ViewOfficerNotes | EditOfficerNotes | EditPublicNotes
Field Value
Remarks
ViewOfficerNotes and ManageApplications are included even though neither feature existed under the enum. They gate functionality that did not exist to be withheld, so including them cannot take anything away from anybody; leaving them out would ship a recruitment queue and an officer note that no officer could reach.
OfficerRankName
Default display name of the seeded middle rank.
public const string OfficerRankName = "Officer"
Field Value
OfficerRankOrder
Rank order held by the default middle rank.
public const byte OfficerRankOrder = 2
Field Value
Methods
NameFor(GuildRank)
The default display name for a legacy GuildRank value.
public static string NameFor(GuildRank rank)
Parameters
rankGuildRankThe legacy rank.
Returns
- string
The default rank name.
PermissionsFor(GuildRank)
The permission set a legacy GuildRank value corresponds to.
public static GuildPermissions PermissionsFor(GuildRank rank)
Parameters
rankGuildRankThe legacy rank.
Returns
- GuildPermissions
The permissions that rank used to imply.
SeededPermissionsFor(byte)
The permission set for a rank order in a guild that has never edited its ranks.
public static GuildPermissions SeededPermissionsFor(byte rankOrder)
Parameters
rankOrderbyteThe rank order byte from
character_guild.rank.
Returns
- GuildPermissions
The seeded permissions for that order.
Remarks
The FALLBACK only. Live checks read the guild's own rank rows; this exists for the seeding path and for the narrow window in which a guild's rows have not been written yet — during which it is safer to reproduce the historical behaviour than to grant nothing (which would soft-lock the guild) or everything (which would not be a permission system).
TrySanitizeRankName(string, out string)
Trims and caps a proposed rank name, and reports whether anything usable is left.
public static bool TrySanitizeRankName(string proposed, out string sanitized)
Parameters
Returns
- bool
True when the name is acceptable.
Remarks
Rank names are rendered in UI Toolkit labels with enableRichText = false, so a
tag in the string is shown, not obeyed. The character filter here is therefore not
about markup — it is about a rank called "" reversing the layout of every
row it appears in, and about a name made of spaces that renders as a blank column.