This commit is contained in:
JacobTech 2024-11-18 23:25:19 -05:00
parent 5c5b975b93
commit e891c3ea6b
8 changed files with 73 additions and 66 deletions

View File

@ -5,7 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<Title>Luski.Shared</Title> <Title>Luski.Shared</Title>
<Version>1.1.0-alpha44</Version> <Version>1.1.0-alpha48</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -9,18 +9,9 @@ public class CategoryPostCTS : CTS
[JsonInclude] [JsonInclude]
[JsonPropertyName("parent")] [JsonPropertyName("parent")]
public long Parent { get; set; } public long Parent { get; set; }
[JsonInclude]
[JsonPropertyName("color_type")]
public ColorType ColorType { get; set; } = ColorType.Full;
[JsonInclude]
[JsonPropertyName("color")]
public string Color { get; set; } = string.Empty;
[JsonInclude] [JsonInclude]
[JsonPropertyName("name")] [JsonPropertyName("name")]
public string Name { get; set; } = string.Empty; public string Name { get; set; } = string.Empty;
[JsonInclude] [JsonInclude]
[JsonPropertyName("description")] [JsonPropertyName("description")]
public string Description { get; set; } = string.Empty; public string Description { get; set; } = string.Empty;

View File

@ -10,12 +10,6 @@ public class ChannelPostCTS : CTS
[JsonPropertyName("parent")] [JsonPropertyName("parent")]
public long Parent { get; set; } public long Parent { get; set; }
[JsonInclude] [JsonInclude]
[JsonPropertyName("color_type")]
public ColorType ColorType { get; set; } = ColorType.Full;
[JsonInclude]
[JsonPropertyName("color")]
public string Color { get; set; } = string.Empty;
[JsonInclude]
[JsonPropertyName("type")] [JsonPropertyName("type")]
public ChannelType Type { get; set; } = ChannelType.TextAndVoice; public ChannelType Type { get; set; } = ChannelType.TextAndVoice;
[JsonInclude] [JsonInclude]

View File

@ -5,156 +5,168 @@ namespace Luski.Shared.PublicServers.V1.Enums;
[Flags] [Flags]
public enum ServerPermission : long public enum ServerPermission : long
{ {
None = 0b_0000000000000000000000000000000000000000000000000000000000000000, None = 0b_0000000000000000000000000000000000000000000000000000000000000000,
/// <summary> /// <summary>
/// Internal permission for quick permission lookup. /// Internal permission for quick permission lookup.
/// </summary> /// </summary>
[Description("Internal permission for quick permission lookup")] [Description("Internal permission for quick permission lookup")]
[GlobalAttributes.DisplayName("View This")] [GlobalAttributes.DisplayName("View This")]
[Category("Internal")] [Category("Internal")]
ViewThis = 0b_0000000000000000000000000000000000000000000000000000000000000001, ViewThis = 0b_0000000000000000000000000000000000000000000000000000000000000001,
[Description("User can view channels")] [Description("User can view channels")]
[GlobalAttributes.DisplayName("View Channels")] [GlobalAttributes.DisplayName("View Channels")]
[Category("General")] [Category("General")]
ViewChannels = 0b_0000000000000000000000000000000000000000000000000000000000000010, ViewChannels = 0b_0000000000000000000000000000000000000000000000000000000000000010,
[Description("User can move channels")] [Description("User can move channels")]
[GlobalAttributes.DisplayName("Move Channels")] [GlobalAttributes.DisplayName("Move Channels")]
[Category("General")] [Category("General")]
MoveChannels = 0b_0000000000000000000000000000000000000000000000000000000000000100, MoveChannels = 0b_0000000000000000000000000000000000000000000000000000000000000100,
[Description("User can edit channels")] [Description("User can edit channels")]
[GlobalAttributes.DisplayName("Edit Channels")] [GlobalAttributes.DisplayName("Edit Channels")]
[Category("General")] [Category("General")]
EditChannels = 0b_0000000000000000000000000000000000000000000000000000000000001000, EditChannels = 0b_0000000000000000000000000000000000000000000000000000000000001000,
[Description("User can edit channel permissions")] [Description("User can edit channel permissions")]
[GlobalAttributes.DisplayName("Edit Channel Permissions")] [GlobalAttributes.DisplayName("Edit Channel Permissions")]
[Category("General")] [Category("General")]
EditChannelPermissions = 0b_0000000000000000000000000000000000000000000000000000000000010000, EditChannelPermissions = 0b_0000000000000000000000000000000000000000000000000000000000010000,
[Description("User can create channels")] [Description("User can create channels")]
[GlobalAttributes.DisplayName("Create Channels")] [GlobalAttributes.DisplayName("Create Channels")]
[Category("General")] [Category("General")]
CreateChannels = 0b_0000000000000000000000000000000000000000000000000000000000100000, CreateChannels = 0b_0000000000000000000000000000000000000000000000000000000000100000,
[Description("User can delete channels")] [Description("User can delete channels")]
[GlobalAttributes.DisplayName("Delete Channels")] [GlobalAttributes.DisplayName("Delete Channels")]
[Category("General")] [Category("General")]
DeleteChannels = 0b_0000000000000000000000000000000000000000000000000000000001000000, DeleteChannels = 0b_0000000000000000000000000000000000000000000000000000000001000000,
[Description("User can view categories")] [Description("User can view categories")]
[GlobalAttributes.DisplayName("View Categories")] [GlobalAttributes.DisplayName("View Categories")]
[Category("General")] [Category("General")]
ViewCategories = 0b_0000000000000000000000000000000000000000000000000000000010000000, ViewCategories = 0b_0000000000000000000000000000000000000000000000000000000010000000,
[Description("User can move categories")] [Description("User can move categories")]
[GlobalAttributes.DisplayName("Move Categories")] [GlobalAttributes.DisplayName("Move Categories")]
[Category("General")] [Category("General")]
MoveCategories = 0b_0000000000000000000000000000000000000000000000000000000100000000, MoveCategories = 0b_0000000000000000000000000000000000000000000000000000000100000000,
[Description("User can edit categories")] [Description("User can edit categories")]
[GlobalAttributes.DisplayName("Edit Categories")] [GlobalAttributes.DisplayName("Edit Categories")]
[Category("General")] [Category("General")]
EditCategories = 0b_0000000000000000000000000000000000000000000000000000001000000000, EditCategories = 0b_0000000000000000000000000000000000000000000000000000001000000000,
[Description("User can edit category permissions")] [Description("User can edit category permissions")]
[GlobalAttributes.DisplayName("Edit Category Permissions")] [GlobalAttributes.DisplayName("Edit Category Permissions")]
[Category("General")] [Category("General")]
EditCategoryPermissions = 0b_0000000000000000000000000000000000000000000000000000010000000000, EditCategoryPermissions = 0b_0000000000000000000000000000000000000000000000000000010000000000,
[Description("User can create categories")] [Description("User can create categories")]
[GlobalAttributes.DisplayName("Create Categories")] [GlobalAttributes.DisplayName("Create Categories")]
[Category("General")] [Category("General")]
CreateCategories = 0b_0000000000000000000000000000000000000000000000000000100000000000, CreateCategories = 0b_0000000000000000000000000000000000000000000000000000100000000000,
[Description("User can delete categories")] [Description("User can delete categories")]
[GlobalAttributes.DisplayName("Delete Categories")] [GlobalAttributes.DisplayName("Delete Categories")]
[Category("General")] [Category("General")]
DeleteCategories = 0b_0000000000000000000000000000000000000000000000000001000000000000, DeleteCategories = 0b_0000000000000000000000000000000000000000000000000001000000000000,
[Description("User can delete keys")] [Description("User can delete keys")]
[GlobalAttributes.DisplayName("Delete Keys")] [GlobalAttributes.DisplayName("Delete Keys")]
[Category("General")] [Category("General")]
DeleteKeys = 0b_0000000000000000000000000000000000000000000000000010000000000000, DeleteKeys = 0b_0000000000000000000000000000000000000000000000000010000000000000,
[Description("User can manage roles")] [Description("User can manage roles")]
[GlobalAttributes.DisplayName("Manage Roles")] [GlobalAttributes.DisplayName("Manage Roles")]
[Category("General")] [Category("General")]
ManageRoles = 0b_0000000000000000000000000000000000000000000000000100000000000000, ManageRoles = 0b_0000000000000000000000000000000000000000000000000100000000000000,
[Description("User can view logs")] [Description("User can view logs")]
[GlobalAttributes.DisplayName("View Logs")] [GlobalAttributes.DisplayName("View Logs")]
[Category("General")] [Category("General")]
ViewLogs = 0b_0000000000000000000000000000000000000000000000001000000000000000, ViewLogs = 0b_0000000000000000000000000000000000000000000000001000000000000000,
[Description("User can manage the server")] [Description("User can manage the server")]
[GlobalAttributes.DisplayName("Manage Server")] [GlobalAttributes.DisplayName("Manage Server")]
[Category("General")] [Category("General")]
ManageServer = 0b_0000000000000000000000000000000000000000000000010000000000000000, ManageServer = 0b_0000000000000000000000000000000000000000000000010000000000000000,
[Description("User can add servers")] [Description("User can add servers")]
[GlobalAttributes.DisplayName("Add Servers")] [GlobalAttributes.DisplayName("Add Servers")]
[Category("General")] [Category("General")]
AddServers = 0b_0000000000000000000000000000000000000000000000100000000000000000, AddServers = 0b_0000000000000000000000000000000000000000000000100000000000000000,
[Description("User can remove servers")] [Description("User can remove servers")]
[GlobalAttributes.DisplayName("Remove Servers")] [GlobalAttributes.DisplayName("Remove Servers")]
[Category("General")] [Category("General")]
RemoveServers = 0b_0000000000000000000000000000000000000000000001000000000000000000, RemoveServers = 0b_0000000000000000000000000000000000000000000001000000000000000000,
[Description("User can invite people to the server if invite codes are required")] [Description("User can invite people to the server if invite codes are required")]
[GlobalAttributes.DisplayName("Invite")] [GlobalAttributes.DisplayName("Invite")]
[Category("General")] [Category("General")]
Invite = 0b_0000000000000000000000000000000000000000000010000000000000000000, Invite = 0b_0000000000000000000000000000000000000000000010000000000000000000,
[Description("User can kick people")] [Description("User can kick people")]
[GlobalAttributes.DisplayName("Kick")] [GlobalAttributes.DisplayName("Kick")]
[Category("General")] [Category("General")]
Kick = 0b_0000000000000000000000000000000000000000000100000000000000000000, Kick = 0b_0000000000000000000000000000000000000000000100000000000000000000,
[Description("User can ban people")] [Description("User can ban people")]
[GlobalAttributes.DisplayName("Ban")] [GlobalAttributes.DisplayName("Ban")]
[Category("General")] [Category("General")]
Ban = 0b_0000000000000000000000000000000000000000001000000000000000000000, Ban = 0b_0000000000000000000000000000000000000000001000000000000000000000,
[Description("User can send messages")] [Description("User can send messages")]
[GlobalAttributes.DisplayName("Send Messages")] [GlobalAttributes.DisplayName("Send Messages")]
[Category("Text Channel")] [Category("Text Channel")]
SendMessages = 0b_0000000000000000000000000000000000000000010000000000000000000000, SendMessages = 0b_0000000000000000000000000000000000000000010000000000000000000000,
[Description("User can send files")] [Description("User can send files")]
[GlobalAttributes.DisplayName("Send Files")] [GlobalAttributes.DisplayName("Send Files")]
[Category("Text Channel")] [Category("Text Channel")]
SendFiles = 0b_0000000000000000000000000000000000000000100000000000000000000000, SendFiles = 0b_0000000000000000000000000000000000000000100000000000000000000000,
[Description("User can ping channels")] [Description("User can ping channels")]
[GlobalAttributes.DisplayName("Ping Channels")] [GlobalAttributes.DisplayName("Ping Channels")]
[Category("Text Channel")] [Category("Text Channel")]
ChannelPings = 0b_0000000000000000000000000000000000000001000000000000000000000000, ChannelPings = 0b_0000000000000000000000000000000000000001000000000000000000000000,
[Description("User can ping the server")] [Description("User can ping the server")]
[GlobalAttributes.DisplayName("Ping Server")] [GlobalAttributes.DisplayName("Ping Server")]
[Category("Text Channel")] [Category("Text Channel")]
ServerPings = 0b_0000000000000000000000000000000000000010000000000000000000000000, ServerPings = 0b_0000000000000000000000000000000000000010000000000000000000000000,
[Description("User can ping people")] [Description("User can ping people")]
[GlobalAttributes.DisplayName("Ping Someone")] [GlobalAttributes.DisplayName("Ping Someone")]
[Category("Text Channel")] [Category("Text Channel")]
PingSomeone = 0b_0000000000000000000000000000000000000100000000000000000000000000, PingSomeone = 0b_0000000000000000000000000000000000000100000000000000000000000000,
[Description("User can manage messages")] [Description("User can manage messages")]
[GlobalAttributes.DisplayName("Manage Messages")] [GlobalAttributes.DisplayName("Manage Messages")]
[Category("Text Channel")] [Category("Text Channel")]
ManageMessages = 0b_0000000000000000000000000000000000001000000000000000000000000000, ManageMessages = 0b_0000000000000000000000000000000000001000000000000000000000000000,
[Description("User can read message history")] [Description("User can read message history")]
[GlobalAttributes.DisplayName("Read Message History")] [GlobalAttributes.DisplayName("Read Message History")]
[Category("Text Channel")] [Category("Text Channel")]
ReadMessageHistory = 0b_0000000000000000000000000000000000010000000000000000000000000000, ReadMessageHistory = 0b_0000000000000000000000000000000000010000000000000000000000000000,
[Description("User can use commands")] [Description("User can use commands")]
[GlobalAttributes.DisplayName("Use Commands")] [GlobalAttributes.DisplayName("Use Commands")]
[Category("Text Channel")] [Category("Text Channel")]
UseServerCommands = 0b_0000000000000000000000000000000000100000000000000000000000000000, UseServerCommands = 0b_0000000000000000000000000000000000100000000000000000000000000000,
[Description("User can join voice chats")] [Description("User can join voice chats")]
[GlobalAttributes.DisplayName("Join Voice")] [GlobalAttributes.DisplayName("Join Voice")]
[Category("Voice Channel")] [Category("Voice Channel")]
JoinVoice = 0b_0000000000000000000000000000000001000000000000000000000000000000, JoinVoice = 0b_0000000000000000000000000000000001000000000000000000000000000000,
[Description("User can speak in voice")] [Description("User can speak in voice")]
[GlobalAttributes.DisplayName("Speak In Voice")] [GlobalAttributes.DisplayName("Speak In Voice")]
[Category("Voice Channel")] [Category("Voice Channel")]
SpeakInVoice = 0b_0000000000000000000000000000000010000000000000000000000000000000, SpeakInVoice = 0b_0000000000000000000000000000000010000000000000000000000000000000,
[Description("User can mute people in voice")] [Description("User can mute people in voice")]
[GlobalAttributes.DisplayName("Mute Members In Voice")] [GlobalAttributes.DisplayName("Mute Members In Voice")]
[Category("Voice Channel")] [Category("Voice Channel")]
MuteMembers = 0b_0000000000000000000000000000000100000000000000000000000000000000, MuteMembers = 0b_0000000000000000000000000000000100000000000000000000000000000000,
[Description("User can defen people in voice")] [Description("User can defen people in voice")]
[GlobalAttributes.DisplayName("Deafen Members In Voice")] [GlobalAttributes.DisplayName("Deafen Members In Voice")]
[Category("Voice Channel")] [Category("Voice Channel")]
DeafenMembers = 0b_0000000000000000000000000000001000000000000000000000000000000000, DeafenMembers = 0b_0000000000000000000000000000001000000000000000000000000000000000,
[Description("User can move people in voice")] [Description("User can move people in voice")]
[GlobalAttributes.DisplayName("Move Members In Voice")] [GlobalAttributes.DisplayName("Move Members In Voice")]
[Category("Voice Channel")] [Category("Voice Channel")]
MoveMembers = 0b_0000000000000000000000000000010000000000000000000000000000000000, MoveMembers = 0b_0000000000000000000000000000010000000000000000000000000000000000,
[Description("User can manage profiles")] [Description("User can manage profiles")]
[GlobalAttributes.DisplayName("Manage Profiles")] [GlobalAttributes.DisplayName("Manage Profiles")]
[Category("Personalization")] [Category("Personalization")]
ManageProfiles = 0b_0000000000000000000000000000100000000000000000000000000000000000, ManageProfiles = 0b_0000000000000000000000000000100000000000000000000000000000000000,
[Description("User can create profiles")] [Description("User can create profiles")]
[GlobalAttributes.DisplayName("Create Profiles")] [GlobalAttributes.DisplayName("Create Profiles")]
[Category("Personalization")] [Category("Personalization")]
CreateProfile = 0b_0000000000000000000000000001000000000000000000000000000000000000, CreateProfile = 0b_0000000000000000000000000001000000000000000000000000000000000000,
[Description("User can change profile text restrictions")]
[GlobalAttributes.DisplayName("Change Profile Text Restrictions")]
[Category("General")]
ChangeProfileTextRestrictions = 0b_0000000000000000000000000010000000000000000000000000000000000000,
[Description("User can change channel title text restrictions")]
[GlobalAttributes.DisplayName("Change Channel Title Text Restrictions")]
[Category("General")]
ChangeChannelTitleTextRestrictions = 0b_0000000000000000000000000100000000000000000000000000000000000000,
[Description("User can change category title text restrictions")]
[GlobalAttributes.DisplayName("Change Category Title Text Restrictions")]
[Category("General")]
ChangeCategoryTitleTextRestrictions = 0b_0000000000000000000000001000000000000000000000000000000000000000,
} }

