This commit is contained in:
Zurazan
2025-08-27 03:02:29 +02:00
commit 80235a174b
344 changed files with 43249 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
using System.ComponentModel.DataAnnotations;
namespace LightlessSyncShared.Models;
public class Auth
{
[Key]
[MaxLength(64)]
public string HashedKey { get; set; }
public string UserUID { get; set; }
public User User { get; set; }
public bool MarkForBan { get; set; }
public bool IsBanned { get; set; }
public string? PrimaryUserUID { get; set; }
public User? PrimaryUser { get; set; }
}

View File

@@ -0,0 +1,13 @@
using System.ComponentModel.DataAnnotations;
namespace LightlessSyncShared.Models;
public class Banned
{
[Key]
[MaxLength(100)]
public string CharacterIdentification { get; set; }
public string Reason { get; set; }
[Timestamp]
public byte[] Timestamp { get; set; }
}

View File

@@ -0,0 +1,10 @@
using System.ComponentModel.DataAnnotations;
namespace LightlessSyncShared.Models;
public class BannedRegistrations
{
[Key]
[MaxLength(100)]
public string DiscordIdOrLodestoneAuth { get; set; }
}

View File

@@ -0,0 +1,91 @@
using System.ComponentModel.DataAnnotations;
namespace LightlessSyncShared.Models;
public enum CharaDataAccess
{
Individuals,
ClosePairs,
AllPairs,
Public
}
public enum CharaDataShare
{
Private,
Shared
}
public class CharaData
{
public string Id { get; set; }
public virtual User Uploader { get; set; }
public string UploaderUID { get; set; }
public DateTime CreatedDate { get; set; }
public DateTime UpdatedDate { get; set; }
public string Description { get; set; }
public CharaDataAccess AccessType { get; set; }
public CharaDataShare ShareType { get; set; }
public DateTime? ExpiryDate { get; set; }
public string? GlamourerData { get; set; }
public string? CustomizeData { get; set; }
public string? ManipulationData { get; set; }
public int DownloadCount { get; set; } = 0;
public virtual ICollection<CharaDataPose> Poses { get; set; } = [];
public virtual ICollection<CharaDataFile> Files { get; set; } = [];
public virtual ICollection<CharaDataFileSwap> FileSwaps { get; set; } = [];
public virtual ICollection<CharaDataOriginalFile> OriginalFiles { get; set; } = [];
public virtual ICollection<CharaDataAllowance> AllowedIndividiuals { get; set; } = [];
}
public class CharaDataAllowance
{
[Key]
public long Id { get; set; }
public virtual CharaData Parent { get; set; }
public string ParentId { get; set; }
public string ParentUploaderUID { get; set; }
public virtual User? AllowedUser { get; set; }
public string? AllowedUserUID { get; set; }
public virtual Group? AllowedGroup { get; set; }
public string? AllowedGroupGID { get; set; }
}
public class CharaDataOriginalFile
{
public virtual CharaData Parent { get; set; }
public string ParentId { get; set; }
public string ParentUploaderUID { get; set; }
public string GamePath { get; set; }
public string Hash { get; set; }
}
public class CharaDataFile
{
public virtual FileCache FileCache { get; set; }
public string FileCacheHash { get; set; }
public string GamePath { get; set; }
public virtual CharaData Parent { get; set; }
public string ParentId { get; set; }
public string ParentUploaderUID { get; set; }
}
public class CharaDataFileSwap
{
public virtual CharaData Parent { get; set; }
public string ParentId { get; set; }
public string ParentUploaderUID { get; set; }
public string GamePath { get; set; }
public string FilePath { get; set; }
}
public class CharaDataPose
{
public long Id { get; set; }
public virtual CharaData Parent { get; set; }
public string ParentId { get; set; }
public string ParentUploaderUID { get; set; }
public string Description { get; set; }
public string PoseData { get; set; }
public string WorldData { get; set; }
}

View File

@@ -0,0 +1,15 @@
using System.ComponentModel.DataAnnotations;
namespace LightlessSyncShared.Models;
public class ClientPair
{
[MaxLength(10)]
public string UserUID { get; set; }
public User User { get; set; }
[MaxLength(10)]
public string OtherUserUID { get; set; }
public User OtherUser { get; set; }
[Timestamp]
public byte[] Timestamp { get; set; }
}

View File

@@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
namespace LightlessSyncShared.Models;
public class FileCache
{
[Key]
[MaxLength(40)]
public string Hash { get; set; }
[MaxLength(10)]
public string UploaderUID { get; set; }
public User Uploader { get; set; }
public bool Uploaded { get; set; }
public DateTime UploadDate { get; set; }
[Timestamp]
public byte[] Timestamp { get; set; }
public long Size { get; set; }
public long RawSize { get; set; }
}

View File

@@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
namespace LightlessSyncShared.Models;
public class ForbiddenUploadEntry
{
[Key]
[MaxLength(40)]
public string Hash { get; set; }
[MaxLength(100)]
public string ForbiddenBy { get; set; }
[Timestamp]
public byte[] Timestamp { get; set; }
}

View File

@@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
namespace LightlessSyncShared.Models;
public class Group
{
[Key]
[MaxLength(20)]
public string GID { get; set; }
public string OwnerUID { get; set; }
public User Owner { get; set; }
[MaxLength(50)]
public string Alias { get; set; }
public bool InvitesEnabled { get; set; }
public string HashedPassword { get; set; }
public bool PreferDisableSounds { get; set; }
public bool PreferDisableAnimations { get; set; }
public bool PreferDisableVFX { get; set; }
}

View File

