Bugfixes (#69)

* - fix: Fix bans.

* - fix: Fix all roles for admins.

* - fix: No command headrevs.

* - tweak: Now round ends on rev win.

* - fix: Ash now smimmune.

* - fix: Ghost role cvar fix.

* - fix: Security icons only work on humans.
This commit is contained in:
Aviu00
2024-02-15 01:52:07 +09:00
committed by GitHub
parent db58e0938f
commit 19cc8366fb
7 changed files with 16 additions and 6 deletions

View File

@@ -2,6 +2,7 @@ using System.Linq;
using Content.Shared._Miracle.Components;
using Content.Shared.Access.Components;
using Content.Shared.Access.Systems;
using Content.Shared.Humanoid;
using Content.Shared.IdentityManagement.Components;
using Content.Shared.Inventory;
using Content.Shared.Mindshield.Components;
@@ -31,10 +32,10 @@ public sealed class ShowSecurityIconsSystem : EquipmentHudSystem<ShowSecurityIco
{
base.Initialize();
SubscribeLocalEvent<StatusIconComponent, GetStatusIconsEvent>(OnGetStatusIconsEvent);
SubscribeLocalEvent<HumanoidAppearanceComponent, GetStatusIconsEvent>(OnGetStatusIconsEvent);
}
private void OnGetStatusIconsEvent(EntityUid uid, StatusIconComponent _, ref GetStatusIconsEvent @event)
private void OnGetStatusIconsEvent(EntityUid uid, HumanoidAppearanceComponent _, ref GetStatusIconsEvent @event)
{
if (!IsActive || @event.InContainer)
{

View File

@@ -1,4 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using Content.Client.Administration.Managers;
using Content.Shared.CCVar;
using Content.Shared.Players;
using Content.Shared.Players.PlayTimeTracking;
@@ -20,6 +21,7 @@ public sealed class JobRequirementsManager
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IPrototypeManager _prototypes = default!;
[Dependency] private readonly IClientAdminManager _adminManager = default!; // WD
private readonly Dictionary<string, TimeSpan> _roles = new();
private readonly List<string> _roleBans = new();
@@ -37,6 +39,7 @@ public sealed class JobRequirementsManager
_net.RegisterNetMessage<MsgPlayTime>(RxPlayTime);
_client.RunLevelChanged += ClientOnRunLevelChanged;
_adminManager.AdminStatusUpdated += () => Updated?.Invoke(); // WD
}
private void ClientOnRunLevelChanged(object? sender, RunLevelChangedEventArgs e)
@@ -98,6 +101,9 @@ public sealed class JobRequirementsManager
if (player == null)
return true;
if (_adminManager.IsActive()) // WD
return true;
return CheckRoleTime(job.Requirements, out reason);
}

View File

@@ -103,7 +103,7 @@ public sealed class BanManager : IBanManager, IPostInjectInit
//Miracle edit start
private async Task CacheDbServerBans(NetUserId userId, IPAddress? address = null, ImmutableArray<byte>? hwId = null)
{
var serverBans = await _db.GetServerBansAsync(address, userId, hwId, false);
var serverBans = await _db.GetServerBansAsync(address, userId, hwId, false, _cfg.GetCVar(CCVars.AdminLogsServerName));
var userServerBans = new HashSet<ServerBanDef>(serverBans);

View File

@@ -170,7 +170,7 @@ namespace Content.Server.Connection
}
//WD-EDIT
var bans = await _db.GetServerBansAsync(addr, userId, hwId, includeUnbanned: false);
var bans = await _db.GetServerBansAsync(addr, userId, hwId, includeUnbanned: false, _cfg.GetCVar(CCVars.AdminLogsServerName));
if (bans.Count > 0 && bans.Any(x=> x.ExpirationTime == null)) //Miracle edit
{
var firstBan = bans[0];

View File

@@ -87,7 +87,8 @@ public sealed class RevolutionaryRuleSystem : GameRuleSystem<RevolutionaryRuleCo
if (CheckCommandLose())
{
_roundEnd.DoRoundEndBehavior(RoundEndBehavior.ShuttleCall, component.ShuttleCallTime);
// _roundEnd.DoRoundEndBehavior(RoundEndBehavior.ShuttleCall, component.ShuttleCallTime);
_roundEnd.EndRound(); // WD EDIT
GameTicker.EndGameRule(uid, gameRule);
}
}
@@ -155,6 +156,7 @@ public sealed class RevolutionaryRuleSystem : GameRuleSystem<RevolutionaryRuleCo
{
_antagSelection.EligiblePlayers(comp.HeadRevPrototypeId, comp.MaxHeadRevs, comp.PlayersPerHeadRev, comp.HeadRevStartSound,
"head-rev-role-greeting", "#5e9cff", out var chosen);
chosen = chosen.Where(x => !HasComp<CommandStaffComponent>(x)).ToList(); // WD
if (chosen.Any())
GiveHeadRev(chosen, comp.HeadRevPrototypeId, comp);
else

View File

@@ -1839,7 +1839,7 @@ namespace Content.Shared.CCVar
/// The time you must spend reading the rules, before the "Request" button is enabled
/// </summary>
public static readonly CVarDef<float> GhostRoleTime =
CVarDef.Create("ghost.role_time", 3f, CVar.REPLICATED);
CVarDef.Create("ghost.role_time", 3f, CVar.SERVER | CVar.REPLICATED);
/*
* Fire alarm

View File

@@ -108,6 +108,7 @@
- type: Tag
tags:
- Trash
- SMImmune
- type: SolutionContainerManager
solutions:
food: