diff --git a/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml b/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml
index ef7aa2af65..89e5694b0d 100644
--- a/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml
+++ b/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml
@@ -10,11 +10,10 @@
-
-
-
-
+
+
+
+
diff --git a/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs b/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs
index cc05d0c06a..664ba22072 100644
--- a/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs
+++ b/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs
@@ -6,11 +6,13 @@ using Content.Client.Administration.UI.CustomControls;
using Content.Client.Administration.UI.Tabs.AdminTab;
using Content.Client.Stylesheets;
using Content.Client.UserInterface.Systems.Bwoink;
+using Content.Client.UserInterface.Systems.Chat.Controls;
using Content.Shared.Administration;
using Robust.Client.AutoGenerated;
using Robust.Client.Console;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
+using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Network;
using Robust.Shared.Utility;
@@ -49,17 +51,9 @@ namespace Content.Client.Administration.UI.Bwoink
ChannelSelector.OnSelectionChanged += sel =>
{
_currentPlayer = sel;
- if (sel == null)
- {
- SetPlayerActionsVisibility(false);
- }
- else
+ if (sel is not null)
{
SwitchToChannel(sel.SessionId);
-
- SetPlayerActionsVisibility(true);
- Bans.Text = Loc.GetString("admin-player-actions-bans", ("count", sel.Bans));
- Notes.Text = Loc.GetString("admin-player-actions-notes", ("count", sel.Notes));
}
ChannelSelector.PlayerListContainer.DirtyList();
@@ -170,8 +164,6 @@ namespace Content.Client.Administration.UI.Bwoink
{
uiController.PopOut();
};
-
- SetPlayerActionsVisibility(_currentPlayer != null);
}
private Dictionary Confirmations { get; } = new();
@@ -253,7 +245,8 @@ namespace Content.Client.Administration.UI.Bwoink
{
foreach (var bw in BwoinkArea.Children)
bw.Visible = false;
- AHelpHelper.EnsurePanel(ch).Visible = true;
+ var panel = AHelpHelper.EnsurePanel(ch);
+ panel.Visible = true;
}
private bool TryConfirm(Button button)
@@ -280,15 +273,5 @@ namespace Content.Client.Administration.UI.Bwoink
button.Text = Loc.GetString("admin-player-actions-confirm");
return false;
}
-
- private void SetPlayerActionsVisibility(bool visible)
- {
- Bans.Visible = visible;
- Notes.Visible = visible;
- Kick.Visible = visible;
- Ban.Visible = visible;
- Respawn.Visible = visible;
- Teleport.Visible = visible;
- }
}
}
diff --git a/Content.Client/Administration/UI/Bwoink/BwoinkWindow.xaml b/Content.Client/Administration/UI/Bwoink/BwoinkWindow.xaml
index 84b1667f1f..4e0156d7a0 100644
--- a/Content.Client/Administration/UI/Bwoink/BwoinkWindow.xaml
+++ b/Content.Client/Administration/UI/Bwoink/BwoinkWindow.xaml
@@ -1,6 +1,6 @@
diff --git a/Content.Client/Administration/UI/Bwoink/BwoinkWindow.xaml.cs b/Content.Client/Administration/UI/Bwoink/BwoinkWindow.xaml.cs
index c2b628f263..58217052b4 100644
--- a/Content.Client/Administration/UI/Bwoink/BwoinkWindow.xaml.cs
+++ b/Content.Client/Administration/UI/Bwoink/BwoinkWindow.xaml.cs
@@ -1,6 +1,20 @@
+using System.Text;
+using System.Threading;
+using Content.Client.Administration.Managers;
+using Content.Client.Administration.UI.CustomControls;
+using Content.Client.Administration.UI.Tabs.AdminTab;
+using Content.Client.Stylesheets;
+using Content.Client.UserInterface.Systems.Bwoink;
+using Content.Shared.Administration;
using Robust.Client.AutoGenerated;
+using Robust.Client.Console;
+using Robust.Client.UserInterface;
+using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
+using Robust.Shared.Network;
+using Robust.Shared.Utility;
+using Timer = Robust.Shared.Timing.Timer;
namespace Content.Client.Administration.UI.Bwoink
{
diff --git a/Content.Server/Administration/Notes/AdminNotesManager.cs b/Content.Server/Administration/Notes/AdminNotesManager.cs
index f6307e46c7..2ef1508084 100644
--- a/Content.Server/Administration/Notes/AdminNotesManager.cs
+++ b/Content.Server/Administration/Notes/AdminNotesManager.cs
@@ -124,11 +124,6 @@ public sealed class AdminNotesManager : IAdminNotesManager, IPostInjectInit
return await _db.GetAdminNotes(player);
}
- public async Task CountNotes(Guid player)
- {
- return await _db.CountAdminNotes(player);
- }
-
public async Task GetPlayerName(Guid player)
{
return (await _db.GetPlayerRecordByUserId(new NetUserId(player)))?.LastSeenUserName ?? string.Empty;
diff --git a/Content.Server/Administration/Notes/IAdminNotesManager.cs b/Content.Server/Administration/Notes/IAdminNotesManager.cs
index bf61a9ea85..ae4e7712b2 100644
--- a/Content.Server/Administration/Notes/IAdminNotesManager.cs
+++ b/Content.Server/Administration/Notes/IAdminNotesManager.cs
@@ -20,6 +20,5 @@ public interface IAdminNotesManager
Task DeleteNote(int noteId, IPlayerSession deletedBy);
Task ModifyNote(int noteId, IPlayerSession editedBy, string message);
Task> GetNotes(Guid player);
- Task CountNotes(Guid player);
Task GetPlayerName(Guid player);
}
diff --git a/Content.Server/Administration/Systems/AdminSystem.cs b/Content.Server/Administration/Systems/AdminSystem.cs
index 1bae389467..48751e02c6 100644
--- a/Content.Server/Administration/Systems/AdminSystem.cs
+++ b/Content.Server/Administration/Systems/AdminSystem.cs
@@ -1,9 +1,7 @@
using System.Globalization;
using System.Linq;
-using System.Threading.Tasks;
using Content.Server.Administration.Managers;
-using Content.Server.Administration.Notes;
-using Content.Server.Database;
+using Content.Server.GameTicking.Events;
using Content.Server.IdentityManagement;
using Content.Server.Players;
using Content.Server.Roles;
@@ -15,7 +13,6 @@ using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Enums;
using Robust.Shared.Network;
-using Job = Content.Server.Roles.Job;
namespace Content.Server.Administration.Systems
{
@@ -23,8 +20,6 @@ namespace Content.Server.Administration.Systems
{
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IAdminManager _adminManager = default!;
- [Dependency] private readonly IServerDbManager _db = default!;
- [Dependency] private readonly IAdminNotesManager _notes = default!;
private readonly Dictionary _playerList = new();
@@ -49,7 +44,7 @@ namespace Content.Server.Administration.Systems
SubscribeLocalEvent(OnRoundRestartCleanup);
}
- private async void OnRoundRestartCleanup(RoundRestartCleanupEvent ev)
+ private void OnRoundRestartCleanup(RoundRestartCleanupEvent ev)
{
_roundActivePlayers.Clear();
@@ -62,7 +57,7 @@ namespace Content.Server.Administration.Systems
return;
_playerManager.TryGetSessionById(id, out var session);
- _playerList[id] = await GetPlayerInfo(playerData, session);
+ _playerList[id] = GetPlayerInfo(playerData, session);
}
var updateEv = new FullPlayerListEvent() { PlayersInfo = _playerList.Values.ToList() };
@@ -73,9 +68,9 @@ namespace Content.Server.Administration.Systems
}
}
- public async void UpdatePlayerList(IPlayerSession player)
+ public void UpdatePlayerList(IPlayerSession player)
{
- _playerList[player.UserId] = await GetPlayerInfo(player.Data, player);
+ _playerList[player.UserId] = GetPlayerInfo(player.Data, player);
var playerInfoChangedEvent = new PlayerInfoChangedEvent
{
@@ -162,7 +157,7 @@ namespace Content.Server.Administration.Systems
RaiseNetworkEvent(ev, playerSession.ConnectedClient);
}
- private async Task GetPlayerInfo(IPlayerData data, IPlayerSession? session)
+ private PlayerInfo GetPlayerInfo(IPlayerData data, IPlayerSession? session)
{
var name = data.UserName;
var entityName = string.Empty;
@@ -183,11 +178,8 @@ namespace Content.Server.Administration.Systems
var connected = session != null && session.Status is SessionStatus.Connected or SessionStatus.InGame;
- var bans = await _db.CountServerBansAsync(null, data.UserId, null);
- var notes = await _notes.CountNotes(data.UserId);
-
return new PlayerInfo(name, entityName, identityName, startingRole, antag, session?.AttachedEntity, data.UserId,
- connected, _roundActivePlayers.Contains(data.UserId), bans, notes);
+ connected, _roundActivePlayers.Contains(data.UserId));
}
}
}
diff --git a/Content.Server/Database/ServerDbBase.cs b/Content.Server/Database/ServerDbBase.cs
index fedd0c9639..cb61f2422b 100644
--- a/Content.Server/Database/ServerDbBase.cs
+++ b/Content.Server/Database/ServerDbBase.cs
@@ -330,22 +330,6 @@ namespace Content.Server.Database
ImmutableArray? hwId,
bool includeUnbanned);
- ///
- /// Counts an user's bans.
- /// This will return pardoned bans as well.
- /// One of or need to not be null.
- ///
- /// The ip address of the user.
- /// The id of the user.
- /// The HWId of the user.
- /// Include pardoned and expired bans.
- /// The user's ban history.
- public abstract Task CountServerBansAsync(
- IPAddress? address,
- NetUserId? userId,
- ImmutableArray? hwId,
- bool includeUnbanned);
-
public abstract Task AddServerBanAsync(ServerBanDef serverBan);
public abstract Task AddServerUnbanAsync(ServerUnbanDef serverUnban);
@@ -1012,19 +996,6 @@ namespace Content.Server.Database
.ToListAsync();
}
- public async Task CountAdminNotes(Guid player)
- {
- await using var db = await GetDb();
- return await db.DbContext.AdminNotes
- .Where(note => note.PlayerUserId == player)
- .Where(note => !note.Deleted)
- .Include(note => note.Round)
- .Include(note => note.CreatedBy)
- .Include(note => note.LastEditedBy)
- .Include(note => note.Player)
- .CountAsync();
- }
-
public async Task DeleteAdminNote(int id, Guid deletedBy, DateTime deletedAt)
{
await using var db = await GetDb();
diff --git a/Content.Server/Database/ServerDbManager.cs b/Content.Server/Database/ServerDbManager.cs
index 1b49655728..0a520706d1 100644
--- a/Content.Server/Database/ServerDbManager.cs
+++ b/Content.Server/Database/ServerDbManager.cs
@@ -82,21 +82,6 @@ namespace Content.Server.Database
ImmutableArray? hwId,
bool includeUnbanned=true);
- ///
- /// Counts an user's bans.
- /// One of or need to not be null.
- ///
- /// The ip address of the user.
- /// The id of the user.
- /// The HWId of the user.
- /// If true, bans that have been expired or pardoned are also included.
- /// The user's ban history.
- Task CountServerBansAsync(
- IPAddress? address,
- NetUserId? userId,
- ImmutableArray? hwId,
- bool includeUnbanned=true);
-
Task AddServerBanAsync(ServerBanDef serverBan);
Task AddServerUnbanAsync(ServerUnbanDef serverBan);
@@ -251,7 +236,6 @@ namespace Content.Server.Database
Task AddAdminNote(int? roundId, Guid player, string message, Guid createdBy, DateTime createdAt);
Task GetAdminNote(int id);
Task> GetAdminNotes(Guid player);
- Task CountAdminNotes(Guid player);
Task DeleteAdminNote(int id, Guid deletedBy, DateTime deletedAt);
Task EditAdminNote(int id, string message, Guid editedBy, DateTime editedAt);
@@ -374,12 +358,6 @@ namespace Content.Server.Database
return _db.GetServerBansAsync(address, userId, hwId, includeUnbanned);
}
- public Task CountServerBansAsync(IPAddress? address, NetUserId? userId, ImmutableArray? hwId, bool includeUnbanned = true)
- {
- DbReadOpsMetric.Inc();
- return _db.CountServerBansAsync(address, userId, hwId, includeUnbanned);
- }
-
public Task AddServerBanAsync(ServerBanDef serverBan)
{
DbWriteOpsMetric.Inc();
@@ -668,12 +646,6 @@ namespace Content.Server.Database
return _db.GetAdminNotes(player);
}
- public Task CountAdminNotes(Guid player)
- {
- DbReadOpsMetric.Inc();
- return _db.CountAdminNotes(player);
- }
-
public Task DeleteAdminNote(int id, Guid deletedBy, DateTime deletedAt)
{
DbWriteOpsMetric.Inc();
diff --git a/Content.Server/Database/ServerDbPostgres.cs b/Content.Server/Database/ServerDbPostgres.cs
index bf11817f20..cfc37da546 100644
--- a/Content.Server/Database/ServerDbPostgres.cs
+++ b/Content.Server/Database/ServerDbPostgres.cs
@@ -98,21 +98,6 @@ namespace Content.Server.Database
return bans;
}
- public override async Task CountServerBansAsync(IPAddress? address, NetUserId? userId, ImmutableArray? hwId, bool includeUnbanned)
- {
- if (address == null && userId == null && hwId == null)
- {
- throw new ArgumentException("Address, userId, and hwId cannot all be null");
- }
-
- await using var db = await GetDbImpl();
-
- var exempt = await GetBanExemptionCore(db, userId);
- var query = MakeBanLookupQuery(address, userId, hwId, db, includeUnbanned, exempt);
-
- return await query.CountAsync();
- }
-
private static IQueryable MakeBanLookupQuery(
IPAddress? address,
NetUserId? userId,
diff --git a/Content.Server/Database/ServerDbSqlite.cs b/Content.Server/Database/ServerDbSqlite.cs
index f056847cb7..20b4f5c628 100644
--- a/Content.Server/Database/ServerDbSqlite.cs
+++ b/Content.Server/Database/ServerDbSqlite.cs
@@ -97,22 +97,6 @@ namespace Content.Server.Database
.ToList()!;
}
- public override async Task CountServerBansAsync(IPAddress? address, NetUserId? userId, ImmutableArray? hwId, bool includeUnbanned)
- {
- await using var db = await GetDbImpl();
-
- var exempt = await GetBanExemptionCore(db, userId);
-
- // SQLite can't do the net masking stuff we need to match IP address ranges.
- // So just pull down the whole list into memory.
- var queryBans = await GetAllBans(db.SqliteDbContext, includeUnbanned, exempt);
-
- return queryBans
- .Where(b => BanMatches(b, address, userId, hwId))
- .Select(ConvertBan)
- .Count();
- }
-
private static async Task> GetAllBans(
SqliteServerDbContext db,
bool includeUnbanned,
diff --git a/Content.Shared/Administration/PlayerInfo.cs b/Content.Shared/Administration/PlayerInfo.cs
index 3fc07d9e44..d6b3f0c0dc 100644
--- a/Content.Shared/Administration/PlayerInfo.cs
+++ b/Content.Shared/Administration/PlayerInfo.cs
@@ -13,7 +13,5 @@ namespace Content.Shared.Administration
EntityUid? EntityUid,
NetUserId SessionId,
bool Connected,
- bool ActiveThisRound,
- int Bans,
- int Notes);
+ bool ActiveThisRound);
}
diff --git a/Resources/Locale/en-US/administration/ui/actions.ftl b/Resources/Locale/en-US/administration/ui/actions.ftl
index fa790fb9f1..86a5e15039 100644
--- a/Resources/Locale/en-US/administration/ui/actions.ftl
+++ b/Resources/Locale/en-US/administration/ui/actions.ftl
@@ -1,5 +1,5 @@
-admin-player-actions-bans = Ban List ({$count})
-admin-player-actions-notes = Notes ({$count})
+admin-player-actions-bans = Ban List
+admin-player-actions-notes = Notes
admin-player-actions-kick = Kick
admin-player-actions-ban = Ban
admin-player-actions-ahelp = AHelp