Skip to content

Commit

Permalink
Fix melee and DB errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepyyapril committed Dec 21, 2024
1 parent 78bfce2 commit 9bb4c93
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 22 deletions.
3 changes: 1 addition & 2 deletions Content.Server/Administration/Commands/RoleBanListCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ public async void Execute(IConsoleShell shell, string argStr, string[] args)
}

var targetUid = located.UserId;
var targetHWid = located.LastHWId;
var targetAddress = located.LastAddress;

var bans = await _dbManager.GetServerRoleBansAsync(data.LastAddress, data.UserId, data.LastLegacyHWId, data.LastModernHWIds, includeUnbanned);
var bans = await dbMan.GetServerRoleBansAsync(targetAddress, targetUid, located.LastLegacyHWId, located.LastModernHWIds, includeUnbanned);

if (bans.Count == 0)
{
Expand Down
17 changes: 10 additions & 7 deletions Content.Server/Administration/Notes/AdminMessageEui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ public sealed class AdminMessageEui : BaseEui
{
[Dependency] private readonly IAdminNotesManager _notesMan = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
private readonly float _closeWait;
private AdminMessageRecord? _message;
private DateTime _startTime;
[Dependency] private readonly IGameTiming _gameTiming = default!;

private readonly TimeSpan _closeWait;
private readonly TimeSpan _endTime;
private readonly AdminMessageRecord[] _messages;

public AdminMessageEui(AdminMessageRecord[] messages)
{
Expand All @@ -26,7 +28,7 @@ public AdminMessageEui(AdminMessageRecord[] messages)
_messages = messages;
}

public void SetMessage(AdminMessageRecord message)
public override void Opened()
{
StateDirty();
}
Expand All @@ -35,9 +37,10 @@ public override EuiStateBase GetNewState()
{
return new AdminMessageEuiState(
_closeWait,
_message.Message,
_message.CreatedBy?.LastSeenUserName ?? "[System]",
_message.CreatedAt.UtcDateTime
_messages.Select(x => new AdminMessageEuiState.Message(
x.Message,
x.CreatedBy?.LastSeenUserName ?? Loc.GetString("admin-notes-fallback-admin-name"),
x.CreatedAt.UtcDateTime)).ToArray()
);
}

Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Administration/Systems/AdminSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public override void Initialize()
Subs.CVar(_config, CCVars.PanicBunkerCountDeadminnedAdmins, OnPanicBunkerCountDeadminnedAdminsChanged, true);
Subs.CVar(_config, CCVars.PanicBunkerShowReason, OnShowReasonChanged, true);
Subs.CVar(_config, CCVars.PanicBunkerMinAccountAge, OnPanicBunkerMinAccountAgeChanged, true);
Subs.CVar(_config, CCVars.PanicBunkerMinOverallMinutes, OnPanicBunkerMinOverallMinutesChanged, true);
Subs.CVar(_config, CCVars.PanicBunkerMinOverallHours, OnPanicBunkerMinOverallHoursChanged, true);

/*
* TODO: Remove baby jail code once a more mature gateway process is established. This code is only being issued as a stopgap to help with potential tiding in the immediate future.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Content.Shared.GameTicking.Components;
using JetBrains.Annotations;
using Robust.Shared.Configuration;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Toolshed;
using Robust.Shared.Utility;
Expand Down
24 changes: 12 additions & 12 deletions Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -840,17 +840,17 @@ private void OnItemToggle(EntityUid uid, ItemToggleMeleeWeaponComponent itemTogg
if (itemToggleMelee.ActivatedSoundOnHitNoDamage != null)
{
//Setting the deactivated sound on no damage hit to the weapon's regular value before changing it.
itemToggleMelee.DeactivatedSoundOnHitNoDamage ??= meleeWeapon.NoDamageSound;
meleeWeapon.NoDamageSound = itemToggleMelee.ActivatedSoundOnHitNoDamage;
DirtyField(uid, meleeWeapon, nameof(MeleeWeaponComponent.NoDamageSound));
itemToggleMelee.DeactivatedSoundOnHitNoDamage ??= meleeWeapon.SoundNoDamage;
meleeWeapon.SoundNoDamage = itemToggleMelee.ActivatedSoundOnHitNoDamage;
DirtyField(uid, meleeWeapon, nameof(MeleeWeaponComponent.SoundNoDamage));
}

if (itemToggleMelee.ActivatedSoundOnSwing != null)
{
//Setting the deactivated sound on no damage hit to the weapon's regular value before changing it.
itemToggleMelee.DeactivatedSoundOnSwing ??= meleeWeapon.SwingSound;
meleeWeapon.SwingSound = itemToggleMelee.ActivatedSoundOnSwing;
DirtyField(uid, meleeWeapon, nameof(MeleeWeaponComponent.SwingSound));
itemToggleMelee.DeactivatedSoundOnSwing ??= meleeWeapon.SoundSwing;
meleeWeapon.SoundSwing = itemToggleMelee.ActivatedSoundOnSwing;
DirtyField(uid, meleeWeapon, nameof(MeleeWeaponComponent.SoundSwing));
}

if (itemToggleMelee.DeactivatedSecret)
Expand All @@ -866,19 +866,19 @@ private void OnItemToggle(EntityUid uid, ItemToggleMeleeWeaponComponent itemTogg
DirtyField(uid, meleeWeapon, nameof(MeleeWeaponComponent.Damage));
}

meleeWeapon.HitSound = itemToggleMelee.DeactivatedSoundOnHit;
DirtyField(uid, meleeWeapon, nameof(MeleeWeaponComponent.HitSound));
meleeWeapon.SoundHit = itemToggleMelee.DeactivatedSoundOnHit;
DirtyField(uid, meleeWeapon, nameof(MeleeWeaponComponent.SoundHit));

if (itemToggleMelee.DeactivatedSoundOnHitNoDamage != null)
{
meleeWeapon.NoDamageSound = itemToggleMelee.DeactivatedSoundOnHitNoDamage;
DirtyField(uid, meleeWeapon, nameof(MeleeWeaponComponent.NoDamageSound));
meleeWeapon.SoundNoDamage = itemToggleMelee.DeactivatedSoundOnHitNoDamage;
DirtyField(uid, meleeWeapon, nameof(MeleeWeaponComponent.SoundNoDamage));
}

if (itemToggleMelee.DeactivatedSoundOnSwing != null)
{
meleeWeapon.SwingSound = itemToggleMelee.DeactivatedSoundOnSwing;
DirtyField(uid, meleeWeapon, nameof(MeleeWeaponComponent.SwingSound));
meleeWeapon.SoundSwing = itemToggleMelee.DeactivatedSoundOnSwing;
DirtyField(uid, meleeWeapon, nameof(MeleeWeaponComponent.SoundSwing));
}

if (itemToggleMelee.DeactivatedSecret)
Expand Down

0 comments on commit 9bb4c93

Please sign in to comment.