@@ -0,0 +1,13 @@
namespace LightlessSyncShared.Models;
public class GroupBan
{
public Group Group { get; set; }
public string GroupGID { get; set; }
public User BannedUser { get; set; }
public string BannedUserUID { get; set; }
public User BannedBy { get; set; }
public string BannedByUID { get; set; }
public DateTime BannedOn { get; set; }
public string BannedReason { get; set; }
}

View File

@@ -0,0 +1,11 @@
namespace LightlessSyncShared.Models;
public class GroupPair
{
public string GroupGID { get; set; }
public Group Group { get; set; }
public string GroupUserUID { get; set; }
public User GroupUser { get; set; }
public bool IsPinned { get; set; }
public bool IsModerator { get; set; }
}

View File

@@ -0,0 +1,13 @@
namespace LightlessSyncShared.Models;
public class GroupPairPreferredPermission
{
public string GroupGID { get; set; }
public Group Group { get; set; }
public string UserUID { get; set; }
public User User { get; set; }
public bool IsPaused { get; set; }
public bool DisableAnimations { get; set; }
public bool DisableSounds { get; set; }
public bool DisableVFX { get; set; }
}

View File

@@ -0,0 +1,12 @@
using System.ComponentModel.DataAnnotations;
namespace LightlessSyncShared.Models;
public class GroupTempInvite
{
public Group Group { get; set; }
public string GroupGID { get; set; }
[MaxLength(64)]
public string Invite { get; set; }
public DateTime ExpirationDate { get; set; }
}

View File

@@ -0,0 +1,15 @@
using System.ComponentModel.DataAnnotations;
namespace LightlessSyncShared.Models;
public class LodeStoneAuth
{
[Key]
public ulong DiscordId { get; set; }
[MaxLength(100)]
public string HashedLodestoneId { get; set; }
[MaxLength(100)]
public string? LodestoneAuthString { get; set; }
public User? User { get; set; }
public DateTime? StartedAt { get; set; }
}

View File

@@ -0,0 +1,20 @@
using System.ComponentModel.DataAnnotations;
namespace LightlessSyncShared.Models;
public class User
{
[Key]
[MaxLength(10)]
public string UID { get; set; }
[Timestamp]
public byte[] Timestamp { get; set; }
public bool IsModerator { get; set; } = false;
public bool IsAdmin { get; set; } = false;
public DateTime LastLoggedIn { get; set; }
[MaxLength(15)]
public string Alias { get; set; }
}

View File

@@ -0,0 +1,22 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace LightlessSyncShared.Models;
public class UserDefaultPreferredPermission
{
[Key]
[MaxLength(10)]
[ForeignKey("User")]
public string UserUID { get; set; }
public User User { get; set; }
public bool DisableIndividualAnimations { get; set; } = false;
public bool DisableIndividualSounds { get; set; } = false;
public bool DisableIndividualVFX { get; set; } = false;
public bool DisableGroupAnimations { get; set; } = false;
public bool DisableGroupSounds { get; set; } = false;
public bool DisableGroupVFX { get; set; } = false;
public bool IndividualIsSticky { get; set; } = false;
}

View File

@@ -0,0 +1,40 @@
namespace LightlessSyncShared.Models;
public class UserPermissionQuery
{
public string UserUID { get; set; }
public string OtherUserUID { get; set; }
public string Alias { get; set; }
public string GID { get; set; }
public bool Synced { get; set; }
public bool? OwnpermIsPaused { get; set; }
public bool? OwnpermSticky { get; set; }
public bool? OwnpermDisableAnimations { get; set; }
public bool? OwnpermDisableSounds { get; set; }
public bool? OwnpermDisableVFX { get; set; }
public bool? OtherpermIsPaused { get; set; }
public bool? OtherpermDisableAnimations { get; set; }
public bool? OtherpermDisableSounds { get; set; }
public bool? OtherpermDisableVFX { get; set; }
public UserPermissionSet? OwnPermissions => OwnpermSticky == null ? null : new UserPermissionSet
{
UserUID = UserUID,
OtherUserUID = OtherUserUID,
IsPaused = OwnpermIsPaused.Value,
DisableAnimations = OwnpermDisableAnimations.Value,
DisableSounds = OwnpermDisableSounds.Value,
DisableVFX = OwnpermDisableVFX.Value,
Sticky = OwnpermSticky.Value
};
public UserPermissionSet? OtherPermissions => !Synced ? null : new UserPermissionSet
{
UserUID = OtherUserUID,
OtherUserUID = UserUID,
IsPaused = OtherpermIsPaused ?? false,
DisableAnimations = OtherpermDisableAnimations ?? false,
DisableSounds = OtherpermDisableSounds ?? false,
DisableVFX = OtherpermDisableVFX ?? false,
};
}

View File

@@ -0,0 +1,18 @@
using System.Diagnostics.CodeAnalysis;
namespace LightlessSyncShared.Models;
public class UserPermissionSet
{
[NotNull]
public string UserUID { get; set; }
public User User { get; set; }
[NotNull]
public string OtherUserUID { get; set; }
public User OtherUser { get; set; }
public bool Sticky { get; set; } = false;
public bool IsPaused { get; set; } = false;
public bool DisableAnimations { get; set; } = false;
public bool DisableVFX { get; set; } = false;
public bool DisableSounds { get; set; } = false;
}

View File

@@ -0,0 +1,20 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace LightlessSyncShared.Models;
public class UserProfileData
{
public string Base64ProfileImage { get; set; }
public bool FlaggedForReport { get; set; }
public bool IsNSFW { get; set; }
public bool ProfileDisabled { get; set; }
public User User { get; set; }
public string UserDescription { get; set; }
[Required]
[Key]
[ForeignKey(nameof(User))]
public string UserUID { get; set; }
}