* ogh * i should save my work * ogh * hhcdfhjbghshbxdfhghshc - lots of bugs in parsing still - invocation is a stub * expr parsing works * awawa * Saving work * Improve APIs a bit all around, add shortcuts. * awa * awa * AAAAAA * save work * Move shit to engine * lord * bql is kill * forgot the fucking bike rack * bql is kill for real * pjb will kill me * aughfhbdj * adgddf * gdsgvfvxshngfgh * b * hfsjhghj * a * tf you mean i have to document it * follow C# standards * Assorted cleanup and documentation pass, minor bugfix in ValueRefParser. * Start porting old commands, remove that pesky prefix in favor of integrating with the shell. * bw * Fix valueref up a bit, improve autocomplete for it. * awa * fix tests * git shut up * Arithmetic commands. * parse improvements * Update engine. --------- Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com>
95 lines
3.4 KiB
C#
95 lines
3.4 KiB
C#
using Content.Shared.Administration;
|
|
using Content.Shared.Administration.Managers;
|
|
using Robust.Server.Player;
|
|
using Robust.Shared.Toolshed;
|
|
|
|
|
|
namespace Content.Server.Administration.Managers
|
|
{
|
|
/// <summary>
|
|
/// Manages server administrators and their permission flags.
|
|
/// </summary>
|
|
public interface IAdminManager : ISharedAdminManager
|
|
{
|
|
/// <summary>
|
|
/// Fired when the permissions of an admin on the server changed.
|
|
/// </summary>
|
|
event Action<AdminPermsChangedEventArgs> OnPermsChanged;
|
|
|
|
/// <summary>
|
|
/// Gets all active admins currently on the server.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This does not include admins that are de-adminned.
|
|
/// </remarks>
|
|
IEnumerable<IPlayerSession> ActiveAdmins { get; }
|
|
|
|
/// <summary>
|
|
/// Gets all admins currently on the server, even de-adminned ones.
|
|
/// </summary>
|
|
IEnumerable<IPlayerSession> AllAdmins { get; }
|
|
|
|
/// <summary>
|
|
/// Checks if a player is an admin.
|
|
/// </summary>
|
|
/// <param name="session">The player to check.</param>
|
|
/// <param name="includeDeAdmin">
|
|
/// Whether to return admin data for admins that are current de-adminned.
|
|
/// </param>
|
|
/// <returns>true if the player is an admin, false otherwise.</returns>
|
|
bool IsAdmin(IPlayerSession session, bool includeDeAdmin = false);
|
|
|
|
/// <summary>
|
|
/// Gets the admin data for a player, if they are an admin.
|
|
/// </summary>
|
|
/// <param name="session">The player to get admin data for.</param>
|
|
/// <param name="includeDeAdmin">
|
|
/// Whether to return admin data for admins that are current de-adminned.
|
|
/// </param>
|
|
/// <returns><see langword="null" /> if the player is not an admin.</returns>
|
|
AdminData? GetAdminData(IPlayerSession session, bool includeDeAdmin = false);
|
|
|
|
/// <summary>
|
|
/// See if a player has an admin flag.
|
|
/// </summary>
|
|
/// <returns>True if the player is and admin and has the specified flags.</returns>
|
|
bool HasAdminFlag(IPlayerSession player, AdminFlags flag)
|
|
{
|
|
var data = GetAdminData(player);
|
|
return data != null && data.HasFlag(flag);
|
|
}
|
|
|
|
/// <summary>
|
|
/// De-admins an admin temporarily so they are effectively a normal player.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// De-adminned admins are able to re-admin at any time if they so desire.
|
|
/// </remarks>
|
|
void DeAdmin(IPlayerSession session);
|
|
|
|
/// <summary>
|
|
/// Re-admins a de-adminned admin.
|
|
/// </summary>
|
|
void ReAdmin(IPlayerSession session);
|
|
|
|
/// <summary>
|
|
/// Re-loads the permissions of an player in case their admin data changed DB-side.
|
|
/// </summary>
|
|
/// <seealso cref="ReloadAdminsWithRank"/>
|
|
void ReloadAdmin(IPlayerSession player);
|
|
|
|
/// <summary>
|
|
/// Reloads admin permissions for all admins with a certain rank.
|
|
/// </summary>
|
|
/// <param name="rankId">The database ID of the rank.</param>
|
|
/// <seealso cref="ReloadAdmin"/>
|
|
void ReloadAdminsWithRank(int rankId);
|
|
|
|
void Initialize();
|
|
|
|
void PromoteHost(IPlayerSession player);
|
|
|
|
bool TryGetCommandFlags(CommandSpec command, out AdminFlags[]? flags);
|
|
}
|
|
}
|