diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
index 7c05b879ad..983ea16ed8 100644
--- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
+++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
@@ -2,6 +2,7 @@ using System.IO;
using System.Linq;
using System.Numerics;
using Content.Client._WL.Records; // WL-Records
+using Content.Client._WL.Skills.Ui; // WL-Skills
using Content.Client.Electrocution;
using Content.Client.Guidebook;
using Content.Client.Humanoid;
@@ -12,6 +13,7 @@ using Content.Client.Players.PlayTimeTracking;
using Content.Client.Sprite;
using Content.Client.Stylesheets;
using Content.Client.UserInterface.Systems.Guidebook;
+using Content.Shared._WL.Skills; // WL-Skills
using Content.Shared.CCVar;
using Content.Shared.Clothing;
using Content.Shared.Corvax.CCCVars;
@@ -132,6 +134,7 @@ namespace Content.Client.Lobby.UI
// One at a time.
private LoadoutWindow? _loadoutWindow;
+ private SkillsWindow? _skillsWindow; // WL-Skills
private TTSTab? _ttsTab; // Corvax-TTS
@@ -1135,6 +1138,13 @@ namespace Content.Client.Lobby.UI
_loadoutWindow?.Dispose();
}
+ // WL-Skills-start
+ public void RefreshSkills()
+ {
+ _skillsWindow?.Dispose();
+ }
+ // WL-Skills-end
+
///
/// Reloads the entire dummy entity for preview.
///
@@ -1199,6 +1209,7 @@ namespace Content.Client.Lobby.UI
RefreshAntags();
RefreshJobs();
RefreshLoadouts();
+ RefreshSkills(); // WL-Skills
RefreshSpecies();
RefreshTraits();
RefreshFlavorText();
@@ -1423,6 +1434,17 @@ namespace Content.Client.Lobby.UI
Margin = new Thickness(3f, 3f, 0f, 0f),
};
+ // WL-Skills-start
+ var skillsWindowBtn = new Button()
+ {
+ Text = Loc.GetString("skill-window"),
+ HorizontalAlignment = HAlignment.Right,
+ VerticalAlignment = VAlignment.Center,
+ Margin = new Thickness(3f, 3f, 0f, 0f),
+ ToolTip = Loc.GetString("skill-window-tooltip")
+ };
+ // WL-Skills-end
+
var collection = IoCManager.Instance!;
var protoManager = collection.Resolve();
@@ -1452,10 +1474,28 @@ namespace Content.Client.Lobby.UI
};
}
+ // WL-Skills-start
+ skillsWindowBtn.OnPressed += args =>
+ {
+ OpenSkills(job);
+ };
+ // WL-Skills-end
+
_jobPriorities.Add((job.ID, subnameSelector, selector));
jobContainer.AddChild(selector);
- jobContainer.AddChild(loadoutWindowBtn);
+
+ // WL-Skills-Edit-start
+ var buttonsContainer = new BoxContainer
+ {
+ Orientation = LayoutOrientation.Horizontal,
+ HorizontalAlignment = HAlignment.Right
+ };
+ buttonsContainer.AddChild(loadoutWindowBtn);
+ buttonsContainer.AddChild(skillsWindowBtn);
+
+ jobContainer.AddChild(buttonsContainer);
category.AddChild(jobContainer);
+ // WL-Skills-Edit-end
}
//WL-Changes-end
}
@@ -1523,6 +1563,61 @@ namespace Content.Client.Lobby.UI
UpdateJobPriorities();
}
+ // WL-Skills-start
+ private void OpenSkills(JobPrototype? jobProto)
+ {
+ _skillsWindow?.Dispose();
+ _skillsWindow = null;
+
+ if (jobProto == null || Profile == null)
+ return;
+
+ JobOverride = jobProto;
+
+ var currentSkills = Profile.Skills.GetValueOrDefault(jobProto.ID, new Dictionary());
+ var defaultSkills = jobProto.DefaultSkills.ToDictionary(
+ kvp => (byte)kvp.Key,
+ kvp => kvp.Value
+ );
+
+ var bonusPoints = jobProto.BonusSkillPoints;
+ var racialBonus = CalculateRacialBonus(Profile.Species, Profile.Age);
+ var totalPoints = bonusPoints + racialBonus;
+
+ _skillsWindow = new SkillsWindow(jobProto.ID, currentSkills, defaultSkills, totalPoints);
+ _skillsWindow.OnSkillChanged += (jobId, skillKey, newLevel) =>
+ {
+ Profile = Profile.WithSkill(jobId, skillKey, newLevel);
+ SetDirty();
+ };
+
+ _skillsWindow.OnClose += () =>
+ {
+ JobOverride = null;
+ ReloadPreview();
+ };
+
+ _skillsWindow.OpenCenteredLeft();
+ JobOverride = jobProto;
+ ReloadPreview();
+ }
+
+ private int CalculateRacialBonus(string species, int age)
+ {
+ var bonus = 0;
+ foreach (var racialBonusProto in _prototypeManager.EnumeratePrototypes())
+ {
+ if (racialBonusProto.Species != species)
+ continue;
+
+ bonus = racialBonusProto.GetBonusForAge(age);
+ break;
+ }
+
+ return bonus;
+ }
+ // WL-Skills-end
+
private void OnFlavorTextChange(string content)
{
if (Profile is null)
@@ -1604,6 +1699,8 @@ namespace Content.Client.Lobby.UI
_loadoutWindow?.Dispose();
_loadoutWindow = null;
+ _skillsWindow?.Dispose(); // WL-Skills
+ _skillsWindow = null; // WL-Skills
}
protected override void EnteredTree()
@@ -1623,6 +1720,7 @@ namespace Content.Client.Lobby.UI
{
Profile = Profile?.WithAge(newAge);
ReloadPreview();
+ RefreshSkills(); // WL-Skills
}
// WL-Height-Start
@@ -1679,6 +1777,7 @@ namespace Content.Client.Lobby.UI
RefreshJobs();
// In case there's species restrictions for loadouts
RefreshLoadouts();
+ RefreshSkills(); // WL-Skills
UpdateSexControls(); // update sex for new species
UpdateSpeciesGuidebookIcon();
ReloadPreview();
diff --git a/Content.Client/UserInterface/Systems/Character/CharacterUIController.cs b/Content.Client/UserInterface/Systems/Character/CharacterUIController.cs
index 6fe0243c63..cbba74e20f 100644
--- a/Content.Client/UserInterface/Systems/Character/CharacterUIController.cs
+++ b/Content.Client/UserInterface/Systems/Character/CharacterUIController.cs
@@ -1,3 +1,5 @@
+using System.Linq;
+using Content.Client._WL.Skills.Ui; // WL-Skills
using Content.Client._WL.DynamicText.UI; // WL-Chages
using Content.Client.CharacterInfo;
using Content.Client.Gameplay;
@@ -6,6 +8,8 @@ using Content.Client.UserInterface.Controls;
using Content.Client.UserInterface.Systems.Character.Controls;
using Content.Client.UserInterface.Systems.Character.Windows;
using Content.Client.UserInterface.Systems.Objectives.Controls;
+using Content.Shared._WL.Skills; // WL-Skills
+using Content.Shared._WL.Skills.Components; // WL-Skills
using Content.Shared.Input;
using Content.Shared.Mind;
using Content.Shared.Mind.Components;
@@ -19,7 +23,6 @@ using Robust.Client.UserInterface.Controls;
using Robust.Shared.Input.Binding;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
-using System.Linq;
using static Content.Client.CharacterInfo.CharacterInfoSystem;
using static Robust.Client.UserInterface.Controls.BaseButton;
@@ -31,6 +34,7 @@ public sealed class CharacterUIController : UIController, IOnStateEntered UIManager.GetActiveUIWidgetOrNull()?.CharacterButton;
public void OnStateEntered(GameplayState state)
@@ -60,6 +65,10 @@ public sealed class CharacterUIController : UIController, IOnStateEntered(_player.LocalEntity))
+ _window.SkillsButton.Disabled = false;
+
_window.DynamicTextButton.OnPressed += _ =>
{
_dynamicText.OpenWindow();
@@ -267,4 +276,57 @@ public sealed class CharacterUIController : UIController, IOnStateEntered();
+ if (!_ent.TryGetComponent(entity, out var skillsComp))
+ return;
+
+ var jobId = skillsComp.CurrentJob;
+ var defaultSkills = skillsSystem.GetDefaultSkillsForJob(jobId);
+ var totalPoints = skillsSystem.GetTotalPoints(entity, jobId, skillsComp);
+ var currentSkills = skillsComp.Skills.ToDictionary(
+ kvp => (byte)kvp.Key,
+ kvp => kvp.Value
+ );
+
+ var skillsWindow = new SkillsWindow(
+ jobId ?? "unknown",
+ currentSkills,
+ defaultSkills,
+ totalPoints,
+ true
+ );
+
+ _skillsWindow = skillsWindow;
+
+ skillsWindow.OnSkillChanged += (changedJobId, skillKey, newLevel) =>
+ {
+ if (_player.LocalEntity is not { } localEntity)
+ return;
+
+ var skillType = (SkillType)skillKey;
+ var ev = new SelectSkillPressedEvent(_ent.GetNetEntity(localEntity), skillType, newLevel, changedJobId);
+ _entityNetworkManager.SendSystemNetworkMessage(ev);
+ };
+
+ skillsWindow.OpenCentered();
+ }
+ // WL-Skills-end
}
diff --git a/Content.Client/UserInterface/Systems/Character/Windows/CharacterWindow.xaml b/Content.Client/UserInterface/Systems/Character/Windows/CharacterWindow.xaml
index 0c75999846..a67de47395 100644
--- a/Content.Client/UserInterface/Systems/Character/Windows/CharacterWindow.xaml
+++ b/Content.Client/UserInterface/Systems/Character/Windows/CharacterWindow.xaml
@@ -18,6 +18,9 @@
+
+
+
diff --git a/Content.Client/_WL/Administration/UI/SkillsAdminEui.cs b/Content.Client/_WL/Administration/UI/SkillsAdminEui.cs
new file mode 100644
index 0000000000..864a8ebe72
--- /dev/null
+++ b/Content.Client/_WL/Administration/UI/SkillsAdminEui.cs
@@ -0,0 +1,44 @@
+using Content.Client.Eui;
+using Content.Shared._WL.Skills.UI;
+using Content.Shared.Eui;
+using JetBrains.Annotations;
+
+namespace Content.Client._WL.Administration.UI;
+
+[UsedImplicitly]
+public sealed class SkillsAdminEui : BaseEui
+{
+ private readonly SkillsAdminWindow _window;
+
+ public SkillsAdminEui()
+ {
+ _window = new SkillsAdminWindow();
+
+ _window.OnClose += () => SendMessage(new SkillsAdminEuiClosedMessage());
+ _window.OnSkillChanged += (skillKey, newLevel) =>
+ SendMessage(new SkillsAdminEuiSkillChangedMessage(skillKey, newLevel));
+ _window.OnPointsChanged += (newBonus) =>
+ SendMessage(new SkillsAdminEuiPointsChangedMessage(newBonus));
+ _window.OnResetAll += () => SendMessage(new SkillsAdminEuiResetMessage());
+ }
+
+ public override void Opened()
+ {
+ _window.OpenCentered();
+ }
+
+ public override void Closed()
+ {
+ _window.Close();
+ }
+
+ public override void HandleState(EuiStateBase state)
+ {
+ base.HandleState(state);
+
+ if (state is SkillsAdminEuiState adminState)
+ {
+ _window.UpdateState(adminState);
+ }
+ }
+}
diff --git a/Content.Client/_WL/Administration/UI/SkillsAdminWindow.xaml b/Content.Client/_WL/Administration/UI/SkillsAdminWindow.xaml
new file mode 100644
index 0000000000..7b1d797f03
--- /dev/null
+++ b/Content.Client/_WL/Administration/UI/SkillsAdminWindow.xaml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Content.Client/_WL/Administration/UI/SkillsAdminWindow.xaml.cs b/Content.Client/_WL/Administration/UI/SkillsAdminWindow.xaml.cs
new file mode 100644
index 0000000000..5270610cff
--- /dev/null
+++ b/Content.Client/_WL/Administration/UI/SkillsAdminWindow.xaml.cs
@@ -0,0 +1,94 @@
+using Content.Client._WL.Skills.Ui;
+using Content.Client.UserInterface.Controls;
+using Content.Shared._WL.Skills;
+using Content.Shared._WL.Skills.UI;
+using Robust.Client.AutoGenerated;
+using Robust.Client.UserInterface.Controls;
+using Robust.Client.UserInterface.XAML;
+
+namespace Content.Client._WL.Administration.UI;
+
+[GenerateTypedNameReferences]
+public sealed partial class SkillsAdminWindow : FancyWindow
+{
+ [Dependency] private readonly IEntityManager _entMan = default!;
+ private readonly SharedSkillsSystem _skillsSystem;
+
+ public event Action? OnSkillChanged;
+ public event Action? OnPointsChanged;
+ public event Action? OnResetAll;
+
+ private Dictionary _currentSkills = new();
+ private int _bonusPoints;
+ private int _spentPoints;
+
+ public SkillsAdminWindow()
+ {
+ RobustXamlLoader.Load(this);
+ IoCManager.InjectDependencies(this);
+
+ _skillsSystem = _entMan.System();
+
+ CloseButton.OnPressed += _ => Close();
+ ApplyPointsButton.OnPressed += OnApplyPoints;
+ ResetButton.OnPressed += _ => OnResetAll?.Invoke();
+ }
+
+ public void UpdateState(SkillsAdminEuiState state)
+ {
+ TargetNameLabel.Text = state.EntityName;
+ JobLabel.Text = state.CurrentJob;
+
+ _currentSkills = new Dictionary(state.CurrentSkills);
+ _bonusPoints = state.BonusPoints;
+ _spentPoints = state.SpentPoints;
+
+ UpdatePointsDisplay();
+ PopulateSkills();
+ }
+
+ private void UpdatePointsDisplay()
+ {
+ BonusPointsEdit.Text = _bonusPoints.ToString();
+ SpentPointsLabel.Text = _spentPoints.ToString();
+ }
+
+ private void PopulateSkills()
+ {
+ SkillsContainer.RemoveAllChildren();
+
+ foreach (var skillType in Enum.GetValues())
+ {
+ var costs = _skillsSystem.GetSkillCost(skillType);
+ var color = _skillsSystem.GetSkillColor(skillType);
+ byte skillKey = (byte)skillType;
+
+ var currentLevel = _currentSkills.GetValueOrDefault(skillKey, 1);
+
+ var skillSelector = new SkillSelector(skillType, currentLevel, costs, color, 1)
+ {
+ Margin = new Thickness(0, 5),
+ HorizontalExpand = true
+ };
+
+ skillSelector.IsLocked = false;
+ skillSelector.UpdateAvailability(int.MaxValue, _skillsSystem);
+
+ skillSelector.OnSkillLevelChanged += (newLevel) =>
+ {
+ _currentSkills[skillKey] = newLevel;
+ OnSkillChanged?.Invoke(skillKey, newLevel);
+ };
+
+ SkillsContainer.AddChild(skillSelector);
+ }
+ }
+
+ private void OnApplyPoints(BaseButton.ButtonEventArgs args)
+ {
+ if (int.TryParse(BonusPointsEdit.Text, out var newBonus))
+ {
+ OnPointsChanged?.Invoke(newBonus);
+ }
+ }
+}
diff --git a/Content.Client/_WL/Skills/SkillsSystem.cs b/Content.Client/_WL/Skills/SkillsSystem.cs
new file mode 100644
index 0000000000..a979a10133
--- /dev/null
+++ b/Content.Client/_WL/Skills/SkillsSystem.cs
@@ -0,0 +1,7 @@
+using Content.Shared._WL.Skills;
+
+namespace Content.Client._WL.Skills;
+
+public sealed class SkillsSystem : SharedSkillsSystem
+{
+}
diff --git a/Content.Client/_WL/Skills/Ui/SkillSelector.xaml b/Content.Client/_WL/Skills/Ui/SkillSelector.xaml
new file mode 100644
index 0000000000..981bd08b7e
--- /dev/null
+++ b/Content.Client/_WL/Skills/Ui/SkillSelector.xaml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Content.Client/_WL/Skills/Ui/SkillSelector.xaml.cs b/Content.Client/_WL/Skills/Ui/SkillSelector.xaml.cs
new file mode 100644
index 0000000000..6810bf0d91
--- /dev/null
+++ b/Content.Client/_WL/Skills/Ui/SkillSelector.xaml.cs
@@ -0,0 +1,207 @@
+using Content.Client.Stylesheets;
+using Content.Shared._WL.Skills;
+using Robust.Client.AutoGenerated;
+using Robust.Client.Graphics;
+using Robust.Client.UserInterface;
+using Robust.Client.UserInterface.Controls;
+using Robust.Client.UserInterface.XAML;
+
+namespace Content.Client._WL.Skills.Ui;
+
+[GenerateTypedNameReferences]
+public sealed partial class SkillSelector : Control
+{
+ public Action? OnSkillLevelChanged;
+
+ private readonly int[] _costs;
+ private int _currentLevel;
+ private int _defaultLevel;
+ private bool _isLocked;
+
+ private readonly bool _upgradeOnly;
+
+ public bool IsLocked
+ {
+ get => _isLocked;
+ set
+ {
+ _isLocked = value;
+ UpdateUI();
+ }
+ }
+
+ public SkillSelector(SkillType skillType, int currentLevel, int[] costs, Color skillColor,
+ int defaultLevel = 1, bool upgradeOnly = false)
+ {
+ RobustXamlLoader.Load(this);
+ IoCManager.InjectDependencies(this);
+
+ _currentLevel = currentLevel;
+ _costs = costs;
+ _defaultLevel = defaultLevel;
+
+ _upgradeOnly = upgradeOnly;
+
+ ColorPanel.PanelOverride = new StyleBoxFlat
+ {
+ BackgroundColor = skillColor,
+ ContentMarginTopOverride = 0,
+ ContentMarginBottomOverride = 0,
+ ContentMarginLeftOverride = 0,
+ ContentMarginRightOverride = 0
+ };
+
+ UpdateButtonTexts();
+
+ SkillNameLabel.Text = Loc.GetString($"skill-{skillType.ToString().ToLower()}");
+ SkillDescriptionLabel.Text = Loc.GetString($"skill-{skillType.ToString().ToLower()}-desc");
+
+ UpdateUI();
+
+ Level1Button.OnPressed += _ => SetLevel(1);
+ Level2Button.OnPressed += _ => SetLevel(2);
+ Level3Button.OnPressed += _ => SetLevel(3);
+ Level4Button.OnPressed += _ => SetLevel(4);
+
+ if (_upgradeOnly)
+ {
+ Level1Button.Disabled = true;
+ Level2Button.Disabled = currentLevel <= 2;
+ Level3Button.Disabled = currentLevel <= 3;
+ Level4Button.Disabled = currentLevel <= 4;
+ }
+ }
+
+ private void UpdateButtonTexts()
+ {
+ Level1Button.Text = Loc.GetString("skill-level-1") + $" ({GetDisplayCost(0)})";
+ Level2Button.Text = Loc.GetString("skill-level-2") + $" ({GetDisplayCost(1)})";
+ Level3Button.Text = Loc.GetString("skill-level-3") + $" ({GetDisplayCost(2)})";
+ Level4Button.Text = Loc.GetString("skill-level-4") + $" ({GetDisplayCost(3)})";
+ }
+
+ private string GetDisplayCost(int levelIndex)
+ {
+ var level = levelIndex + 1;
+ if (level <= _defaultLevel)
+ return "0";
+
+ return _costs[levelIndex].ToString();
+ }
+
+ public void UpdateAvailability(int unspentPoints, SharedSkillsSystem skillsSystem)
+ {
+ if (_isLocked)
+ return;
+
+ for (int targetLevel = 1; targetLevel <= 4; targetLevel++)
+ {
+ var button = GetLevelButton(targetLevel);
+ if (button == null) continue;
+
+ if (targetLevel <= _currentLevel)
+ {
+ button.Disabled = false;
+ continue;
+ }
+
+ var upgradeCost = CalculateTotalUpgradeCost(_currentLevel, targetLevel);
+ button.Disabled = unspentPoints < upgradeCost;
+ }
+ }
+
+ private int CalculateTotalUpgradeCost(int fromLevel, int toLevel)
+ {
+ var totalCost = 0;
+ for (int level = fromLevel; level < toLevel; level++)
+ {
+ if (level >= _defaultLevel && level < _costs.Length)
+ totalCost += _costs[level];
+ }
+ return totalCost;
+ }
+
+ public int GetPaidSpentCost()
+ {
+ if (_currentLevel <= _defaultLevel)
+ return 0;
+
+ return CalculateTotalUpgradeCost(_defaultLevel, _currentLevel);
+ }
+
+ private Button? GetLevelButton(int level)
+ {
+ return level switch
+ {
+ 1 => Level1Button,
+ 2 => Level2Button,
+ 3 => Level3Button,
+ 4 => Level4Button,
+ _ => null
+ };
+ }
+
+ private void UpdateUI()
+ {
+ UpdateLevelButtons();
+
+ Level1Button.Disabled = _isLocked || _currentLevel <= 1;
+ Level2Button.Disabled = _isLocked || _currentLevel <= 2;
+ Level3Button.Disabled = _isLocked || _currentLevel <= 3;
+ Level4Button.Disabled = _isLocked || _currentLevel <= 4;
+
+ var paidSpent = GetPaidSpentCost();
+ if (paidSpent > 0)
+ {
+ SkillCostLabel.Text = Loc.GetString("skill-total-cost", ("cost", paidSpent));
+ }
+ else if (_currentLevel > _defaultLevel)
+ {
+ SkillCostLabel.Text = Loc.GetString("skill-free-upgraded");
+ }
+ else
+ {
+ SkillCostLabel.Text = Loc.GetString("skill-free-default");
+ }
+
+ if (_isLocked)
+ {
+ SkillNameLabel.Modulate = Color.Gray;
+ SkillDescriptionLabel.Modulate = Color.Gray;
+ SkillCostLabel.Modulate = Color.Gray;
+ SkillCostLabel.Text = Loc.GetString("skill-locked-default");
+ }
+ else
+ {
+ SkillNameLabel.Modulate = Color.White;
+ SkillDescriptionLabel.Modulate = Color.LightGray;
+ SkillCostLabel.Modulate = Color.LightGray;
+ }
+ }
+
+ private void UpdateLevelButtons()
+ {
+ Level1Button.Pressed = _currentLevel >= 1;
+ Level2Button.Pressed = _currentLevel >= 2;
+ Level3Button.Pressed = _currentLevel >= 3;
+ Level4Button.Pressed = _currentLevel >= 4;
+
+ Level1Button.StyleClasses.Add(StyleNano.ButtonOpenRight);
+ Level2Button.StyleClasses.Add(StyleNano.ButtonOpenBoth);
+ Level3Button.StyleClasses.Add(StyleNano.ButtonOpenBoth);
+ Level4Button.StyleClasses.Add(StyleNano.ButtonOpenLeft);
+ }
+
+ public void SetLevel(int level)
+ {
+ if (level == _currentLevel || _isLocked)
+ return;
+
+ if (_upgradeOnly && level < _currentLevel)
+ return;
+
+ _currentLevel = level;
+ UpdateUI();
+ OnSkillLevelChanged?.Invoke(level);
+ }
+}
diff --git a/Content.Client/_WL/Skills/Ui/SkillsEui.cs b/Content.Client/_WL/Skills/Ui/SkillsEui.cs
new file mode 100644
index 0000000000..0f6fe601d5
--- /dev/null
+++ b/Content.Client/_WL/Skills/Ui/SkillsEui.cs
@@ -0,0 +1,50 @@
+using System.Numerics;
+using Content.Client.Eui;
+using Content.Shared._WL.Skills.UI;
+using Content.Shared.Eui;
+using JetBrains.Annotations;
+using Robust.Client.Graphics;
+
+namespace Content.Client._WL.Skills.Ui;
+
+[UsedImplicitly]
+public sealed class SkillsEui : BaseEui
+{
+ private readonly SkillsForcedWindow _window;
+
+ public SkillsEui()
+ {
+ _window = new SkillsForcedWindow();
+
+ _window.OnClose += () =>
+ {
+ SendMessage(new SkillsEuiClosedMessage());
+ };
+
+ _window.OnSkillChanged += (jobId, skillKey, newLevel) =>
+ {
+ SendMessage(new SkillsEuiSkillChangedMessage(jobId, skillKey, newLevel));
+ };
+ }
+
+ public override void Opened()
+ {
+ IoCManager.Resolve().RequestWindowAttention();
+ _window.OpenCenteredAt(new Vector2(0.5f, 0.75f));
+ }
+
+ public override void Closed()
+ {
+ _window.Close();
+ }
+
+ public override void HandleState(EuiStateBase state)
+ {
+ base.HandleState(state);
+
+ if (state is SkillsEuiState skillsState)
+ {
+ _window.UpdateState(skillsState);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Content.Client/_WL/Skills/Ui/SkillsForcedWindow.xaml b/Content.Client/_WL/Skills/Ui/SkillsForcedWindow.xaml
new file mode 100644
index 0000000000..db1d3a1623
--- /dev/null
+++ b/Content.Client/_WL/Skills/Ui/SkillsForcedWindow.xaml
@@ -0,0 +1,10 @@
+
+
+
diff --git a/Content.Client/_WL/Skills/Ui/SkillsForcedWindow.xaml.cs b/Content.Client/_WL/Skills/Ui/SkillsForcedWindow.xaml.cs
new file mode 100644
index 0000000000..372a2bb42b
--- /dev/null
+++ b/Content.Client/_WL/Skills/Ui/SkillsForcedWindow.xaml.cs
@@ -0,0 +1,181 @@
+using Content.Client.UserInterface.Controls;
+using Content.Shared._WL.Skills;
+using Content.Shared._WL.Skills.UI;
+using Robust.Client.AutoGenerated;
+using Robust.Client.UserInterface;
+using Robust.Client.UserInterface.Controls;
+using Robust.Client.UserInterface.XAML;
+
+namespace Content.Client._WL.Skills.Ui;
+
+[GenerateTypedNameReferences]
+public sealed partial class SkillsForcedWindow : FancyWindow
+{
+ [Dependency] private readonly IEntityManager _entMan = default!;
+ private readonly SharedSkillsSystem _skillsSystem;
+
+ public event Action? OnSkillChanged;
+
+ private string _jobId = string.Empty;
+ private Dictionary _currentSkills = new();
+ private Dictionary _defaultSkills = new();
+ private int _totalPoints;
+ private int _spentPoints;
+
+ public SkillsForcedWindow()
+ {
+ RobustXamlLoader.Load(this);
+ IoCManager.InjectDependencies(this);
+
+ _skillsSystem = _entMan.System();
+ }
+
+ public void UpdateState(SkillsEuiState state)
+ {
+ _jobId = state.JobId;
+ _currentSkills = new Dictionary(state.CurrentSkills);
+ _defaultSkills = new Dictionary(state.DefaultSkills);
+ _totalPoints = state.TotalPoints;
+ _spentPoints = state.SpentPoints;
+
+ UpdateWindow();
+ }
+
+ private void UpdateWindow()
+ {
+ SkillsContainer.RemoveAllChildren();
+
+ var pointsLabel = new Label
+ {
+ Text = $"{_totalPoints - _spentPoints} / {_totalPoints}",
+ HorizontalAlignment = Control.HAlignment.Center,
+ Margin = new Thickness(0, 0, 0, 10)
+ };
+ SkillsContainer.AddChild(pointsLabel);
+
+ var warningLabel = new Label
+ {
+ Text = Loc.GetString("skills-forced-warning"),
+ StyleClasses = { "LabelSubText" },
+ HorizontalAlignment = Control.HAlignment.Center,
+ Margin = new Thickness(0, 0, 0, 20)
+ };
+ SkillsContainer.AddChild(warningLabel);
+
+ var scrollContainer = new ScrollContainer
+ {
+ VerticalExpand = true
+ };
+ var skillsList = new BoxContainer
+ {
+ Orientation = BoxContainer.LayoutOrientation.Vertical,
+ HorizontalExpand = true
+ };
+ scrollContainer.AddChild(skillsList);
+
+ PopulateSkillsList(skillsList);
+ SkillsContainer.AddChild(scrollContainer);
+
+ var bottomContainer = new BoxContainer
+ {
+ Orientation = BoxContainer.LayoutOrientation.Vertical,
+ HorizontalAlignment = Control.HAlignment.Center,
+ Margin = new Thickness(0, 20, 0, 0)
+ };
+
+ var confirmButton = new Button
+ {
+ Text = Loc.GetString("skills-confirm-button"),
+ HorizontalAlignment = Control.HAlignment.Center
+ };
+
+ var warningContainer = new BoxContainer
+ {
+ Orientation = BoxContainer.LayoutOrientation.Vertical,
+ HorizontalAlignment = Control.HAlignment.Center
+ };
+
+ confirmButton.OnPressed += _ =>
+ {
+ if (_totalPoints - _spentPoints == 0)
+ {
+ Close();
+ }
+ else
+ {
+ warningContainer.RemoveAllChildren();
+ var warning = new Label
+ {
+ Text = Loc.GetString("skills-unspent-warning"),
+ FontColorOverride = Color.Yellow,
+ HorizontalAlignment = Control.HAlignment.Center
+ };
+ warningContainer.AddChild(warning);
+ }
+ };
+
+ bottomContainer.AddChild(confirmButton);
+ bottomContainer.AddChild(warningContainer);
+ SkillsContainer.AddChild(bottomContainer);
+ }
+
+ private void PopulateSkillsList(BoxContainer skillsList)
+ {
+ var unspentPoints = _totalPoints - _spentPoints;
+ foreach (var skillType in Enum.GetValues())
+ {
+ var costs = _skillsSystem.GetSkillCost(skillType);
+ var color = _skillsSystem.GetSkillColor(skillType);
+ byte skillKey = (byte)skillType;
+
+ var defaultLevel = _defaultSkills.GetValueOrDefault(skillKey, 1);
+ var currentLevel = _currentSkills.GetValueOrDefault(skillKey, defaultLevel);
+
+ var skillSelector = new SkillSelector(skillType, currentLevel, costs, color, defaultLevel)
+ {
+ Margin = new Thickness(0, 5)
+ };
+
+ skillSelector.IsLocked = defaultLevel == 4;
+
+ skillSelector.UpdateAvailability(unspentPoints, _skillsSystem);
+
+ skillSelector.OnSkillLevelChanged += (newLevel) =>
+ {
+ if (newLevel < defaultLevel)
+ {
+ skillSelector.SetLevel(currentLevel);
+ return;
+ }
+
+ _currentSkills[skillKey] = newLevel;
+ OnSkillChanged?.Invoke(_jobId, skillKey, newLevel);
+
+ _spentPoints = CalculateTotalSpentPoints();
+ UpdateWindow();
+ };
+
+ skillsList.AddChild(skillSelector);
+ }
+ }
+
+ private int CalculateTotalSpentPoints()
+ {
+ var totalSpent = 0;
+
+ foreach (var (skillKey, level) in _currentSkills)
+ {
+ var skillType = (SkillType)skillKey;
+ var costs = _skillsSystem.GetSkillCost(skillType);
+ var defaultLevel = _defaultSkills.GetValueOrDefault(skillKey, 1);
+
+ for (int currentLevel = defaultLevel; currentLevel < level; currentLevel++)
+ {
+ if (currentLevel < costs.Length)
+ totalSpent += costs[currentLevel];
+ }
+ }
+
+ return totalSpent;
+ }
+}
diff --git a/Content.Client/_WL/Skills/Ui/SkillsWindow.xaml b/Content.Client/_WL/Skills/Ui/SkillsWindow.xaml
new file mode 100644
index 0000000000..6c2037f3b0
--- /dev/null
+++ b/Content.Client/_WL/Skills/Ui/SkillsWindow.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Content.Client/_WL/Skills/Ui/SkillsWindow.xaml.cs b/Content.Client/_WL/Skills/Ui/SkillsWindow.xaml.cs
new file mode 100644
index 0000000000..a8c7cf7690
--- /dev/null
+++ b/Content.Client/_WL/Skills/Ui/SkillsWindow.xaml.cs
@@ -0,0 +1,151 @@
+using System.Linq;
+using Content.Client.UserInterface.Controls;
+using Content.Shared._WL.Skills;
+using Robust.Client.AutoGenerated;
+using Robust.Client.Graphics;
+using Robust.Client.UserInterface.Controls;
+using Robust.Client.UserInterface.XAML;
+
+namespace Content.Client._WL.Skills.Ui;
+
+[GenerateTypedNameReferences]
+public sealed partial class SkillsWindow : FancyWindow
+{
+ [Dependency] private readonly IEntityManager _entMan = default!;
+ private readonly SharedSkillsSystem _skillsSystem;
+
+ public event Action? OnSkillChanged;
+
+ private readonly string _jobId;
+ private readonly Dictionary _currentSkills;
+ private readonly Dictionary _defaultSkills;
+ private readonly bool _upgradeOnly;
+ private readonly int _totalPoints;
+ private int _spentPoints;
+
+ private readonly Color _rowColor1 = Color.FromHex("#1B1B1E");
+ private readonly Color _rowColor2 = Color.FromHex("#202025");
+ private int _rowCount = 0;
+
+ public SkillsWindow(
+ string jobId,
+ Dictionary currentSkills,
+ Dictionary defaultSkills,
+ int totalPoints, bool upgradeOnly = false)
+ {
+ RobustXamlLoader.Load(this);
+ IoCManager.InjectDependencies(this);
+
+ _skillsSystem = _entMan.System();
+
+ _jobId = jobId;
+ _currentSkills = new Dictionary(currentSkills);
+ _defaultSkills = new Dictionary(defaultSkills);
+ _upgradeOnly = upgradeOnly;
+ _totalPoints = totalPoints;
+ _spentPoints = 0;
+
+ PopulateSkills();
+ UpdatePoints();
+ }
+
+ private void PopulateSkills()
+ {
+ SkillsList.DisposeAllChildren();
+ _rowCount = 0;
+ foreach (var skillType in Enum.GetValues())
+ {
+ var costs = _skillsSystem.GetSkillCost(skillType);
+ var color = _skillsSystem.GetSkillColor(skillType);
+ byte skillKey = (byte)skillType;
+
+ var defaultLevel = _defaultSkills.GetValueOrDefault(skillKey, 1);
+ var currentLevel = _currentSkills.GetValueOrDefault(skillKey, defaultLevel);
+
+ var skillSelector = new SkillSelector(skillType, currentLevel, costs, color, defaultLevel, _upgradeOnly)
+ {
+ IsLocked = _upgradeOnly && defaultLevel == 4
+ };
+
+ skillSelector.OnSkillLevelChanged += (newLevel) =>
+ {
+ if (newLevel < defaultLevel)
+ {
+ skillSelector.SetLevel(currentLevel);
+ return;
+ }
+
+ _currentSkills[skillKey] = newLevel;
+ OnSkillChanged?.Invoke(_jobId, skillKey, newLevel);
+ UpdatePoints();
+ };
+
+ var rowContainer = CreateSkillRow(skillSelector);
+ SkillsList.AddChild(rowContainer);
+
+ _rowCount++;
+ }
+ }
+
+ private PanelContainer CreateSkillRow(SkillSelector skillSelector)
+ {
+ var currentRowColor = (_rowCount % 2 == 0) ? _rowColor1 : _rowColor2;
+
+ return new PanelContainer
+ {
+ PanelOverride = new StyleBoxFlat
+ {
+ BackgroundColor = currentRowColor,
+ ContentMarginTopOverride = 2,
+ ContentMarginBottomOverride = 2,
+ ContentMarginLeftOverride = 4,
+ ContentMarginRightOverride = 4
+ },
+ Children = { skillSelector }
+ };
+ }
+
+ private void UpdatePoints()
+ {
+ _spentPoints = CalculateTotalSpentPoints();
+ var unspentPoints = _totalPoints - _spentPoints;
+
+ PointsLabel.Text = $" {unspentPoints} / {_totalPoints}";
+
+ UpdateSkillAvailability(unspentPoints);
+ }
+
+ private int CalculateTotalSpentPoints()
+ {
+ var totalSpent = 0;
+
+ foreach (var (skillKey, level) in _currentSkills)
+ {
+ var skillType = (SkillType)skillKey;
+ var costs = _skillsSystem.GetSkillCost(skillType);
+ var defaultLevel = _defaultSkills.GetValueOrDefault(skillKey, 1);
+
+ for (int currentLevel = defaultLevel; currentLevel < level; currentLevel++)
+ {
+ if (currentLevel < costs.Length)
+ totalSpent += costs[currentLevel];
+ }
+ }
+
+ return totalSpent;
+ }
+
+ private void UpdateSkillAvailability(int unspentPoints)
+ {
+ foreach (var child in SkillsList.Children)
+ {
+ if (child is PanelContainer panel && panel.ChildCount > 0)
+ {
+ if (panel.Children.ElementAt(0) is SkillSelector selector)
+ {
+ selector.UpdateAvailability(unspentPoints, _skillsSystem);
+ }
+ }
+ }
+ }
+}
diff --git a/Content.Server.Database/Migrations/Postgres/20251018200752_Skills.Designer.cs b/Content.Server.Database/Migrations/Postgres/20251018200752_Skills.Designer.cs
new file mode 100644
index 0000000000..259be8f62a
--- /dev/null
+++ b/Content.Server.Database/Migrations/Postgres/20251018200752_Skills.Designer.cs
@@ -0,0 +1,2317 @@
+//
+using System;
+using System.Collections.Generic;
+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("20251018200752_Skills")]
+ partial class Skills
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "9.0.1")
+ .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("Deadminned")
+ .HasColumnType("boolean")
+ .HasColumnName("deadminned");
+
+ b.Property("Suspended")
+ .HasColumnType("boolean")
+ .HasColumnName("suspended");
+
+ 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")
+ .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")
+ .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.BanTemplate", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("ban_template_id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AutoDelete")
+ .HasColumnType("boolean")
+ .HasColumnName("auto_delete");
+
+ b.Property("ExemptFlags")
+ .HasColumnType("integer")
+ .HasColumnName("exempt_flags");
+
+ b.Property("Hidden")
+ .HasColumnType("boolean")
+ .HasColumnName("hidden");
+
+ b.Property("Length")
+ .HasColumnType("interval")
+ .HasColumnName("length");
+
+ b.Property("Reason")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("reason");
+
+ b.Property("Severity")
+ .HasColumnType("integer")
+ .HasColumnName("severity");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("title");
+
+ b.HasKey("Id")
+ .HasName("PK_ban_template");
+
+ b.ToTable("ban_template", (string)null);
+ });
+
+ modelBuilder.Entity("Content.Server.Database.Blacklist", b =>
+ {
+ b.Property("UserId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid")
+ .HasColumnName("user_id");
+
+ b.HasKey("UserId")
+ .HasName("PK_blacklist");
+
+ b.ToTable("blacklist", (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("ServerId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasDefaultValue(0)
+ .HasColumnName("server_id");
+
+ b.Property("Time")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("time");
+
+ b.Property("Trust")
+ .HasColumnType("real")
+ .HasColumnName("trust");
+
+ 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("Time");
+
+ 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.DiscordConnection", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("discord_connections_id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("DiscordId")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("discord_id");
+
+ b.Property("UserGuid")
+ .HasColumnType("uuid")
+ .HasColumnName("user_guid");
+
+ b.HasKey("Id")
+ .HasName("PK_discord_connections");
+
+ b.HasIndex("DiscordId")
+ .IsUnique();
+
+ b.HasIndex("UserGuid")
+ .IsUnique();
+
+ b.ToTable("discord_connections", (string)null);
+ });
+
+ modelBuilder.Entity("Content.Server.Database.IPIntelCache", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("ipintel_cache_id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Address")
+ .IsRequired()
+ .HasColumnType("inet")
+ .HasColumnName("address");
+
+ b.Property("Score")
+ .HasColumnType("real")
+ .HasColumnName("score");
+
+ b.Property("Time")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("time");
+
+ b.HasKey("Id")
+ .HasName("PK_ipintel_cache");
+
+ b.ToTable("ipintel_cache", (string)null);
+ });
+
+ 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.JobSubname", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("job_subname_id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("JobName")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("job_name");
+
+ b.Property("ProfileId")
+ .HasColumnType("integer")
+ .HasColumnName("profile_id");
+
+ b.Property("Subname")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("subname");
+
+ b.HasKey("Id")
+ .HasName("PK_job_subname");
+
+ b.HasIndex("ProfileId", "JobName")
+ .IsUnique();
+
+ b.ToTable("job_subname", (string)null);
+ });
+
+ modelBuilder.Entity("Content.Server.Database.JobUnblocking", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("job_unblocking_id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ForceUnblocked")
+ .HasColumnType("boolean")
+ .HasColumnName("force_unblocked");
+
+ b.Property("JobName")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("job_name");
+
+ b.Property("ProfileId")
+ .HasColumnType("integer")
+ .HasColumnName("profile_id");
+
+ b.HasKey("Id")
+ .HasName("PK_job_unblocking");
+
+ b.HasIndex("ProfileId", "JobName")
+ .IsUnique();
+
+ b.ToTable("job_unblocking", (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("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.PrimitiveCollection>("ConstructionFavorites")
+ .IsRequired()
+ .HasColumnType("text[]")
+ .HasColumnName("construction_favorites");
+
+ 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("CharacterName")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("char_name");
+
+ b.Property("EmploymentRecord")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("employment_record");
+
+ 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("integer")
+ .HasColumnName("height");
+
+ b.Property("Markings")
+ .HasColumnType("jsonb")
+ .HasColumnName("markings");
+
+ b.Property("MedicalRecord")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("medical_record");
+
+ b.Property("OocText")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("ooc_text");
+
+ b.Property("PreferenceId")
+ .HasColumnType("integer")
+ .HasColumnName("preference_id");
+
+ b.Property("PreferenceUnavailable")
+ .HasColumnType("integer")
+ .HasColumnName("pref_unavailable");
+
+ b.Property("SecurityRecord")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("security_record");
+
+ 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.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.ProfileJobSkills", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("profile_job_skills_id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("JobName")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("job_name");
+
+ b.Property("ProfileId")
+ .HasColumnType("integer")
+ .HasColumnName("profile_id");
+
+ b.Property("Skills")
+ .IsRequired()
+ .HasColumnType("jsonb")
+ .HasColumnName("skills");
+
+ b.HasKey("Id")
+ .HasName("PK_profile_job_skills");
+
+ b.HasIndex("ProfileId", "JobName")
+ .IsUnique();
+
+ b.ToTable("profile_job_skills", (string)null);
+ });
+
+ modelBuilder.Entity("Content.Server.Database.ProfileLoadout", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("profile_loadout_id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("LoadoutName")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("loadout_name");
+
+ b.Property("ProfileLoadoutGroupId")
+ .HasColumnType("integer")
+ .HasColumnName("profile_loadout_group_id");
+
+ b.HasKey("Id")
+ .HasName("PK_profile_loadout");
+
+ b.HasIndex("ProfileLoadoutGroupId");
+
+ b.ToTable("profile_loadout", (string)null);
+ });
+
+ modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("profile_loadout_group_id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("GroupName")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("group_name");
+
+ b.Property("ProfileRoleLoadoutId")
+ .HasColumnType("integer")
+ .HasColumnName("profile_role_loadout_id");
+
+ b.HasKey("Id")
+ .HasName("PK_profile_loadout_group");
+
+ b.HasIndex("ProfileRoleLoadoutId");
+
+ b.ToTable("profile_loadout_group", (string)null);
+ });
+
+ modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("profile_role_loadout_id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("EntityName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)")
+ .HasColumnName("entity_name");
+
+ b.Property("ProfileId")
+ .HasColumnType("integer")
+ .HasColumnName("profile_id");
+
+ b.Property("RoleName")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("role_name");
+
+ b.HasKey("Id")
+ .HasName("PK_profile_role_loadout");
+
+ b.HasIndex("ProfileId");
+
+ b.ToTable("profile_role_loadout", (string)null);
+ });
+
+ modelBuilder.Entity("Content.Server.Database.RoleWhitelist", b =>
+ {
+ b.Property("PlayerUserId")
+ .HasColumnType("uuid")
+ .HasColumnName("player_user_id");
+
+ b.Property("RoleId")
+ .HasColumnType("text")
+ .HasColumnName("role_id");
+
+ b.HasKey("PlayerUserId", "RoleId")
+ .HasName("PK_role_whitelists");
+
+ b.ToTable("role_whitelists", (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("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