Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log tweaks&fix #2653

Merged
merged 3 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ private void InitPowerConsumptionSpinBox()
if (child.GetType() == typeof(LineEdit))
child.MinSize = new Vector2(60, 0);
}
PowerConsumptionSpinBox.AddLeftButton(-100, "-100");

PowerConsumptionSpinBox.AddLeftButton(-500, "-500");
PowerConsumptionSpinBox.AddLeftButton(-100, "-100");
PowerConsumptionSpinBox.AddRightButton(100, "+100");
PowerConsumptionSpinBox.AddRightButton(500, "+500");
PowerConsumptionSpinBox.IsValid = PowerConsumptionValidate;
Expand Down
8 changes: 7 additions & 1 deletion Content.Server/Administration/UI/AdminAnnounceEui.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
using Content.Server.Administration.Logs;
using Content.Server.Administration.Managers;
using Content.Server.Chat;
using Content.Server.Chat.Managers;
using Content.Server.Chat.Systems;
using Content.Server.EUI;
using Content.Shared.Administration;
using Content.Shared.Database;
using Content.Shared.Eui;

namespace Content.Server.Administration.UI
{
public sealed class AdminAnnounceEui : BaseEui
{
[Dependency] private readonly IAdminLogManager _adminLogManager = default!; // SS220-add-eui-log
[Dependency] private readonly IAdminManager _adminManager = default!;
[Dependency] private readonly IChatManager _chatManager = default!;
private readonly ChatSystem _chatSystem;
Expand Down Expand Up @@ -42,7 +45,10 @@ public override void HandleMessage(EuiMessageBase msg)
Close();
break;
}

// SS220-add-eui-log
_adminLogManager.Add(LogType.Chat, LogImpact.Low,
$"Announcement from {Player:user}, announcer: {doAnnounce.Announcer}, message: {doAnnounce.Announcement}");
// SS220-add-eui-log
switch (doAnnounce.AnnounceType)
{
case AdminAnnounceType.Server:
Expand Down
7 changes: 7 additions & 0 deletions Content.Server/Fax/AdminUI/AdminFaxEui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
using Content.Shared.Ghost;
using Content.Shared.Paper;
using Content.Shared.SS220.Photocopier;
using Content.Server.Administration.Logs;
using Content.Shared.Database;

namespace Content.Server.Fax.AdminUI;

public sealed class AdminFaxEui : BaseEui
{
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly IAdminLogManager _adminLogManager = default!; // SS220-add-eui-log
private readonly FaxSystem _faxSystem;
private readonly FollowerSystem _followerSystem;

Expand Down Expand Up @@ -75,6 +78,10 @@ public override void HandleMessage(EuiMessageBase msg)
PrototypeId = "PaperNtFormCc"
};

// SS220-add-eui-log
_adminLogManager.Add(LogType.Action, LogImpact.Low,
$"Announcement from {Player:user}, title is {sendData.Title}, content {sendData.Content}, stamp state '{sendData.StampState}', stamped by {sendData.From}");
// SS220-add-eui-log
var printout = new FaxPrintout(dataToCopy, metaData);
_faxSystem.Receive(_entityManager.GetEntity(sendData.Target), printout);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ public void BroadcastData(Entity<SuperMatterComponent> crystal)
comp.Name ??= MetaData(crystal.Owner).EntityName;
Dictionary<Gas, float> gasRatios = new();

if (!comp.AccumulatedGasesMoles.TryGetValue(Gas.Oxygen, out _))
return;

foreach (var gas in Enum.GetValues<Gas>())
{
gasRatios.Add(gas, comp.AccumulatedGasesMoles[gas] / comp.AccumulatedGasesMoles.Values.Sum());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private void Delaminate(Entity<SuperMatterComponent> crystal)
switch (smState)
{
case SuperMatterPhaseState.ResonanceRegion:
spawnedUid = Spawn(crystal.Comp.ResonanceSpawnPrototype, Transform(crystal.Owner).Coordinates);
_explosion.TriggerExplosive(crystal.Owner);
break;
case SuperMatterPhaseState.SingularityRegion:
spawnedUid = Spawn(crystal.Comp.SingularitySpawnPrototype, Transform(crystal.Owner).Coordinates);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
using Content.Shared.Interaction;
using Content.Shared.Projectiles;
using Content.Shared.Tools.Components;
using Microsoft.EntityFrameworkCore.Migrations.Operations;
using Content.Server.Construction.Completions;
using Content.Shared.Destructible;
using Content.Shared.SS220.SuperMatter.Ui;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Content.Shared.Humanoid;
using Content.Shared.Database;

namespace Content.Server.SS220.SuperMatterCrystal;

Expand Down Expand Up @@ -88,6 +85,7 @@ private void OnActivation(Entity<SuperMatterComponent> entity, ref SuperMatterAc
if (!entity.Comp.Activated)
{
SendAdminChatAlert(entity, Loc.GetString("supermatter-admin-alert-activated"), $"{EntityManager.ToPrettyString(args.Target)}");
_adminLog.Add(LogType.Action, LogImpact.High, $"Crystal {ToPrettyString(entity):user} was activated by {ToPrettyString(args.Target):target}");
entity.Comp.Activated = true;
}
args.Handled = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,20 @@ public override void Update(float frameTime)
while (query.MoveNext(out var uid, out var smComp))
{
if (!HasComp<MetaDataComponent>(uid)
|| MetaData(uid).Initialized == false)
|| MetaData(uid).EntityLifeStage < EntityLifeStage.MapInitialized)
continue;

// add here to give admins a way to freeze all logic
if (HasComp<AdminFrozenComponent>(uid))
continue;

// I kinda fixed it, but in case of another misunderstanding
if (!smComp.AccumulatedGasesMoles.TryGetValue(Gas.Oxygen, out _))
{
Log.Debug($"Dictionary for Supermatter crystal {ToPrettyString(uid)} gas accumulator isn't initialized!");
continue;
}

var crystal = new Entity<SuperMatterComponent>(uid, smComp);
UpdateDelayed(crystal, flooredFrameTime);
SuperMatterUpdate(crystal, flooredFrameTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@
- type: CollisionWake
enabled: false
- type: SinguloFood
energy: 10000
energy: 5000
- type: Explosive
explosionType: Default
maxIntensity: 25000
intensitySlope: 5
totalIntensity: 25000
maxIntensity: 60
intensitySlope: 10
totalIntensity: 100000
maxTileBreak: 128
- type: NameIdentifier
group: GenericNumber
- type: TTS
Expand Down
Loading