mirror of
https://github.com/CyberL1/Minecraft-Realms-Emulator.git
synced 2026-09-15 19:25:48 -04:00
fix(Core): mark relation fields with [JsonIgnore]
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Core.Entities;
|
namespace Core.Entities;
|
||||||
|
|
||||||
public class Player
|
public class Player
|
||||||
@@ -7,6 +9,6 @@ public class Player
|
|||||||
public required string Name { get; set; }
|
public required string Name { get; set; }
|
||||||
public required bool Operator { get; set; }
|
public required bool Operator { get; set; }
|
||||||
public required bool Accepted { get; set; }
|
public required bool Accepted { get; set; }
|
||||||
public int? RealmId { get; set; }
|
[JsonIgnore] public int? RealmId { get; set; }
|
||||||
public Realm Realm { get; set; } = null!;
|
[JsonIgnore] public Realm Realm { get; set; } = null!;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,18 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Core.Entities;
|
namespace Core.Entities;
|
||||||
|
|
||||||
public class Realm
|
public class Realm
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public Subscription Subscription { get; set; } = null!;
|
[JsonIgnore] public Subscription Subscription { get; set; } = null!;
|
||||||
public required string Name { get; set; }
|
public required string Name { get; set; }
|
||||||
public required string Description { get; set; }
|
public required string Description { get; set; }
|
||||||
public required string State { get; set; }
|
public required string State { get; set; }
|
||||||
public required List<Player> Players { get; set; }
|
public required List<Player> Players { get; set; }
|
||||||
public required List<Slot> Slots { get; set; }
|
public required List<Slot> Slots { get; set; }
|
||||||
public required string WorldType { get; set; }
|
public required string WorldType { get; set; }
|
||||||
public required int ActiveSlotId { get; set; }
|
[JsonIgnore] public required int ActiveSlotId { get; set; }
|
||||||
public Slot ActiveSlot { get; set; } = null!;
|
[JsonIgnore] public Slot ActiveSlot { get; set; } = null!;
|
||||||
public Realm? ParentWorld { get; set; }
|
[JsonIgnore] public Realm? ParentWorld { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Core.Entities;
|
namespace Core.Entities;
|
||||||
|
|
||||||
public class Slot
|
public class Slot
|
||||||
@@ -6,6 +8,6 @@ public class Slot
|
|||||||
public required int SlotId { get; set; }
|
public required int SlotId { get; set; }
|
||||||
public SlotOptions Options { get; set; } = null!;
|
public SlotOptions Options { get; set; } = null!;
|
||||||
public WorldSettings Settings { get; set; } = null!;
|
public WorldSettings Settings { get; set; } = null!;
|
||||||
public int? RealmId { get; set; }
|
[JsonIgnore] public int? RealmId { get; set; }
|
||||||
public Realm Realm { get; set; } = null!;
|
[JsonIgnore] public Realm Realm { get; set; } = null!;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Core.Entities;
|
namespace Core.Entities;
|
||||||
|
|
||||||
public class SlotOptions
|
public class SlotOptions
|
||||||
@@ -9,6 +11,6 @@ public class SlotOptions
|
|||||||
public int Gamemode { get; set; }
|
public int Gamemode { get; set; }
|
||||||
public required string SlotName { get; set; }
|
public required string SlotName { get; set; }
|
||||||
public required string Version { get; set; }
|
public required string Version { get; set; }
|
||||||
public required int SlotId { get; set; }
|
[JsonIgnore] public int SlotId { get; set; }
|
||||||
public Slot Slot { get; set; } = null!;
|
[JsonIgnore] public Slot Slot { get; set; } = null!;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Core.Entities;
|
namespace Core.Entities;
|
||||||
|
|
||||||
public class Subscription
|
public class Subscription
|
||||||
@@ -6,8 +8,9 @@ public class Subscription
|
|||||||
public required string SubscriptionId { get; set; }
|
public required string SubscriptionId { get; set; }
|
||||||
public required DateTime StartDate { get; set; }
|
public required DateTime StartDate { get; set; }
|
||||||
public required string Type { get; set; }
|
public required string Type { get; set; }
|
||||||
public int? RealmId { get; set; }
|
[JsonIgnore] public int? RealmId { get; set; }
|
||||||
public Realm Realm { get; set; } = null!;
|
|
||||||
|
[JsonIgnore] public Realm Realm { get; set; } = null!;
|
||||||
|
|
||||||
// Helper fields
|
// Helper fields
|
||||||
public int DaysLeft => (StartDate.AddDays(30) - DateTime.Today).Days;
|
public int DaysLeft => (StartDate.AddDays(30) - DateTime.Today).Days;
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Core.Entities;
|
namespace Core.Entities;
|
||||||
|
|
||||||
public class WorldSettings
|
public class WorldSettings
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public bool Hardcore { get; set; }
|
public bool Hardcore { get; set; }
|
||||||
public required int SlotId { get; set; }
|
[JsonIgnore] public int SlotId { get; set; }
|
||||||
public Slot Slot { get; set; } = null!;
|
[JsonIgnore] public Slot Slot { get; set; } = null!;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user