View File

@ -0,0 +1,13 @@
namespace Luski.Shared.PublicServers.V1.Enums;
[Flags]
public enum TextModification : byte
{
Rainbow = 0b_0000_0001,
Gradient = 0b_0000_0010,
Color = 0b_0000_0100,
FontSize = 0b_0000_1000,
PX = 0b_0001_0000,
URL = 0b_0010_0000,
Italic = 0b_0100_0000,
}

View File

@ -13,12 +13,6 @@ public class CategorySTC : STC
[JsonPropertyName("picture_type")] [JsonPropertyName("picture_type")]
public PictureType PictureType { get; set; } public PictureType PictureType { get; set; }
[JsonInclude] [JsonInclude]
[JsonPropertyName("color_type")]
public ColorType ColorType { get; set; } = ColorType.Full;
[JsonInclude]
[JsonPropertyName("color")]
public string Color { get; set; } = string.Empty;
[JsonInclude]
[JsonPropertyName("name")] [JsonPropertyName("name")]
public string Name { get; set; } = string.Empty; public string Name { get; set; } = string.Empty;
[JsonInclude] [JsonInclude]

View File

@ -13,12 +13,6 @@ public class ChannelSTC : STC
[JsonPropertyName("parent")] [JsonPropertyName("parent")]
public long Parent { get; set; } public long Parent { get; set; }
[JsonInclude] [JsonInclude]
[JsonPropertyName("color_type")]
public ColorType ColorType { get; set; } = ColorType.Full;
[JsonInclude]
[JsonPropertyName("color")]
public string Color { get; set; } = string.Empty;
[JsonInclude]
[JsonPropertyName("type")] [JsonPropertyName("type")]
public ChannelType Type { get; set; } public ChannelType Type { get; set; }
[JsonInclude] [JsonInclude]

View File

@ -22,6 +22,15 @@ public class ServerInfoSTC : STC
[JsonPropertyName("picture_type")] [JsonPropertyName("picture_type")]
public PictureType PictureType { get; set; } public PictureType PictureType { get; set; }
[JsonInclude] [JsonInclude]
[JsonPropertyName("allowed_profile_text_modifications")]
public TextModification ProfileModifications { get; set; } = TextModification.Rainbow | TextModification.Gradient | TextModification.Color | TextModification.Italic;
[JsonInclude]
[JsonPropertyName("allowed_channel_text_modifications")]
public TextModification ChannelModifications { get; set; } = TextModification.Rainbow | TextModification.Gradient | TextModification.Color | TextModification.Italic;
[JsonInclude]
[JsonPropertyName("allowed_category_text_modifications")]
public TextModification CategoryModifications { get; set; } = TextModification.Rainbow | TextModification.Gradient | TextModification.Color | TextModification.Italic;
[JsonInclude]
[JsonPropertyName("alternate_servers")] [JsonPropertyName("alternate_servers")]
public ServerData[] AlternateServers { get; set; } =Array.Empty<ServerData>(); public ServerData[] AlternateServers { get; set; } =Array.Empty<ServerData>();
} }