Make AdminLogsSystem an IoC manager (#8492)
* Make log not entity system * Fixes
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
using Content.Shared.Administration.Logs;
|
||||
|
||||
namespace Content.Client.Administration.Logs;
|
||||
|
||||
public sealed class AdminLogSystem : SharedAdminLogSystem
|
||||
{
|
||||
}
|
||||
@@ -18,6 +18,7 @@ using Content.Client.Stylesheets;
|
||||
using Content.Client.Viewport;
|
||||
using Content.Client.Voting;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Module;
|
||||
|
||||
namespace Content.Client.IoC
|
||||
@@ -45,6 +46,7 @@ namespace Content.Client.IoC
|
||||
IoCManager.Register<ViewportManager, ViewportManager>();
|
||||
IoCManager.Register<IGamePrototypeLoadManager, GamePrototypeLoadManager>();
|
||||
IoCManager.Register<NetworkResourceManager>();
|
||||
IoCManager.Register<ISharedAdminLogManager, SharedAdminLogManager>();
|
||||
IoCManager.Register<GhostKickManager>();
|
||||
IoCManager.Register<ExtendedDisconnectInformationManager>();
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public sealed class AddTests : ContentIntegrationTest
|
||||
var sMaps = server.ResolveDependency<IMapManager>();
|
||||
var sSystems = server.ResolveDependency<IEntitySystemManager>();
|
||||
|
||||
var sAdminLogSystem = sSystems.GetEntitySystem<AdminLogSystem>();
|
||||
var sAdminLogSystem = server.ResolveDependency<IAdminLogManager>();
|
||||
|
||||
var guid = Guid.NewGuid();
|
||||
|
||||
@@ -89,7 +89,7 @@ public sealed class AddTests : ContentIntegrationTest
|
||||
var sMaps = server.ResolveDependency<IMapManager>();
|
||||
var sSystems = server.ResolveDependency<IEntitySystemManager>();
|
||||
|
||||
var sAdminLogSystem = sSystems.GetEntitySystem<AdminLogSystem>();
|
||||
var sAdminLogSystem = server.ResolveDependency<IAdminLogManager>();
|
||||
var sGamerTicker = sSystems.GetEntitySystem<GameTicker>();
|
||||
|
||||
var guid = Guid.NewGuid();
|
||||
@@ -156,7 +156,7 @@ public sealed class AddTests : ContentIntegrationTest
|
||||
var sMaps = server.ResolveDependency<IMapManager>();
|
||||
var sSystems = server.ResolveDependency<IEntitySystemManager>();
|
||||
|
||||
var sAdminLogSystem = sSystems.GetEntitySystem<AdminLogSystem>();
|
||||
var sAdminLogSystem = server.ResolveDependency<IAdminLogManager>();
|
||||
|
||||
await server.WaitPost(() =>
|
||||
{
|
||||
@@ -193,7 +193,7 @@ public sealed class AddTests : ContentIntegrationTest
|
||||
var sPlayers = server.ResolveDependency<IPlayerManager>();
|
||||
var sSystems = server.ResolveDependency<IEntitySystemManager>();
|
||||
|
||||
var sAdminLogSystem = sSystems.GetEntitySystem<AdminLogSystem>();
|
||||
var sAdminLogSystem = server.ResolveDependency<IAdminLogManager>();
|
||||
Guid playerGuid = default;
|
||||
|
||||
await server.WaitPost(() =>
|
||||
@@ -236,7 +236,7 @@ public sealed class AddTests : ContentIntegrationTest
|
||||
var sDatabase = server.ResolveDependency<IServerDbManager>();
|
||||
var sSystems = server.ResolveDependency<IEntitySystemManager>();
|
||||
|
||||
var sAdminLogSystem = sSystems.GetEntitySystem<AdminLogSystem>();
|
||||
var sAdminLogSystem = server.ResolveDependency<IAdminLogManager>();
|
||||
var sGamerTicker = sSystems.GetEntitySystem<GameTicker>();
|
||||
|
||||
var guid = Guid.NewGuid();
|
||||
@@ -302,7 +302,7 @@ public sealed class AddTests : ContentIntegrationTest
|
||||
var sPlayers = server.ResolveDependency<IPlayerManager>();
|
||||
var sSystems = server.ResolveDependency<IEntitySystemManager>();
|
||||
|
||||
var sAdminLogSystem = sSystems.GetEntitySystem<AdminLogSystem>();
|
||||
var sAdminLogSystem = server.ResolveDependency<IAdminLogManager>();
|
||||
|
||||
var guid = Guid.NewGuid();
|
||||
|
||||
@@ -347,7 +347,7 @@ public sealed class AddTests : ContentIntegrationTest
|
||||
var sPlayers = server.ResolveDependency<IPlayerManager>();
|
||||
var sSystems = server.ResolveDependency<IEntitySystemManager>();
|
||||
|
||||
var sAdminLogSystem = sSystems.GetEntitySystem<AdminLogSystem>();
|
||||
var sAdminLogSystem = server.ResolveDependency<IAdminLogManager>();
|
||||
|
||||
var guid = Guid.NewGuid();
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public sealed class FilterTests : ContentIntegrationTest
|
||||
var sMaps = server.ResolveDependency<IMapManager>();
|
||||
var sSystems = server.ResolveDependency<IEntitySystemManager>();
|
||||
|
||||
var sAdminLogSystem = sSystems.GetEntitySystem<AdminLogSystem>();
|
||||
var sAdminLogSystem = server.ResolveDependency<IAdminLogManager>();
|
||||
|
||||
var commonGuid = Guid.NewGuid();
|
||||
var firstGuid = Guid.NewGuid();
|
||||
|
||||
@@ -33,7 +33,7 @@ public sealed class QueryTests : ContentIntegrationTest
|
||||
var sSystems = server.ResolveDependency<IEntitySystemManager>();
|
||||
var sPlayers = server.ResolveDependency<IPlayerManager>();
|
||||
|
||||
var sAdminLogSystem = sSystems.GetEntitySystem<AdminLogSystem>();
|
||||
var sAdminLogSystem = server.ResolveDependency<IAdminLogManager>();
|
||||
var sGamerTicker = sSystems.GetEntitySystem<GameTicker>();
|
||||
|
||||
var date = DateTime.UtcNow;
|
||||
|
||||
@@ -37,7 +37,7 @@ public sealed class AdminLogBulk : IConsoleCommand
|
||||
return;
|
||||
}
|
||||
|
||||
var logs = EntitySystem.Get<AdminLogSystem>();
|
||||
var logManager = IoCManager.Resolve<IAdminLogManager>();
|
||||
|
||||
var stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
@@ -46,14 +46,14 @@ public sealed class AdminLogBulk : IConsoleCommand
|
||||
{
|
||||
Parallel.For(0, amount, _ =>
|
||||
{
|
||||
logs.Add(LogType.Unknown, $"Debug log added by {entity:Player}");
|
||||
logManager.Add(LogType.Unknown, $"Debug log added by {entity:Player}");
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
for (var i = 0; i < amount; i++)
|
||||
{
|
||||
logs.Add(LogType.Unknown, $"Debug log added by {entity:Player}");
|
||||
logManager.Add(LogType.Unknown, $"Debug log added by {entity:Player}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ using Prometheus;
|
||||
|
||||
namespace Content.Server.Administration.Logs;
|
||||
|
||||
public sealed partial class AdminLogSystem
|
||||
public sealed partial class AdminLogManager
|
||||
{
|
||||
private const int MaxRoundsCached = 3;
|
||||
private const int LogListInitialSize = 30_000;
|
||||
@@ -26,10 +26,10 @@ public sealed partial class AdminLogSystem
|
||||
"How many logs are in cache.");
|
||||
|
||||
// TODO ADMIN LOGS cache previous {MaxRoundsCached} rounds on startup
|
||||
private void CacheNewRound()
|
||||
public void CacheNewRound()
|
||||
{
|
||||
List<SharedAdminLog> list;
|
||||
var oldestRound = CurrentRoundId - MaxRoundsCached;
|
||||
var oldestRound = _currentRoundId - MaxRoundsCached;
|
||||
|
||||
if (_roundsLogCache.Remove(oldestRound, out var oldestList))
|
||||
{
|
||||
@@ -41,7 +41,7 @@ public sealed partial class AdminLogSystem
|
||||
list = new List<SharedAdminLog>(LogListInitialSize);
|
||||
}
|
||||
|
||||
_roundsLogCache.Add(CurrentRoundId, list);
|
||||
_roundsLogCache.Add(_currentRoundId, list);
|
||||
CacheRoundCount.Set(_roundsLogCache.Count);
|
||||
}
|
||||
|
||||
@@ -61,14 +61,14 @@ public sealed partial class AdminLogSystem
|
||||
private void CacheLog(SharedAdminLog log)
|
||||
{
|
||||
// TODO ADMIN LOGS remove redundant data and don't do a dictionary lookup per log
|
||||
var cache = _roundsLogCache[CurrentRoundId];
|
||||
var cache = _roundsLogCache[_currentRoundId];
|
||||
cache.Add(log);
|
||||
CacheLogCount.Set(cache.Count);
|
||||
}
|
||||
|
||||
private void CacheLogs(IEnumerable<SharedAdminLog> logs)
|
||||
{
|
||||
var cache = _roundsLogCache[CurrentRoundId];
|
||||
var cache = _roundsLogCache[_currentRoundId];
|
||||
cache.AddRange(logs);
|
||||
CacheLogCount.Set(cache.Count);
|
||||
}
|
||||
@@ -7,7 +7,7 @@ using Robust.Server.Player;
|
||||
|
||||
namespace Content.Server.Administration.Logs;
|
||||
|
||||
public sealed partial class AdminLogSystem
|
||||
public sealed partial class AdminLogManager
|
||||
{
|
||||
private static readonly JsonNamingPolicy NamingPolicy = JsonNamingPolicy.CamelCase;
|
||||
|
||||
360
Content.Server/Administration/Logs/AdminLogManager.cs
Normal file
360
Content.Server/Administration/Logs/AdminLogManager.cs
Normal file
@@ -0,0 +1,360 @@
|
||||
using System.Collections.Concurrent;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Content.Server.Database;
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Database;
|
||||
using Prometheus;
|
||||
using Robust.Shared;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Reflection;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Server.Administration.Logs;
|
||||
|
||||
public sealed partial class AdminLogManager : SharedAdminLogManager, IAdminLogManager
|
||||
{
|
||||
[Dependency] private readonly IConfigurationManager _configuration = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
[Dependency] private readonly ILogManager _logManager = default!;
|
||||
[Dependency] private readonly IServerDbManager _db = default!;
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
[Dependency] private readonly IDynamicTypeFactory _typeFactory = default!;
|
||||
[Dependency] private readonly IReflectionManager _reflection = default!;
|
||||
|
||||
public const string SawmillId = "admin.logs";
|
||||
|
||||
private static readonly Histogram DatabaseUpdateTime = Metrics.CreateHistogram(
|
||||
"admin_logs_database_time",
|
||||
"Time used to send logs to the database in ms",
|
||||
new HistogramConfiguration
|
||||
{
|
||||
Buckets = Histogram.LinearBuckets(0, 0.5, 20)
|
||||
});
|
||||
|
||||
private static readonly Gauge Queue = Metrics.CreateGauge(
|
||||
"admin_logs_queue",
|
||||
"How many logs are in the queue.");
|
||||
|
||||
private static readonly Gauge PreRoundQueue = Metrics.CreateGauge(
|
||||
"admin_logs_pre_round_queue",
|
||||
"How many logs are in the pre-round queue.");
|
||||
|
||||
private static readonly Gauge QueueCapReached = Metrics.CreateGauge(
|
||||
"admin_logs_queue_cap_reached",
|
||||
"Number of times the log queue cap has been reached in a round.");
|
||||
|
||||
private static readonly Gauge PreRoundQueueCapReached = Metrics.CreateGauge(
|
||||
"admin_logs_queue_cap_reached",
|
||||
"Number of times the pre-round log queue cap has been reached in a round.");
|
||||
|
||||
private static readonly Gauge LogsSent = Metrics.CreateGauge(
|
||||
"admin_logs_sent",
|
||||
"Amount of logs sent to the database in a round.");
|
||||
|
||||
// Init only
|
||||
private ISawmill _sawmill = default!;
|
||||
|
||||
// CVars
|
||||
private bool _metricsEnabled;
|
||||
private bool _enabled;
|
||||
private TimeSpan _queueSendDelay;
|
||||
private int _queueMax;
|
||||
private int _preRoundQueueMax;
|
||||
|
||||
// Per update
|
||||
private TimeSpan _nextUpdateTime;
|
||||
private readonly ConcurrentQueue<QueuedLog> _logQueue = new();
|
||||
private readonly ConcurrentQueue<QueuedLog> _preRoundLogQueue = new();
|
||||
|
||||
// Per round
|
||||
private int _currentRoundId;
|
||||
private int _currentLogId;
|
||||
private int NextLogId => Interlocked.Increment(ref _currentLogId);
|
||||
private GameRunLevel _runLevel = GameRunLevel.PreRoundLobby;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
_sawmill = _logManager.GetSawmill(SawmillId);
|
||||
|
||||
InitializeJson();
|
||||
|
||||
_configuration.OnValueChanged(CVars.MetricsEnabled,
|
||||
value => _metricsEnabled = value, true);
|
||||
_configuration.OnValueChanged(CCVars.AdminLogsEnabled,
|
||||
value => _enabled = value, true);
|
||||
_configuration.OnValueChanged(CCVars.AdminLogsQueueSendDelay,
|
||||
value => _queueSendDelay = TimeSpan.FromSeconds(value), true);
|
||||
_configuration.OnValueChanged(CCVars.AdminLogsQueueMax,
|
||||
value => _queueMax = value, true);
|
||||
_configuration.OnValueChanged(CCVars.AdminLogsPreRoundQueueMax,
|
||||
value => _preRoundQueueMax = value, true);
|
||||
|
||||
if (_metricsEnabled)
|
||||
{
|
||||
PreRoundQueueCapReached.Set(0);
|
||||
QueueCapReached.Set(0);
|
||||
LogsSent.Set(0);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task Shutdown()
|
||||
{
|
||||
if (!_logQueue.IsEmpty)
|
||||
{
|
||||
await SaveLogs();
|
||||
}
|
||||
}
|
||||
|
||||
public async void Update()
|
||||
{
|
||||
if (_runLevel == GameRunLevel.PreRoundLobby)
|
||||
{
|
||||
await PreRoundUpdate();
|
||||
return;
|
||||
}
|
||||
|
||||
var count = _logQueue.Count;
|
||||
Queue.Set(count);
|
||||
|
||||
var preRoundCount = _preRoundLogQueue.Count;
|
||||
PreRoundQueue.Set(preRoundCount);
|
||||
|
||||
if (count + preRoundCount == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_timing.RealTime >= _nextUpdateTime)
|
||||
{
|
||||
await SaveLogs();
|
||||
return;
|
||||
}
|
||||
|
||||
if (count >= _queueMax)
|
||||
{
|
||||
if (_metricsEnabled)
|
||||
{
|
||||
QueueCapReached.Inc();
|
||||
}
|
||||
|
||||
_sawmill.Warning($"Maximum cap of {_queueMax} reached for admin logs.");
|
||||
await SaveLogs();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task PreRoundUpdate()
|
||||
{
|
||||
var preRoundCount = _preRoundLogQueue.Count;
|
||||
PreRoundQueue.Set(preRoundCount);
|
||||
|
||||
if (preRoundCount < _preRoundQueueMax)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_metricsEnabled)
|
||||
{
|
||||
PreRoundQueueCapReached.Inc();
|
||||
}
|
||||
|
||||
_sawmill.Warning($"Maximum cap of {_preRoundQueueMax} reached for pre-round admin logs.");
|
||||
await SaveLogs();
|
||||
}
|
||||
|
||||
private async Task SaveLogs()
|
||||
{
|
||||
_nextUpdateTime = _timing.RealTime.Add(_queueSendDelay);
|
||||
|
||||
// TODO ADMIN LOGS array pool
|
||||
var copy = new List<QueuedLog>(_logQueue.Count + _preRoundLogQueue.Count);
|
||||
|
||||
copy.AddRange(_logQueue);
|
||||
_logQueue.Clear();
|
||||
Queue.Set(0);
|
||||
|
||||
if (_runLevel == GameRunLevel.PreRoundLobby && !_preRoundLogQueue.IsEmpty)
|
||||
{
|
||||
_sawmill.Error($"Dropping {_preRoundLogQueue.Count} pre-round logs. Current cap: {_preRoundQueueMax}");
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var queued in _preRoundLogQueue)
|
||||
{
|
||||
queued.Log.RoundId = _currentRoundId;
|
||||
CacheLog(queued);
|
||||
}
|
||||
|
||||
copy.AddRange(_preRoundLogQueue);
|
||||
}
|
||||
|
||||
_preRoundLogQueue.Clear();
|
||||
PreRoundQueue.Set(0);
|
||||
|
||||
// ship the logs to Azkaban
|
||||
var task = Task.Run(async () =>
|
||||
{
|
||||
await _db.AddAdminLogs(copy);
|
||||
});
|
||||
|
||||
_sawmill.Debug($"Saving {copy.Count} admin logs.");
|
||||
|
||||
if (_metricsEnabled)
|
||||
{
|
||||
LogsSent.Inc(copy.Count);
|
||||
|
||||
using (DatabaseUpdateTime.NewTimer())
|
||||
{
|
||||
await task;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
await task;
|
||||
}
|
||||
|
||||
public void RoundStarting(int id)
|
||||
{
|
||||
_currentRoundId = id;
|
||||
CacheNewRound();
|
||||
}
|
||||
|
||||
public void RunLevelChanged(GameRunLevel level)
|
||||
{
|
||||
_runLevel = level;
|
||||
|
||||
if (level == GameRunLevel.PreRoundLobby)
|
||||
{
|
||||
Interlocked.Exchange(ref _currentLogId, 0);
|
||||
|
||||
if (_metricsEnabled)
|
||||
{
|
||||
PreRoundQueueCapReached.Set(0);
|
||||
QueueCapReached.Set(0);
|
||||
LogsSent.Set(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async void Add(LogType type, LogImpact impact, string message, JsonDocument json, HashSet<Guid> players, Dictionary<int, string?> entities)
|
||||
{
|
||||
var logId = NextLogId;
|
||||
var date = DateTime.UtcNow;
|
||||
|
||||
var log = new AdminLog
|
||||
{
|
||||
Id = logId,
|
||||
RoundId = _currentRoundId,
|
||||
Type = type,
|
||||
Impact = impact,
|
||||
Date = date,
|
||||
Message = message,
|
||||
Json = json,
|
||||
Players = new List<AdminLogPlayer>(players.Count)
|
||||
};
|
||||
|
||||
var queued = new QueuedLog(log, entities);
|
||||
|
||||
foreach (var id in players)
|
||||
{
|
||||
var player = new AdminLogPlayer
|
||||
{
|
||||
LogId = logId,
|
||||
PlayerUserId = id
|
||||
};
|
||||
|
||||
log.Players.Add(player);
|
||||
}
|
||||
|
||||
if (_runLevel == GameRunLevel.PreRoundLobby)
|
||||
{
|
||||
_preRoundLogQueue.Enqueue(queued);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logQueue.Enqueue(queued);
|
||||
CacheLog(log);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Add(LogType type, LogImpact impact, ref LogStringHandler handler)
|
||||
{
|
||||
if (!_enabled)
|
||||
{
|
||||
handler.ToStringAndClear();
|
||||
return;
|
||||
}
|
||||
|
||||
var (json, players, entities) = ToJson(handler.Values);
|
||||
var message = handler.ToStringAndClear();
|
||||
|
||||
Add(type, impact, message, json, players, entities);
|
||||
}
|
||||
|
||||
public override void Add(LogType type, ref LogStringHandler handler)
|
||||
{
|
||||
Add(type, LogImpact.Medium, ref handler);
|
||||
}
|
||||
|
||||
public async Task<List<SharedAdminLog>> All(LogFilter? filter = null)
|
||||
{
|
||||
if (TrySearchCache(filter, out var results))
|
||||
{
|
||||
return results;
|
||||
}
|
||||
|
||||
var initialSize = Math.Min(filter?.Limit ?? 0, 1000);
|
||||
var list = new List<SharedAdminLog>(initialSize);
|
||||
|
||||
await foreach (var log in _db.GetAdminLogs(filter).WithCancellation(filter?.CancellationToken ?? default))
|
||||
{
|
||||
list.Add(log);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public IAsyncEnumerable<string> AllMessages(LogFilter? filter = null)
|
||||
{
|
||||
return _db.GetAdminLogMessages(filter);
|
||||
}
|
||||
|
||||
public IAsyncEnumerable<JsonDocument> AllJson(LogFilter? filter = null)
|
||||
{
|
||||
return _db.GetAdminLogsJson(filter);
|
||||
}
|
||||
|
||||
public Task<Round> Round(int roundId)
|
||||
{
|
||||
return _db.GetRound(roundId);
|
||||
}
|
||||
|
||||
public Task<List<SharedAdminLog>> CurrentRoundLogs(LogFilter? filter = null)
|
||||
{
|
||||
filter ??= new LogFilter();
|
||||
filter.Round = _currentRoundId;
|
||||
return All(filter);
|
||||
}
|
||||
|
||||
public IAsyncEnumerable<string> CurrentRoundMessages(LogFilter? filter = null)
|
||||
{
|
||||
filter ??= new LogFilter();
|
||||
filter.Round = _currentRoundId;
|
||||
return AllMessages(filter);
|
||||
}
|
||||
|
||||
public IAsyncEnumerable<JsonDocument> CurrentRoundJson(LogFilter? filter = null)
|
||||
{
|
||||
filter ??= new LogFilter();
|
||||
filter.Round = _currentRoundId;
|
||||
return AllJson(filter);
|
||||
}
|
||||
|
||||
public Task<Round> CurrentRound()
|
||||
{
|
||||
return Round(_currentRoundId);
|
||||
}
|
||||
}
|
||||
@@ -1,367 +1,31 @@
|
||||
using System.Collections.Concurrent;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Content.Server.Database;
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Server.GameTicking.Events;
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Database;
|
||||
using Prometheus;
|
||||
using Robust.Shared;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Reflection;
|
||||
|
||||
namespace Content.Server.Administration.Logs;
|
||||
|
||||
public sealed partial class AdminLogSystem : SharedAdminLogSystem
|
||||
/// <summary>
|
||||
/// For system events that the manager needs to know about.
|
||||
/// <see cref="IAdminLogManager"/> for admin log usage.
|
||||
/// </summary>
|
||||
public sealed class AdminLogSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IConfigurationManager _configuration = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
[Dependency] private readonly ILogManager _logManager = default!;
|
||||
[Dependency] private readonly IServerDbManager _db = default!;
|
||||
[Dependency] private readonly IDynamicTypeFactory _typeFactory = default!;
|
||||
[Dependency] private readonly IReflectionManager _reflection = default!;
|
||||
|
||||
[Dependency] private readonly GameTicker _gameTicker = default!;
|
||||
|
||||
public const string SawmillId = "admin.logs";
|
||||
|
||||
private static readonly Histogram DatabaseUpdateTime = Metrics.CreateHistogram(
|
||||
"admin_logs_database_time",
|
||||
"Time used to send logs to the database in ms",
|
||||
new HistogramConfiguration
|
||||
{
|
||||
Buckets = Histogram.LinearBuckets(0, 0.5, 20)
|
||||
});
|
||||
|
||||
private static readonly Gauge Queue = Metrics.CreateGauge(
|
||||
"admin_logs_queue",
|
||||
"How many logs are in the queue.");
|
||||
|
||||
private static readonly Gauge PreRoundQueue = Metrics.CreateGauge(
|
||||
"admin_logs_pre_round_queue",
|
||||
"How many logs are in the pre-round queue.");
|
||||
|
||||
private static readonly Gauge QueueCapReached = Metrics.CreateGauge(
|
||||
"admin_logs_queue_cap_reached",
|
||||
"Number of times the log queue cap has been reached in a round.");
|
||||
|
||||
private static readonly Gauge PreRoundQueueCapReached = Metrics.CreateGauge(
|
||||
"admin_logs_queue_cap_reached",
|
||||
"Number of times the pre-round log queue cap has been reached in a round.");
|
||||
|
||||
private static readonly Gauge LogsSent = Metrics.CreateGauge(
|
||||
"admin_logs_sent",
|
||||
"Amount of logs sent to the database in a round.");
|
||||
|
||||
// Init only
|
||||
private ISawmill _sawmill = default!;
|
||||
|
||||
// CVars
|
||||
private bool _metricsEnabled;
|
||||
private bool _enabled;
|
||||
private TimeSpan _queueSendDelay;
|
||||
private int _queueMax;
|
||||
private int _preRoundQueueMax;
|
||||
|
||||
// Per update
|
||||
private float _accumulatedFrameTime;
|
||||
private readonly ConcurrentQueue<QueuedLog> _logQueue = new();
|
||||
private readonly ConcurrentQueue<QueuedLog> _preRoundLogQueue = new();
|
||||
|
||||
// Per round
|
||||
private int CurrentRoundId => _gameTicker.RoundId;
|
||||
private int _currentLogId;
|
||||
private int NextLogId => Interlocked.Increment(ref _currentLogId);
|
||||
[Dependency] private readonly IAdminLogManager _adminLogs = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
_sawmill = _logManager.GetSawmill(SawmillId);
|
||||
|
||||
InitializeJson();
|
||||
|
||||
_configuration.OnValueChanged(CVars.MetricsEnabled,
|
||||
value => _metricsEnabled = value, true);
|
||||
_configuration.OnValueChanged(CCVars.AdminLogsEnabled,
|
||||
value => _enabled = value, true);
|
||||
_configuration.OnValueChanged(CCVars.AdminLogsQueueSendDelay,
|
||||
value => _queueSendDelay = TimeSpan.FromSeconds(value), true);
|
||||
_configuration.OnValueChanged(CCVars.AdminLogsQueueMax,
|
||||
value => _queueMax = value, true);
|
||||
_configuration.OnValueChanged(CCVars.AdminLogsPreRoundQueueMax,
|
||||
value => _preRoundQueueMax = value, true);
|
||||
|
||||
if (_metricsEnabled)
|
||||
{
|
||||
PreRoundQueueCapReached.Set(0);
|
||||
QueueCapReached.Set(0);
|
||||
LogsSent.Set(0);
|
||||
SubscribeLocalEvent<RoundStartingEvent>(ev => _adminLogs.RoundStarting(ev.Id));
|
||||
SubscribeLocalEvent<GameRunLevelChangedEvent>(ev => _adminLogs.RunLevelChanged(ev.New));
|
||||
}
|
||||
|
||||
SubscribeLocalEvent<RoundStartingEvent>(RoundStarting);
|
||||
SubscribeLocalEvent<GameRunLevelChangedEvent>(RunLevelChanged);
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
_adminLogs.Update();
|
||||
}
|
||||
|
||||
public override async void Shutdown()
|
||||
public override void Shutdown()
|
||||
{
|
||||
base.Shutdown();
|
||||
|
||||
if (!_logQueue.IsEmpty)
|
||||
{
|
||||
await SaveLogs();
|
||||
}
|
||||
}
|
||||
|
||||
public override async void Update(float frameTime)
|
||||
{
|
||||
if (_gameTicker.RunLevel == GameRunLevel.PreRoundLobby)
|
||||
{
|
||||
await PreRoundUpdate();
|
||||
return;
|
||||
}
|
||||
|
||||
var count = _logQueue.Count;
|
||||
Queue.Set(count);
|
||||
|
||||
var preRoundCount = _preRoundLogQueue.Count;
|
||||
PreRoundQueue.Set(preRoundCount);
|
||||
|
||||
if (count + preRoundCount == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_accumulatedFrameTime >= _queueSendDelay.TotalSeconds)
|
||||
{
|
||||
await SaveLogs();
|
||||
return;
|
||||
}
|
||||
|
||||
if (count >= _queueMax)
|
||||
{
|
||||
if (_metricsEnabled)
|
||||
{
|
||||
QueueCapReached.Inc();
|
||||
}
|
||||
|
||||
_sawmill.Warning($"Maximum cap of {_queueMax} reached for admin logs.");
|
||||
await SaveLogs();
|
||||
return;
|
||||
}
|
||||
|
||||
_accumulatedFrameTime += frameTime;
|
||||
}
|
||||
|
||||
private async Task PreRoundUpdate()
|
||||
{
|
||||
var preRoundCount = _preRoundLogQueue.Count;
|
||||
PreRoundQueue.Set(preRoundCount);
|
||||
|
||||
if (preRoundCount < _preRoundQueueMax)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_metricsEnabled)
|
||||
{
|
||||
PreRoundQueueCapReached.Inc();
|
||||
}
|
||||
|
||||
_sawmill.Warning($"Maximum cap of {_preRoundQueueMax} reached for pre-round admin logs.");
|
||||
await SaveLogs();
|
||||
}
|
||||
|
||||
private async Task SaveLogs()
|
||||
{
|
||||
_accumulatedFrameTime = 0f;
|
||||
|
||||
// TODO ADMIN LOGS array pool
|
||||
var copy = new List<QueuedLog>(_logQueue.Count + _preRoundLogQueue.Count);
|
||||
|
||||
copy.AddRange(_logQueue);
|
||||
_logQueue.Clear();
|
||||
Queue.Set(0);
|
||||
|
||||
if (_gameTicker.RunLevel == GameRunLevel.PreRoundLobby)
|
||||
{
|
||||
_sawmill.Error($"Dropping {_preRoundLogQueue.Count} pre-round logs. Current cap: {_preRoundQueueMax}");
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var queued in _preRoundLogQueue)
|
||||
{
|
||||
queued.Log.RoundId = _gameTicker.RoundId;
|
||||
CacheLog(queued);
|
||||
}
|
||||
|
||||
copy.AddRange(_preRoundLogQueue);
|
||||
}
|
||||
|
||||
_preRoundLogQueue.Clear();
|
||||
PreRoundQueue.Set(0);
|
||||
|
||||
// ship the logs to Azkaban
|
||||
var task = Task.Run(async () =>
|
||||
{
|
||||
await _db.AddAdminLogs(copy);
|
||||
});
|
||||
|
||||
_sawmill.Debug($"Saving {copy.Count} admin logs.");
|
||||
|
||||
if (_metricsEnabled)
|
||||
{
|
||||
LogsSent.Inc(copy.Count);
|
||||
|
||||
using (DatabaseUpdateTime.NewTimer())
|
||||
{
|
||||
await task;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
await task;
|
||||
}
|
||||
|
||||
private void RoundStarting(RoundStartingEvent ev)
|
||||
{
|
||||
CacheNewRound();
|
||||
}
|
||||
|
||||
private void RunLevelChanged(GameRunLevelChangedEvent ev)
|
||||
{
|
||||
if (ev.New == GameRunLevel.PreRoundLobby)
|
||||
{
|
||||
Interlocked.Exchange(ref _currentLogId, 0);
|
||||
|
||||
if (_metricsEnabled)
|
||||
{
|
||||
PreRoundQueueCapReached.Set(0);
|
||||
QueueCapReached.Set(0);
|
||||
LogsSent.Set(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async void Add(LogType type, LogImpact impact, string message, JsonDocument json, HashSet<Guid> players, Dictionary<int, string?> entities)
|
||||
{
|
||||
var logId = NextLogId;
|
||||
var date = DateTime.UtcNow;
|
||||
|
||||
var log = new AdminLog
|
||||
{
|
||||
Id = logId,
|
||||
RoundId = CurrentRoundId,
|
||||
Type = type,
|
||||
Impact = impact,
|
||||
Date = date,
|
||||
Message = message,
|
||||
Json = json,
|
||||
Players = new List<AdminLogPlayer>(players.Count)
|
||||
};
|
||||
|
||||
var queued = new QueuedLog(log, entities);
|
||||
|
||||
foreach (var id in players)
|
||||
{
|
||||
var player = new AdminLogPlayer
|
||||
{
|
||||
LogId = logId,
|
||||
PlayerUserId = id
|
||||
};
|
||||
|
||||
log.Players.Add(player);
|
||||
}
|
||||
|
||||
if (_gameTicker.RunLevel == GameRunLevel.PreRoundLobby)
|
||||
{
|
||||
_preRoundLogQueue.Enqueue(queued);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logQueue.Enqueue(queued);
|
||||
CacheLog(log);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Add(LogType type, LogImpact impact, ref LogStringHandler handler)
|
||||
{
|
||||
if (!_enabled)
|
||||
{
|
||||
handler.ToStringAndClear();
|
||||
return;
|
||||
}
|
||||
|
||||
var (json, players, entities) = ToJson(handler.Values);
|
||||
var message = handler.ToStringAndClear();
|
||||
|
||||
Add(type, impact, message, json, players, entities);
|
||||
}
|
||||
|
||||
public override void Add(LogType type, ref LogStringHandler handler)
|
||||
{
|
||||
Add(type, LogImpact.Medium, ref handler);
|
||||
}
|
||||
|
||||
public async Task<List<SharedAdminLog>> All(LogFilter? filter = null)
|
||||
{
|
||||
if (TrySearchCache(filter, out var results))
|
||||
{
|
||||
return results;
|
||||
}
|
||||
|
||||
var initialSize = Math.Min(filter?.Limit ?? 0, 1000);
|
||||
var list = new List<SharedAdminLog>(initialSize);
|
||||
|
||||
await foreach (var log in _db.GetAdminLogs(filter).WithCancellation(filter?.CancellationToken ?? default))
|
||||
{
|
||||
list.Add(log);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public IAsyncEnumerable<string> AllMessages(LogFilter? filter = null)
|
||||
{
|
||||
return _db.GetAdminLogMessages(filter);
|
||||
}
|
||||
|
||||
public IAsyncEnumerable<JsonDocument> AllJson(LogFilter? filter = null)
|
||||
{
|
||||
return _db.GetAdminLogsJson(filter);
|
||||
}
|
||||
|
||||
public Task<Round> Round(int roundId)
|
||||
{
|
||||
return _db.GetRound(roundId);
|
||||
}
|
||||
|
||||
public Task<List<SharedAdminLog>> CurrentRoundLogs(LogFilter? filter = null)
|
||||
{
|
||||
filter ??= new LogFilter();
|
||||
filter.Round = CurrentRoundId;
|
||||
return All(filter);
|
||||
}
|
||||
|
||||
public IAsyncEnumerable<string> CurrentRoundMessages(LogFilter? filter = null)
|
||||
{
|
||||
filter ??= new LogFilter();
|
||||
filter.Round = CurrentRoundId;
|
||||
return AllMessages(filter);
|
||||
}
|
||||
|
||||
public IAsyncEnumerable<JsonDocument> CurrentRoundJson(LogFilter? filter = null)
|
||||
{
|
||||
filter ??= new LogFilter();
|
||||
filter.Round = CurrentRoundId;
|
||||
return AllJson(filter);
|
||||
}
|
||||
|
||||
public Task<Round> CurrentRound()
|
||||
{
|
||||
return Round(CurrentRoundId);
|
||||
_adminLogs.Shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace Content.Server.Administration.Logs;
|
||||
|
||||
public sealed class AdminLogsEui : BaseEui
|
||||
{
|
||||
[Dependency] private readonly IAdminLogManager _adminLogs = default!;
|
||||
[Dependency] private readonly IAdminManager _adminManager = default!;
|
||||
[Dependency] private readonly ILogManager _logManager = default!;
|
||||
[Dependency] private readonly IConfigurationManager _configuration = default!;
|
||||
|
||||
private readonly ISawmill _sawmill;
|
||||
private readonly AdminLogSystem _logSystem;
|
||||
|
||||
private int _clientBatchSize;
|
||||
private bool _isLoading = true;
|
||||
@@ -33,12 +33,10 @@ public sealed class AdminLogsEui : BaseEui
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
_sawmill = _logManager.GetSawmill(AdminLogSystem.SawmillId);
|
||||
_sawmill = _logManager.GetSawmill(AdminLogManager.SawmillId);
|
||||
|
||||
_configuration.OnValueChanged(CCVars.AdminLogsClientBatchSize, ClientBatchSizeChanged, true);
|
||||
|
||||
_logSystem = EntitySystem.Get<AdminLogSystem>();
|
||||
|
||||
_filter = new LogFilter
|
||||
{
|
||||
CancellationToken = _logSendCancellation.Token,
|
||||
@@ -146,7 +144,7 @@ public sealed class AdminLogsEui : BaseEui
|
||||
|
||||
await Task.Run(async () =>
|
||||
{
|
||||
logs = await _logSystem.All(_filter);
|
||||
logs = await _adminLogs.All(_filter);
|
||||
}, _filter.CancellationToken);
|
||||
|
||||
if (logs.Count > 0)
|
||||
@@ -186,7 +184,7 @@ public sealed class AdminLogsEui : BaseEui
|
||||
_isLoading = true;
|
||||
StateDirty();
|
||||
|
||||
var round = await Task.Run(() => _logSystem.Round(roundId));
|
||||
var round = await Task.Run(() => _adminLogs.Round(roundId));
|
||||
var players = round.Players
|
||||
.ToDictionary(player => player.UserId, player => player.LastSeenUserName);
|
||||
|
||||
|
||||
26
Content.Server/Administration/Logs/IAdminLogManager.cs
Normal file
26
Content.Server/Administration/Logs/IAdminLogManager.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using Content.Server.Database;
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Shared.Administration.Logs;
|
||||
|
||||
namespace Content.Server.Administration.Logs;
|
||||
|
||||
public interface IAdminLogManager : ISharedAdminLogManager
|
||||
{
|
||||
void Initialize();
|
||||
Task Shutdown();
|
||||
void Update();
|
||||
|
||||
void RoundStarting(int id);
|
||||
void RunLevelChanged(GameRunLevel level);
|
||||
|
||||
Task<List<SharedAdminLog>> All(LogFilter? filter = null);
|
||||
IAsyncEnumerable<string> AllMessages(LogFilter? filter = null);
|
||||
IAsyncEnumerable<JsonDocument> AllJson(LogFilter? filter = null);
|
||||
Task<Round> Round(int roundId);
|
||||
Task<List<SharedAdminLog>> CurrentRoundLogs(LogFilter? filter = null);
|
||||
IAsyncEnumerable<string> CurrentRoundMessages(LogFilter? filter = null);
|
||||
IAsyncEnumerable<JsonDocument> CurrentRoundJson(LogFilter? filter = null);
|
||||
Task<Round> CurrentRound();
|
||||
}
|
||||
@@ -479,7 +479,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
}
|
||||
|
||||
if(tileCount > 10 && (totalMolesRemoved / tileCount) > 20)
|
||||
_adminLog.Add(LogType.ExplosiveDepressurization, LogImpact.High,
|
||||
_adminLogger.Add(LogType.ExplosiveDepressurization, LogImpact.High,
|
||||
$"Explosive depressurization removed {totalMolesRemoved} moles from {tileCount} tiles starting from position {tile.GridIndices:position} on grid ID {tile.GridIndex:grid}");
|
||||
|
||||
Array.Clear(_depressurizeTiles, 0, Atmospherics.MonstermosHardTileLimit);
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
public sealed partial class AtmosphereSystem : SharedAtmosphereSystem
|
||||
{
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly AdminLogSystem _adminLog = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _containers = default!;
|
||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
||||
[Dependency] private readonly AlertsSystem _alertsSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger= default!;
|
||||
[Dependency] private readonly InventorySystem _inventorySystem = default!;
|
||||
|
||||
private const float UpdateTimer = 1f;
|
||||
@@ -172,7 +172,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
if (!barotrauma.TakingDamage)
|
||||
{
|
||||
barotrauma.TakingDamage = true;
|
||||
_logSystem.Add(LogType.Barotrauma, $"{ToPrettyString(barotrauma.Owner):entity} started taking low pressure damage");
|
||||
_adminLogger.Add(LogType.Barotrauma, $"{ToPrettyString(barotrauma.Owner):entity} started taking low pressure damage");
|
||||
}
|
||||
|
||||
if (pressure <= Atmospherics.HazardLowPressure)
|
||||
@@ -199,7 +199,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
if (!barotrauma.TakingDamage)
|
||||
{
|
||||
barotrauma.TakingDamage = true;
|
||||
_logSystem.Add(LogType.Barotrauma, $"{ToPrettyString(barotrauma.Owner):entity} started taking high pressure damage");
|
||||
_adminLogger.Add(LogType.Barotrauma, $"{ToPrettyString(barotrauma.Owner):entity} started taking high pressure damage");
|
||||
}
|
||||
|
||||
if (pressure >= Atmospherics.HazardHighPressure)
|
||||
@@ -216,7 +216,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
if (barotrauma.TakingDamage)
|
||||
{
|
||||
barotrauma.TakingDamage = false;
|
||||
_logSystem.Add(LogType.Barotrauma, $"{ToPrettyString(barotrauma.Owner):entity} stopped taking pressure damage");
|
||||
_adminLogger.Add(LogType.Barotrauma, $"{ToPrettyString(barotrauma.Owner):entity} stopped taking pressure damage");
|
||||
}
|
||||
_alertsSystem.ClearAlertCategory(barotrauma.Owner, AlertCategory.Pressure);
|
||||
break;
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
[Dependency] private readonly TemperatureSystem _temperatureSystem = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
||||
[Dependency] private readonly AlertsSystem _alertsSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
|
||||
private const float MinimumFireStacks = -10f;
|
||||
private const float MaximumFireStacks = 20f;
|
||||
@@ -151,7 +151,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
if (!flammable.OnFire)
|
||||
return;
|
||||
|
||||
_logSystem.Add(LogType.Flammable, $"{ToPrettyString(flammable.Owner):entity} stopped being on fire damage");
|
||||
_adminLogger.Add(LogType.Flammable, $"{ToPrettyString(flammable.Owner):entity} stopped being on fire damage");
|
||||
flammable.OnFire = false;
|
||||
flammable.FireStacks = 0;
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
|
||||
if (flammable.FireStacks > 0 && !flammable.OnFire)
|
||||
{
|
||||
_logSystem.Add(LogType.Flammable, $"{ToPrettyString(flammable.Owner):entity} is on fire");
|
||||
_adminLogger.Add(LogType.Flammable, $"{ToPrettyString(flammable.Owner):entity} is on fire");
|
||||
flammable.OnFire = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
public sealed class GasPressurePumpSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly UserInterfaceSystem _userInterfaceSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _adminLogSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
||||
[Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
private void OnToggleStatusMessage(EntityUid uid, GasPressurePumpComponent pump, GasPressurePumpToggleStatusMessage args)
|
||||
{
|
||||
pump.Enabled = args.Enabled;
|
||||
_adminLogSystem.Add(LogType.AtmosPowerChanged, LogImpact.Medium,
|
||||
_adminLogger.Add(LogType.AtmosPowerChanged, LogImpact.Medium,
|
||||
$"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the power on {ToPrettyString(uid):device} to {args.Enabled}");
|
||||
DirtyUI(uid, pump);
|
||||
}
|
||||
@@ -124,7 +124,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
private void OnOutputPressureChangeMessage(EntityUid uid, GasPressurePumpComponent pump, GasPressurePumpChangeOutputPressureMessage args)
|
||||
{
|
||||
pump.TargetPressure = Math.Clamp(args.Pressure, 0f, Atmospherics.MaxOutputPressure);
|
||||
_adminLogSystem.Add(LogType.AtmosPressureChanged, LogImpact.Medium,
|
||||
_adminLogger.Add(LogType.AtmosPressureChanged, LogImpact.Medium,
|
||||
$"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the pressure on {ToPrettyString(uid):device} to {args.Pressure}kPa");
|
||||
DirtyUI(uid, pump);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
||||
[Dependency] private readonly UserInterfaceSystem _userInterfaceSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _adminLogSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
@@ -121,7 +121,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
private void OnToggleStatusMessage(EntityUid uid, GasVolumePumpComponent pump, GasVolumePumpToggleStatusMessage args)
|
||||
{
|
||||
pump.Enabled = args.Enabled;
|
||||
_adminLogSystem.Add(LogType.AtmosPowerChanged, LogImpact.Medium,
|
||||
_adminLogger.Add(LogType.AtmosPowerChanged, LogImpact.Medium,
|
||||
$"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the power on {ToPrettyString(uid):device} to {args.Enabled}");
|
||||
DirtyUI(uid, pump);
|
||||
}
|
||||
@@ -129,7 +129,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
||||
private void OnTransferRateChangeMessage(EntityUid uid, GasVolumePumpComponent pump, GasVolumePumpChangeTransferRateMessage args)
|
||||
{
|
||||
pump.TransferRate = Math.Clamp(args.TransferRate, 0f, pump.MaxTransferRate);
|
||||
_adminLogSystem.Add(LogType.AtmosVolumeChanged, LogImpact.Medium,
|
||||
_adminLogger.Add(LogType.AtmosVolumeChanged, LogImpact.Medium,
|
||||
$"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the transfer rate on {ToPrettyString(uid):device} to {args.TransferRate}");
|
||||
DirtyUI(uid, pump);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
{
|
||||
[Dependency] private IGameTiming _gameTiming = default!;
|
||||
[Dependency] private UserInterfaceSystem _userInterfaceSystem = default!;
|
||||
[Dependency] private AdminLogSystem _adminLogSystem = default!;
|
||||
[Dependency] private IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
||||
[Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
private void OnToggleStatusMessage(EntityUid uid, GasFilterComponent filter, GasFilterToggleStatusMessage args)
|
||||
{
|
||||
filter.Enabled = args.Enabled;
|
||||
_adminLogSystem.Add(LogType.AtmosPowerChanged, LogImpact.Medium,
|
||||
_adminLogger.Add(LogType.AtmosPowerChanged, LogImpact.Medium,
|
||||
$"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the power on {ToPrettyString(uid):device} to {args.Enabled}");
|
||||
|
||||
DirtyUI(uid, filter);
|
||||
@@ -149,7 +149,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
private void OnTransferRateChangeMessage(EntityUid uid, GasFilterComponent filter, GasFilterChangeRateMessage args)
|
||||
{
|
||||
filter.TransferRate = Math.Clamp(args.Rate, 0f, filter.MaxTransferRate);
|
||||
_adminLogSystem.Add(LogType.AtmosVolumeChanged, LogImpact.Medium,
|
||||
_adminLogger.Add(LogType.AtmosVolumeChanged, LogImpact.Medium,
|
||||
$"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the transfer rate on {ToPrettyString(uid):device} to {args.Rate}");
|
||||
DirtyUI(uid, filter);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
public sealed class GasMixerSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private UserInterfaceSystem _userInterfaceSystem = default!;
|
||||
[Dependency] private AdminLogSystem _adminLogSystem = default!;
|
||||
[Dependency] private IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
||||
[Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;
|
||||
|
||||
@@ -180,7 +180,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
private void OnToggleStatusMessage(EntityUid uid, GasMixerComponent mixer, GasMixerToggleStatusMessage args)
|
||||
{
|
||||
mixer.Enabled = args.Enabled;
|
||||
_adminLogSystem.Add(LogType.AtmosPowerChanged, LogImpact.Medium,
|
||||
_adminLogger.Add(LogType.AtmosPowerChanged, LogImpact.Medium,
|
||||
$"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the power on {ToPrettyString(uid):device} to {args.Enabled}");
|
||||
DirtyUI(uid, mixer);
|
||||
UpdateAppearance(uid, mixer);
|
||||
@@ -189,7 +189,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
private void OnOutputPressureChangeMessage(EntityUid uid, GasMixerComponent mixer, GasMixerChangeOutputPressureMessage args)
|
||||
{
|
||||
mixer.TargetPressure = Math.Clamp(args.Pressure, 0f, mixer.MaxTargetPressure);
|
||||
_adminLogSystem.Add(LogType.AtmosPressureChanged, LogImpact.Medium,
|
||||
_adminLogger.Add(LogType.AtmosPressureChanged, LogImpact.Medium,
|
||||
$"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the pressure on {ToPrettyString(uid):device} to {args.Pressure}kPa");
|
||||
DirtyUI(uid, mixer);
|
||||
}
|
||||
@@ -200,7 +200,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
float nodeOne = Math.Clamp(args.NodeOne, 0f, 100.0f) / 100.0f;
|
||||
mixer.InletOneConcentration = nodeOne;
|
||||
mixer.InletTwoConcentration = 1.0f - mixer.InletOneConcentration;
|
||||
_adminLogSystem.Add(LogType.AtmosRatioChanged, LogImpact.Medium,
|
||||
_adminLogger.Add(LogType.AtmosRatioChanged, LogImpact.Medium,
|
||||
$"{EntityManager.ToPrettyString(args.Session.AttachedEntity!.Value):player} set the ratio on {EntityManager.ToPrettyString(uid):device} to {mixer.InletOneConcentration}:{mixer.InletTwoConcentration}");
|
||||
DirtyUI(uid, mixer);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
{
|
||||
[Dependency] private readonly UserInterfaceSystem _userInterfaceSystem = default!;
|
||||
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _adminLogSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
@@ -56,7 +56,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
if (environment is not null)
|
||||
_atmosphereSystem.Merge(environment, canister.Air);
|
||||
|
||||
_adminLogSystem.Add(LogType.CanisterPurged, LogImpact.Medium, $"Canister {ToPrettyString(uid):canister} purged its contents of {canister.Air:gas} into the environment.");
|
||||
_adminLogger.Add(LogType.CanisterPurged, LogImpact.Medium, $"Canister {ToPrettyString(uid):canister} purged its contents of {canister.Air:gas} into the environment.");
|
||||
canister.Air.Clear();
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
if (container.ContainedEntities.Count == 0)
|
||||
return;
|
||||
|
||||
_adminLogSystem.Add(LogType.CanisterTankEjected, LogImpact.Medium, $"Player {ToPrettyString(args.Session.AttachedEntity.GetValueOrDefault()):player} ejected tank {ToPrettyString(container.ContainedEntities[0]):tank} from {ToPrettyString(uid):canister}");
|
||||
_adminLogger.Add(LogType.CanisterTankEjected, LogImpact.Medium, $"Player {ToPrettyString(args.Session.AttachedEntity.GetValueOrDefault()):player} ejected tank {ToPrettyString(container.ContainedEntities[0]):tank} from {ToPrettyString(uid):canister}");
|
||||
container.Remove(container.ContainedEntities[0]);
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
{
|
||||
var pressure = Math.Clamp(args.Pressure, canister.MinReleasePressure, canister.MaxReleasePressure);
|
||||
|
||||
_adminLogSystem.Add(LogType.CanisterPressure, LogImpact.Medium, $"{ToPrettyString(args.Session.AttachedEntity.GetValueOrDefault()):player} set the release pressure on {ToPrettyString(uid):canister} to {args.Pressure}");
|
||||
_adminLogger.Add(LogType.CanisterPressure, LogImpact.Medium, $"{ToPrettyString(args.Session.AttachedEntity.GetValueOrDefault()):player} set the release pressure on {ToPrettyString(uid):canister} to {args.Pressure}");
|
||||
|
||||
canister.ReleasePressure = pressure;
|
||||
DirtyUI(uid, canister);
|
||||
@@ -131,7 +131,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
&& containerManager.TryGetContainer(canister.ContainerName, out var container))
|
||||
impact = container.ContainedEntities.Count != 0 ? LogImpact.Medium : LogImpact.High;
|
||||
|
||||
_adminLogSystem.Add(LogType.CanisterValve, impact, $"{ToPrettyString(args.Session.AttachedEntity.GetValueOrDefault()):player} set the valve on {ToPrettyString(uid):canister} to {args.Valve:valveState}");
|
||||
_adminLogger.Add(LogType.CanisterValve, impact, $"{ToPrettyString(args.Session.AttachedEntity.GetValueOrDefault()):player} set the valve on {ToPrettyString(uid):canister} to {args.Valve:valveState}");
|
||||
|
||||
canister.ReleaseValve = args.Valve;
|
||||
DirtyUI(uid, canister);
|
||||
@@ -245,7 +245,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
if (!_handsSystem.TryDropIntoContainer(args.User, args.Used, container))
|
||||
return;
|
||||
|
||||
_adminLogSystem.Add(LogType.CanisterTankInserted, LogImpact.Medium, $"Player {ToPrettyString(args.User):player} inserted tank {ToPrettyString(container.ContainedEntities[0]):tank} into {ToPrettyString(canister):canister}");
|
||||
_adminLogger.Add(LogType.CanisterTankInserted, LogImpact.Medium, $"Player {ToPrettyString(args.User):player} inserted tank {ToPrettyString(container.ContainedEntities[0]):tank} into {ToPrettyString(canister):canister}");
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Content.Server.Body.Systems
|
||||
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly SharedAdminLogSystem _logSystem = default!;
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -182,7 +182,7 @@ namespace Content.Server.Body.Systems
|
||||
|
||||
if (effect.ShouldLog)
|
||||
{
|
||||
_logSystem.Add(LogType.ReagentEffect, effect.LogImpact,
|
||||
_adminLogger.Add(LogType.ReagentEffect, effect.LogImpact,
|
||||
$"Metabolism effect {effect.GetType().Name:effect} of reagent {args.Reagent.LocalizedName:reagent} applied on entity {actualEntity:entity} at {Transform(actualEntity).Coordinates:coordinates}");
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Content.Server.Body.Systems
|
||||
public sealed class RespiratorSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly DamageableSystem _damageableSys = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logSys = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly BodySystem _bodySystem = default!;
|
||||
[Dependency] private readonly LungSystem _lungSystem = default!;
|
||||
[Dependency] private readonly AtmosphereSystem _atmosSys = default!;
|
||||
@@ -154,7 +154,7 @@ namespace Content.Server.Body.Systems
|
||||
private void TakeSuffocationDamage(EntityUid uid, RespiratorComponent respirator)
|
||||
{
|
||||
if (respirator.SuffocationCycles == 2)
|
||||
_logSys.Add(LogType.Asphyxiation, $"{ToPrettyString(uid):entity} started suffocating");
|
||||
_adminLogger.Add(LogType.Asphyxiation, $"{ToPrettyString(uid):entity} started suffocating");
|
||||
|
||||
if (respirator.SuffocationCycles >= respirator.SuffocationCycleThreshold)
|
||||
{
|
||||
@@ -167,7 +167,7 @@ namespace Content.Server.Body.Systems
|
||||
private void StopSuffocation(EntityUid uid, RespiratorComponent respirator)
|
||||
{
|
||||
if (respirator.SuffocationCycles >= 2)
|
||||
_logSys.Add(LogType.Asphyxiation, $"{ToPrettyString(uid):entity} stopped suffocating");
|
||||
_adminLogger.Add(LogType.Asphyxiation, $"{ToPrettyString(uid):entity} stopped suffocating");
|
||||
|
||||
_alertsSystem.ClearAlert(uid, AlertType.LowOxygen);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public sealed class ChatSystem : SharedChatSystem
|
||||
[Dependency] private readonly IAdminManager _adminManager = default!;
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logs = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
|
||||
[Dependency] private readonly ListeningSystem _listener = default!;
|
||||
[Dependency] private readonly InventorySystem _inventory = default!;
|
||||
@@ -155,7 +155,7 @@ public sealed class ChatSystem : SharedChatSystem
|
||||
|
||||
var ev = new EntitySpokeEvent(message);
|
||||
RaiseLocalEvent(source, ev, false);
|
||||
_logs.Add(LogType.Chat, LogImpact.Low, $"Say from {ToPrettyString(source):user}: {message}");
|
||||
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Say from {ToPrettyString(source):user}: {message}");
|
||||
}
|
||||
|
||||
private void SendEntityWhisper(EntityUid source, string message, bool hideChat = false)
|
||||
@@ -199,7 +199,7 @@ public sealed class ChatSystem : SharedChatSystem
|
||||
|
||||
var ev = new EntitySpokeEvent(message);
|
||||
RaiseLocalEvent(source, ev, false);
|
||||
_logs.Add(LogType.Chat, LogImpact.Low, $"Whisper from {ToPrettyString(source):user}: {message}");
|
||||
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Whisper from {ToPrettyString(source):user}: {message}");
|
||||
}
|
||||
|
||||
private void SendEntityEmote(EntityUid source, string action, bool hideChat)
|
||||
@@ -210,7 +210,7 @@ public sealed class ChatSystem : SharedChatSystem
|
||||
("entityName", Name(source)));
|
||||
|
||||
SendInVoiceRange(ChatChannel.Emotes, action, messageWrap, source, hideChat);
|
||||
_logs.Add(LogType.Chat, LogImpact.Low, $"Emote from {ToPrettyString(source):user}: {action}");
|
||||
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Emote from {ToPrettyString(source):user}: {action}");
|
||||
}
|
||||
|
||||
// ReSharper disable once InconsistentNaming
|
||||
@@ -225,7 +225,7 @@ public sealed class ChatSystem : SharedChatSystem
|
||||
("entityName", Name(source)));
|
||||
|
||||
SendInVoiceRange(ChatChannel.LOOC, message, messageWrap, source, hideChat);
|
||||
_logs.Add(LogType.Chat, LogImpact.Low, $"LOOC from {player:Player}: {message}");
|
||||
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"LOOC from {player:Player}: {message}");
|
||||
}
|
||||
|
||||
private void SendDeadChat(EntityUid source, IPlayerSession player, string message, bool hideChat)
|
||||
@@ -238,18 +238,18 @@ public sealed class ChatSystem : SharedChatSystem
|
||||
messageWrap = Loc.GetString("chat-manager-send-admin-dead-chat-wrap-message",
|
||||
("adminChannelName", Loc.GetString("chat-manager-admin-channel-name")),
|
||||
("userName", player.ConnectedClient.UserName));
|
||||
_logs.Add(LogType.Chat, LogImpact.Low, $"Dead chat from {player:Player}: {message}");
|
||||
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Dead chat from {player:Player}: {message}");
|
||||
}
|
||||
else
|
||||
{
|
||||
messageWrap = Loc.GetString("chat-manager-send-dead-chat-wrap-message",
|
||||
("deadChannelName", Loc.GetString("chat-manager-dead-channel-name")),
|
||||
("playerName", (playerName)));
|
||||
_logs.Add(LogType.Chat, LogImpact.Low, $"Admin dead chat from {player:Player}: {message}");
|
||||
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Admin dead chat from {player:Player}: {message}");
|
||||
}
|
||||
|
||||
_chatManager.ChatMessageToMany(ChatChannel.Dead, message, messageWrap, source, hideChat, clients.ToList());
|
||||
_logs.Add(LogType.Chat, LogImpact.Low, $"Dead chat from {player:Player}: {message}");
|
||||
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Dead chat from {player:Player}: {message}");
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -32,11 +32,10 @@ namespace Content.Server.Chat.Managers
|
||||
[Dependency] private readonly IServerNetManager _netManager = default!;
|
||||
[Dependency] private readonly IMoMMILink _mommiLink = default!;
|
||||
[Dependency] private readonly IAdminManager _adminManager = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly IServerPreferencesManager _preferencesManager = default!;
|
||||
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
|
||||
|
||||
private AdminLogSystem _logs = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The maximum length a player-sent message can be sent
|
||||
/// </summary>
|
||||
@@ -47,7 +46,6 @@ namespace Content.Server.Chat.Managers
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
_logs = EntitySystem.Get<AdminLogSystem>();
|
||||
_netManager.RegisterNetMessage<MsgChatMessage>();
|
||||
|
||||
_configurationManager.OnValueChanged(CCVars.OocEnabled, OnOocEnabledChanged, true);
|
||||
@@ -78,7 +76,7 @@ namespace Content.Server.Chat.Managers
|
||||
ChatMessageToAll(ChatChannel.Server, message, messageWrap, colorOverride);
|
||||
Logger.InfoS("SERVER", message);
|
||||
|
||||
_logs.Add(LogType.Chat, LogImpact.Low, $"Server announcement: {message}");
|
||||
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Server announcement: {message}");
|
||||
}
|
||||
|
||||
public void DispatchStationAnnouncement(string message, string sender = "Central Command", bool playDefaultSound = true, Color? colorOverride = null)
|
||||
@@ -90,7 +88,7 @@ namespace Content.Server.Chat.Managers
|
||||
SoundSystem.Play(Filter.Broadcast(), "/Audio/Announcements/announce.ogg", AudioParams.Default.WithVolume(-2f));
|
||||
}
|
||||
|
||||
_logs.Add(LogType.Chat, LogImpact.Low, $"Station Announcement from {sender}: {message}");
|
||||
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Station Announcement from {sender}: {message}");
|
||||
}
|
||||
|
||||
public void DispatchServerMessage(IPlayerSession player, string message)
|
||||
@@ -98,7 +96,7 @@ namespace Content.Server.Chat.Managers
|
||||
var messageWrap = Loc.GetString("chat-manager-server-wrap-message");
|
||||
ChatMessageToOne(ChatChannel.Server, message, messageWrap, default, false, player.ConnectedClient);
|
||||
|
||||
_logs.Add(LogType.Chat, LogImpact.Low, $"Server message to {player:Player}: {message}");
|
||||
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Server message to {player:Player}: {message}");
|
||||
}
|
||||
|
||||
public void SendAdminAnnouncement(string message)
|
||||
@@ -110,7 +108,7 @@ namespace Content.Server.Chat.Managers
|
||||
("adminChannelName", Loc.GetString("chat-manager-admin-channel-name")));
|
||||
|
||||
ChatMessageToMany(ChatChannel.Admin, message, messageWrap, default, false, clients.ToList());
|
||||
_logs.Add(LogType.Chat, LogImpact.Low, $"Admin announcement from {message}: {message}");
|
||||
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Admin announcement from {message}: {message}");
|
||||
}
|
||||
|
||||
public void SendHookOOC(string sender, string message)
|
||||
@@ -122,7 +120,7 @@ namespace Content.Server.Chat.Managers
|
||||
message = FormattedMessage.EscapeText(message);
|
||||
var messageWrap = Loc.GetString("chat-manager-send-hook-ooc-wrap-message", ("senderName", sender));
|
||||
ChatMessageToAll(ChatChannel.OOC, message, messageWrap);
|
||||
_logs.Add(LogType.Chat, LogImpact.Low, $"Hook OOC from {sender}: {message}");
|
||||
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Hook OOC from {sender}: {message}");
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -191,14 +189,14 @@ namespace Content.Server.Chat.Managers
|
||||
//TODO: player.Name color, this will need to change the structure of the MsgChatMessage
|
||||
ChatMessageToAll(ChatChannel.OOC, message, messageWrap, colorOverride);
|
||||
_mommiLink.SendOOCMessage(player.Name, message);
|
||||
_logs.Add(LogType.Chat, LogImpact.Low, $"OOC from {player:Player}: {message}");
|
||||
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"OOC from {player:Player}: {message}");
|
||||
}
|
||||
|
||||
private void SendAdminChat(IPlayerSession player, string message)
|
||||
{
|
||||
if (!_adminManager.IsAdmin(player))
|
||||
{
|
||||
_logs.Add(LogType.Chat, LogImpact.Extreme, $"{player:Player} attempted to send admin message but was not admin");
|
||||
_adminLogger.Add(LogType.Chat, LogImpact.Extreme, $"{player:Player} attempted to send admin message but was not admin");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -208,7 +206,7 @@ namespace Content.Server.Chat.Managers
|
||||
("playerName", player.Name));
|
||||
ChatMessageToMany(ChatChannel.Admin, message, messageWrap, default, false, clients.ToList());
|
||||
|
||||
_logs.Add(LogType.Chat, $"Admin chat from {player:Player}: {message}");
|
||||
_adminLogger.Add(LogType.Chat, $"Admin chat from {player:Player}: {message}");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Content.Server.Chat
|
||||
{
|
||||
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
||||
[Dependency] private readonly EntityLookupSystem _entityLookupSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _adminLogSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly TagSystem _tagSystem = default!;
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Content.Server.Chat
|
||||
return false;
|
||||
}
|
||||
|
||||
_adminLogSystem.Add(LogType.Suicide,
|
||||
_adminLogger.Add(LogType.Suicide,
|
||||
$"{EntityManager.ToPrettyString(victim):player} is committing suicide");
|
||||
|
||||
var suicideEvent = new SuicideEvent(victim);
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Content.Server.Chemistry.EntitySystems
|
||||
|
||||
var coordinates = Transform(owner).Coordinates;
|
||||
|
||||
_logSystem.Add(LogType.ChemicalReaction, reaction.Impact,
|
||||
_adminLogger.Add(LogType.ChemicalReaction, reaction.Impact,
|
||||
$"Chemical reaction {reaction.ID:reaction} occurred with strength {unitReactions:strength} on entity {ToPrettyString(owner):metabolizer} at {coordinates}");
|
||||
|
||||
SoundSystem.Play(Filter.Pvs(owner, entityManager:EntityManager), reaction.Sound.GetSound(), owner);
|
||||
|
||||
@@ -206,7 +206,7 @@ public sealed partial class ChemistrySystem
|
||||
// Add an admin log, using the "force feed" log type. It's not quite feeding, but the effect is the same.
|
||||
if (component.ToggleState == SharedInjectorComponent.InjectorToggleMode.Inject)
|
||||
{
|
||||
_logs.Add(LogType.ForceFeed,
|
||||
_adminLogger.Add(LogType.ForceFeed,
|
||||
$"{EntityManager.ToPrettyString(user):user} is attempting to inject {EntityManager.ToPrettyString(target):target} with a solution {SolutionContainerSystem.ToPrettyString(solution):solution}");
|
||||
}
|
||||
}
|
||||
@@ -216,7 +216,7 @@ public sealed partial class ChemistrySystem
|
||||
actualDelay /= 2;
|
||||
|
||||
if (component.ToggleState == SharedInjectorComponent.InjectorToggleMode.Inject)
|
||||
_logs.Add(LogType.Ingestion,
|
||||
_adminLogger.Add(LogType.Ingestion,
|
||||
$"{EntityManager.ToPrettyString(user):user} is attempting to inject themselves with a solution {SolutionContainerSystem.ToPrettyString(solution):solution}.");
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Chemistry.EntitySystems;
|
||||
|
||||
public sealed partial class ChemistrySystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly AdminLogSystem _logs = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly BloodstreamSystem _blood = default!;
|
||||
[Dependency] private readonly DoAfterSystem _doAfter = default!;
|
||||
[Dependency] private readonly PopupSystem _popup = default!;
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Content.Server.CombatMode
|
||||
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
|
||||
[Dependency] private readonly MeleeWeaponSystem _meleeWeaponSystem = default!;
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger= default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
public override void Initialize()
|
||||
@@ -87,7 +87,7 @@ namespace Content.Server.CombatMode
|
||||
|
||||
_meleeWeaponSystem.SendAnimation("disarm", angle, args.Performer, args.Performer, new[] { args.Target });
|
||||
SoundSystem.Play(filterAll, component.DisarmSuccessSound.GetSound(), args.Performer, AudioHelpers.WithVariation(0.025f));
|
||||
_logSystem.Add(LogType.DisarmedAction, $"{ToPrettyString(args.Performer):user} used disarm on {ToPrettyString(args.Target):target}");
|
||||
_adminLogger.Add(LogType.DisarmedAction, $"{ToPrettyString(args.Performer):user} used disarm on {ToPrettyString(args.Target):target}");
|
||||
|
||||
var eventArgs = new DisarmedEvent() { Target = args.Target, Source = args.Performer, PushProbability = component.DisarmPushChance };
|
||||
RaiseLocalEvent(args.Target, eventArgs);
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Content.Server.Construction
|
||||
{
|
||||
public sealed class AnchorableSystem : SharedAnchorableSystem
|
||||
{
|
||||
[Dependency] private readonly AdminLogSystem _adminLogs = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly ToolSystem _toolSystem = default!;
|
||||
[Dependency] private readonly PullingSystem _pullingSystem = default!;
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Content.Server.Construction
|
||||
|
||||
RaiseLocalEvent(uid, new UserUnanchoredEvent(args.User, args.Using), false);
|
||||
|
||||
_adminLogs.Add(
|
||||
_adminLogger.Add(
|
||||
LogType.Action,
|
||||
LogImpact.Low,
|
||||
$"{EntityManager.ToPrettyString(args.User):user} unanchored {EntityManager.ToPrettyString(uid):anchored} using {EntityManager.ToPrettyString(args.Using):using}"
|
||||
@@ -78,7 +78,7 @@ namespace Content.Server.Construction
|
||||
|
||||
RaiseLocalEvent(uid, new UserAnchoredEvent(args.User, args.Using), false);
|
||||
|
||||
_adminLogs.Add(
|
||||
_adminLogger.Add(
|
||||
LogType.Action,
|
||||
LogImpact.Low,
|
||||
$"{EntityManager.ToPrettyString(args.User):user} anchored {EntityManager.ToPrettyString(uid):anchored} using {EntityManager.ToPrettyString(args.Using):using}"
|
||||
|
||||
@@ -22,11 +22,11 @@ public sealed class AdminLog : IGraphAction
|
||||
|
||||
public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager)
|
||||
{
|
||||
var logSys = entityManager.EntitySysManager.GetEntitySystem<AdminLogSystem>();
|
||||
var logManager = IoCManager.Resolve<IAdminLogManager>();
|
||||
|
||||
if (userUid.HasValue)
|
||||
logSys.Add(LogType, Impact, $"{Message} - Entity: {entityManager.ToPrettyString(uid):entity}, User: {entityManager.ToPrettyString(userUid.Value):user}");
|
||||
logManager.Add(LogType, Impact, $"{Message} - Entity: {entityManager.ToPrettyString(uid):entity}, User: {entityManager.ToPrettyString(userUid.Value):user}");
|
||||
else
|
||||
logSys.Add(LogType, Impact, $"{Message} - Entity: {entityManager.ToPrettyString(uid):entity}");
|
||||
logManager.Add(LogType, Impact, $"{Message} - Entity: {entityManager.ToPrettyString(uid):entity}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Content.Server.Crayon;
|
||||
public sealed class CrayonSystem : SharedCrayonSystem
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logs = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly DecalSystem _decals = default!;
|
||||
[Dependency] private readonly PopupSystem _popup = default!;
|
||||
|
||||
@@ -73,7 +73,7 @@ public sealed class CrayonSystem : SharedCrayonSystem
|
||||
// Decrease "Ammo"
|
||||
component.Charges--;
|
||||
Dirty(component);
|
||||
_logs.Add(LogType.CrayonDraw, LogImpact.Low, $"{EntityManager.ToPrettyString(args.User):user} drew a {component.Color:color} {component.SelectedState}");
|
||||
_adminLogger.Add(LogType.CrayonDraw, LogImpact.Low, $"{EntityManager.ToPrettyString(args.User):user} drew a {component.Color:color} {component.SelectedState}");
|
||||
args.Handled = true;
|
||||
|
||||
if (component.DeleteEmpty && component.Charges <= 0)
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Server.Damage.Systems
|
||||
public sealed class DamageOnToolInteractSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger= default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -33,7 +33,7 @@ namespace Content.Server.Damage.Systems
|
||||
var dmg = _damageableSystem.TryChangeDamage(args.Target, weldingDamage);
|
||||
|
||||
if (dmg != null)
|
||||
_logSystem.Add(LogType.Damaged,
|
||||
_adminLogger.Add(LogType.Damaged,
|
||||
$"{ToPrettyString(args.User):user} used {ToPrettyString(args.Used):used} as a welder to deal {dmg.Total:damage} damage to {ToPrettyString(args.Target):target}");
|
||||
|
||||
args.Handled = true;
|
||||
@@ -45,7 +45,7 @@ namespace Content.Server.Damage.Systems
|
||||
var dmg = _damageableSystem.TryChangeDamage(args.Target, damage);
|
||||
|
||||
if (dmg != null)
|
||||
_logSystem.Add(LogType.Damaged,
|
||||
_adminLogger.Add(LogType.Damaged,
|
||||
$"{ToPrettyString(args.User):user} used {ToPrettyString(args.Used):used} as a tool to deal {dmg.Total:damage} damage to {ToPrettyString(args.Target):target}");
|
||||
|
||||
args.Handled = true;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Server.Damage.Systems
|
||||
public sealed class DamageOtherOnHitSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger= default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -23,7 +23,7 @@ namespace Content.Server.Damage.Systems
|
||||
|
||||
// Log damage only for mobs. Useful for when people throw spears at each other, but also avoids log-spam when explosions send glass shards flying.
|
||||
if (dmg != null && HasComp<MobStateComponent>(args.Target))
|
||||
_logSystem.Add(LogType.ThrowHit, $"{ToPrettyString(args.Target):target} received {dmg.Total:damage} damage from collision");
|
||||
_adminLogger.Add(LogType.ThrowHit, $"{ToPrettyString(args.Target):target} received {dmg.Total:damage} damage from collision");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Content.Server.Electrocution
|
||||
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
||||
[Dependency] private readonly NodeGroupSystem _nodeGroupSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger= default!;
|
||||
[Dependency] private readonly TagSystem _tagSystem = default!;
|
||||
|
||||
private const string StatusEffectKey = "Electrocution";
|
||||
@@ -105,7 +105,7 @@ namespace Content.Server.Electrocution
|
||||
var actual = _damageableSystem.TryChangeDamage(finished.Electrocuting, damage);
|
||||
if (actual != null)
|
||||
{
|
||||
_logSystem.Add(LogType.Electrocution,
|
||||
_adminLogger.Add(LogType.Electrocution,
|
||||
$"{ToPrettyString(finished.Owner):entity} received {actual.Total:damage} powered electrocution damage");
|
||||
}
|
||||
}
|
||||
@@ -361,7 +361,7 @@ namespace Content.Server.Electrocution
|
||||
|
||||
if (actual != null)
|
||||
{
|
||||
_logSystem.Add(LogType.Electrocution,
|
||||
_adminLogger.Add(LogType.Electrocution,
|
||||
$"{ToPrettyString(statusEffects.Owner):entity} received {actual.Total:damage} powered electrocution damage");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Server.Emag
|
||||
public sealed class EmagSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly SharedAdminLogSystem _adminLog = default!;
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
|
||||
[Dependency] private readonly TagSystem _tagSystem = default!;
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace Content.Server.Emag
|
||||
if (emaggedEvent.Handled)
|
||||
{
|
||||
_popupSystem.PopupEntity(Loc.GetString("emag-success", ("target", args.Target)), args.User, Filter.Entities(args.User));
|
||||
_adminLog.Add(LogType.Emag, LogImpact.High, $"{ToPrettyString(args.User):player} emagged {ToPrettyString(args.Target.Value):target}");
|
||||
_adminLogger.Add(LogType.Emag, LogImpact.High, $"{ToPrettyString(args.User):player} emagged {ToPrettyString(args.Target.Value):target}");
|
||||
component.Charges--;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Administration.Managers;
|
||||
using Content.Server.Afk;
|
||||
using Content.Server.AI.Utility;
|
||||
@@ -81,6 +82,7 @@ namespace Content.Server.Entry
|
||||
logManager.GetSawmill("Storage").Level = LogLevel.Info;
|
||||
logManager.GetSawmill("db.ef").Level = LogLevel.Info;
|
||||
|
||||
IoCManager.Resolve<IAdminLogManager>().Initialize();
|
||||
IoCManager.Resolve<IConnectionManager>().Initialize();
|
||||
IoCManager.Resolve<IServerDbManager>().Init();
|
||||
IoCManager.Resolve<IServerPreferencesManager>().Init();
|
||||
|
||||
@@ -33,7 +33,7 @@ public sealed partial class ExplosionSystem : EntitySystem
|
||||
[Dependency] private readonly NodeGroupSystem _nodeGroupSystem = default!;
|
||||
[Dependency] private readonly CameraRecoilSystem _recoilSystem = default!;
|
||||
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logsSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly ThrowingSystem _throwingSystem = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
|
||||
|
||||
@@ -213,10 +213,10 @@ public sealed partial class ExplosionSystem : EntitySystem
|
||||
return;
|
||||
|
||||
if (user == null)
|
||||
_logsSystem.Add(LogType.Explosion, LogImpact.High,
|
||||
_adminLogger.Add(LogType.Explosion, LogImpact.High,
|
||||
$"{ToPrettyString(uid):entity} exploded at {pos:coordinates} with intensity {totalIntensity} slope {slope}");
|
||||
else
|
||||
_logsSystem.Add(LogType.Explosion, LogImpact.High,
|
||||
_adminLogger.Add(LogType.Explosion, LogImpact.High,
|
||||
$"{ToPrettyString(user.Value):user} caused {ToPrettyString(uid):entity} to explode at {pos:coordinates} with intensity {totalIntensity} slope {slope}");
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ public sealed partial class ExplosionSystem : EntitySystem
|
||||
}
|
||||
|
||||
if (addLog) // dont log if already created a separate, more detailed, log.
|
||||
_logsSystem.Add(LogType.Explosion, LogImpact.High, $"Explosion spawned at {epicenter:coordinates} with intensity {totalIntensity} slope {slope}");
|
||||
_adminLogger.Add(LogType.Explosion, LogImpact.High, $"Explosion spawned at {epicenter:coordinates} with intensity {totalIntensity} slope {slope}");
|
||||
|
||||
_explosionQueue.Enqueue(() => SpawnExplosion(epicenter, type, totalIntensity,
|
||||
slope, maxTileIntensity, tileBreakScale, maxTileBreak, canCreateVacuum));
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Content.Server.Explosion.EntitySystems
|
||||
[Dependency] private readonly FixtureSystem _fixtures = default!;
|
||||
[Dependency] private readonly FlashSystem _flashSystem = default!;
|
||||
[Dependency] private readonly SharedBroadphaseSystem _broadphase = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger= default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -106,12 +106,12 @@ namespace Content.Server.Explosion.EntitySystems
|
||||
|
||||
if (user != null)
|
||||
{
|
||||
_logSystem.Add(LogType.Trigger,
|
||||
_adminLogger.Add(LogType.Trigger,
|
||||
$"{ToPrettyString(user.Value):user} started a {delay} second timer trigger on entity {ToPrettyString(uid):timer}");
|
||||
}
|
||||
else
|
||||
{
|
||||
_logSystem.Add(LogType.Trigger,
|
||||
_adminLogger.Add(LogType.Trigger,
|
||||
$"{delay} second timer trigger started on entity {ToPrettyString(uid):timer}");
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ public sealed class SpillableSystem : EntitySystem
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger= default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -84,7 +84,7 @@ public sealed class SpillableSystem : EntitySystem
|
||||
|
||||
if (args.User != null)
|
||||
{
|
||||
_logSystem.Add(LogType.Landed,
|
||||
_adminLogger.Add(LogType.Landed,
|
||||
$"{ToPrettyString(uid):entity} spilled a solution {SolutionContainerSystem.ToPrettyString(solution):solution} on landing");
|
||||
}
|
||||
|
||||
|
||||
@@ -5,4 +5,10 @@
|
||||
/// </summary>
|
||||
public sealed class RoundStartingEvent : EntityEventArgs
|
||||
{
|
||||
public RoundStartingEvent(int id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public int Id { get; }
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace Content.Server.GameTicking
|
||||
return await _db.AddNewRound(server, playerIds);
|
||||
}).Result;
|
||||
|
||||
var startingEvent = new RoundStartingEvent();
|
||||
var startingEvent = new RoundStartingEvent(RoundId);
|
||||
RaiseLocalEvent(startingEvent);
|
||||
|
||||
List<IPlayerSession> readyPlayers;
|
||||
|
||||
@@ -179,9 +179,9 @@ namespace Content.Server.GameTicking
|
||||
_stationJobs.TryAssignJob(station, jobPrototype);
|
||||
|
||||
if (lateJoin)
|
||||
_adminLogSystem.Add(LogType.LateJoin, LogImpact.Medium, $"Player {player.Name} late joined as {character.Name:characterName} on station {Name(station):stationName} with {ToPrettyString(mob):entity} as a {job.Name:jobName}.");
|
||||
_adminLogger.Add(LogType.LateJoin, LogImpact.Medium, $"Player {player.Name} late joined as {character.Name:characterName} on station {Name(station):stationName} with {ToPrettyString(mob):entity} as a {job.Name:jobName}.");
|
||||
else
|
||||
_adminLogSystem.Add(LogType.RoundStartJoin, LogImpact.Medium, $"Player {player.Name} joined as {character.Name:characterName} on station {Name(station):stationName} with {ToPrettyString(mob):entity} as a {job.Name:jobName}.");
|
||||
_adminLogger.Add(LogType.RoundStartJoin, LogImpact.Medium, $"Player {player.Name} joined as {character.Name:characterName} on station {Name(station):stationName} with {ToPrettyString(mob):entity} as a {job.Name:jobName}.");
|
||||
|
||||
// Make sure they're aware of extended access.
|
||||
if (Comp<StationJobsComponent>(station).ExtendedAccess
|
||||
@@ -199,7 +199,7 @@ namespace Content.Server.GameTicking
|
||||
public void Respawn(IPlayerSession player)
|
||||
{
|
||||
player.ContentData()?.WipeMind();
|
||||
_adminLogSystem.Add(LogType.Respawn, LogImpact.Medium, $"Player {player} was respawned.");
|
||||
_adminLogger.Add(LogType.Respawn, LogImpact.Medium, $"Player {player} was respawned.");
|
||||
|
||||
if (LobbyEnabled)
|
||||
PlayerJoinLobby(player);
|
||||
|
||||
@@ -104,6 +104,7 @@ namespace Content.Server.GameTicking
|
||||
[Dependency] private readonly IWatchdogApi _watchdogApi = default!;
|
||||
[Dependency] private readonly IGameMapManager _gameMapManager = default!;
|
||||
[Dependency] private readonly IServerDbManager _db = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly ILogManager _logManager = default!;
|
||||
[Dependency] private readonly IConsoleHost _consoleHost = default!;
|
||||
#if EXCEPTION_TOLERANCE
|
||||
@@ -112,7 +113,6 @@ namespace Content.Server.GameTicking
|
||||
[Dependency] private readonly StationSystem _stationSystem = default!;
|
||||
[Dependency] private readonly StationSpawningSystem _stationSpawning = default!;
|
||||
[Dependency] private readonly StationJobsSystem _stationJobs = default!;
|
||||
[Dependency] private readonly AdminLogSystem _adminLogSystem = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageable = default!;
|
||||
[Dependency] private readonly GhostSystem _ghosts = default!;
|
||||
[Dependency] private readonly RoleBanManager _roleBanManager = default!;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Content.Server.Ghost.Roles
|
||||
{
|
||||
[Dependency] private readonly EuiManager _euiManager = default!;
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly AdminLogSystem _adminLogSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly FollowerSystem _followerSystem = default!;
|
||||
|
||||
private uint _nextRoleIdentifier;
|
||||
@@ -182,7 +182,7 @@ namespace Content.Server.Ghost.Roles
|
||||
if (!role.Take(player)) return;
|
||||
|
||||
if (player.AttachedEntity != null)
|
||||
_adminLogSystem.Add(LogType.GhostRoleTaken, LogImpact.Low, $"{player:player} took the {role.RoleName:roleName} ghost role {ToPrettyString(player.AttachedEntity.Value):entity}");
|
||||
_adminLogger.Add(LogType.GhostRoleTaken, LogImpact.Low, $"{player:player} took the {role.RoleName:roleName} ghost role {ToPrettyString(player.AttachedEntity.Value):entity}");
|
||||
|
||||
CloseEui(player);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Content.Server.Interaction
|
||||
{
|
||||
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
|
||||
[Dependency] private readonly PullingSystem _pullSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _adminLogSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
@@ -219,7 +219,7 @@ namespace Content.Server.Interaction
|
||||
|
||||
if (ev.Handled)
|
||||
{
|
||||
_adminLogSystem.Add(LogType.AttackArmedWide, LogImpact.Low, $"{ToPrettyString(user):user} wide attacked with {ToPrettyString(item.Value):used} at {coordinates}");
|
||||
_adminLogger.Add(LogType.AttackArmedWide, LogImpact.Low, $"{ToPrettyString(user):user} wide attacked with {ToPrettyString(item.Value):used} at {coordinates}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -232,12 +232,12 @@ namespace Content.Server.Interaction
|
||||
{
|
||||
if (target != null)
|
||||
{
|
||||
_adminLogSystem.Add(LogType.AttackArmedClick, LogImpact.Low,
|
||||
_adminLogger.Add(LogType.AttackArmedClick, LogImpact.Low,
|
||||
$"{ToPrettyString(user):user} attacked {ToPrettyString(target.Value):target} with {ToPrettyString(item.Value):used} at {coordinates}");
|
||||
}
|
||||
else
|
||||
{
|
||||
_adminLogSystem.Add(LogType.AttackArmedClick, LogImpact.Low,
|
||||
_adminLogger.Add(LogType.AttackArmedClick, LogImpact.Low,
|
||||
$"{ToPrettyString(user):user} attacked with {ToPrettyString(item.Value):used} at {coordinates}");
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ namespace Content.Server.Interaction
|
||||
var ev = new WideAttackEvent(user, user, coordinates);
|
||||
RaiseLocalEvent(user, ev, false);
|
||||
if (ev.Handled)
|
||||
_adminLogSystem.Add(LogType.AttackUnarmedWide, LogImpact.Low, $"{ToPrettyString(user):user} wide attacked at {coordinates}");
|
||||
_adminLogger.Add(LogType.AttackUnarmedWide, LogImpact.Low, $"{ToPrettyString(user):user} wide attacked at {coordinates}");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -270,12 +270,12 @@ namespace Content.Server.Interaction
|
||||
{
|
||||
if (target != null)
|
||||
{
|
||||
_adminLogSystem.Add(LogType.AttackUnarmedClick, LogImpact.Low,
|
||||
_adminLogger.Add(LogType.AttackUnarmedClick, LogImpact.Low,
|
||||
$"{ToPrettyString(user):user} attacked {ToPrettyString(target.Value):target} at {coordinates}");
|
||||
}
|
||||
else
|
||||
{
|
||||
_adminLogSystem.Add(LogType.AttackUnarmedClick, LogImpact.Low,
|
||||
_adminLogger.Add(LogType.AttackUnarmedClick, LogImpact.Low,
|
||||
$"{ToPrettyString(user):user} attacked at {coordinates}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Administration.Managers;
|
||||
using Content.Server.Administration.Notes;
|
||||
using Content.Server.Afk;
|
||||
@@ -20,6 +21,7 @@ using Content.Server.Objectives.Interfaces;
|
||||
using Content.Server.Preferences.Managers;
|
||||
using Content.Server.Voting.Managers;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Kitchen;
|
||||
using Content.Shared.Module;
|
||||
|
||||
@@ -54,6 +56,8 @@ namespace Content.Server.IoC
|
||||
IoCManager.Register<NetworkResourceManager>();
|
||||
IoCManager.Register<IAdminNotesManager, AdminNotesManager>();
|
||||
IoCManager.Register<GhostKickManager>();
|
||||
IoCManager.Register<ISharedAdminLogManager, AdminLogManager>();
|
||||
IoCManager.Register<IAdminLogManager, AdminLogManager>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
[Dependency] private readonly SharedAmbientSoundSystem _ambientSystem = default!;
|
||||
[Dependency] private readonly LightBulbSystem _bulbSystem = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger= default!;
|
||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||
[Dependency] private readonly SignalLinkerSystem _signalSystem = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||
@@ -111,7 +111,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
var damage = _damageableSystem.TryChangeDamage(userUid, light.Damage);
|
||||
|
||||
if (damage != null)
|
||||
_logSystem.Add(LogType.Damaged,
|
||||
_adminLogger.Add(LogType.Damaged,
|
||||
$"{ToPrettyString(args.User):user} burned their hand on {ToPrettyString(args.Target):target} and received {damage.Total:damage} damage");
|
||||
|
||||
SoundSystem.Play(Filter.Pvs(uid), light.BurnHandSound.GetSound(), uid);
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Content.Server.Medical;
|
||||
|
||||
public sealed class HealingSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly AdminLogSystem _logs = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageable = default!;
|
||||
[Dependency] private readonly BloodstreamSystem _bloodstreamSystem = default!;
|
||||
[Dependency] private readonly DoAfterSystem _doAfter = default!;
|
||||
@@ -59,9 +59,9 @@ public sealed class HealingSystem : EntitySystem
|
||||
_stacks.Use(args.Component.Owner, 1, stack);
|
||||
|
||||
if (uid != args.User)
|
||||
_logs.Add(LogType.Healed, $"{EntityManager.ToPrettyString(args.User):user} healed {EntityManager.ToPrettyString(uid):target} for {healed.Total:damage} damage");
|
||||
_adminLogger.Add(LogType.Healed, $"{EntityManager.ToPrettyString(args.User):user} healed {EntityManager.ToPrettyString(uid):target} for {healed.Total:damage} damage");
|
||||
else
|
||||
_logs.Add(LogType.Healed, $"{EntityManager.ToPrettyString(args.User):user} healed themselves for {healed.Total:damage} damage");
|
||||
_adminLogger.Add(LogType.Healed, $"{EntityManager.ToPrettyString(args.User):user} healed themselves for {healed.Total:damage} damage");
|
||||
|
||||
if (args.Component.HealingEndSound != null)
|
||||
{
|
||||
|
||||
@@ -196,10 +196,11 @@ namespace Content.Server.Nutrition.Components
|
||||
// _trySound(calculatedThreshold);
|
||||
if (calculatedHungerThreshold != _currentHungerThreshold)
|
||||
{
|
||||
var logManager = IoCManager.Resolve<IAdminLogManager>();
|
||||
if (_currentHungerThreshold == HungerThreshold.Dead)
|
||||
EntitySystem.Get<AdminLogSystem>().Add(LogType.Hunger, $"{_entMan.ToPrettyString(Owner):entity} has stopped starving");
|
||||
logManager.Add(LogType.Hunger, $"{_entMan.ToPrettyString(Owner):entity} has stopped starving");
|
||||
else if (calculatedHungerThreshold == HungerThreshold.Dead)
|
||||
EntitySystem.Get<AdminLogSystem>().Add(LogType.Hunger, $"{_entMan.ToPrettyString(Owner):entity} has started starving");
|
||||
logManager.Add(LogType.Hunger, $"{_entMan.ToPrettyString(Owner):entity} has started starving");
|
||||
|
||||
_currentHungerThreshold = calculatedHungerThreshold;
|
||||
HungerThresholdEffect();
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
[Dependency] private readonly BodySystem _bodySystem = default!;
|
||||
[Dependency] private readonly StomachSystem _stomachSystem = default!;
|
||||
[Dependency] private readonly DoAfterSystem _doAfterSystem = default!;
|
||||
[Dependency] private readonly SharedAdminLogSystem _logSystem = default!;
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly SpillableSystem _spillableSystem = default!;
|
||||
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
||||
|
||||
@@ -227,7 +227,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
user, Filter.Entities(target));
|
||||
|
||||
// logging
|
||||
_logSystem.Add(LogType.ForceFeed, LogImpact.Medium, $"{ToPrettyString(user):user} is forcing {ToPrettyString(target):target} to drink {ToPrettyString(drink.Owner):drink} {SolutionContainerSystem.ToPrettyString(drinkSolution)}");
|
||||
_adminLogger.Add(LogType.ForceFeed, LogImpact.Medium, $"{ToPrettyString(user):user} is forcing {ToPrettyString(target):target} to drink {ToPrettyString(drink.Owner):drink} {SolutionContainerSystem.ToPrettyString(drinkSolution)}");
|
||||
}
|
||||
|
||||
drink.CancelToken = new CancellationTokenSource();
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly UtensilSystem _utensilSystem = default!;
|
||||
[Dependency] private readonly DoAfterSystem _doAfterSystem = default!;
|
||||
[Dependency] private readonly SharedAdminLogSystem _logSystem = default!;
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly InventorySystem _inventorySystem = default!;
|
||||
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||
@@ -121,7 +121,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
user, Filter.Entities(target));
|
||||
|
||||
// logging
|
||||
_logSystem.Add(LogType.ForceFeed, LogImpact.Medium, $"{ToPrettyString(user):user} is forcing {ToPrettyString(target):target} to eat {ToPrettyString(food.Owner):food} {SolutionContainerSystem.ToPrettyString(foodSolution)}");
|
||||
_adminLogger.Add(LogType.ForceFeed, LogImpact.Medium, $"{ToPrettyString(user):user} is forcing {ToPrettyString(target):target} to eat {ToPrettyString(food.Owner):food} {SolutionContainerSystem.ToPrettyString(foodSolution)}");
|
||||
}
|
||||
|
||||
var moveBreak = user != target;
|
||||
@@ -290,9 +290,9 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
|
||||
// logging
|
||||
if (user == null)
|
||||
_logSystem.Add(LogType.ForceFeed, $"{ToPrettyString(uid):food} {SolutionContainerSystem.ToPrettyString(foodSolution):solution} was thrown into the mouth of {ToPrettyString(target):target}");
|
||||
_adminLogger.Add(LogType.ForceFeed, $"{ToPrettyString(uid):food} {SolutionContainerSystem.ToPrettyString(foodSolution):solution} was thrown into the mouth of {ToPrettyString(target):target}");
|
||||
else
|
||||
_logSystem.Add(LogType.ForceFeed, $"{ToPrettyString(user.Value):user} threw {ToPrettyString(uid):food} {SolutionContainerSystem.ToPrettyString(foodSolution):solution} into the mouth of {ToPrettyString(target):target}");
|
||||
_adminLogger.Add(LogType.ForceFeed, $"{ToPrettyString(user.Value):user} threw {ToPrettyString(uid):food} {SolutionContainerSystem.ToPrettyString(foodSolution):solution} into the mouth of {ToPrettyString(target):target}");
|
||||
|
||||
var filter = user == null ? Filter.Entities(target) : Filter.Entities(target, user.Value);
|
||||
_popupSystem.PopupEntity(Loc.GetString(food.EatMessage, ("food", food.Owner)), target, filter);
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly AlertsSystem _alerts = default!;
|
||||
[Dependency] private readonly AdminLogSystem _adminlog = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly DamageableSystem _damage = default!;
|
||||
[Dependency] private readonly MovementSpeedModifierSystem _movement = default!;
|
||||
|
||||
@@ -136,9 +136,9 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
if (calculatedThirstThreshold != component.CurrentThirstThreshold)
|
||||
{
|
||||
if (component.CurrentThirstThreshold == ThirstThreshold.Dead)
|
||||
_adminlog.Add(LogType.Thirst, $"{EntityManager.ToPrettyString(component.Owner):entity} has stopped taking dehydration damage");
|
||||
_adminLogger.Add(LogType.Thirst, $"{EntityManager.ToPrettyString(component.Owner):entity} has stopped taking dehydration damage");
|
||||
else if (calculatedThirstThreshold == ThirstThreshold.Dead)
|
||||
_adminlog.Add(LogType.Thirst, $"{EntityManager.ToPrettyString(component.Owner):entity} has started taking dehydration damage");
|
||||
_adminLogger.Add(LogType.Thirst, $"{EntityManager.ToPrettyString(component.Owner):entity} has started taking dehydration damage");
|
||||
|
||||
component.CurrentThirstThreshold = calculatedThirstThreshold;
|
||||
UpdateEffects(component);
|
||||
|
||||
@@ -15,7 +15,7 @@ public sealed class PayloadSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly TagSystem _tagSystem = default!;
|
||||
[Dependency] private readonly SolutionContainerSystem _solutionSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger= default!;
|
||||
[Dependency] private readonly IComponentFactory _componentFactory = default!;
|
||||
[Dependency] private readonly ISerializationManager _serializationManager = default!;
|
||||
|
||||
@@ -123,7 +123,7 @@ public sealed class PayloadSystem : EntitySystem
|
||||
var solStringA = SolutionContainerSystem.ToPrettyString(solutionA);
|
||||
var solStringB = SolutionContainerSystem.ToPrettyString(solutionB);
|
||||
|
||||
_logSystem.Add(LogType.ChemicalReaction,
|
||||
_adminLogger.Add(LogType.ChemicalReaction,
|
||||
$"Chemical bomb payload {ToPrettyString(uid):payload} at {Transform(uid).MapPosition:location} is combining two solutions: {solStringA:solutionA} and {solStringB:solutionB}");
|
||||
|
||||
solutionA.MaxVolume += solutionB.MaxVolume;
|
||||
|
||||
@@ -17,7 +17,7 @@ public sealed class PowerCellSystem : SharedPowerCellSystem
|
||||
{
|
||||
[Dependency] private readonly SolutionContainerSystem _solutionsSystem = default!;
|
||||
[Dependency] private readonly ExplosionSystem _explosionSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger= default!;
|
||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
@@ -82,7 +82,7 @@ public sealed class PowerCellSystem : SharedPowerCellSystem
|
||||
|
||||
private void Explode(EntityUid uid, BatteryComponent? battery = null)
|
||||
{
|
||||
_logSystem.Add(LogType.Explosion, LogImpact.High, $"Sabotaged power cell {ToPrettyString(uid)} is exploding");
|
||||
_adminLogger.Add(LogType.Explosion, LogImpact.High, $"Sabotaged power cell {ToPrettyString(uid)} is exploding");
|
||||
|
||||
if (!Resolve(uid, ref battery))
|
||||
return;
|
||||
@@ -112,7 +112,7 @@ public sealed class PowerCellSystem : SharedPowerCellSystem
|
||||
|
||||
if (component.IsRigged)
|
||||
{
|
||||
_logSystem.Add(LogType.Explosion, LogImpact.Medium, $"Power cell {ToPrettyString(uid)} has been rigged up to explode when used.");
|
||||
_adminLogger.Add(LogType.Explosion, LogImpact.Medium, $"Power cell {ToPrettyString(uid)} has been rigged up to explode when used.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Content.Server.Projectiles
|
||||
public sealed class ProjectileSystem : SharedProjectileSystem
|
||||
{
|
||||
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _adminLogSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly CameraRecoilSystem _cameraRecoil = default!;
|
||||
[Dependency] private readonly GunSystem _guns = default!;
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Content.Server.Projectiles
|
||||
|
||||
if (modifiedDamage is not null && EntityManager.EntityExists(component.Shooter))
|
||||
{
|
||||
_adminLogSystem.Add(LogType.BulletHit,
|
||||
_adminLogger.Add(LogType.BulletHit,
|
||||
HasComp<ActorComponent>(otherEntity) ? LogImpact.Extreme : LogImpact.High,
|
||||
$"Projectile {ToPrettyString(component.Owner):projectile} shot by {ToPrettyString(component.Shooter):user} hit {ToPrettyString(otherEntity):target} and dealt {modifiedDamage.Total:damage} damage");
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Content.Server.RCD.Systems
|
||||
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
|
||||
[Dependency] private readonly AdminLogSystem _logs = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly DoAfterSystem _doAfterSystem = default!;
|
||||
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
||||
[Dependency] private readonly PopupSystem _popup = default!;
|
||||
@@ -114,20 +114,20 @@ namespace Content.Server.RCD.Systems
|
||||
//Floor mode just needs the tile to be a space tile (subFloor)
|
||||
case RcdMode.Floors:
|
||||
mapGrid.SetTile(snapPos, new Tile(_tileDefinitionManager["floor_steel"].TileId));
|
||||
_logs.Add(LogType.RCD, LogImpact.High, $"{ToPrettyString(args.User):user} used RCD to set grid: {tile.GridIndex} {snapPos} to floor_steel");
|
||||
_adminLogger.Add(LogType.RCD, LogImpact.High, $"{ToPrettyString(args.User):user} used RCD to set grid: {tile.GridIndex} {snapPos} to floor_steel");
|
||||
break;
|
||||
//We don't want to place a space tile on something that's already a space tile. Let's do the inverse of the last check.
|
||||
case RcdMode.Deconstruct:
|
||||
if (!tile.IsBlockedTurf(true)) //Delete the turf
|
||||
{
|
||||
mapGrid.SetTile(snapPos, Tile.Empty);
|
||||
_logs.Add(LogType.RCD, LogImpact.High, $"{ToPrettyString(args.User):user} used RCD to set grid: {tile.GridIndex} tile: {snapPos} to space");
|
||||
_adminLogger.Add(LogType.RCD, LogImpact.High, $"{ToPrettyString(args.User):user} used RCD to set grid: {tile.GridIndex} tile: {snapPos} to space");
|
||||
}
|
||||
else //Delete what the user targeted
|
||||
{
|
||||
if (args.Target is {Valid: true} target)
|
||||
{
|
||||
_logs.Add(LogType.RCD, LogImpact.High, $"{ToPrettyString(args.User):user} used RCD to delete {ToPrettyString(target):target}");
|
||||
_adminLogger.Add(LogType.RCD, LogImpact.High, $"{ToPrettyString(args.User):user} used RCD to delete {ToPrettyString(target):target}");
|
||||
QueueDel(target);
|
||||
}
|
||||
}
|
||||
@@ -137,12 +137,12 @@ namespace Content.Server.RCD.Systems
|
||||
case RcdMode.Walls:
|
||||
var ent = EntityManager.SpawnEntity("WallSolid", mapGrid.GridTileToLocal(snapPos));
|
||||
Transform(ent).LocalRotation = Angle.Zero; // Walls always need to point south.
|
||||
_logs.Add(LogType.RCD, LogImpact.High, $"{ToPrettyString(args.User):user} used RCD to spawn {ToPrettyString(ent)} at {snapPos} on grid {mapGrid.Index}");
|
||||
_adminLogger.Add(LogType.RCD, LogImpact.High, $"{ToPrettyString(args.User):user} used RCD to spawn {ToPrettyString(ent)} at {snapPos} on grid {mapGrid.Index}");
|
||||
break;
|
||||
case RcdMode.Airlock:
|
||||
var airlock = EntityManager.SpawnEntity("Airlock", mapGrid.GridTileToLocal(snapPos));
|
||||
Transform(airlock).LocalRotation = Transform(rcd.Owner).LocalRotation; //Now apply icon smoothing.
|
||||
_logs.Add(LogType.RCD, LogImpact.High, $"{ToPrettyString(args.User):user} used RCD to spawn {ToPrettyString(airlock)} at {snapPos} on grid {mapGrid.Index}");
|
||||
_adminLogger.Add(LogType.RCD, LogImpact.High, $"{ToPrettyString(args.User):user} used RCD to spawn {ToPrettyString(airlock)} at {snapPos} on grid {mapGrid.Index}");
|
||||
break;
|
||||
default:
|
||||
args.Handled = true;
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Server.Repairable
|
||||
{
|
||||
[Dependency] private readonly ToolSystem _toolSystem = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger= default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -31,13 +31,13 @@ namespace Content.Server.Repairable
|
||||
if (component.Damage != null)
|
||||
{
|
||||
var damageChanged = _damageableSystem.TryChangeDamage(uid, component.Damage, true, false);
|
||||
_logSystem.Add(LogType.Healed, $"{ToPrettyString(args.User):user} repaired {ToPrettyString(uid):target} by {damageChanged?.Total}");
|
||||
_adminLogger.Add(LogType.Healed, $"{ToPrettyString(args.User):user} repaired {ToPrettyString(uid):target} by {damageChanged?.Total}");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Repair all damage
|
||||
_damageableSystem.SetAllDamage(damageable, 0);
|
||||
_logSystem.Add(LogType.Healed, $"{ToPrettyString(args.User):user} repaired {ToPrettyString(uid):target} back to full health");
|
||||
_adminLogger.Add(LogType.Healed, $"{ToPrettyString(args.User):user} repaired {ToPrettyString(uid):target} back to full health");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Content.Server.RoundEnd
|
||||
[Dependency] private readonly IChatManager _chatManager = default!;
|
||||
[Dependency] private readonly GameTicker _gameTicker = default!;
|
||||
|
||||
[Dependency] private readonly AdminLogSystem _adminLog = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
|
||||
|
||||
public TimeSpan DefaultCooldownDuration { get; set; } = TimeSpan.FromSeconds(30);
|
||||
@@ -73,11 +73,11 @@ namespace Content.Server.RoundEnd
|
||||
|
||||
if (requester != null)
|
||||
{
|
||||
_adminLog.Add(LogType.ShuttleCalled, LogImpact.High, $"Shuttle called by {ToPrettyString(requester.Value):user}");
|
||||
_adminLogger.Add(LogType.ShuttleCalled, LogImpact.High, $"Shuttle called by {ToPrettyString(requester.Value):user}");
|
||||
}
|
||||
else
|
||||
{
|
||||
_adminLog.Add(LogType.ShuttleCalled, LogImpact.High, $"Shuttle called");
|
||||
_adminLogger.Add(LogType.ShuttleCalled, LogImpact.High, $"Shuttle called");
|
||||
}
|
||||
|
||||
_chatManager.DispatchStationAnnouncement(Loc.GetString("round-end-system-shuttle-called-announcement",("minutes", countdownTime.Minutes)), Loc.GetString("Station"), false, Color.Gold);
|
||||
@@ -102,11 +102,11 @@ namespace Content.Server.RoundEnd
|
||||
|
||||
if (requester != null)
|
||||
{
|
||||
_adminLog.Add(LogType.ShuttleRecalled, LogImpact.High, $"Shuttle recalled by {ToPrettyString(requester.Value):user}");
|
||||
_adminLogger.Add(LogType.ShuttleRecalled, LogImpact.High, $"Shuttle recalled by {ToPrettyString(requester.Value):user}");
|
||||
}
|
||||
else
|
||||
{
|
||||
_adminLog.Add(LogType.ShuttleRecalled, LogImpact.High, $"Shuttle recalled");
|
||||
_adminLogger.Add(LogType.ShuttleRecalled, LogImpact.High, $"Shuttle recalled");
|
||||
}
|
||||
|
||||
_chatManager.DispatchStationAnnouncement(Loc.GetString("round-end-system-shuttle-recalled-announcement"),
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Content.Server.Singularity.EntitySystems
|
||||
public sealed class EmitterSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly AdminLogSystem _adminLog = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -56,7 +56,7 @@ namespace Content.Server.Singularity.EntitySystems
|
||||
component.Owner.PopupMessage(args.User, Loc.GetString("comp-emitter-turned-off", ("target", component.Owner)));
|
||||
}
|
||||
|
||||
_adminLog.Add(LogType.Emitter,
|
||||
_adminLogger.Add(LogType.Emitter,
|
||||
component.IsOn ? LogImpact.Medium : LogImpact.High,
|
||||
$"{ToPrettyString(args.User):player} toggled {ToPrettyString(uid):emitter}");
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace Content.Server.StationEvents.Events
|
||||
Occurrences += 1;
|
||||
LastRun = EntitySystem.Get<GameTicker>().RoundDuration();
|
||||
|
||||
EntitySystem.Get<AdminLogSystem>()
|
||||
IoCManager.Resolve<IAdminLogManager>()
|
||||
.Add(LogType.EventStarted, LogImpact.High, $"Event startup: {Name}");
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace Content.Server.StationEvents.Events
|
||||
/// </summary>
|
||||
public virtual void Announce()
|
||||
{
|
||||
EntitySystem.Get<AdminLogSystem>()
|
||||
IoCManager.Resolve<IAdminLogManager>()
|
||||
.Add(LogType.EventAnnounced, $"Event announce: {Name}");
|
||||
|
||||
if (StartAnnouncement != null)
|
||||
@@ -158,7 +158,7 @@ namespace Content.Server.StationEvents.Events
|
||||
/// </summary>
|
||||
public virtual void Shutdown()
|
||||
{
|
||||
EntitySystem.Get<AdminLogSystem>()
|
||||
IoCManager.Resolve<IAdminLogManager>()
|
||||
.Add(LogType.EventStopped, $"Event shutdown: {Name}");
|
||||
|
||||
if (EndAnnouncement != null)
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Content.Server.StationEvents
|
||||
[Dependency] private readonly GameTicker _gameTicker = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
[Dependency] private readonly AdminLogSystem _adminLog = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
|
||||
public StationEvent? CurrentEvent { get; private set; }
|
||||
public IReadOnlyCollection<StationEvent> StationEvents => _stationEvents;
|
||||
@@ -72,7 +72,7 @@ namespace Content.Server.StationEvents
|
||||
/// <returns></returns>
|
||||
public string RunEvent(string name)
|
||||
{
|
||||
_adminLog.Add(LogType.EventRan, LogImpact.High, $"Event run: {name}");
|
||||
_adminLogger.Add(LogType.EventRan, LogImpact.High, $"Event run: {name}");
|
||||
|
||||
// Could use a dictionary but it's such a minor thing, eh.
|
||||
// Wasn't sure on whether to localize this given it's a command
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Content.Server.Stunnable
|
||||
public sealed class StunSystem : SharedStunSystem
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly AdminLogSystem _adminLogSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -42,7 +42,7 @@ namespace Content.Server.Stunnable
|
||||
source.PopupMessageOtherClients(Loc.GetString("stunned-component-disarm-success-others", ("source", Name(source)), ("target", Name(target))));
|
||||
source.PopupMessageCursor(Loc.GetString("stunned-component-disarm-success", ("target", Name(target))));
|
||||
|
||||
_adminLogSystem.Add(LogType.DisarmedKnockdown, LogImpact.Medium, $"{ToPrettyString(args.Source):user} knocked down {ToPrettyString(args.Target):target}");
|
||||
_adminLogger.Add(LogType.DisarmedKnockdown, LogImpact.Medium, $"{ToPrettyString(args.Source):user} knocked down {ToPrettyString(args.Target):target}");
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Content.Server.Temperature.Systems
|
||||
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
||||
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
||||
[Dependency] private readonly AlertsSystem _alertsSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger= default!;
|
||||
|
||||
/// <summary>
|
||||
/// All the components that will have their damage updated at the end of the tick.
|
||||
@@ -163,7 +163,7 @@ namespace Content.Server.Temperature.Systems
|
||||
{
|
||||
if (!temperature.TakingDamage)
|
||||
{
|
||||
_logSystem.Add(LogType.Temperature, $"{ToPrettyString(temperature.Owner):entity} started taking high temperature damage");
|
||||
_adminLogger.Add(LogType.Temperature, $"{ToPrettyString(temperature.Owner):entity} started taking high temperature damage");
|
||||
temperature.TakingDamage = true;
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ namespace Content.Server.Temperature.Systems
|
||||
{
|
||||
if (!temperature.TakingDamage)
|
||||
{
|
||||
_logSystem.Add(LogType.Temperature, $"{ToPrettyString(temperature.Owner):entity} started taking low temperature damage");
|
||||
_adminLogger.Add(LogType.Temperature, $"{ToPrettyString(temperature.Owner):entity} started taking low temperature damage");
|
||||
temperature.TakingDamage = true;
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace Content.Server.Temperature.Systems
|
||||
}
|
||||
else if (temperature.TakingDamage)
|
||||
{
|
||||
_logSystem.Add(LogType.Temperature, $"{ToPrettyString(temperature.Owner):entity} stopped taking temperature damage");
|
||||
_adminLogger.Add(LogType.Temperature, $"{ToPrettyString(temperature.Owner):entity} stopped taking temperature damage");
|
||||
temperature.TakingDamage = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Content.Server.Verbs
|
||||
{
|
||||
public sealed class VerbSystem : SharedVerbSystem
|
||||
{
|
||||
[Dependency] private readonly SharedAdminLogSystem _logSystem = default!;
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly IAdminManager _adminMgr = default!;
|
||||
|
||||
@@ -118,12 +118,12 @@ namespace Content.Server.Verbs
|
||||
|
||||
if (holding == null)
|
||||
{
|
||||
_logSystem.Add(LogType.Verb, verb.Impact,
|
||||
_adminLogger.Add(LogType.Verb, verb.Impact,
|
||||
$"{ToPrettyString(user):user} {executionText} the [{verbText:verb}] verb targeting {ToPrettyString(target):target}");
|
||||
}
|
||||
else
|
||||
{
|
||||
_logSystem.Add(LogType.Verb, verb.Impact,
|
||||
_adminLogger.Add(LogType.Verb, verb.Impact,
|
||||
$"{ToPrettyString(user):user} {executionText} the [{verbText:verb}] verb targeting {ToPrettyString(target):target} while holding {ToPrettyString(holding.Value):held}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Content.Server.Weapon.Melee
|
||||
[Dependency] private readonly IPrototypeManager _protoManager = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
||||
[Dependency] private readonly SolutionContainerSystem _solutionsSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logSystem = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly BloodstreamSystem _bloodstreamSystem = default!;
|
||||
|
||||
public const float DamagePitchVariation = 0.15f;
|
||||
@@ -100,10 +100,10 @@ namespace Content.Server.Weapon.Melee
|
||||
if (damageResult != null)
|
||||
{
|
||||
if (args.Used == args.User)
|
||||
_logSystem.Add(LogType.MeleeHit,
|
||||
_adminLogger.Add(LogType.MeleeHit,
|
||||
$"{ToPrettyString(args.User):user} melee attacked {ToPrettyString(args.Target.Value):target} using their hands and dealt {damageResult.Total:damage} damage");
|
||||
else
|
||||
_logSystem.Add(LogType.MeleeHit,
|
||||
_adminLogger.Add(LogType.MeleeHit,
|
||||
$"{ToPrettyString(args.User):user} melee attacked {ToPrettyString(args.Target.Value):target} using {ToPrettyString(args.Used):used} and dealt {damageResult.Total:damage} damage");
|
||||
}
|
||||
|
||||
@@ -181,10 +181,10 @@ namespace Content.Server.Weapon.Melee
|
||||
if (damageResult != null)
|
||||
{
|
||||
if (args.Used == args.User)
|
||||
_logSystem.Add(LogType.MeleeHit,
|
||||
_adminLogger.Add(LogType.MeleeHit,
|
||||
$"{ToPrettyString(args.User):user} melee attacked {ToPrettyString(entity):target} using their hands and dealt {damageResult.Total:damage} damage");
|
||||
else
|
||||
_logSystem.Add(LogType.MeleeHit,
|
||||
_adminLogger.Add(LogType.MeleeHit,
|
||||
$"{ToPrettyString(args.User):user} melee attacked {ToPrettyString(entity):target} using {ToPrettyString(args.Used):used} and dealt {damageResult.Total:damage} damage");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ public sealed partial class GunSystem
|
||||
hitscan.FireEffects(shooter, distance, angle, result.HitEntity);
|
||||
var modifiedDamage = _damageable.TryChangeDamage(result.HitEntity, hitscan.Damage);
|
||||
if (modifiedDamage != null)
|
||||
_logs.Add(LogType.HitScanHit,
|
||||
_adminLogger.Add(LogType.HitScanHit,
|
||||
$"{EntityManager.ToPrettyString(shooter):user} hit {EntityManager.ToPrettyString(result.HitEntity):target} using {EntityManager.ToPrettyString(hitscan.Owner):used} and dealt {modifiedDamage.Total:damage} damage");
|
||||
|
||||
PlaySound(rayCastResults[0].HitEntity, modifiedDamage, hitscan.SoundHit, hitscan.ForceSound);
|
||||
|
||||
@@ -35,7 +35,7 @@ public sealed partial class GunSystem : EntitySystem
|
||||
[Dependency] private readonly IPrototypeManager _protoManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly ActionBlockerSystem _blocker = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logs = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly AtmosphereSystem _atmos = default!;
|
||||
[Dependency] private readonly CameraRecoilSystem _recoil = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageable = default!;
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Content.Shared.Actions;
|
||||
|
||||
public abstract class SharedActionsSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedAdminLogSystem _logSystem = default!;
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
||||
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||
@@ -113,7 +113,7 @@ public abstract class SharedActionsSystem : EntitySystem
|
||||
// Does the user actually have the requested action?
|
||||
if (!component.Actions.TryGetValue(ev.Action, out var act))
|
||||
{
|
||||
_logSystem.Add(LogType.Action,
|
||||
_adminLogger.Add(LogType.Action,
|
||||
$"{ToPrettyString(user):user} attempted to perform an action that they do not have: {ev.Action.Name}.");
|
||||
return;
|
||||
}
|
||||
@@ -146,10 +146,10 @@ public abstract class SharedActionsSystem : EntitySystem
|
||||
return;
|
||||
|
||||
if (act.Provider == null)
|
||||
_logSystem.Add(LogType.Action,
|
||||
_adminLogger.Add(LogType.Action,
|
||||
$"{ToPrettyString(user):user} is performing the {name:action} action targeted at {ToPrettyString(entityTarget):target}.");
|
||||
else
|
||||
_logSystem.Add(LogType.Action,
|
||||
_adminLogger.Add(LogType.Action,
|
||||
$"{ToPrettyString(user):user} is performing the {name:action} action (provided by {ToPrettyString(act.Provider.Value):provider}) targeted at {ToPrettyString(entityTarget):target}.");
|
||||
|
||||
if (entityAction.Event != null)
|
||||
@@ -174,10 +174,10 @@ public abstract class SharedActionsSystem : EntitySystem
|
||||
return;
|
||||
|
||||
if (act.Provider == null)
|
||||
_logSystem.Add(LogType.Action,
|
||||
_adminLogger.Add(LogType.Action,
|
||||
$"{ToPrettyString(user):user} is performing the {name:action} action targeted at {mapTarget:target}.");
|
||||
else
|
||||
_logSystem.Add(LogType.Action,
|
||||
_adminLogger.Add(LogType.Action,
|
||||
$"{ToPrettyString(user):user} is performing the {name:action} action (provided by {ToPrettyString(act.Provider.Value):provider}) targeted at {mapTarget:target}.");
|
||||
|
||||
if (worldAction.Event != null)
|
||||
@@ -194,10 +194,10 @@ public abstract class SharedActionsSystem : EntitySystem
|
||||
return;
|
||||
|
||||
if (act.Provider == null)
|
||||
_logSystem.Add(LogType.Action,
|
||||
_adminLogger.Add(LogType.Action,
|
||||
$"{ToPrettyString(user):user} is performing the {name:action} action.");
|
||||
else
|
||||
_logSystem.Add(LogType.Action,
|
||||
_adminLogger.Add(LogType.Action,
|
||||
$"{ToPrettyString(user):user} is performing the {name:action} action provided by {ToPrettyString(act.Provider.Value):provider}.");
|
||||
|
||||
performEvent = instantAction.Event;
|
||||
|
||||
10
Content.Shared/Administration/Logs/ISharedAdminLogManager.cs
Normal file
10
Content.Shared/Administration/Logs/ISharedAdminLogManager.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using Content.Shared.Database;
|
||||
|
||||
namespace Content.Shared.Administration.Logs;
|
||||
|
||||
public interface ISharedAdminLogManager
|
||||
{
|
||||
void Add(LogType type, LogImpact impact, ref LogStringHandler handler);
|
||||
|
||||
void Add(LogType type, ref LogStringHandler handler);
|
||||
}
|
||||
17
Content.Shared/Administration/Logs/SharedAdminLogManager.cs
Normal file
17
Content.Shared/Administration/Logs/SharedAdminLogManager.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Content.Shared.Database;
|
||||
|
||||
namespace Content.Shared.Administration.Logs;
|
||||
|
||||
[Virtual]
|
||||
public class SharedAdminLogManager : ISharedAdminLogManager
|
||||
{
|
||||
public virtual void Add(LogType type, LogImpact impact, ref LogStringHandler handler)
|
||||
{
|
||||
// noop
|
||||
}
|
||||
|
||||
public virtual void Add(LogType type, ref LogStringHandler handler)
|
||||
{
|
||||
// noop
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ namespace Content.Shared.Chemistry.Reaction
|
||||
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] protected readonly SharedAdminLogSystem _logSystem = default!;
|
||||
[Dependency] protected readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly IGamePrototypeLoadManager _gamePrototypeLoadManager = default!;
|
||||
|
||||
/// <summary>
|
||||
@@ -202,7 +202,7 @@ namespace Content.Shared.Chemistry.Reaction
|
||||
if (effect.ShouldLog)
|
||||
{
|
||||
var entity = args.SolutionEntity;
|
||||
_logSystem.Add(LogType.ReagentEffect, effect.LogImpact,
|
||||
_adminLogger.Add(LogType.ReagentEffect, effect.LogImpact,
|
||||
$"Reaction effect {effect.GetType().Name:effect} of reaction ${reaction.ID:reaction} applied on entity {ToPrettyString(entity):entity} at {Transform(entity).Coordinates:coordinates}");
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Content.Shared.Chemistry
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||
[Dependency] private readonly SharedAdminLogSystem _logSystem = default!;
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
|
||||
public void ReactionEntity(EntityUid uid, ReactionMethod method, Solution solution)
|
||||
{
|
||||
@@ -63,7 +63,7 @@ namespace Content.Shared.Chemistry
|
||||
if (effect.ShouldLog)
|
||||
{
|
||||
var entity = args.SolutionEntity;
|
||||
_logSystem.Add(LogType.ReagentEffect, effect.LogImpact,
|
||||
_adminLogger.Add(LogType.ReagentEffect, effect.LogImpact,
|
||||
$"Reactive effect {effect.GetType().Name:effect} of reagent {reagent.ID:reagent} with method {method} applied on entity {ToPrettyString(entity):entity} at {Transform(entity).Coordinates:coordinates}");
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace Content.Shared.Chemistry
|
||||
if (effect.ShouldLog)
|
||||
{
|
||||
var entity = args.SolutionEntity;
|
||||
_logSystem.Add(LogType.ReagentEffect, effect.LogImpact,
|
||||
_adminLogger.Add(LogType.ReagentEffect, effect.LogImpact,
|
||||
$"Reactive effect {effect.GetType().Name:effect} of {ToPrettyString(entity):entity} using reagent {reagent.ID:reagent} with method {method} at {Transform(entity).Coordinates:coordinates}");
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
_adminLogSystem.Add(LogType.Pickup, LogImpact.Low, $"{ToPrettyString(uid):user} picked up {ToPrettyString(entity):entity}");
|
||||
_adminLogger.Add(LogType.Pickup, LogImpact.Low, $"{ToPrettyString(uid):user} picked up {ToPrettyString(entity):entity}");
|
||||
|
||||
Dirty(hands);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Shared.Hands.EntitySystems;
|
||||
|
||||
public abstract partial class SharedHandsSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedAdminLogSystem _adminLogSystem = default!;
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
||||
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Content.Shared.Interaction
|
||||
[Dependency] private readonly SharedPhysicsSystem _sharedBroadphaseSystem = default!;
|
||||
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
|
||||
[Dependency] private readonly SharedVerbSystem _verbSystem = default!;
|
||||
[Dependency] private readonly SharedAdminLogSystem _adminLogSystem = default!;
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly RotateToFaceSystem _rotateToFaceSystem = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly UseDelaySystem _useDelay = default!;
|
||||
@@ -281,7 +281,7 @@ namespace Content.Shared.Interaction
|
||||
// all interactions should only happen when in range / unobstructed, so no range check is needed
|
||||
var message = new InteractHandEvent(user, target);
|
||||
RaiseLocalEvent(target, message);
|
||||
_adminLogSystem.Add(LogType.InteractHand, LogImpact.Low, $"{ToPrettyString(user):user} interacted with {ToPrettyString(target):target}");
|
||||
_adminLogger.Add(LogType.InteractHand, LogImpact.Low, $"{ToPrettyString(user):user} interacted with {ToPrettyString(target):target}");
|
||||
if (message.Handled)
|
||||
return;
|
||||
|
||||
@@ -721,7 +721,7 @@ namespace Content.Shared.Interaction
|
||||
if (activateMsg.Handled)
|
||||
{
|
||||
_useDelay.BeginDelay(used, delayComponent);
|
||||
_adminLogSystem.Add(LogType.InteractActivate, LogImpact.Low, $"{ToPrettyString(user):user} activated {ToPrettyString(used):used}");
|
||||
_adminLogger.Add(LogType.InteractActivate, LogImpact.Low, $"{ToPrettyString(user):user} activated {ToPrettyString(used):used}");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -733,7 +733,7 @@ namespace Content.Shared.Interaction
|
||||
|
||||
// No way to check success.
|
||||
_useDelay.BeginDelay(used, delayComponent);
|
||||
_adminLogSystem.Add(LogType.InteractActivate, LogImpact.Low, $"{ToPrettyString(user):user} activated {ToPrettyString(used):used}");
|
||||
_adminLogger.Add(LogType.InteractActivate, LogImpact.Low, $"{ToPrettyString(user):user} activated {ToPrettyString(used):used}");
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
@@ -808,11 +808,11 @@ namespace Content.Shared.Interaction
|
||||
RaiseLocalEvent(thrown, throwMsg);
|
||||
if (throwMsg.Handled)
|
||||
{
|
||||
_adminLogSystem.Add(LogType.Throw, LogImpact.Low,$"{ToPrettyString(user):user} threw {ToPrettyString(thrown):entity}");
|
||||
_adminLogger.Add(LogType.Throw, LogImpact.Low,$"{ToPrettyString(user):user} threw {ToPrettyString(thrown):entity}");
|
||||
return;
|
||||
}
|
||||
|
||||
_adminLogSystem.Add(LogType.Throw, LogImpact.Low,$"{ToPrettyString(user):user} threw {ToPrettyString(thrown):entity}");
|
||||
_adminLogger.Add(LogType.Throw, LogImpact.Low,$"{ToPrettyString(user):user} threw {ToPrettyString(thrown):entity}");
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -821,7 +821,7 @@ namespace Content.Shared.Interaction
|
||||
var dropMsg = new DroppedEvent(user);
|
||||
RaiseLocalEvent(item, dropMsg);
|
||||
if (dropMsg.Handled)
|
||||
_adminLogSystem.Add(LogType.Drop, LogImpact.Low, $"{ToPrettyString(user):user} dropped {ToPrettyString(item):entity}");
|
||||
_adminLogger.Add(LogType.Drop, LogImpact.Low, $"{ToPrettyString(user):user} dropped {ToPrettyString(item):entity}");
|
||||
Transform(item).LocalRotation = Angle.Zero;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Shared.Slippery
|
||||
[UsedImplicitly]
|
||||
public abstract class SharedSlipperySystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedAdminLogSystem _adminLog = default!;
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly SharedStunSystem _stunSystem = default!;
|
||||
[Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _container = default!;
|
||||
@@ -71,7 +71,7 @@ namespace Content.Shared.Slippery
|
||||
if (playSound)
|
||||
PlaySound(component);
|
||||
|
||||
_adminLog.Add(LogType.Slip, LogImpact.Low,
|
||||
_adminLogger.Add(LogType.Slip, LogImpact.Low,
|
||||
$"{ToPrettyString(other):mob} slipped on collision with {ToPrettyString(component.Owner):entity}");
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Content.Shared.Throwing
|
||||
public sealed class ThrownItemSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||
[Dependency] private readonly SharedAdminLogSystem _adminLogSystem = default!;
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly FixtureSystem _fixtures = default!;
|
||||
|
||||
private const string ThrowingFixture = "throw-fixture";
|
||||
@@ -131,7 +131,7 @@ namespace Content.Shared.Throwing
|
||||
|
||||
// Assume it's uninteresting if it has no thrower. For now anyway.
|
||||
if (thrownItem.Thrower is not null)
|
||||
_adminLogSystem.Add(LogType.Landed, LogImpact.Low, $"{ToPrettyString(landing):entity} thrown by {ToPrettyString(thrownItem.Thrower.Value):thrower} landed.");
|
||||
_adminLogger.Add(LogType.Landed, LogImpact.Low, $"{ToPrettyString(landing):entity} thrown by {ToPrettyString(thrownItem.Thrower.Value):thrower} landed.");
|
||||
|
||||
var landMsg = new LandEvent {User = thrownItem.Thrower};
|
||||
RaiseLocalEvent(landing, landMsg, false);
|
||||
@@ -143,7 +143,7 @@ namespace Content.Shared.Throwing
|
||||
public void ThrowCollideInteraction(EntityUid? user, IPhysBody thrown, IPhysBody target)
|
||||
{
|
||||
if (user is not null)
|
||||
_adminLogSystem.Add(LogType.ThrowHit, LogImpact.Low,
|
||||
_adminLogger.Add(LogType.ThrowHit, LogImpact.Low,
|
||||
$"{ToPrettyString(thrown.Owner):thrown} thrown by {ToPrettyString(user.Value):thrower} hit {ToPrettyString(target.Owner):target}.");
|
||||
// TODO: Just pass in the bodies directly
|
||||
RaiseLocalEvent(target.Owner, new ThrowHitByEvent(user, thrown.Owner, target.Owner));
|
||||
|
||||
Reference in New Issue
Block a user