Обнова спонсорки

This commit is contained in:
VigersRay 2024-07-01 17:03:24 +03:00
parent 7c0697474f
commit ff394987f4
26 changed files with 115 additions and 107 deletions

View file

@ -57,6 +57,11 @@ namespace Content.Client.Administration.UI.Bwoink
{
var sb = new StringBuilder();
// Alteros-Sponsors-start
if (info.IsSponsor)
sb.Append("★");
// Alteros-Sponsors-end
if (info.Connected)
sb.Append('●');
else

View file

@ -196,6 +196,7 @@ namespace Content.Client.Administration.UI.Tabs.PlayerTab
Header.Username => Compare(x.Username, y.Username),
Header.Character => Compare(x.CharacterName, y.CharacterName),
Header.Job => Compare(x.StartingJob, y.StartingJob),
Header.Sponsor => string.Compare(x.SponsorTitle!, y.SponsorTitle, StringComparison.Ordinal),
Header.Antagonist => x.Antag.CompareTo(y.Antag),
Header.Playtime => TimeSpan.Compare(x.OverallPlaytime ?? default, y.OverallPlaytime ?? default),
_ => 1

View file

@ -1,32 +1,37 @@
<PanelContainer xmlns="https://spacestation14.io"
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls"
Name="BackgroundColorPanel">
<ContainerButton xmlns="https://spacestation14.io"
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls">
<PanelContainer Name="BackgroundColorPanel"/>
<BoxContainer Orientation="Horizontal"
HorizontalExpand="True"
SeparationOverride="4">
<Label Name="UsernameLabel"
SizeFlagsStretchRatio="3"
SizeFlagsStretchRatio="5"
HorizontalExpand="True"
ClipText="True"/>
<customControls:VSeparator/>
<Label Name="CharacterLabel"
SizeFlagsStretchRatio="3"
SizeFlagsStretchRatio="4"
HorizontalExpand="True"
ClipText="True"/>
<customControls:VSeparator/>
<Label Name="JobLabel"
SizeFlagsStretchRatio="2"
SizeFlagsStretchRatio="4"
HorizontalExpand="True"
ClipText="True"/>
<customControls:VSeparator/>
<Label Name="SponsorLabel"
SizeFlagsStretchRatio="5"
HorizontalExpand="True"
ClipText="True"/>
<customControls:VSeparator/>
<Label Name="AntagonistLabel"
SizeFlagsStretchRatio="1"
SizeFlagsStretchRatio="2"
HorizontalExpand="True"
ClipText="True"/>
<customControls:VSeparator/>
<Label Name="OverallPlaytimeLabel"
SizeFlagsStretchRatio="1"
SizeFlagsStretchRatio="4"
HorizontalExpand="True"
ClipText="True"/>
</BoxContainer>
</PanelContainer>
</ContainerButton>

View file

@ -1,5 +1,4 @@
using Content.Shared.Administration;
using Robust.Client.AutoGenerated;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
@ -7,24 +6,24 @@ using Robust.Client.UserInterface.XAML;
namespace Content.Client.Administration.UI.Tabs.PlayerTab;
[GenerateTypedNameReferences]
public sealed partial class PlayerTabEntry : PanelContainer
public sealed partial class PlayerTabEntry : ContainerButton
{
public NetEntity? PlayerEntity;
public PlayerTabEntry(PlayerInfo player, StyleBoxFlat styleBoxFlat)
public PlayerTabEntry(string username, string character, string identity, string job, string sponsor, string antagonist, StyleBox styleBox, bool connected, string overallPlaytime)
{
RobustXamlLoader.Load(this);
UsernameLabel.Text = player.Username;
if (!player.Connected)
UsernameLabel.Text = username;
if (!connected)
UsernameLabel.StyleClasses.Add("Disabled");
JobLabel.Text = player.StartingJob;
CharacterLabel.Text = player.CharacterName;
if (player.IdentityName != player.CharacterName)
CharacterLabel.Text += $" [{player.IdentityName}]";
AntagonistLabel.Text = Loc.GetString(player.Antag ? "player-tab-is-antag-yes" : "player-tab-is-antag-no");
BackgroundColorPanel.PanelOverride = styleBoxFlat;
OverallPlaytimeLabel.Text = player.PlaytimeString;
PlayerEntity = player.NetEntity;
JobLabel.Text = job;
CharacterLabel.Text = character;
if (identity != character)
CharacterLabel.Text += $" [{identity}]";
SponsorLabel.Text = sponsor;
AntagonistLabel.Text = antagonist;
BackgroundColorPanel.PanelOverride = styleBox;
OverallPlaytimeLabel.Text = overallPlaytime;
}
}

View file

@ -1,43 +1,49 @@
<Control xmlns="https://spacestation14.io"
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls">
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls">
<PanelContainer Name="BackgroundColorPanel" Access="Public"/>
<BoxContainer Orientation="Horizontal"
HorizontalExpand="True"
SeparationOverride="4">
<Label Name="UsernameLabel"
SizeFlagsStretchRatio="3"
SizeFlagsStretchRatio="5"
HorizontalExpand="True"
ClipText="True"
Text="{Loc player-tab-username}"
MouseFilter="Pass"/>
<cc:VSeparator/>
<Label Name="CharacterLabel"
SizeFlagsStretchRatio="3"
SizeFlagsStretchRatio="4"
HorizontalExpand="True"
ClipText="True"
Text="{Loc player-tab-character}"
MouseFilter="Pass"/>
<cc:VSeparator/>
<Label Name="JobLabel"
SizeFlagsStretchRatio="2"
SizeFlagsStretchRatio="4"
HorizontalExpand="True"
ClipText="True"
Text="{Loc player-tab-job}"
MouseFilter="Pass"/>
<cc:VSeparator/>
<Label Name="SponsorLabel"
SizeFlagsStretchRatio="5"
HorizontalExpand="True"
ClipText="True"
Text="{Loc player-tab-sponsor}"
MouseFilter="Pass"/>
<cc:VSeparator/>
<Label Name="AntagonistLabel"
SizeFlagsStretchRatio="1"
SizeFlagsStretchRatio="2"
HorizontalExpand="True"
ClipText="True"
Text="{Loc player-tab-antagonist}"
MouseFilter="Pass"/>
<cc:VSeparator/>
<Label Name="PlaytimeLabel"
SizeFlagsStretchRatio="1"
SizeFlagsStretchRatio="4"
HorizontalExpand="True"
ClipText="True"
Text="{Loc player-tab-playtime}"
MouseFilter="Pass"
ToolTip="{Loc player-tab-entry-tooltip}"/>
MouseFilter="Pass"/>
</BoxContainer>
</Control>

View file

@ -18,6 +18,7 @@ public sealed partial class PlayerTabHeader : Control
UsernameLabel.OnKeyBindDown += UsernameClicked;
CharacterLabel.OnKeyBindDown += CharacterClicked;
JobLabel.OnKeyBindDown += JobClicked;
SponsorLabel.OnKeyBindDown += SponsorClicked;
AntagonistLabel.OnKeyBindDown += AntagonistClicked;
PlaytimeLabel.OnKeyBindDown += PlaytimeClicked;
}
@ -28,7 +29,8 @@ public sealed partial class PlayerTabHeader : Control
{
Header.Username => UsernameLabel,
Header.Character => CharacterLabel,
Header.Job => JobLabel,
Header.Job => JobLabel, // Sunrise-Sponsors
Header.Sponsor => SponsorLabel,
Header.Antagonist => AntagonistLabel,
Header.Playtime => PlaytimeLabel,
_ => throw new ArgumentOutOfRangeException(nameof(header), header, null)
@ -40,6 +42,7 @@ public sealed partial class PlayerTabHeader : Control
UsernameLabel.Text = Loc.GetString("player-tab-username");
CharacterLabel.Text = Loc.GetString("player-tab-character");
JobLabel.Text = Loc.GetString("player-tab-job");
SponsorLabel.Text = Loc.GetString("player-tab-sponsor"); // Sunrise-Sponsors
AntagonistLabel.Text = Loc.GetString("player-tab-antagonist");
PlaytimeLabel.Text = Loc.GetString("player-tab-playtime");
}
@ -70,6 +73,13 @@ public sealed partial class PlayerTabHeader : Control
HeaderClicked(args, Header.Job);
}
// Sunrise-Sponsors-Start
private void SponsorClicked(GUIBoundKeyEventArgs args)
{
HeaderClicked(args, Header.Sponsor);
}
// Sunrise-Sponsors-End
private void AntagonistClicked(GUIBoundKeyEventArgs args)
{
HeaderClicked(args, Header.Antagonist);
@ -99,6 +109,7 @@ public sealed partial class PlayerTabHeader : Control
Username,
Character,
Job,
Sponsor, // Sunrise-Sponsors
Antagonist,
Playtime
}

