mirror of
https://github.com/TbT480jcspy/Deluxe-2023-Server-Code.git
synced 2026-09-08 14:41:26 -07:00
Movement
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace DeluxeNET.Data
|
||||
{
|
||||
public class AppDbContext : DbContext
|
||||
{
|
||||
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) { }
|
||||
|
||||
public DbSet<CachedLogin> CachedLogins { get; set; }
|
||||
public DbSet<account> Accounts { get; set; }
|
||||
public DbSet<setting> Settings { get; set; }
|
||||
public DbSet<avatar> Avatars { get; set; }
|
||||
public DbSet<progression> Progressions { get; set; }
|
||||
public DbSet<reputation> Reputations { get; set; }
|
||||
|
||||
public DbSet<Room> Rooms { get; set; }
|
||||
public DbSet<RoomRole> RoomRoles { get; set; }
|
||||
public DbSet<RoomStats> RoomStats { get; set; }
|
||||
public DbSet<SubRoom> SubRooms { get; set; }
|
||||
public DbSet<SubRoomSave> SubRoomSaves { get; set; }
|
||||
|
||||
public DbSet<Heartbeat> Heartbeats { get; set; }
|
||||
public DbSet<RoomInstance> RoomInstances { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
modelBuilder.Entity<Room>()
|
||||
.HasMany(r => r.SubRooms)
|
||||
.WithOne(sr => sr.Room)
|
||||
.HasForeignKey(sr => sr.RoomId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
modelBuilder.Entity<Room>()
|
||||
.HasMany(r => r.Roles)
|
||||
.WithOne(rr => rr.Room)
|
||||
.HasForeignKey(rr => rr.RoomId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
modelBuilder.Entity<Room>()
|
||||
.HasOne(r => r.Stats)
|
||||
.WithOne(rs => rs.Room)
|
||||
.HasForeignKey<RoomStats>(rs => rs.RoomId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
modelBuilder.Entity<SubRoom>()
|
||||
.HasOne(sr => sr.CurrentSave)
|
||||
.WithOne(srs => srs.SubRoom)
|
||||
.HasForeignKey<SubRoomSave>(srs => srs.SubRoomId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
modelBuilder.Entity<SubRoomSave>()
|
||||
.HasOne(srs => srs.Room)
|
||||
.WithMany()
|
||||
.HasForeignKey(srs => srs.RoomId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
modelBuilder.Entity<Heartbeat>()
|
||||
.HasOne(h => h.RoomInstance)
|
||||
.WithMany(r => r.Heartbeats)
|
||||
.HasForeignKey(h => h.RoomInstanceId)
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
modelBuilder.Entity<RoomInstance>()
|
||||
.HasIndex(r => r.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace DeluxeNET.Data
|
||||
{
|
||||
public class CachedLogin
|
||||
{
|
||||
[JsonPropertyName("Id")] [Key] public long Id { get; set; }
|
||||
[JsonPropertyName("platform")] public required int platform { get; set; }
|
||||
[JsonPropertyName("platformId")] public required string platformId { get; set; }
|
||||
[JsonPropertyName("accountId")] public required long accountId { get; set; }
|
||||
[JsonPropertyName("lastLoginTime")] public required DateTime lastLoginTime { get; set; }
|
||||
[JsonPropertyName("requirePassword")] public required bool requirePassword { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace DeluxeNET.Data
|
||||
{
|
||||
public class Heartbeat
|
||||
{
|
||||
[Key]
|
||||
public long Id { get; set; }
|
||||
|
||||
public long PlayerId { get; set; }
|
||||
|
||||
public int StatusVisibility { get; set; }
|
||||
|
||||
public int Platform { get; set; }
|
||||
|
||||
public int DeviceClass { get; set; }
|
||||
|
||||
public long? RoomInstanceId { get; set; }
|
||||
|
||||
[ForeignKey(nameof(RoomInstanceId))]
|
||||
public RoomInstance? RoomInstance { get; set; }
|
||||
|
||||
public int VrMovementMode { get; set; }
|
||||
|
||||
public DateTime LastOnline { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public bool IsOnline { get; set; }
|
||||
|
||||
public string AppVersion { get; set; } = "20230406";
|
||||
}
|
||||
|
||||
public class RoomInstance
|
||||
{
|
||||
[Key]
|
||||
public long RoomInstanceId { get; set; }
|
||||
|
||||
public long RoomId { get; set; }
|
||||
|
||||
public long SubRoomId { get; set; }
|
||||
|
||||
public string Location { get; set; } = null!;
|
||||
|
||||
public int RoomInstanceType { get; set; }
|
||||
|
||||
public string PhotonRegionId { get; set; } = null!;
|
||||
|
||||
public string PhotonRegion { get; set; } = null!;
|
||||
|
||||
public string PhotonRoomId { get; set; } = null!;
|
||||
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
public int MaxCapacity { get; set; }
|
||||
|
||||
public bool IsFull { get; set; }
|
||||
|
||||
public bool IsPrivate { get; set; }
|
||||
|
||||
public bool IsInProgress { get; set; }
|
||||
|
||||
public int MatchmakingPolicy { get; set; }
|
||||
|
||||
public ICollection<Heartbeat> Heartbeats { get; set; } = new List<Heartbeat>();
|
||||
}
|
||||
}
|
||||
+258
@@ -0,0 +1,258 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace DeluxeNET.Data
|
||||
{
|
||||
public class Room
|
||||
{
|
||||
[Key]
|
||||
[JsonPropertyName("RoomId")]
|
||||
public long RoomId { get; set; }
|
||||
|
||||
[JsonPropertyName("Accessibility")]
|
||||
public int Accessibility { get; set; }
|
||||
|
||||
[JsonPropertyName("CloningAllowed")]
|
||||
public bool CloningAllowed { get; set; }
|
||||
|
||||
[JsonPropertyName("CreatedAt")]
|
||||
public DateTime CreatedAt { get; set; }
|
||||
|
||||
[JsonPropertyName("CreatorAccountId")]
|
||||
public int CreatorAccountId { get; set; }
|
||||
|
||||
[JsonPropertyName("CustomWarning")]
|
||||
public string CustomWarning { get; set; }
|
||||
|
||||
[JsonPropertyName("DataBlob")]
|
||||
[NotMapped]
|
||||
public object DataBlob { get; set; }
|
||||
|
||||
[JsonPropertyName("Description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
[JsonPropertyName("DisableMicAutoMute")]
|
||||
public bool DisableMicAutoMute { get; set; }
|
||||
|
||||
[JsonPropertyName("DisableRoomComments")]
|
||||
public bool DisableRoomComments { get; set; }
|
||||
|
||||
[JsonPropertyName("EncryptVoiceChat")]
|
||||
public bool EncryptVoiceChat { get; set; }
|
||||
|
||||
[JsonPropertyName("ImageName")]
|
||||
public string ImageName { get; set; }
|
||||
|
||||
[JsonPropertyName("IsDeveloperOwned")]
|
||||
public bool IsDeveloperOwned { get; set; }
|
||||
|
||||
[JsonPropertyName("IsDorm")]
|
||||
public bool IsDorm { get; set; }
|
||||
|
||||
[JsonPropertyName("IsRRO")]
|
||||
public bool IsRRO { get; set; }
|
||||
|
||||
[JsonPropertyName("LoadScreenLocked")]
|
||||
public bool LoadScreenLocked { get; set; }
|
||||
|
||||
[JsonPropertyName("LoadScreens")]
|
||||
[NotMapped]
|
||||
public List<object> LoadScreens { get; set; }
|
||||
|
||||
[JsonPropertyName("MaxPlayerCalculationMode")]
|
||||
public int MaxPlayerCalculationMode { get; set; }
|
||||
|
||||
[JsonPropertyName("MaxPlayers")]
|
||||
public int MaxPlayers { get; set; }
|
||||
|
||||
[JsonPropertyName("MinLevel")]
|
||||
public int MinLevel { get; set; }
|
||||
|
||||
[JsonPropertyName("Name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonPropertyName("PromoExternalContent")]
|
||||
[NotMapped]
|
||||
public List<object> PromoExternalContent { get; set; }
|
||||
|
||||
[JsonPropertyName("PromoImages")]
|
||||
[NotMapped]
|
||||
public List<object> PromoImages { get; set; }
|
||||
|
||||
[JsonPropertyName("Roles")]
|
||||
public List<RoomRole> Roles { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("State")]
|
||||
public int State { get; set; }
|
||||
|
||||
[JsonPropertyName("Stats")]
|
||||
public RoomStats Stats { get; set; }
|
||||
|
||||
[JsonPropertyName("SupportsJuniors")]
|
||||
public bool SupportsJuniors { get; set; }
|
||||
|
||||
[JsonPropertyName("SupportsLevelVoting")]
|
||||
public bool SupportsLevelVoting { get; set; }
|
||||
|
||||
[JsonPropertyName("SupportsMobile")]
|
||||
public bool SupportsMobile { get; set; }
|
||||
|
||||
[JsonPropertyName("SupportsQuest2")]
|
||||
public bool SupportsQuest2 { get; set; }
|
||||
|
||||
[JsonPropertyName("SupportsScreens")]
|
||||
public bool SupportsScreens { get; set; }
|
||||
|
||||
[JsonPropertyName("SupportsTeleportVR")]
|
||||
public bool SupportsTeleportVR { get; set; }
|
||||
|
||||
[JsonPropertyName("SupportsVRLow")]
|
||||
public bool SupportsVRLow { get; set; }
|
||||
|
||||
[JsonPropertyName("SupportsWalkVR")]
|
||||
public bool SupportsWalkVR { get; set; }
|
||||
|
||||
[JsonPropertyName("Tags")]
|
||||
public List<string> Tags { get; set; }
|
||||
|
||||
[JsonPropertyName("Version")]
|
||||
public int Version { get; set; }
|
||||
|
||||
[JsonPropertyName("WarningMask")]
|
||||
public int WarningMask { get; set; }
|
||||
|
||||
[JsonPropertyName("SubRooms")]
|
||||
public List<SubRoom> SubRooms { get; set; } = new();
|
||||
}
|
||||
|
||||
public class RoomRole
|
||||
{
|
||||
[Key]
|
||||
public long Id { get; set; }
|
||||
|
||||
[ForeignKey("Room")]
|
||||
[JsonPropertyName("RoomId")]
|
||||
public long RoomId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public Room Room { get; set; }
|
||||
|
||||
[JsonPropertyName("AccountId")]
|
||||
public int AccountId { get; set; }
|
||||
|
||||
[JsonPropertyName("InvitedRole")]
|
||||
public int InvitedRole { get; set; }
|
||||
|
||||
[JsonPropertyName("Role")]
|
||||
public int Role { get; set; }
|
||||
}
|
||||
|
||||
public class RoomStats
|
||||
{
|
||||
[Key]
|
||||
public long Id { get; set; }
|
||||
|
||||
[ForeignKey("Room")]
|
||||
[JsonPropertyName("RoomId")]
|
||||
public long RoomId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public Room Room { get; set; }
|
||||
|
||||
[JsonPropertyName("CheerCount")]
|
||||
public int CheerCount { get; set; }
|
||||
|
||||
[JsonPropertyName("FavoriteCount")]
|
||||
public int FavoriteCount { get; set; }
|
||||
|
||||
[JsonPropertyName("VisitCount")]
|
||||
public int VisitCount { get; set; }
|
||||
|
||||
[JsonPropertyName("VisitorCount")]
|
||||
public int VisitorCount { get; set; }
|
||||
}
|
||||
|
||||
public class SubRoom
|
||||
{
|
||||
[Key]
|
||||
[JsonPropertyName("SubRoomId")]
|
||||
public int SubRoomId { get; set; }
|
||||
|
||||
[ForeignKey("Room")]
|
||||
[JsonPropertyName("RoomId")]
|
||||
public long RoomId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public Room Room { get; set; }
|
||||
|
||||
[JsonPropertyName("Accessibility")]
|
||||
public int Accessibility { get; set; }
|
||||
|
||||
[JsonPropertyName("CurrentSave")]
|
||||
public SubRoomSave CurrentSave { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public List<SubRoomSave> SubRoomSaves { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("IsSandbox")]
|
||||
public bool IsSandbox { get; set; }
|
||||
|
||||
[JsonPropertyName("MaxPlayers")]
|
||||
public int MaxPlayers { get; set; }
|
||||
|
||||
[JsonPropertyName("Name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonPropertyName("UnitySceneId")]
|
||||
public string UnitySceneId { get; set; }
|
||||
}
|
||||
|
||||
public class SubRoomSave
|
||||
{
|
||||
[Key]
|
||||
public long Id { get; set; }
|
||||
|
||||
[ForeignKey("Room")]
|
||||
[JsonPropertyName("RoomId")]
|
||||
public long RoomId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public Room Room { get; set; }
|
||||
|
||||
[ForeignKey("SubRoom")]
|
||||
[JsonPropertyName("SubRoomId")]
|
||||
public int SubRoomId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public SubRoom SubRoom { get; set; }
|
||||
|
||||
[JsonPropertyName("SubRoomDataSaveId")]
|
||||
public int SubRoomDataSaveId { get; set; }
|
||||
|
||||
[JsonPropertyName("DataBlob")]
|
||||
public string DataBlob { get; set; }
|
||||
|
||||
[JsonPropertyName("SavedByAccountId")]
|
||||
public int SavedByAccountId { get; set; }
|
||||
|
||||
[JsonPropertyName("SavedOnPlatform")]
|
||||
[NotMapped]
|
||||
public object SavedOnPlatform { get; set; }
|
||||
|
||||
[JsonPropertyName("SavedOnDeviceClass")]
|
||||
[NotMapped]
|
||||
public object SavedOnDeviceClass { get; set; }
|
||||
|
||||
[JsonPropertyName("Description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
[JsonPropertyName("CreatedAt")]
|
||||
public DateTime CreatedAt { get; set; }
|
||||
|
||||
[JsonPropertyName("UnityAssetId")]
|
||||
public string UnityAssetId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace DeluxeNET.Data
|
||||
{
|
||||
public class account
|
||||
{
|
||||
[JsonPropertyName("accountId")][Key] public long accountId { get; set; }
|
||||
[JsonPropertyName("username")] public required string username { get; set; }
|
||||
[JsonPropertyName("displayName")] public required string displayName { get; set; }
|
||||
[JsonPropertyName("profileImage")] public string profileImage { get; set; } = "defaultpfp.png";
|
||||
[JsonPropertyName("bannerImage")] public string bannerImage { get; set; } = "defaultbanner.png";
|
||||
[JsonPropertyName("isJunior")] public bool isJunior { get; set; } = false;
|
||||
[JsonPropertyName("bio")] public string bio { get; set; } = string.Empty;
|
||||
[JsonPropertyName("platforms")] public int platforms { get; set; } = 0;
|
||||
[JsonPropertyName("personalPronouns")] public int personalPronouns { get; set; } = 0;
|
||||
[JsonPropertyName("identityFlags")] public int identityFlags { get; set; } = 0;
|
||||
[JsonPropertyName("createdAt")] public DateTime createdAt { get; set; } = DateTime.UtcNow;
|
||||
[JsonPropertyName("isMetaPlatformBlocked")] public bool isMetaPlatformBlocked { get; set; } = false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace DeluxeNET.Data
|
||||
{
|
||||
public class avatar
|
||||
{
|
||||
[JsonPropertyName("Id")][Key] public long Id { get; set; }
|
||||
[JsonPropertyName("accountId")] public required long? accountId { get; set; }
|
||||
[JsonPropertyName("OutfitSelections")] public string OutfitSelections { get; set; } = string.Empty;
|
||||
[JsonPropertyName("FaceFeatures")] public string FaceFeatures { get; set; } = string.Empty;
|
||||
[JsonPropertyName("SkinColor")] public string SkinColor { get; set; } = string.Empty;
|
||||
[JsonPropertyName("HairColor")] public string HairColor { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace DeluxeNET.Data
|
||||
{
|
||||
public class progression
|
||||
{
|
||||
[JsonPropertyName("Id")][Key] public long Id { get; set; }
|
||||
[JsonPropertyName("PlayerId")] public required long PlayerId { get; set; }
|
||||
[JsonPropertyName("Level")] public int Level { get; set; } = 1;
|
||||
[JsonPropertyName("XP")] public int XP { get; set; } = 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace DeluxeNET.Data
|
||||
{
|
||||
public class reputation
|
||||
{
|
||||
[JsonPropertyName("Id")][Key] public long Id { get; set; }
|
||||
[JsonPropertyName("accountId")] public required long accountId { get; set; }
|
||||
[JsonPropertyName("IsCheerful")] public bool IsCheerful { get; set; } = false;
|
||||
[JsonPropertyName("Noteriety")] public float Noteriety { get; set; } = 0.0f;
|
||||
[JsonPropertyName("SelectedCheer")] public int SelectedCheer { get; set; } = 0;
|
||||
[JsonPropertyName("CheerCredit")] public int CheerCredit { get; set; } = 20;
|
||||
[JsonPropertyName("CheerGeneral")] public int CheerGeneral { get; set; } = 0;
|
||||
[JsonPropertyName("CheerHelpful")] public int CheerHelpful { get; set; } = 0;
|
||||
[JsonPropertyName("CheerCreative")] public int CheerCreative { get; set; } = 0;
|
||||
[JsonPropertyName("CheerGreatHost")] public int CheerGreatHost { get; set; } = 0;
|
||||
[JsonPropertyName("CheerSportsman")] public int CheerSportsman { get; set; } = 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace DeluxeNET.Data
|
||||
{
|
||||
public class setting
|
||||
{
|
||||
[JsonPropertyName("Id")][Key] public long Id { get; set; }
|
||||
[JsonPropertyName("accountId")] public required long? accountId { get; set; }
|
||||
[JsonPropertyName("Key")] public required string Key { get; set; }
|
||||
[JsonPropertyName("Value")] public required string Value { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user