diff --git a/Content.Client/LateJoin/LateJoinGui.cs b/Content.Client/LateJoin/LateJoinGui.cs index 1351aa9e86..dd8c7c496b 100644 --- a/Content.Client/LateJoin/LateJoinGui.cs +++ b/Content.Client/LateJoin/LateJoinGui.cs @@ -20,6 +20,10 @@ using Robust.Shared.Prototypes; using Robust.Shared.Utility; using static Robust.Client.UserInterface.Controls.BoxContainer; +using Robust.Shared.Player; +#if LPP_Sponsors +using Content.Client._LostParadise.Sponsors; +#endif namespace Content.Client.LateJoin { @@ -86,6 +90,13 @@ private void RebuildUI() _jobButtons.Clear(); _jobCategories.Clear(); +#if LPP_Sponsors + var sys = IoCManager.Resolve(); + var _checkSponsorSystem = sys.GetEntitySystem(); + _checkSponsorSystem.GoCheckSponsor(); + var sponsorTier = _checkSponsorSystem.GetSponsorStatus().Item2; +#endif + if (!_gameTicker.DisallowedLateJoin && _gameTicker.StationNames.Count == 0) Logger.Warning("No stations exist, nothing to display in late-join GUI"); @@ -273,7 +284,11 @@ private void RebuildUI() _entityManager, _prototypeManager, _configManager, - out var reasons)) + out var reasons +#if LPP_Sponsors + , 0, sponsorTier +#endif + )) { jobButton.Disabled = true; diff --git a/Content.Client/Preferences/UI/AntagPreferenceSelector.cs b/Content.Client/Preferences/UI/AntagPreferenceSelector.cs index f4975a6090..bd48bdb29a 100644 --- a/Content.Client/Preferences/UI/AntagPreferenceSelector.cs +++ b/Content.Client/Preferences/UI/AntagPreferenceSelector.cs @@ -4,6 +4,9 @@ using Content.Shared.Roles; using Robust.Shared.Configuration; using Robust.Shared.Prototypes; +#if LPP_Sponsors +using Content.Client._LostParadise.Sponsors; +#endif namespace Content.Client.Preferences.UI; @@ -40,6 +43,14 @@ public AntagPreferenceSelector(AntagPrototype proto, JobPrototype highJob) : bas var protoMan = IoCManager.Resolve(); var configMan = IoCManager.Resolve(); +#if LPP_Sponsors + Logger.Error("SPONSOR: go check sponsor - Antag"); + var sys = IoCManager.Resolve(); + var _checkSponsorSystem = sys.GetEntitySystem(); + _checkSponsorSystem.GoCheckSponsor(); + var sponsorTier = _checkSponsorSystem.GetSponsorStatus().Item2; +#endif + if (proto.Requirements != null && !characterReqs.CheckRequirementsValid( proto.Requirements, @@ -51,7 +62,11 @@ public AntagPreferenceSelector(AntagPrototype proto, JobPrototype highJob) : bas entMan, protoMan, configMan, - out var reasons)) + out var reasons +#if LPP_Sponsors + , 0, sponsorTier +#endif + )) LockRequirements(characterReqs.GetRequirementsText(reasons)); } } diff --git a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs index 96d0c45e11..d426ef8573 100644 --- a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs +++ b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs @@ -38,6 +38,9 @@ using Robust.Shared.Utility; using static Content.Client.Stylesheets.StyleBase; using Direction = Robust.Shared.Maths.Direction; +#if LPP_Sponsors +using Content.Client._LostParadise.Sponsors; +#endif namespace Content.Client.Preferences.UI { @@ -751,6 +754,14 @@ private void UpdateRoleRequirements() _jobCategories.Clear(); var firstCategory = true; +#if LPP_Sponsors + Logger.Error("SPONSOR: go check sponsor - HPE - UpdateRole"); + var sys = IoCManager.Resolve(); + var _checkSponsorSystem = sys.GetEntitySystem(); + _checkSponsorSystem.GoCheckSponsor(); + var sponsorTier = _checkSponsorSystem.GetSponsorStatus().Item2; +#endif + var departments = _prototypeManager.EnumeratePrototypes().ToArray(); Array.Sort(departments, DepartmentUIComparer.Instance); @@ -817,7 +828,11 @@ private void UpdateRoleRequirements() _entityManager, _prototypeManager, _configurationManager, - out var reasons)) + out var reasons +#if LPP_Sponsors + , 0, sponsorTier +#endif + )) selector.LockRequirements(_characterRequirementsSystem.GetRequirementsText(reasons)); category.AddChild(selector); @@ -860,6 +875,13 @@ private void UpdateRoleRequirements() /// private void EnsureJobRequirementsValid() { +#if LPP_Sponsors + Logger.Error("SPONSOR: go check sponsor - HPE - EnsureJob"); + var sys = IoCManager.Resolve(); + var _checkSponsorSystem = sys.GetEntitySystem(); + _checkSponsorSystem.GoCheckSponsor(); + var sponsorTier = _checkSponsorSystem.GetSponsorStatus().Item2; +#endif foreach (var selector in _jobPriorities) { if (selector.Priority == JobPriority.Never @@ -873,7 +895,11 @@ private void EnsureJobRequirementsValid() _entityManager, _prototypeManager, _configurationManager, - out _)) + out _ +#if LPP_Sponsors + , 0, sponsorTier +#endif + )) continue; selector.Priority = JobPriority.Never; @@ -1520,6 +1546,14 @@ private void UpdateTraits(bool showUnusable) // Get the highest priority job to use for trait filtering var highJob = _controller.GetPreferredJob(Profile ?? HumanoidCharacterProfile.DefaultWithSpecies()); +#if LPP_Sponsors + Logger.Error("SPONSOR: go check sponsor - HPE - UpdateTraits"); + var sys = IoCManager.Resolve(); + var _checkSponsorSystem = sys.GetEntitySystem(); + _checkSponsorSystem.GoCheckSponsor(); + var sponsorTier = _checkSponsorSystem.GetSponsorStatus().Item2; +#endif + _traits.Clear(); foreach (var trait in _prototypeManager.EnumeratePrototypes()) { @@ -1534,6 +1568,9 @@ private void UpdateTraits(bool showUnusable) _prototypeManager, _configurationManager, out _ +#if LPP_Sponsors + , 0, sponsorTier +#endif ); _traits.Add(trait, usable); @@ -1826,6 +1863,13 @@ private void UpdateLoadouts(bool showUnusable) _loadoutPointsBar.MaxValue = points; _loadoutPointsBar.Value = points; +#if LPP_Sponsors + Logger.Error("SPONSOR: go check sponsor - HPE - UpdateLoadouts"); + var sys = IoCManager.Resolve(); + var _checkSponsorSystem = sys.GetEntitySystem(); + _checkSponsorSystem.GoCheckSponsor(); + var sponsorTier = _checkSponsorSystem.GetSponsorStatus().Item2; +#endif // Get the highest priority job to use for loadout filtering var highJob = _controller.GetPreferredJob(Profile ?? HumanoidCharacterProfile.DefaultWithSpecies()); @@ -1844,6 +1888,9 @@ private void UpdateLoadouts(bool showUnusable) _prototypeManager, _configurationManager, out _ +#if LPP_Sponsors + , 0, sponsorTier +#endif ); _loadouts.Add(loadout, usable); diff --git a/Content.Client/Preferences/UI/LoadoutPreferenceSelector.cs b/Content.Client/Preferences/UI/LoadoutPreferenceSelector.cs index 7769c64e5a..303cd02b69 100644 --- a/Content.Client/Preferences/UI/LoadoutPreferenceSelector.cs +++ b/Content.Client/Preferences/UI/LoadoutPreferenceSelector.cs @@ -15,10 +15,12 @@ using Robust.Shared.Map; using Robust.Shared.Prototypes; using Robust.Shared.Utility; +#if LPP_Sponsors +using Content.Client._LostParadise.Sponsors; +#endif namespace Content.Client.Preferences.UI; - public sealed class LoadoutPreferenceSelector : Control { public LoadoutPrototype Loadout { get; } @@ -145,13 +147,24 @@ public LoadoutPreferenceSelector(LoadoutPrototype loadout, JobPrototype highJob, if (!string.IsNullOrEmpty(desc)) tooltip.Append($"{Loc.GetString(desc)}"); +#if LPP_Sponsors + Logger.Error("SPONSOR: go check sponsor - Loadout"); + var sys = IoCManager.Resolve(); + var _checkSponsorSystem = sys.GetEntitySystem(); + _checkSponsorSystem.GoCheckSponsor(); + var sponsorTier = _checkSponsorSystem.GetSponsorStatus().Item2; +#endif // Get requirement reasons characterRequirementsSystem.CheckRequirementsValid( loadout.Requirements, highJob, profile, new Dictionary(), jobRequirementsManager.IsWhitelisted(), loadout, entityManager, prototypeManager, configManager, - out var reasons); + out var reasons +#if LPP_Sponsors + , 0, sponsorTier +#endif + ); // Add requirement reasons to the tooltip foreach (var reason in reasons) diff --git a/Content.Client/Preferences/UI/TraitPreferenceSelector.cs b/Content.Client/Preferences/UI/TraitPreferenceSelector.cs index e242f2955e..01337102bf 100644 --- a/Content.Client/Preferences/UI/TraitPreferenceSelector.cs +++ b/Content.Client/Preferences/UI/TraitPreferenceSelector.cs @@ -11,10 +11,12 @@ using Robust.Shared.Configuration; using Robust.Shared.Prototypes; using Robust.Shared.Utility; +#if LPP_Sponsors +using Content.Client._LostParadise.Sponsors; +#endif namespace Content.Client.Preferences.UI; - public sealed class TraitPreferenceSelector : Control { public TraitPrototype Trait { get; } @@ -82,13 +84,24 @@ public TraitPreferenceSelector(TraitPrototype trait, JobPrototype highJob, Human if (!string.IsNullOrEmpty(desc) && desc != $"trait-description-{trait.ID}") tooltip.Append(desc); +#if LPP_Sponsors + Logger.Error("SPONSOR: go check sponsor - Trait"); + var sys = IoCManager.Resolve(); + var _checkSponsorSystem = sys.GetEntitySystem(); + _checkSponsorSystem.GoCheckSponsor(); + var sponsorTier = _checkSponsorSystem.GetSponsorStatus().Item2; +#endif // Get requirement reasons characterRequirementsSystem.CheckRequirementsValid( trait.Requirements, highJob, profile, new Dictionary(), jobRequirementsManager.IsWhitelisted(), trait, entityManager, prototypeManager, configManager, - out var reasons); + out var reasons +#if LPP_Sponsors + , 0, sponsorTier +#endif + ); // Add requirement reasons to the tooltip foreach (var reason in reasons) diff --git a/Content.Server.Database/Migrations/Postgres/20240906151158_Sponsors-allowjob.Designer.cs b/Content.Server.Database/Migrations/Postgres/20240906151158_Sponsors-allowjob.Designer.cs deleted file mode 100644 index f388607327..0000000000 --- a/Content.Server.Database/Migrations/Postgres/20240906151158_Sponsors-allowjob.Designer.cs +++ /dev/null @@ -1,1868 +0,0 @@ -// -#if LPP_Sponsors -using System; -using System.Net; -using System.Text.Json; -using Content.Server.Database; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using NpgsqlTypes; - -#nullable disable - -namespace Content.Server.Database.Migrations.Postgres -{ - [DbContext(typeof(PostgresServerDbContext))] - [Migration("20240906151158_Sponsors-allowjob")] - partial class Sponsorsallowjob - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Content.Server.Database.Admin", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("AdminRankId") - .HasColumnType("integer") - .HasColumnName("admin_rank_id"); - - b.Property("Title") - .HasColumnType("text") - .HasColumnName("title"); - - b.HasKey("UserId") - .HasName("PK_admin"); - - b.HasIndex("AdminRankId") - .HasDatabaseName("IX_admin_admin_rank_id"); - - b.ToTable("admin", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminFlag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_flag_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminId") - .HasColumnType("uuid") - .HasColumnName("admin_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("text") - .HasColumnName("flag"); - - b.Property("Negative") - .HasColumnType("boolean") - .HasColumnName("negative"); - - b.HasKey("Id") - .HasName("PK_admin_flag"); - - b.HasIndex("AdminId") - .HasDatabaseName("IX_admin_flag_admin_id"); - - b.HasIndex("Flag", "AdminId") - .IsUnique(); - - b.ToTable("admin_flag", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminLog", b => - { - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Id") - .HasColumnType("integer") - .HasColumnName("admin_log_id"); - - b.Property("Date") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); - - b.Property("Impact") - .HasColumnType("smallint") - .HasColumnName("impact"); - - b.Property("Json") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("json"); - - b.Property("Message") - .IsRequired() - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("RoundId", "Id") - .HasName("PK_admin_log"); - - b.HasIndex("Date"); - - b.HasIndex("Message") - .HasAnnotation("Npgsql:TsVectorConfig", "english"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("Message"), "GIN"); - - b.HasIndex("Type") - .HasDatabaseName("IX_admin_log_type"); - - b.ToTable("admin_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminLogPlayer", b => - { - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("LogId") - .HasColumnType("integer") - .HasColumnName("log_id"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.HasKey("RoundId", "LogId", "PlayerUserId") - .HasName("PK_admin_log_player"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_log_player_player_user_id"); - - b.ToTable("admin_log_player", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_messages_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("uuid") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("boolean") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("uuid") - .HasColumnName("deleted_by_id"); - - b.Property("Dismissed") - .HasColumnType("boolean") - .HasColumnName("dismissed"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Seen") - .HasColumnType("boolean") - .HasColumnName("seen"); - - b.HasKey("Id") - .HasName("PK_admin_messages"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_messages_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_messages_round_id"); - - b.ToTable("admin_messages", null, t => - { - t.HasCheckConstraint("NotDismissedAndSeen", "NOT dismissed OR seen"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_notes_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("uuid") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("boolean") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("uuid") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Secret") - .HasColumnType("boolean") - .HasColumnName("secret"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_admin_notes"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_notes_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_notes_round_id"); - - b.ToTable("admin_notes", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminRank", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_rank_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("PK_admin_rank"); - - b.ToTable("admin_rank", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminRankFlag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_rank_flag_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminRankId") - .HasColumnType("integer") - .HasColumnName("admin_rank_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("text") - .HasColumnName("flag"); - - b.HasKey("Id") - .HasName("PK_admin_rank_flag"); - - b.HasIndex("AdminRankId"); - - b.HasIndex("Flag", "AdminRankId") - .IsUnique(); - - b.ToTable("admin_rank_flag", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminWatchlist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("admin_watchlists_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("uuid") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("boolean") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("uuid") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.HasKey("Id") - .HasName("PK_admin_watchlists"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_watchlists_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_watchlists_round_id"); - - b.ToTable("admin_watchlists", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Antag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("antag_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AntagName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("antag_name"); - - b.Property("ProfileId") - .HasColumnType("integer") - .HasColumnName("profile_id"); - - b.HasKey("Id") - .HasName("PK_antag"); - - b.HasIndex("ProfileId", "AntagName") - .IsUnique(); - - b.ToTable("antag", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AssignedUserId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("assigned_user_id_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("UserName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("user_name"); - - b.HasKey("Id") - .HasName("PK_assigned_user_id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.HasIndex("UserName") - .IsUnique(); - - b.ToTable("assigned_user_id", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ConnectionLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("connection_log_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("inet") - .HasColumnName("address"); - - b.Property("Denied") - .HasColumnType("smallint") - .HasColumnName("denied"); - - b.Property("HWId") - .HasColumnType("bytea") - .HasColumnName("hwid"); - - b.Property("ServerId") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("server_id"); - - b.Property("Time") - .HasColumnType("timestamp with time zone") - .HasColumnName("time"); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("UserName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("user_name"); - - b.HasKey("Id") - .HasName("PK_connection_log"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_connection_log_server_id"); - - b.HasIndex("UserId"); - - b.ToTable("connection_log", null, t => - { - t.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.Job", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("job_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("JobName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("job_name"); - - b.Property("Priority") - .HasColumnType("integer") - .HasColumnName("priority"); - - b.Property("ProfileId") - .HasColumnType("integer") - .HasColumnName("profile_id"); - - b.HasKey("Id") - .HasName("PK_job"); - - b.HasIndex("ProfileId"); - - b.HasIndex("ProfileId", "JobName") - .IsUnique(); - - b.HasIndex(new[] { "ProfileId" }, "IX_job_one_high_priority") - .IsUnique() - .HasFilter("priority = 3"); - - b.ToTable("job", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Loadout", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("loadout_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("LoadoutName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("loadout_name"); - - b.Property("ProfileId") - .HasColumnType("integer") - .HasColumnName("profile_id"); - - b.HasKey("Id") - .HasName("PK_loadout"); - - b.HasIndex("ProfileId", "LoadoutName") - .IsUnique(); - - b.ToTable("loadout", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.PlayTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("play_time_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("PlayerId") - .HasColumnType("uuid") - .HasColumnName("player_id"); - - b.Property("TimeSpent") - .HasColumnType("interval") - .HasColumnName("time_spent"); - - b.Property("Tracker") - .IsRequired() - .HasColumnType("text") - .HasColumnName("tracker"); - - b.HasKey("Id") - .HasName("PK_play_time"); - - b.HasIndex("PlayerId", "Tracker") - .IsUnique(); - - b.ToTable("play_time", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Player", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("player_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("FirstSeenTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("first_seen_time"); - - b.Property("LastReadRules") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_read_rules"); - - b.Property("LastSeenAddress") - .IsRequired() - .HasColumnType("inet") - .HasColumnName("last_seen_address"); - - b.Property("LastSeenHWId") - .HasColumnType("bytea") - .HasColumnName("last_seen_hwid"); - - b.Property("LastSeenTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_seen_time"); - - b.Property("LastSeenUserName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("last_seen_user_name"); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.HasKey("Id") - .HasName("PK_player"); - - b.HasAlternateKey("UserId") - .HasName("ak_player_user_id"); - - b.HasIndex("LastSeenUserName"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("player", null, t => - { - t.HasCheckConstraint("LastSeenAddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= last_seen_address"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("preference_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AdminOOCColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("admin_ooc_color"); - - b.Property("SelectedCharacterSlot") - .HasColumnType("integer") - .HasColumnName("selected_character_slot"); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.HasKey("Id") - .HasName("PK_preference"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("preference", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Profile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("profile_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Age") - .HasColumnType("integer") - .HasColumnName("age"); - - b.Property("Backpack") - .IsRequired() - .HasColumnType("text") - .HasColumnName("backpack"); - - b.Property("CharacterName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("char_name"); - - b.Property("Clothing") - .IsRequired() - .HasColumnType("text") - .HasColumnName("clothing"); - - b.Property("EyeColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("eye_color"); - - b.Property("FacialHairColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("facial_hair_color"); - - b.Property("FacialHairName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("facial_hair_name"); - - b.Property("FlavorText") - .IsRequired() - .HasColumnType("text") - .HasColumnName("flavor_text"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("text") - .HasColumnName("gender"); - - b.Property("HairColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("hair_color"); - - b.Property("HairName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("hair_name"); - - b.Property("Height") - .HasColumnType("real") - .HasColumnName("height"); - - b.Property("Markings") - .HasColumnType("jsonb") - .HasColumnName("markings"); - - b.Property("PreferenceId") - .HasColumnType("integer") - .HasColumnName("preference_id"); - - b.Property("PreferenceUnavailable") - .HasColumnType("integer") - .HasColumnName("pref_unavailable"); - - b.Property("Sex") - .IsRequired() - .HasColumnType("text") - .HasColumnName("sex"); - - b.Property("SkinColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("skin_color"); - - b.Property("Slot") - .HasColumnType("integer") - .HasColumnName("slot"); - - b.Property("SpawnPriority") - .HasColumnType("integer") - .HasColumnName("spawn_priority"); - - b.Property("Species") - .IsRequired() - .HasColumnType("text") - .HasColumnName("species"); - - b.Property("Voice") - .IsRequired() - .HasColumnType("text") - .HasColumnName("voice"); - - b.Property("Width") - .HasColumnType("real") - .HasColumnName("width"); - - b.HasKey("Id") - .HasName("PK_profile"); - - b.HasIndex("PreferenceId") - .HasDatabaseName("IX_profile_preference_id"); - - b.HasIndex("Slot", "PreferenceId") - .IsUnique(); - - b.ToTable("profile", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("round_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ServerId") - .HasColumnType("integer") - .HasColumnName("server_id"); - - b.Property("StartDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_date"); - - b.HasKey("Id") - .HasName("PK_round"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_round_server_id"); - - b.HasIndex("StartDate"); - - b.ToTable("round", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("server_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("PK_server"); - - b.ToTable("server", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("server_ban_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .HasColumnType("inet") - .HasColumnName("address"); - - b.Property("AutoDelete") - .HasColumnType("boolean") - .HasColumnName("auto_delete"); - - b.Property("BanTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("uuid") - .HasColumnName("banning_admin"); - - b.Property("ExemptFlags") - .HasColumnType("integer") - .HasColumnName("exempt_flags"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("HWId") - .HasColumnType("bytea") - .HasColumnName("hwid"); - - b.Property("Hidden") - .HasColumnType("boolean") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text") - .HasColumnName("reason"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_ban_round_id"); - - b.ToTable("server_ban", null, t => - { - t.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address"); - - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanExemption", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("Flags") - .HasColumnType("integer") - .HasColumnName("flags"); - - b.HasKey("UserId") - .HasName("PK_server_ban_exemption"); - - b.ToTable("server_ban_exemption", null, t => - { - t.HasCheckConstraint("FlagsNotZero", "flags != 0"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanHit", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("server_ban_hit_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BanId") - .HasColumnType("integer") - .HasColumnName("ban_id"); - - b.Property("ConnectionId") - .HasColumnType("integer") - .HasColumnName("connection_id"); - - b.HasKey("Id") - .HasName("PK_server_ban_hit"); - - b.HasIndex("BanId") - .HasDatabaseName("IX_server_ban_hit_ban_id"); - - b.HasIndex("ConnectionId") - .HasDatabaseName("IX_server_ban_hit_connection_id"); - - b.ToTable("server_ban_hit", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ServerRoleBan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("server_role_ban_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .HasColumnType("inet") - .HasColumnName("address"); - - b.Property("BanTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("uuid") - .HasColumnName("banning_admin"); - - b.Property("ExpirationTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("expiration_time"); - - b.Property("HWId") - .HasColumnType("bytea") - .HasColumnName("hwid"); - - b.Property("Hidden") - .HasColumnType("boolean") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("uuid") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("uuid") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("interval") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text") - .HasColumnName("reason"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("text") - .HasColumnName("role_id"); - - b.Property("RoundId") - .HasColumnType("integer") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("integer") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_role_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_role_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_role_ban_round_id"); - - b.ToTable("server_role_ban", null, t => - { - t.HasCheckConstraint("AddressNotIPv6MappedIPv4", "NOT inet '::ffff:0.0.0.0/96' >>= address"); - - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerRoleUnban", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("role_unban_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BanId") - .HasColumnType("integer") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("unban_time"); - - b.Property("UnbanningAdmin") - .HasColumnType("uuid") - .HasColumnName("unbanning_admin"); - - b.HasKey("Id") - .HasName("PK_server_role_unban"); - - b.HasIndex("BanId") - .IsUnique(); - - b.ToTable("server_role_unban", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ServerUnban", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("unban_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BanId") - .HasColumnType("integer") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("unban_time"); - - b.Property("UnbanningAdmin") - .HasColumnType("uuid") - .HasColumnName("unbanning_admin"); - - b.HasKey("Id") - .HasName("PK_server_unban"); - - b.HasIndex("BanId") - .IsUnique(); - - b.ToTable("server_unban", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Sponsor", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.Property("AllowJob") - .HasColumnType("boolean") - .HasColumnName("allow_job"); - - b.Property("AllowedMarkings") - .IsRequired() - .HasColumnType("text") - .HasColumnName("allowed_markings"); - - // b.Property("ExpireDate") - // .HasColumnType("text") - // .HasColumnName("expire_date"); - - b.Property("ExtraSlots") - .HasColumnType("integer") - .HasColumnName("extra_slots"); - - b.Property("HavePriorityJoin") - .HasColumnType("boolean") - .HasColumnName("have_priority_join"); - - b.Property("OOCColor") - .IsRequired() - .HasColumnType("text") - .HasColumnName("ooccolor"); - - b.Property("Tier") - .HasColumnType("integer") - .HasColumnName("tier"); - - b.HasKey("UserId") - .HasName("PK_sponsors"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("sponsors", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Trait", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("trait_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ProfileId") - .HasColumnType("integer") - .HasColumnName("profile_id"); - - b.Property("TraitName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("trait_name"); - - b.HasKey("Id") - .HasName("PK_trait"); - - b.HasIndex("ProfileId", "TraitName") - .IsUnique(); - - b.ToTable("trait", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.UploadedResourceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("uploaded_resource_log_id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Data") - .IsRequired() - .HasColumnType("bytea") - .HasColumnName("data"); - - b.Property("Date") - .HasColumnType("timestamp with time zone") - .HasColumnName("date"); - - b.Property("Path") - .IsRequired() - .HasColumnType("text") - .HasColumnName("path"); - - b.Property("UserId") - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.HasKey("Id") - .HasName("PK_uploaded_resource_log"); - - b.ToTable("uploaded_resource_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Whitelist", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("user_id"); - - b.HasKey("UserId") - .HasName("PK_whitelist"); - - b.ToTable("whitelist", (string)null); - }); - - modelBuilder.Entity("PlayerRound", b => - { - b.Property("PlayersId") - .HasColumnType("integer") - .HasColumnName("players_id"); - - b.Property("RoundsId") - .HasColumnType("integer") - .HasColumnName("rounds_id"); - - b.HasKey("PlayersId", "RoundsId") - .HasName("PK_player_round"); - - b.HasIndex("RoundsId") - .HasDatabaseName("IX_player_round_rounds_id"); - - b.ToTable("player_round", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Admin", b => - { - b.HasOne("Content.Server.Database.AdminRank", "AdminRank") - .WithMany("Admins") - .HasForeignKey("AdminRankId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_admin_rank_admin_rank_id"); - - b.Navigation("AdminRank"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminFlag", b => - { - b.HasOne("Content.Server.Database.Admin", "Admin") - .WithMany("Flags") - .HasForeignKey("AdminId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_admin_flag_admin_admin_id"); - - b.Navigation("Admin"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminLog", b => - { - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany("AdminLogs") - .HasForeignKey("RoundId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_admin_log_round_round_id"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminLogPlayer", b => - { - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminLogs") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_admin_log_player_player_player_user_id"); - - b.HasOne("Content.Server.Database.AdminLog", "Log") - .WithMany("Players") - .HasForeignKey("RoundId", "LogId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_admin_log_player_admin_log_round_id_log_id"); - - b.Navigation("Log"); - - b.Navigation("Player"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminMessagesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminMessagesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminMessagesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminMessagesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_messages_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_messages_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminNotesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminNotesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminNotesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminNotesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_notes_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_notes_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminRankFlag", b => - { - b.HasOne("Content.Server.Database.AdminRank", "Rank") - .WithMany("Flags") - .HasForeignKey("AdminRankId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_admin_rank_flag_admin_rank_admin_rank_id"); - - b.Navigation("Rank"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminWatchlist", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminWatchlistsCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminWatchlistsDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminWatchlistsLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminWatchlistsReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_watchlists_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_watchlists_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.Antag", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Antags") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_antag_profile_profile_id"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("Content.Server.Database.ConnectionLog", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("ConnectionLogs") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.SetNull) - .IsRequired() - .HasConstraintName("FK_connection_log_server_server_id"); - - b.Navigation("Server"); - }); - - modelBuilder.Entity("Content.Server.Database.Job", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Jobs") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_job_profile_profile_id"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("Content.Server.Database.Loadout", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Loadouts") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_loadout_profile_profile_id"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("Content.Server.Database.Profile", b => - { - b.HasOne("Content.Server.Database.Preference", "Preference") - .WithMany("Profiles") - .HasForeignKey("PreferenceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_preference_preference_id"); - - b.Navigation("Preference"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("Rounds") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_round_server_server_id"); - - b.Navigation("Server"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_ban_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanHit", b => - { - b.HasOne("Content.Server.Database.ServerBan", "Ban") - .WithMany("BanHits") - .HasForeignKey("BanId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_server_ban_hit_server_ban_ban_id"); - - b.HasOne("Content.Server.Database.ConnectionLog", "Connection") - .WithMany("BanHits") - .HasForeignKey("ConnectionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_server_ban_hit_connection_log_connection_id"); - - b.Navigation("Ban"); - - b.Navigation("Connection"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerRoleBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerRoleBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerRoleBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_role_ban_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerRoleUnban", b => - { - b.HasOne("Content.Server.Database.ServerRoleBan", "Ban") - .WithOne("Unban") - .HasForeignKey("Content.Server.Database.ServerRoleUnban", "BanId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_server_role_unban_server_role_ban_ban_id"); - - b.Navigation("Ban"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerUnban", b => - { - b.HasOne("Content.Server.Database.ServerBan", "Ban") - .WithOne("Unban") - .HasForeignKey("Content.Server.Database.ServerUnban", "BanId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_server_unban_server_ban_ban_id"); - - b.Navigation("Ban"); - }); - - modelBuilder.Entity("Content.Server.Database.Trait", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Traits") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_trait_profile_profile_id"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("PlayerRound", b => - { - b.HasOne("Content.Server.Database.Player", null) - .WithMany() - .HasForeignKey("PlayersId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_player_round_player_players_id"); - - b.HasOne("Content.Server.Database.Round", null) - .WithMany() - .HasForeignKey("RoundsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_player_round_round_rounds_id"); - }); - - modelBuilder.Entity("Content.Server.Database.Admin", b => - { - b.Navigation("Flags"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminLog", b => - { - b.Navigation("Players"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminRank", b => - { - b.Navigation("Admins"); - - b.Navigation("Flags"); - }); - - modelBuilder.Entity("Content.Server.Database.ConnectionLog", b => - { - b.Navigation("BanHits"); - }); - - modelBuilder.Entity("Content.Server.Database.Player", b => - { - b.Navigation("AdminLogs"); - - b.Navigation("AdminMessagesCreated"); - - b.Navigation("AdminMessagesDeleted"); - - b.Navigation("AdminMessagesLastEdited"); - - b.Navigation("AdminMessagesReceived"); - - b.Navigation("AdminNotesCreated"); - - b.Navigation("AdminNotesDeleted"); - - b.Navigation("AdminNotesLastEdited"); - - b.Navigation("AdminNotesReceived"); - - b.Navigation("AdminServerBansCreated"); - - b.Navigation("AdminServerBansLastEdited"); - - b.Navigation("AdminServerRoleBansCreated"); - - b.Navigation("AdminServerRoleBansLastEdited"); - - b.Navigation("AdminWatchlistsCreated"); - - b.Navigation("AdminWatchlistsDeleted"); - - b.Navigation("AdminWatchlistsLastEdited"); - - b.Navigation("AdminWatchlistsReceived"); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Navigation("Profiles"); - }); - - modelBuilder.Entity("Content.Server.Database.Profile", b => - { - b.Navigation("Antags"); - - b.Navigation("Jobs"); - - b.Navigation("Loadouts"); - - b.Navigation("Traits"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Navigation("AdminLogs"); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Navigation("ConnectionLogs"); - - b.Navigation("Rounds"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.Navigation("BanHits"); - - b.Navigation("Unban"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerRoleBan", b => - { - b.Navigation("Unban"); - }); -#pragma warning restore 612, 618 - } - } -} -#endif diff --git a/Content.Server.Database/Migrations/Postgres/20240906151158_Sponsors-allowjob.cs b/Content.Server.Database/Migrations/Postgres/20240906151158_Sponsors-allowjob.cs deleted file mode 100644 index c6053191de..0000000000 --- a/Content.Server.Database/Migrations/Postgres/20240906151158_Sponsors-allowjob.cs +++ /dev/null @@ -1,31 +0,0 @@ -#if LPP_Sponsors -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Content.Server.Database.Migrations.Postgres -{ - /// - public partial class Sponsorsallowjob : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "allow_job", - table: "sponsors", - type: "boolean", - nullable: false, - defaultValue: false); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "allow_job", - table: "sponsors"); - } - } -} -#endif diff --git a/Content.Server.Database/Migrations/Sqlite/20240906151148_Sponsors-allowjob.Designer.cs b/Content.Server.Database/Migrations/Sqlite/20240906151148_Sponsors-allowjob.Designer.cs deleted file mode 100644 index 993b303031..0000000000 --- a/Content.Server.Database/Migrations/Sqlite/20240906151148_Sponsors-allowjob.Designer.cs +++ /dev/null @@ -1,1797 +0,0 @@ -// -#if LPP_Sponsors -using System; -using Content.Server.Database; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Content.Server.Database.Migrations.Sqlite -{ - [DbContext(typeof(SqliteServerDbContext))] - [Migration("20240906151148_Sponsors-allowjob")] - partial class Sponsorsallowjob - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.0"); - - modelBuilder.Entity("Content.Server.Database.Admin", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("AdminRankId") - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_id"); - - b.Property("Title") - .HasColumnType("TEXT") - .HasColumnName("title"); - - b.HasKey("UserId") - .HasName("PK_admin"); - - b.HasIndex("AdminRankId") - .HasDatabaseName("IX_admin_admin_rank_id"); - - b.ToTable("admin", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminFlag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_flag_id"); - - b.Property("AdminId") - .HasColumnType("TEXT") - .HasColumnName("admin_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("flag"); - - b.Property("Negative") - .HasColumnType("INTEGER") - .HasColumnName("negative"); - - b.HasKey("Id") - .HasName("PK_admin_flag"); - - b.HasIndex("AdminId") - .HasDatabaseName("IX_admin_flag_admin_id"); - - b.HasIndex("Flag", "AdminId") - .IsUnique(); - - b.ToTable("admin_flag", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminLog", b => - { - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Id") - .HasColumnType("INTEGER") - .HasColumnName("admin_log_id"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("date"); - - b.Property("Impact") - .HasColumnType("INTEGER") - .HasColumnName("impact"); - - b.Property("Json") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("json"); - - b.Property("Message") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("Type") - .HasColumnType("INTEGER") - .HasColumnName("type"); - - b.HasKey("RoundId", "Id") - .HasName("PK_admin_log"); - - b.HasIndex("Date"); - - b.HasIndex("Type") - .HasDatabaseName("IX_admin_log_type"); - - b.ToTable("admin_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminLogPlayer", b => - { - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("LogId") - .HasColumnType("INTEGER") - .HasColumnName("log_id"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.HasKey("RoundId", "LogId", "PlayerUserId") - .HasName("PK_admin_log_player"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_log_player_player_user_id"); - - b.ToTable("admin_log_player", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_messages_id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("TEXT") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("INTEGER") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("TEXT") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("TEXT") - .HasColumnName("deleted_by_id"); - - b.Property("Dismissed") - .HasColumnType("INTEGER") - .HasColumnName("dismissed"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Seen") - .HasColumnType("INTEGER") - .HasColumnName("seen"); - - b.HasKey("Id") - .HasName("PK_admin_messages"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_messages_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_messages_round_id"); - - b.ToTable("admin_messages", null, t => - { - t.HasCheckConstraint("NotDismissedAndSeen", "NOT dismissed OR seen"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_notes_id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("TEXT") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("INTEGER") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("TEXT") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("TEXT") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Secret") - .HasColumnType("INTEGER") - .HasColumnName("secret"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_admin_notes"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_notes_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_notes_round_id"); - - b.ToTable("admin_notes", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminRank", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_id"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("PK_admin_rank"); - - b.ToTable("admin_rank", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminRankFlag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_flag_id"); - - b.Property("AdminRankId") - .HasColumnType("INTEGER") - .HasColumnName("admin_rank_id"); - - b.Property("Flag") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("flag"); - - b.HasKey("Id") - .HasName("PK_admin_rank_flag"); - - b.HasIndex("AdminRankId"); - - b.HasIndex("Flag", "AdminRankId") - .IsUnique(); - - b.ToTable("admin_rank_flag", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AdminWatchlist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("admin_watchlists_id"); - - b.Property("CreatedAt") - .HasColumnType("TEXT") - .HasColumnName("created_at"); - - b.Property("CreatedById") - .HasColumnType("TEXT") - .HasColumnName("created_by_id"); - - b.Property("Deleted") - .HasColumnType("INTEGER") - .HasColumnName("deleted"); - - b.Property("DeletedAt") - .HasColumnType("TEXT") - .HasColumnName("deleted_at"); - - b.Property("DeletedById") - .HasColumnType("TEXT") - .HasColumnName("deleted_by_id"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("LastEditedAt") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("TEXT") - .HasColumnName("message"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.HasKey("Id") - .HasName("PK_admin_watchlists"); - - b.HasIndex("CreatedById"); - - b.HasIndex("DeletedById"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_admin_watchlists_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_admin_watchlists_round_id"); - - b.ToTable("admin_watchlists", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Antag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("antag_id"); - - b.Property("AntagName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("antag_name"); - - b.Property("ProfileId") - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.HasKey("Id") - .HasName("PK_antag"); - - b.HasIndex("ProfileId", "AntagName") - .IsUnique(); - - b.ToTable("antag", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.AssignedUserId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("assigned_user_id_id"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("UserName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("user_name"); - - b.HasKey("Id") - .HasName("PK_assigned_user_id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.HasIndex("UserName") - .IsUnique(); - - b.ToTable("assigned_user_id", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ConnectionLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("connection_log_id"); - - b.Property("Address") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("address"); - - b.Property("Denied") - .HasColumnType("INTEGER") - .HasColumnName("denied"); - - b.Property("HWId") - .HasColumnType("BLOB") - .HasColumnName("hwid"); - - b.Property("ServerId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0) - .HasColumnName("server_id"); - - b.Property("Time") - .HasColumnType("TEXT") - .HasColumnName("time"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("UserName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("user_name"); - - b.HasKey("Id") - .HasName("PK_connection_log"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_connection_log_server_id"); - - b.HasIndex("UserId"); - - b.ToTable("connection_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Job", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("job_id"); - - b.Property("JobName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("job_name"); - - b.Property("Priority") - .HasColumnType("INTEGER") - .HasColumnName("priority"); - - b.Property("ProfileId") - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.HasKey("Id") - .HasName("PK_job"); - - b.HasIndex("ProfileId"); - - b.HasIndex("ProfileId", "JobName") - .IsUnique(); - - b.HasIndex(new[] { "ProfileId" }, "IX_job_one_high_priority") - .IsUnique() - .HasFilter("priority = 3"); - - b.ToTable("job", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Loadout", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("loadout_id"); - - b.Property("LoadoutName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("loadout_name"); - - b.Property("ProfileId") - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.HasKey("Id") - .HasName("PK_loadout"); - - b.HasIndex("ProfileId", "LoadoutName") - .IsUnique(); - - b.ToTable("loadout", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.PlayTime", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("play_time_id"); - - b.Property("PlayerId") - .HasColumnType("TEXT") - .HasColumnName("player_id"); - - b.Property("TimeSpent") - .HasColumnType("TEXT") - .HasColumnName("time_spent"); - - b.Property("Tracker") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("tracker"); - - b.HasKey("Id") - .HasName("PK_play_time"); - - b.HasIndex("PlayerId", "Tracker") - .IsUnique(); - - b.ToTable("play_time", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Player", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("player_id"); - - b.Property("FirstSeenTime") - .HasColumnType("TEXT") - .HasColumnName("first_seen_time"); - - b.Property("LastReadRules") - .HasColumnType("TEXT") - .HasColumnName("last_read_rules"); - - b.Property("LastSeenAddress") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_seen_address"); - - b.Property("LastSeenHWId") - .HasColumnType("BLOB") - .HasColumnName("last_seen_hwid"); - - b.Property("LastSeenTime") - .HasColumnType("TEXT") - .HasColumnName("last_seen_time"); - - b.Property("LastSeenUserName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("last_seen_user_name"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.HasKey("Id") - .HasName("PK_player"); - - b.HasAlternateKey("UserId") - .HasName("ak_player_user_id"); - - b.HasIndex("LastSeenUserName"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("player", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("preference_id"); - - b.Property("AdminOOCColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("admin_ooc_color"); - - b.Property("SelectedCharacterSlot") - .HasColumnType("INTEGER") - .HasColumnName("selected_character_slot"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.HasKey("Id") - .HasName("PK_preference"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("preference", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Profile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.Property("Age") - .HasColumnType("INTEGER") - .HasColumnName("age"); - - b.Property("Backpack") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("backpack"); - - b.Property("CharacterName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("char_name"); - - b.Property("Clothing") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("clothing"); - - b.Property("EyeColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("eye_color"); - - b.Property("FacialHairColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("facial_hair_color"); - - b.Property("FacialHairName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("facial_hair_name"); - - b.Property("FlavorText") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("flavor_text"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("gender"); - - b.Property("HairColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("hair_color"); - - b.Property("HairName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("hair_name"); - - b.Property("Height") - .HasColumnType("REAL") - .HasColumnName("height"); - - b.Property("Markings") - .HasColumnType("jsonb") - .HasColumnName("markings"); - - b.Property("PreferenceId") - .HasColumnType("INTEGER") - .HasColumnName("preference_id"); - - b.Property("PreferenceUnavailable") - .HasColumnType("INTEGER") - .HasColumnName("pref_unavailable"); - - b.Property("Sex") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("sex"); - - b.Property("SkinColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("skin_color"); - - b.Property("Slot") - .HasColumnType("INTEGER") - .HasColumnName("slot"); - - b.Property("SpawnPriority") - .HasColumnType("INTEGER") - .HasColumnName("spawn_priority"); - - b.Property("Species") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("species"); - - b.Property("Voice") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("voice"); - - b.Property("Width") - .HasColumnType("REAL") - .HasColumnName("width"); - - b.HasKey("Id") - .HasName("PK_profile"); - - b.HasIndex("PreferenceId") - .HasDatabaseName("IX_profile_preference_id"); - - b.HasIndex("Slot", "PreferenceId") - .IsUnique(); - - b.ToTable("profile", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("ServerId") - .HasColumnType("INTEGER") - .HasColumnName("server_id"); - - b.Property("StartDate") - .HasColumnType("TEXT") - .HasColumnName("start_date"); - - b.HasKey("Id") - .HasName("PK_round"); - - b.HasIndex("ServerId") - .HasDatabaseName("IX_round_server_id"); - - b.HasIndex("StartDate"); - - b.ToTable("round", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_id"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("PK_server"); - - b.ToTable("server", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_ban_id"); - - b.Property("Address") - .HasColumnType("TEXT") - .HasColumnName("address"); - - b.Property("AutoDelete") - .HasColumnType("INTEGER") - .HasColumnName("auto_delete"); - - b.Property("BanTime") - .HasColumnType("TEXT") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("TEXT") - .HasColumnName("banning_admin"); - - b.Property("ExemptFlags") - .HasColumnType("INTEGER") - .HasColumnName("exempt_flags"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("HWId") - .HasColumnType("BLOB") - .HasColumnName("hwid"); - - b.Property("Hidden") - .HasColumnType("INTEGER") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("reason"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_ban_round_id"); - - b.ToTable("server_ban", null, t => - { - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanExemption", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("Flags") - .HasColumnType("INTEGER") - .HasColumnName("flags"); - - b.HasKey("UserId") - .HasName("PK_server_ban_exemption"); - - b.ToTable("server_ban_exemption", null, t => - { - t.HasCheckConstraint("FlagsNotZero", "flags != 0"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanHit", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_ban_hit_id"); - - b.Property("BanId") - .HasColumnType("INTEGER") - .HasColumnName("ban_id"); - - b.Property("ConnectionId") - .HasColumnType("INTEGER") - .HasColumnName("connection_id"); - - b.HasKey("Id") - .HasName("PK_server_ban_hit"); - - b.HasIndex("BanId") - .HasDatabaseName("IX_server_ban_hit_ban_id"); - - b.HasIndex("ConnectionId") - .HasDatabaseName("IX_server_ban_hit_connection_id"); - - b.ToTable("server_ban_hit", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ServerRoleBan", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("server_role_ban_id"); - - b.Property("Address") - .HasColumnType("TEXT") - .HasColumnName("address"); - - b.Property("BanTime") - .HasColumnType("TEXT") - .HasColumnName("ban_time"); - - b.Property("BanningAdmin") - .HasColumnType("TEXT") - .HasColumnName("banning_admin"); - - b.Property("ExpirationTime") - .HasColumnType("TEXT") - .HasColumnName("expiration_time"); - - b.Property("HWId") - .HasColumnType("BLOB") - .HasColumnName("hwid"); - - b.Property("Hidden") - .HasColumnType("INTEGER") - .HasColumnName("hidden"); - - b.Property("LastEditedAt") - .HasColumnType("TEXT") - .HasColumnName("last_edited_at"); - - b.Property("LastEditedById") - .HasColumnType("TEXT") - .HasColumnName("last_edited_by_id"); - - b.Property("PlayerUserId") - .HasColumnType("TEXT") - .HasColumnName("player_user_id"); - - b.Property("PlaytimeAtNote") - .HasColumnType("TEXT") - .HasColumnName("playtime_at_note"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("reason"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("role_id"); - - b.Property("RoundId") - .HasColumnType("INTEGER") - .HasColumnName("round_id"); - - b.Property("Severity") - .HasColumnType("INTEGER") - .HasColumnName("severity"); - - b.HasKey("Id") - .HasName("PK_server_role_ban"); - - b.HasIndex("Address"); - - b.HasIndex("BanningAdmin"); - - b.HasIndex("LastEditedById"); - - b.HasIndex("PlayerUserId") - .HasDatabaseName("IX_server_role_ban_player_user_id"); - - b.HasIndex("RoundId") - .HasDatabaseName("IX_server_role_ban_round_id"); - - b.ToTable("server_role_ban", null, t => - { - t.HasCheckConstraint("HaveEitherAddressOrUserIdOrHWId", "address IS NOT NULL OR player_user_id IS NOT NULL OR hwid IS NOT NULL"); - }); - }); - - modelBuilder.Entity("Content.Server.Database.ServerRoleUnban", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("role_unban_id"); - - b.Property("BanId") - .HasColumnType("INTEGER") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("TEXT") - .HasColumnName("unban_time"); - - b.Property("UnbanningAdmin") - .HasColumnType("TEXT") - .HasColumnName("unbanning_admin"); - - b.HasKey("Id") - .HasName("PK_server_role_unban"); - - b.HasIndex("BanId") - .IsUnique(); - - b.ToTable("server_role_unban", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.ServerUnban", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("unban_id"); - - b.Property("BanId") - .HasColumnType("INTEGER") - .HasColumnName("ban_id"); - - b.Property("UnbanTime") - .HasColumnType("TEXT") - .HasColumnName("unban_time"); - - b.Property("UnbanningAdmin") - .HasColumnType("TEXT") - .HasColumnName("unbanning_admin"); - - b.HasKey("Id") - .HasName("PK_server_unban"); - - b.HasIndex("BanId") - .IsUnique(); - - b.ToTable("server_unban", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Sponsor", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.Property("AllowJob") - .HasColumnType("INTEGER") - .HasColumnName("allow_job"); - - b.Property("AllowedMarkings") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("allowed_markings"); - - // b.Property("ExpireDate") - // .HasColumnType("TEXT") - // .HasColumnName("expire_date"); - - b.Property("ExtraSlots") - .HasColumnType("INTEGER") - .HasColumnName("extra_slots"); - - b.Property("HavePriorityJoin") - .HasColumnType("INTEGER") - .HasColumnName("have_priority_join"); - - b.Property("OOCColor") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("ooccolor"); - - b.Property("Tier") - .HasColumnType("INTEGER") - .HasColumnName("tier"); - - b.HasKey("UserId") - .HasName("PK_sponsors"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("sponsors", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Trait", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("trait_id"); - - b.Property("ProfileId") - .HasColumnType("INTEGER") - .HasColumnName("profile_id"); - - b.Property("TraitName") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("trait_name"); - - b.HasKey("Id") - .HasName("PK_trait"); - - b.HasIndex("ProfileId", "TraitName") - .IsUnique(); - - b.ToTable("trait", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.UploadedResourceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasColumnName("uploaded_resource_log_id"); - - b.Property("Data") - .IsRequired() - .HasColumnType("BLOB") - .HasColumnName("data"); - - b.Property("Date") - .HasColumnType("TEXT") - .HasColumnName("date"); - - b.Property("Path") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("path"); - - b.Property("UserId") - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.HasKey("Id") - .HasName("PK_uploaded_resource_log"); - - b.ToTable("uploaded_resource_log", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Whitelist", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT") - .HasColumnName("user_id"); - - b.HasKey("UserId") - .HasName("PK_whitelist"); - - b.ToTable("whitelist", (string)null); - }); - - modelBuilder.Entity("PlayerRound", b => - { - b.Property("PlayersId") - .HasColumnType("INTEGER") - .HasColumnName("players_id"); - - b.Property("RoundsId") - .HasColumnType("INTEGER") - .HasColumnName("rounds_id"); - - b.HasKey("PlayersId", "RoundsId") - .HasName("PK_player_round"); - - b.HasIndex("RoundsId") - .HasDatabaseName("IX_player_round_rounds_id"); - - b.ToTable("player_round", (string)null); - }); - - modelBuilder.Entity("Content.Server.Database.Admin", b => - { - b.HasOne("Content.Server.Database.AdminRank", "AdminRank") - .WithMany("Admins") - .HasForeignKey("AdminRankId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_admin_rank_admin_rank_id"); - - b.Navigation("AdminRank"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminFlag", b => - { - b.HasOne("Content.Server.Database.Admin", "Admin") - .WithMany("Flags") - .HasForeignKey("AdminId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_admin_flag_admin_admin_id"); - - b.Navigation("Admin"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminLog", b => - { - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany("AdminLogs") - .HasForeignKey("RoundId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_admin_log_round_round_id"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminLogPlayer", b => - { - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminLogs") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_admin_log_player_player_player_user_id"); - - b.HasOne("Content.Server.Database.AdminLog", "Log") - .WithMany("Players") - .HasForeignKey("RoundId", "LogId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_admin_log_player_admin_log_round_id_log_id"); - - b.Navigation("Log"); - - b.Navigation("Player"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminMessage", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminMessagesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminMessagesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminMessagesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_messages_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminMessagesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_messages_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_messages_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminNote", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminNotesCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminNotesDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminNotesLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_notes_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminNotesReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_notes_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_notes_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminRankFlag", b => - { - b.HasOne("Content.Server.Database.AdminRank", "Rank") - .WithMany("Flags") - .HasForeignKey("AdminRankId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_admin_rank_flag_admin_rank_admin_rank_id"); - - b.Navigation("Rank"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminWatchlist", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminWatchlistsCreated") - .HasForeignKey("CreatedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_created_by_id"); - - b.HasOne("Content.Server.Database.Player", "DeletedBy") - .WithMany("AdminWatchlistsDeleted") - .HasForeignKey("DeletedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_deleted_by_id"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminWatchlistsLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_admin_watchlists_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Player", "Player") - .WithMany("AdminWatchlistsReceived") - .HasForeignKey("PlayerUserId") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("FK_admin_watchlists_player_player_user_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_admin_watchlists_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("DeletedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Player"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.Antag", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Antags") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_antag_profile_profile_id"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("Content.Server.Database.ConnectionLog", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("ConnectionLogs") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.SetNull) - .IsRequired() - .HasConstraintName("FK_connection_log_server_server_id"); - - b.Navigation("Server"); - }); - - modelBuilder.Entity("Content.Server.Database.Job", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Jobs") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_job_profile_profile_id"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("Content.Server.Database.Loadout", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Loadouts") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_loadout_profile_profile_id"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("Content.Server.Database.Profile", b => - { - b.HasOne("Content.Server.Database.Preference", "Preference") - .WithMany("Profiles") - .HasForeignKey("PreferenceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_profile_preference_preference_id"); - - b.Navigation("Preference"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.HasOne("Content.Server.Database.Server", "Server") - .WithMany("Rounds") - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_round_server_server_id"); - - b.Navigation("Server"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_ban_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBanHit", b => - { - b.HasOne("Content.Server.Database.ServerBan", "Ban") - .WithMany("BanHits") - .HasForeignKey("BanId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_server_ban_hit_server_ban_ban_id"); - - b.HasOne("Content.Server.Database.ConnectionLog", "Connection") - .WithMany("BanHits") - .HasForeignKey("ConnectionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_server_ban_hit_connection_log_connection_id"); - - b.Navigation("Ban"); - - b.Navigation("Connection"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerRoleBan", b => - { - b.HasOne("Content.Server.Database.Player", "CreatedBy") - .WithMany("AdminServerRoleBansCreated") - .HasForeignKey("BanningAdmin") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_banning_admin"); - - b.HasOne("Content.Server.Database.Player", "LastEditedBy") - .WithMany("AdminServerRoleBansLastEdited") - .HasForeignKey("LastEditedById") - .HasPrincipalKey("UserId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("FK_server_role_ban_player_last_edited_by_id"); - - b.HasOne("Content.Server.Database.Round", "Round") - .WithMany() - .HasForeignKey("RoundId") - .HasConstraintName("FK_server_role_ban_round_round_id"); - - b.Navigation("CreatedBy"); - - b.Navigation("LastEditedBy"); - - b.Navigation("Round"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerRoleUnban", b => - { - b.HasOne("Content.Server.Database.ServerRoleBan", "Ban") - .WithOne("Unban") - .HasForeignKey("Content.Server.Database.ServerRoleUnban", "BanId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_server_role_unban_server_role_ban_ban_id"); - - b.Navigation("Ban"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerUnban", b => - { - b.HasOne("Content.Server.Database.ServerBan", "Ban") - .WithOne("Unban") - .HasForeignKey("Content.Server.Database.ServerUnban", "BanId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_server_unban_server_ban_ban_id"); - - b.Navigation("Ban"); - }); - - modelBuilder.Entity("Content.Server.Database.Trait", b => - { - b.HasOne("Content.Server.Database.Profile", "Profile") - .WithMany("Traits") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_trait_profile_profile_id"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("PlayerRound", b => - { - b.HasOne("Content.Server.Database.Player", null) - .WithMany() - .HasForeignKey("PlayersId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_player_round_player_players_id"); - - b.HasOne("Content.Server.Database.Round", null) - .WithMany() - .HasForeignKey("RoundsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_player_round_round_rounds_id"); - }); - - modelBuilder.Entity("Content.Server.Database.Admin", b => - { - b.Navigation("Flags"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminLog", b => - { - b.Navigation("Players"); - }); - - modelBuilder.Entity("Content.Server.Database.AdminRank", b => - { - b.Navigation("Admins"); - - b.Navigation("Flags"); - }); - - modelBuilder.Entity("Content.Server.Database.ConnectionLog", b => - { - b.Navigation("BanHits"); - }); - - modelBuilder.Entity("Content.Server.Database.Player", b => - { - b.Navigation("AdminLogs"); - - b.Navigation("AdminMessagesCreated"); - - b.Navigation("AdminMessagesDeleted"); - - b.Navigation("AdminMessagesLastEdited"); - - b.Navigation("AdminMessagesReceived"); - - b.Navigation("AdminNotesCreated"); - - b.Navigation("AdminNotesDeleted"); - - b.Navigation("AdminNotesLastEdited"); - - b.Navigation("AdminNotesReceived"); - - b.Navigation("AdminServerBansCreated"); - - b.Navigation("AdminServerBansLastEdited"); - - b.Navigation("AdminServerRoleBansCreated"); - - b.Navigation("AdminServerRoleBansLastEdited"); - - b.Navigation("AdminWatchlistsCreated"); - - b.Navigation("AdminWatchlistsDeleted"); - - b.Navigation("AdminWatchlistsLastEdited"); - - b.Navigation("AdminWatchlistsReceived"); - }); - - modelBuilder.Entity("Content.Server.Database.Preference", b => - { - b.Navigation("Profiles"); - }); - - modelBuilder.Entity("Content.Server.Database.Profile", b => - { - b.Navigation("Antags"); - - b.Navigation("Jobs"); - - b.Navigation("Loadouts"); - - b.Navigation("Traits"); - }); - - modelBuilder.Entity("Content.Server.Database.Round", b => - { - b.Navigation("AdminLogs"); - }); - - modelBuilder.Entity("Content.Server.Database.Server", b => - { - b.Navigation("ConnectionLogs"); - - b.Navigation("Rounds"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerBan", b => - { - b.Navigation("BanHits"); - - b.Navigation("Unban"); - }); - - modelBuilder.Entity("Content.Server.Database.ServerRoleBan", b => - { - b.Navigation("Unban"); - }); -#pragma warning restore 612, 618 - } - } -} -#endif diff --git a/Content.Server.Database/Migrations/Sqlite/20240906151148_Sponsors-allowjob.cs b/Content.Server.Database/Migrations/Sqlite/20240906151148_Sponsors-allowjob.cs deleted file mode 100644 index e7ae83da88..0000000000 --- a/Content.Server.Database/Migrations/Sqlite/20240906151148_Sponsors-allowjob.cs +++ /dev/null @@ -1,31 +0,0 @@ -#if LPP_Sponsors -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Content.Server.Database.Migrations.Sqlite -{ - /// - public partial class Sponsorsallowjob : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "allow_job", - table: "sponsors", - type: "INTEGER", - nullable: false, - defaultValue: false); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "allow_job", - table: "sponsors"); - } - } -} -#endif diff --git a/Content.Server.Database/Model.cs b/Content.Server.Database/Model.cs index 64ef941456..ade907c3e6 100644 --- a/Content.Server.Database/Model.cs +++ b/Content.Server.Database/Model.cs @@ -1062,7 +1062,7 @@ public class Sponsor public string AllowedMarkings { get; set; } = null!; public int ExtraSlots { get; set; } //public DateTime ExpireDate {get;set;} - public bool AllowJob { get; set; } = false; + //public bool AllowJob { get; set; } = false; } #endif } diff --git a/Content.Server/Players/PlayTimeTracking/PlayTimeTrackingSystem.cs b/Content.Server/Players/PlayTimeTracking/PlayTimeTrackingSystem.cs index de53235198..bc976bed43 100644 --- a/Content.Server/Players/PlayTimeTracking/PlayTimeTrackingSystem.cs +++ b/Content.Server/Players/PlayTimeTracking/PlayTimeTrackingSystem.cs @@ -20,6 +20,9 @@ using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Utility; +#if LPP_Sponsors +using Content.Server._LostParadise.Sponsors; +#endif namespace Content.Server.Players.PlayTimeTracking; @@ -37,7 +40,9 @@ public sealed class PlayTimeTrackingSystem : EntitySystem [Dependency] private readonly CharacterRequirementsSystem _characterRequirements = default!; [Dependency] private readonly IServerPreferencesManager _prefs = default!; [Dependency] private readonly IConfigurationManager _config = default!; - +#if LPP_Sponsors + [Dependency] private readonly CheckSponsorSystem _checkSponsor = default!; +#endif public override void Initialize() { @@ -180,6 +185,10 @@ public bool IsAllowed(ICommonSession player, string role) var isWhitelisted = player.ContentData()?.Whitelisted ?? false; // DeltaV - Whitelist requirement +#if LPP_Sponsors + var sponsorTier = _checkSponsor.CheckUser(player.UserId).Item2 ?? 0; +#endif + return _characterRequirements.CheckRequirementsValid( job.Requirements, job, @@ -190,7 +199,11 @@ public bool IsAllowed(ICommonSession player, string role) EntityManager, _prototypes, _config, - out _); + out _ +#if LPP_Sponsors + , 0, sponsorTier +#endif + ); } public HashSet GetDisallowedJobs(ICommonSession player) @@ -207,6 +220,10 @@ public HashSet GetDisallowedJobs(ICommonSession player) var isWhitelisted = player.ContentData()?.Whitelisted ?? false; // DeltaV - Whitelist requirement +#if LPP_Sponsors + var sponsorTier = _checkSponsor.CheckUser(player.UserId).Item2 ?? 0; +#endif + foreach (var job in _prototypes.EnumeratePrototypes()) { if (job.Requirements != null) @@ -221,7 +238,11 @@ public HashSet GetDisallowedJobs(ICommonSession player) EntityManager, _prototypes, _config, - out _)) + out _ +#if LPP_Sponsors + , 0, sponsorTier +#endif + )) continue; goto NoRole; @@ -249,6 +270,10 @@ public void RemoveDisallowedJobs(NetUserId userId, ref List jobs) var isWhitelisted = player.ContentData()?.Whitelisted ?? false; // DeltaV - Whitelist requirement +#if LPP_Sponsors + var sponsorTier = _checkSponsor.CheckUser(player.UserId).Item2 ?? 0; +#endif + for (var i = 0; i < jobs.Count; i++) { var job = jobs[i]; @@ -268,7 +293,11 @@ public void RemoveDisallowedJobs(NetUserId userId, ref List jobs) EntityManager, _prototypes, _config, - out _)) + out _ +#if LPP_Sponsors + , 0, sponsorTier +#endif + )) { jobs.RemoveSwap(i); i--; diff --git a/Content.Shared/Customization/Systems/CharacterRequirements.Job.cs b/Content.Shared/Customization/Systems/CharacterRequirements.Job.cs index f9a060b738..5bfd650268 100644 --- a/Content.Shared/Customization/Systems/CharacterRequirements.Job.cs +++ b/Content.Shared/Customization/Systems/CharacterRequirements.Job.cs @@ -23,6 +23,13 @@ public sealed partial class CharacterJobRequirement : CharacterRequirement [DataField(required: true)] public List> Jobs; +#if LPP_Sponsors + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0, int sponsorTier = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth); +#endif + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, @@ -69,6 +76,13 @@ public sealed partial class CharacterDepartmentRequirement : CharacterRequiremen [DataField(required: true)] public List> Departments; +#if LPP_Sponsors + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0, int sponsorTier = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth); +#endif + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, @@ -111,10 +125,20 @@ public sealed partial class CharacterDepartmentTimeRequirement : CharacterRequir [DataField(required: true)] public ProtoId Department; +#if LPP_Sponsors public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, - out FormattedMessage? reason, int depth = 0) + out FormattedMessage? reason, int depth = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth, 0); +#endif + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0 +#if LPP_Sponsors + , int sponsorTier = 0 +#endif + ) { // Disable the requirement if the role timers are disabled if (!configManager.GetCVar(CCVars.GameRoleTimers)) @@ -123,6 +147,14 @@ public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, return !Inverted; } +#if LPP_Sponsors + if (sponsorTier >= 5 && !whitelisted) + { + reason = null; + return true; + } +#endif + var department = prototypeManager.Index(Department); // Combine all of this department's job playtimes @@ -177,10 +209,20 @@ public sealed partial class CharacterOverallTimeRequirement : CharacterRequireme [DataField] public TimeSpan Max = TimeSpan.MaxValue; +#if LPP_Sponsors public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, - out FormattedMessage? reason, int depth = 0) + out FormattedMessage? reason, int depth = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth, 0); +#endif + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0 +#if LPP_Sponsors + , int sponsorTier = 0 +#endif + ) { // Disable the requirement if the role timers are disabled if (!configManager.GetCVar(CCVars.GameRoleTimers)) @@ -189,6 +231,14 @@ public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, return !Inverted; } +#if LPP_Sponsors + if (sponsorTier >= 5 && !whitelisted) + { + reason = null; + return true; + } +#endif + // Get the overall time var overallTime = playTimes.GetValueOrDefault(PlayTimeTrackingShared.TrackerOverall); @@ -233,10 +283,20 @@ public sealed partial class CharacterPlaytimeRequirement : CharacterRequirement [DataField(required: true)] public ProtoId Tracker; +#if LPP_Sponsors public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, - out FormattedMessage? reason, int depth = 0) + out FormattedMessage? reason, int depth = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth, 0); +#endif + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0 +#if LPP_Sponsors + , int sponsorTier = 0 +#endif + ) { // Disable the requirement if the role timers are disabled if (!configManager.GetCVar(CCVars.GameRoleTimers)) @@ -245,6 +305,14 @@ public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, return !Inverted; } +#if LPP_Sponsors + if (sponsorTier >= 5 && !whitelisted) + { + reason = null; + return true; + } +#endif + // Get SharedJobSystem if (!entityManager.EntitySysManager.TryGetEntitySystem(out SharedJobSystem? jobSystem)) { diff --git a/Content.Shared/Customization/Systems/CharacterRequirements.Logic.cs b/Content.Shared/Customization/Systems/CharacterRequirements.Logic.cs index 397e74bc8b..ff71a8b484 100644 --- a/Content.Shared/Customization/Systems/CharacterRequirements.Logic.cs +++ b/Content.Shared/Customization/Systems/CharacterRequirements.Logic.cs @@ -20,14 +20,28 @@ public sealed partial class CharacterLogicAndRequirement : CharacterRequirement [DataField] public List Requirements { get; private set; } = new(); +#if LPP_Sponsors public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, - out FormattedMessage? reason, int depth = 0) + out FormattedMessage? reason, int depth = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth, 0); +#endif + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0 +#if LPP_Sponsors + , int sponsorTier = 0 +#endif + ) { var succeeded = entityManager.EntitySysManager.GetEntitySystem() .CheckRequirementsValid(Requirements, job, profile, playTimes, whitelisted, prototype, entityManager, - prototypeManager, configManager, out var reasons, depth + 1); + prototypeManager, configManager, out var reasons, depth + 1 +#if LPP_Sponsors + , sponsorTier = 0 +#endif + ); if (reasons.Count == 0) { @@ -56,10 +70,21 @@ public sealed partial class CharacterLogicOrRequirement : CharacterRequirement [DataField] public List Requirements { get; private set; } = new(); +#if LPP_Sponsors + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth, 0); +#endif + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, - out FormattedMessage? reason, int depth = 0) + out FormattedMessage? reason, int depth = 0 +#if LPP_Sponsors + , int sponsorTier = 0 +#endif + ) { var succeeded = false; var reasons = new List(); @@ -67,8 +92,24 @@ public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, foreach (var requirement in Requirements) { - if (characterRequirements.CheckRequirementValid(requirement, job, profile, playTimes, whitelisted, prototype, - entityManager, prototypeManager, configManager, out var raisin, depth + 1)) + var validation = false; + FormattedMessage? raisin; +#if LPP_Sponsors + if (requirement is CharacterDepartmentTimeRequirement || + requirement is CharacterOverallTimeRequirement || + requirement is CharacterPlaytimeRequirement + ) + validation = characterRequirements.CheckRequirementValid(requirement, job, profile, playTimes, whitelisted, prototype, + entityManager, prototypeManager, configManager, out raisin, depth + 1, sponsorTier); + else + validation = characterRequirements.CheckRequirementValid(requirement, job, profile, playTimes, whitelisted, prototype, + entityManager, prototypeManager, configManager, out raisin, depth + 1); +#else + validation = characterRequirements.CheckRequirementValid(requirement, job, profile, playTimes, whitelisted, prototype, + entityManager, prototypeManager, configManager, out var raisin, depth + 1); +#endif + + if (validation) { succeeded = true; break; @@ -105,10 +146,20 @@ public sealed partial class CharacterLogicXorRequirement : CharacterRequirement [DataField] public List Requirements { get; private set; } = new(); +#if LPP_Sponsors + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth, 0); +#endif public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, - out FormattedMessage? reason, int depth = 0) + out FormattedMessage? reason, int depth = 0 +#if LPP_Sponsors + , int sponsorTier = 0 +#endif + ) { var reasons = new List(); var succeeded = false; @@ -116,8 +167,23 @@ public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, foreach (var requirement in Requirements) { - if (characterRequirements.CheckRequirementValid(requirement, job, profile, playTimes, whitelisted, prototype, - entityManager, prototypeManager, configManager, out var raisin, depth + 1)) + var validation = false; + FormattedMessage? raisin; +#if LPP_Sponsors + if (requirement is CharacterDepartmentTimeRequirement || + requirement is CharacterOverallTimeRequirement || + requirement is CharacterPlaytimeRequirement + ) + validation = characterRequirements.CheckRequirementValid(requirement, job, profile, playTimes, whitelisted, prototype, + entityManager, prototypeManager, configManager, out raisin, depth + 1, sponsorTier); + else + validation = characterRequirements.CheckRequirementValid(requirement, job, profile, playTimes, whitelisted, prototype, + entityManager, prototypeManager, configManager, out raisin, depth + 1); +#else + validation = characterRequirements.CheckRequirementValid(requirement, job, profile, playTimes, whitelisted, prototype, + entityManager, prototypeManager, configManager, out var raisin, depth + 1); +#endif + if (validation) { if (succeeded) { diff --git a/Content.Shared/Customization/Systems/CharacterRequirements.Profile.cs b/Content.Shared/Customization/Systems/CharacterRequirements.Profile.cs index 8fdb7c0e7d..f6ef5c7abc 100644 --- a/Content.Shared/Customization/Systems/CharacterRequirements.Profile.cs +++ b/Content.Shared/Customization/Systems/CharacterRequirements.Profile.cs @@ -30,6 +30,12 @@ public sealed partial class CharacterAgeRequirement : CharacterRequirement [DataField(required: true)] public int Max; +#if LPP_Sponsors + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0, int sponsorTier = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth); +#endif public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, @@ -51,6 +57,12 @@ public sealed partial class CharacterBackpackTypeRequirement : CharacterRequirem [DataField(required: true)] public BackpackPreference Preference; +#if LPP_Sponsors + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0, int sponsorTier = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth); +#endif public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, @@ -73,6 +85,12 @@ public sealed partial class CharacterClothingPreferenceRequirement : CharacterRe [DataField(required: true)] public ClothingPreference Preference; +#if LPP_Sponsors + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0, int sponsorTier = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth); +#endif public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, @@ -95,6 +113,12 @@ public sealed partial class CharacterGenderRequirement : CharacterRequirement [DataField(required: true)] public Gender Gender; +#if LPP_Sponsors + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0, int sponsorTier = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth); +#endif public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, @@ -117,6 +141,12 @@ public sealed partial class CharacterSexRequirement : CharacterRequirement [DataField(required: true)] public Sex Sex; +#if LPP_Sponsors + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0, int sponsorTier = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth); +#endif public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, @@ -139,6 +169,12 @@ public sealed partial class CharacterSpeciesRequirement : CharacterRequirement [DataField(required: true)] public List> Species; +#if LPP_Sponsors + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0, int sponsorTier = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth); +#endif public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, @@ -173,6 +209,12 @@ public sealed partial class CharacterHeightRequirement : CharacterRequirement [DataField] public float Max = int.MaxValue; +#if LPP_Sponsors + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0, int sponsorTier = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth); +#endif public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, @@ -208,6 +250,12 @@ public sealed partial class CharacterWidthRequirement : CharacterRequirement [DataField] public float Max = int.MaxValue; +#if LPP_Sponsors + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0, int sponsorTier = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth); +#endif public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, @@ -243,6 +291,12 @@ public sealed partial class CharacterWeightRequirement : CharacterRequirement [DataField] public float Max = int.MaxValue; +#if LPP_Sponsors + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0, int sponsorTier = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth); +#endif public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, @@ -282,6 +336,12 @@ public sealed partial class CharacterTraitRequirement : CharacterRequirement [DataField(required: true)] public List> Traits; +#if LPP_Sponsors + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0, int sponsorTier = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth); +#endif public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, @@ -307,6 +367,12 @@ public sealed partial class CharacterLoadoutRequirement : CharacterRequirement [DataField(required: true)] public List> Loadouts; +#if LPP_Sponsors + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0, int sponsorTier = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth); +#endif public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, @@ -332,6 +398,12 @@ public sealed partial class CharacterItemGroupRequirement : CharacterRequirement [DataField(required: true)] public ProtoId Group; +#if LPP_Sponsors + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0, int sponsorTier = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth); +#endif public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, diff --git a/Content.Shared/Customization/Systems/CharacterRequirements.Whitelist.cs b/Content.Shared/Customization/Systems/CharacterRequirements.Whitelist.cs index d23d472e06..a0504fffa8 100644 --- a/Content.Shared/Customization/Systems/CharacterRequirements.Whitelist.cs +++ b/Content.Shared/Customization/Systems/CharacterRequirements.Whitelist.cs @@ -17,6 +17,12 @@ namespace Content.Shared.Customization.Systems; [Serializable, NetSerializable] public sealed partial class CharacterWhitelistRequirement : CharacterRequirement { +#if LPP_Sponsors + public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, + Dictionary playTimes, bool whitelisted, IPrototype prototype, + IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, + out FormattedMessage? reason, int depth = 0, int sponsorTier = 0) => IsValid(job, profile, playTimes, whitelisted, prototype, entityManager, prototypeManager, configManager, out reason, depth); +#endif public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, diff --git a/Content.Shared/Customization/Systems/CharacterRequirements.cs b/Content.Shared/Customization/Systems/CharacterRequirements.cs index 2bf24700a6..7569707ec9 100644 --- a/Content.Shared/Customization/Systems/CharacterRequirements.cs +++ b/Content.Shared/Customization/Systems/CharacterRequirements.cs @@ -38,4 +38,20 @@ public abstract bool IsValid( out FormattedMessage? reason, int depth = 0 ); + +#if LPP_Sponsors + public abstract bool IsValid( + JobPrototype job, + HumanoidCharacterProfile profile, + Dictionary playTimes, + bool whitelisted, + IPrototype prototype, + IEntityManager entityManager, + IPrototypeManager prototypeManager, + IConfigurationManager configManager, + out FormattedMessage? reason, + int depth = 0, + int sponsorTier = 0 + ); +#endif } diff --git a/Content.Shared/Customization/Systems/CharacterRequirementsSystem.cs b/Content.Shared/Customization/Systems/CharacterRequirementsSystem.cs index 9becb640d1..3eb05cc8ac 100644 --- a/Content.Shared/Customization/Systems/CharacterRequirementsSystem.cs +++ b/Content.Shared/Customization/Systems/CharacterRequirementsSystem.cs @@ -18,33 +18,72 @@ public sealed class CharacterRequirementsSystem : EntitySystem public bool CheckRequirementValid(CharacterRequirement requirement, JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, - out FormattedMessage? reason, int depth = 0) + out FormattedMessage? reason, int depth = 0 +#if LPP_Sponsors + , int sponsorTier = 0 +#endif + ) { + var validation = false; +#if LPP_Sponsors + if (requirement is CharacterDepartmentTimeRequirement || + requirement is CharacterOverallTimeRequirement || + requirement is CharacterPlaytimeRequirement + ) + validation = requirement.IsValid(job, profile, playTimes, whitelisted, prototype, + entityManager, prototypeManager, configManager, + out reason, depth, sponsorTier); + else + validation = requirement.IsValid(job, profile, playTimes, whitelisted, prototype, + entityManager, prototypeManager, configManager, + out reason, depth); +#else + validation = requirement.IsValid(job, profile, playTimes, whitelisted, prototype, + entityManager, prototypeManager, configManager, + out reason, depth); +#endif + // Return false if the requirement is invalid and not inverted // If it's inverted return false when it's valid - return - !requirement.IsValid(job, profile, playTimes, whitelisted, prototype, - entityManager, prototypeManager, configManager, - out reason, depth) - ? requirement.Inverted - : !requirement.Inverted; + return !validation ? requirement.Inverted : !requirement.Inverted; } public bool CheckRequirementsValid(List requirements, JobPrototype job, HumanoidCharacterProfile profile, Dictionary playTimes, bool whitelisted, IPrototype prototype, IEntityManager entityManager, IPrototypeManager prototypeManager, IConfigurationManager configManager, - out List reasons, int depth = 0) + out List reasons, int depth = 0 +#if LPP_Sponsors + , int sponsorTier = 0 +#endif + ) { reasons = new List(); var valid = true; foreach (var requirement in requirements) { + var validation = false; + FormattedMessage? reason; +#if LPP_Sponsors + if (requirement is CharacterDepartmentTimeRequirement || + requirement is CharacterOverallTimeRequirement || + requirement is CharacterPlaytimeRequirement + ) + validation = requirement.IsValid(job, profile, playTimes, whitelisted, prototype, + entityManager, prototypeManager, configManager, + out reason, depth, sponsorTier); + else + validation = requirement.IsValid(job, profile, playTimes, whitelisted, prototype, + entityManager, prototypeManager, configManager, + out reason, depth); +#else + validation = requirement.IsValid(job, profile, playTimes, whitelisted, prototype, + entityManager, prototypeManager, configManager, + out reason, depth); +#endif // Set valid to false if the requirement is invalid and not inverted // If it's inverted set valid to false when it's valid - if (!requirement.IsValid(job, profile, playTimes, whitelisted, prototype, - entityManager, prototypeManager, configManager, - out var reason, depth)) + if (!validation) { if (valid) valid = requirement.Inverted;