View file

@ -2,7 +2,6 @@ using System.Linq;
using Content.Shared.Humanoid;
using Content.Shared.Humanoid.Markings;
using Content.Shared.Humanoid.Prototypes;
using Content.Sunrise.Interfaces.Shared;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
@ -11,6 +10,7 @@ using Robust.Client.Utility;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using static Robust.Client.UserInterface.Controls.BoxContainer;
using Content.Sunrise.Interfaces.Shared; // Sunrise-Sponsors
namespace Content.Client.Humanoid;

View file

@ -1,10 +1,10 @@
using System.Linq;
using Content.Shared.Humanoid.Markings;
using Content.Sunrise.Interfaces.Shared;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Client.Utility;
using Content.Sunrise.Interfaces.Shared; // Sunrise-Sponsors
namespace Content.Client.Humanoid;

View file

@ -1,10 +1,10 @@
using System.Linq;
using Content.Shared.Preferences;
using Content.Sunrise.Interfaces.Shared;
using Robust.Client;
using Robust.Client.Player;
using Robust.Shared.Network;
using Robust.Shared.Utility;
using Content.Sunrise.Interfaces.Shared; // Sunrise-Sponsors
namespace Content.Client.Lobby
{

View file

@ -15,7 +15,6 @@ using Content.Shared.Preferences;
using Content.Shared.Preferences.Loadouts;
using Content.Shared.Roles;
using Content.Shared.Traits;
using Content.Sunrise.Interfaces.Client;
using Robust.Client.Player;
using Robust.Client.ResourceManagement;
using Robust.Client.State;
@ -25,6 +24,7 @@ using Robust.Shared.Configuration;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using Content.Sunrise.Interfaces.Shared; // Sunrise-Sponsors
namespace Content.Client.Lobby;
@ -47,7 +47,7 @@ public sealed partial class LobbyUIController : UIController, IOnStateEntered<Lo
private CharacterSetupGui? _characterSetup;
private HumanoidProfileEditor? _profileEditor;
private IClientSponsorsManager? _sponsorsManager; // Sunrise-Sponsors
private ISharedSponsorsManager? _sponsorsManager; // Sunrise-Sponsors
/// <summary>
/// This is the characher preview panel in the chat. This should only update if their character updates.

View file

@ -20,7 +20,6 @@ using Content.Shared.Preferences;
using Content.Shared.Preferences.Loadouts;
using Content.Shared.Roles;
using Content.Shared.Traits;
using Content.Sunrise.Interfaces.Client;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.Player;
@ -33,6 +32,7 @@ using Robust.Shared.Enums;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using Direction = Robust.Shared.Maths.Direction;
using Content.Sunrise.Interfaces.Shared; // Sunrise-Sponsors
namespace Content.Client.Lobby.UI
{
@ -101,7 +101,7 @@ namespace Content.Client.Lobby.UI
private ISawmill _sawmill;
private IClientSponsorsManager? _sponsorsMgr; // Sunrise-Sponsors
private ISharedSponsorsManager? _sponsorsMgr; // Sunrise-Sponsors
public HumanoidProfileEditor(
IClientPreferencesManager preferencesManager,

View file

@ -2,12 +2,12 @@ using System.Linq;
using Content.Shared.Clothing;
using Content.Shared.Preferences;
using Content.Shared.Preferences.Loadouts;
using Content.Sunrise.Interfaces.Client;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Content.Sunrise.Interfaces.Shared; // Sunrise-Sponsors
namespace Content.Client.Lobby.UI.Loadouts;
@ -15,12 +15,12 @@ namespace Content.Client.Lobby.UI.Loadouts;
public sealed partial class LoadoutGroupContainer : BoxContainer
{
private readonly LoadoutGroupPrototype _groupProto;
private readonly IClientSponsorsManager? _sponsors; // Sunrise-Sponsors
private readonly ISharedSponsorsManager? _sponsors; // Sunrise-Sponsors
public event Action<ProtoId<LoadoutPrototype>>? OnLoadoutPressed;
public event Action<ProtoId<LoadoutPrototype>>? OnLoadoutUnpressed;
public LoadoutGroupContainer(HumanoidCharacterProfile profile, RoleLoadout loadout, LoadoutGroupPrototype groupProto, ICommonSession session, IDependencyCollection collection, IClientSponsorsManager? sponsorsManager) // Sunrise-Sponsors
public LoadoutGroupContainer(HumanoidCharacterProfile profile, RoleLoadout loadout, LoadoutGroupPrototype groupProto, ICommonSession session, IDependencyCollection collection, ISharedSponsorsManager? sponsorsManager) // Sunrise-Sponsors
{
RobustXamlLoader.Load(this);
_groupProto = groupProto;

View file

@ -1,11 +1,11 @@
using Content.Client.UserInterface.Controls;
using Content.Shared.Preferences;
using Content.Shared.Preferences.Loadouts;
using Content.Sunrise.Interfaces.Client;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Content.Sunrise.Interfaces.Shared; // Sunrise-Sponsors
namespace Content.Client.Lobby.UI.Loadouts;
@ -19,7 +19,7 @@ public sealed partial class LoadoutWindow : FancyWindow
public HumanoidCharacterProfile Profile;
public LoadoutWindow(HumanoidCharacterProfile profile, RoleLoadout loadout, RoleLoadoutPrototype proto, ICommonSession session, IDependencyCollection collection, IClientSponsorsManager? sponsorsManager) // Sunrise-Sponsors
public LoadoutWindow(HumanoidCharacterProfile profile, RoleLoadout loadout, RoleLoadoutPrototype proto, ICommonSession session, IDependencyCollection collection, ISharedSponsorsManager? sponsorsManager) // Sunrise-Sponsors
{
RobustXamlLoader.Load(this);
Profile = profile;

View file

@ -13,6 +13,7 @@ using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using Content.Shared.Preferences;
using Content.Sunrise.Interfaces.Shared; // Sunrise-Sponsors
namespace Content.Client.Players.PlayTimeTracking;

View file

@ -6,6 +6,7 @@ using Content.Shared.Ghost.Roles;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Shared.Utility;
using Content.Sunrise.Interfaces.Shared; // Sunrise-Sponsors
namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
{

View file

@ -30,6 +30,7 @@ using Robust.Shared.Configuration;
using Robust.Shared.Enums;
using Robust.Shared.Network;
using Robust.Shared.Player;
using Content.Sunrise.Interfaces.Shared; // Sunrise-Sponsors
namespace Content.Server.Administration.Systems
{
@ -63,6 +64,8 @@ namespace Content.Server.Administration.Systems
public readonly PanicBunkerStatus PanicBunker = new();
public readonly BabyJailStatus BabyJail = new();
private ISharedSponsorsManager? _sponsorsManager; // Sunrise-Sponsors
public override void Initialize()
{
base.Initialize();
@ -96,6 +99,8 @@ namespace Content.Server.Administration.Systems
SubscribeLocalEvent<RoleAddedEvent>(OnRoleEvent);
SubscribeLocalEvent<RoleRemovedEvent>(OnRoleEvent);
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestartCleanup);
IoCManager.Instance!.TryResolveType(out _sponsorsManager); // Sunrise-Sponsors
}
private void OnRoundRestartCleanup(RoundRestartCleanupEvent ev)
@ -247,8 +252,16 @@ namespace Content.Server.Administration.Systems
overallPlaytime = playTime;
}
var isSponsor = false;
var sponsorTitle = "";
if (_sponsorsManager != null)
{
isSponsor = _sponsorsManager.IsSponsor(data.UserId);
_sponsorsManager.TryGetOocTitle(data.UserId, out sponsorTitle);
}
return new PlayerInfo(name, entityName, identityName, startingRole, antag, GetNetEntity(session?.AttachedEntity), data.UserId,
connected, _roundActivePlayers.Contains(data.UserId), overallPlaytime);
connected, _roundActivePlayers.Contains(data.UserId), overallPlaytime, isSponsor, sponsorTitle);
}
private void OnPanicBunkerChanged(bool enabled)

View file

@ -12,14 +12,13 @@ using Content.Shared.CCVar;
using Content.Shared.Chat;
using Content.Shared.Database;
using Content.Shared.Mind;
using Content.Sunrise.Interfaces.Server;
using Content.Sunrise.Interfaces.Shared;
using Robust.Server.Player;
using Robust.Shared.Configuration;
using Robust.Shared.Network;
using Robust.Shared.Player;
using Robust.Shared.Replays;
using Robust.Shared.Utility;
using Content.Sunrise.Interfaces.Shared; // Sunrise-Sponsors
namespace Content.Server.Chat.Managers
{
@ -46,7 +45,7 @@ namespace Content.Server.Chat.Managers
[Dependency] private readonly INetConfigurationManager _netConfigManager = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly PlayerRateLimitManager _rateLimitManager = default!;
private IServerSponsorsManager? _sponsorsManager; // Sunrise-Sponsors
private ISharedSponsorsManager? _sponsorsManager; // Sunrise-Sponsors
/// <summary>
/// The maximum length a player-sent message can be sent

View file

@ -10,13 +10,13 @@ using Content.Shared.CCVar;
using Content.Shared.GameTicking;
using Content.Shared.Players.PlayTimeTracking;
using Content.Sunrise.Interfaces.Server;
using Content.Sunrise.Interfaces.Shared;
using Robust.Server.Player;
using Robust.Shared.Configuration;
using Robust.Shared.Enums;
using Robust.Shared.Network;
using Robust.Shared.Player;
using Robust.Shared.Timing;
using Content.Sunrise.Interfaces.Shared; // Sunrise-Sponsors
/*
* TODO: Remove baby jail code once a more mature gateway process is established. This code is only being issued as a stopgap to help with potential tiding in the immediate future.
@ -57,7 +57,7 @@ namespace Content.Server.Connection
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly ILogManager _logManager = default!;
[Dependency] private readonly IChatManager _chatManager = default!;
private IServerSponsorsManager? _sponsorsMgr; // Sunrise-Sponsors
private ISharedSponsorsManager? _sponsorsMgr; // Sunrise-Sponsors
private readonly Dictionary<NetUserId, TimeSpan> _temporaryBypasses = [];
private ISawmill _sawmill = default!;

View file

@ -5,12 +5,12 @@ using System.Threading.Tasks;
using Content.Server.Database;
using Content.Shared.CCVar;
using Content.Shared.Preferences;
using Content.Sunrise.Interfaces.Server;
using Robust.Server.Player;
using Robust.Shared.Configuration;
using Robust.Shared.Network;
using Robust.Shared.Player;
using Robust.Shared.Utility;
using Content.Sunrise.Interfaces.Shared; // Sunrise-Sponsors
namespace Content.Server.Preferences.Managers
{
@ -27,7 +27,7 @@ namespace Content.Server.Preferences.Managers
[Dependency] private readonly IDependencyCollection _dependencies = default!;
[Dependency] private readonly ILogManager _log = default!;
[Dependency] private readonly UserDbDataManager _userDb = default!;
private IServerSponsorsManager? _sponsors;
private ISharedSponsorsManager? _sponsors;
// Cache player prefs on the server so we don't need as much async hell related to them.
private readonly Dictionary<NetUserId, PlayerPrefData> _cachedPlayerPrefs =

View file

@ -24,7 +24,6 @@ using Content.Shared.Roles;
using Content.Shared.Roles.Jobs;
using Content.Shared.Station;
using Content.Shared.StatusIcon;
using Content.Sunrise.Interfaces.Server;
using JetBrains.Annotations;
using Robust.Shared.Configuration;
using Robust.Shared.Map;
@ -32,6 +31,7 @@ using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Utility;
using Content.Sunrise.Interfaces.Shared; // Sunrise-Sponsors
namespace Content.Server.Station.Systems;
@ -54,7 +54,7 @@ public sealed class StationSpawningSystem : SharedStationSpawningSystem
[Dependency] private readonly MetaDataSystem _metaSystem = default!;
[Dependency] private readonly PdaSystem _pdaSystem = default!;
[Dependency] private readonly SharedAccessSystem _accessSystem = default!;
private IServerSponsorsManager? _sponsorsManager; // Sunrise-Sponsors
private ISharedSponsorsManager? _sponsorsManager; // Sunrise-Sponsors
private bool _randomizeCharacters;

View file

@ -14,7 +14,9 @@ namespace Content.Shared.Administration
NetUserId SessionId,
bool Connected,
bool ActiveThisRound,
TimeSpan? OverallPlaytime)
TimeSpan? OverallPlaytime,
bool IsSponsor,
string? SponsorTitle)
{
private string? _playtimeString;

View file

@ -8,7 +8,6 @@ using Content.Shared.Humanoid.Markings;
using Content.Shared.Humanoid.Prototypes;
using Content.Shared.IdentityManagement;
using Content.Shared.Preferences;
using Content.Sunrise.Interfaces.Shared;
using Robust.Shared;
using Robust.Shared.Configuration;
using Robust.Shared.GameObjects.Components.Localization;
@ -19,6 +18,7 @@ using Robust.Shared.Serialization.Manager;
using Robust.Shared.Serialization.Markdown;
using Robust.Shared.Utility;
using YamlDotNet.RepresentationModel;
using Content.Sunrise.Interfaces.Shared; // Sunrise-Sponsors
namespace Content.Shared.Humanoid;
@ -88,7 +88,7 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem
var profile = export.Profile;
var collection = IoCManager.Instance;
var sponsorPrototypes = _sponsors != null && _sponsors.TryGetPrototypes(session.UserId, out var prototypes) ? prototypes.ToArray() : []; // Sunrise-Sponsors
var sponsorPrototypes = _sponsors?.GetClientPrototypes().ToArray() ?? []; // Sunrise-Sponsors
profile.EnsureValid(session, collection!, sponsorPrototypes);
return profile;
}

View file

@ -1,13 +0,0 @@
using Content.Sunrise.Interfaces.Shared;
using Robust.Shared.Maths;
namespace Content.Sunrise.Interfaces.Client;
public interface IClientSponsorsManager : ISharedSponsorsManager
{
public List<string> Prototypes { get; }
public bool PriorityJoin { get; }
public Color? OocColor { get; }
public int ExtraCharSlots { get; }
public bool AllowedRespawn { get; }
}

View file

@ -1,26 +0,0 @@
using System.Diagnostics.CodeAnalysis;
using Content.Sunrise.Interfaces.Shared;
using Robust.Shared.Maths;
using Robust.Shared.Network;
using Robust.Shared.Player;
namespace Content.Sunrise.Interfaces.Server;
public interface IServerSponsorsManager : ISharedSponsorsManager
{
public bool TryGetGhostTheme(NetUserId userId, [NotNullWhen(true)] out string? ghostTheme);
public bool TryGetOocColor(NetUserId userId, [NotNullWhen(true)] out Color? color);
public bool TryGetOocTitle(NetUserId userId, [NotNullWhen(true)] out string? title);
public int GetExtraCharSlots(NetUserId userId);
public bool HavePriorityJoin(NetUserId userId);
public bool IsSponsor(NetUserId userId);
public bool AllowedRespawn(NetUserId userId);
public List<ICommonSession> PickPrioritySessions(List<ICommonSession> sessions, string roleId);
public NetUserId PickRoleSession(HashSet<NetUserId> users, string roleId);
public bool TryGetPriorityGhostRoles(NetUserId userId, [NotNullWhen(true)] out List<string>? priorityAntags);
public bool TryGetPriorityAntags(NetUserId userId, [NotNullWhen(true)] out List<string>? priorityAntags);
public bool TryGetPriorityRoles(NetUserId userId, [NotNullWhen(true)] out List<string>? priorityRoles);
}

View file

@ -1,11 +0,0 @@
using System.Diagnostics.CodeAnalysis;
using Robust.Shared.Network;
namespace Content.Sunrise.Interfaces.Shared;
public interface ISharedLoadoutsManager
{
public void Initialize();
public bool TryGetServerPrototypes(NetUserId userId, [NotNullWhen(true)] out List<string>? prototypes);
public List<string> GetClientPrototypes();
}

View file

@ -1,6 +1,7 @@
using System.Diagnostics.CodeAnalysis;
using Robust.Shared.Maths;
using Robust.Shared.Network;
using Robust.Shared.Player;
namespace Content.Sunrise.Interfaces.Shared;
@ -10,6 +11,20 @@ public interface ISharedSponsorsManager
// Client
public List<string> GetClientPrototypes();
public bool ClientAllowedRespawn();
// Server
public bool TryGetPrototypes(NetUserId userId, [NotNullWhen(true)] out List<string>? prototypes);
public bool TryGetOocTitle(NetUserId userId, [NotNullWhen(true)] out string? title);
public bool TryGetOocColor(NetUserId userId, [NotNullWhen(true)] out Color? color);
public bool TryGetGhostTheme(NetUserId userId, [NotNullWhen(true)] out string? ghostTheme);
public int GetExtraCharSlots(NetUserId userId);
public bool HavePriorityJoin(NetUserId userId);
public bool IsSponsor(NetUserId userId);
public bool IsAllowedRespawn(NetUserId userId);
public List<ICommonSession> PickPrioritySessions(List<ICommonSession> sessions, string roleId);
public NetUserId? PickRoleSession(HashSet<NetUserId> users, string roleId);
public bool TryGetPriorityGhostRoles(NetUserId userId, [NotNullWhen(true)] out List<string>? priorityAntags);
public bool TryGetPriorityAntags(NetUserId userId, [NotNullWhen(true)] out List<string>? priorityAntags);
public bool TryGetPriorityRoles(NetUserId userId, [NotNullWhen(true)] out List<string>? priorityRoles);
}