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

Upstream Merge 08/05/2024 #77

Merged
merged 85 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
c92ea10
Update Credits (#602)
github-actions[bot] Jul 28, 2024
a0d7f7d
Box Retexture (#597)
CilliePaint Jul 29, 2024
4b9c598
Automatic Changelog Update (#597)
SimpleStation14 Jul 29, 2024
faa239a
Fix 125 Toolshed Commands Being Unusable for Anyone without +HOST (#572)
Mnemotechnician Jul 29, 2024
41a5e8e
Automatic Changelog Update (#572)
SimpleStation14 Jul 29, 2024
a9e28ee
Radiation Doesn't Prevent DoAfters (#606)
VMSolidus Jul 29, 2024
7c5625b
Automatic Changelog Update (#606)
SimpleStation14 Jul 29, 2024
54c119e
Make Jobs & Antags Use CharacterRequirements (#596)
DEATHB4DEFEAT Jul 29, 2024
56d039c
Add Cybernetic Limb Markings (#613)
angelofallars Jul 30, 2024
055ad75
Automatic Changelog Update (#613)
SimpleStation14 Jul 30, 2024
08dde02
Add Makeup (#614)
angelofallars Jul 30, 2024
b744818
Automatic Changelog Update (#614)
SimpleStation14 Jul 30, 2024
29cb1b0
Hotfix Late Joins (#612)
VMSolidus Jul 31, 2024
d38c7d4
Hotfix Playtime Requirements (#621)
Mnemotechnician Jul 31, 2024
9527936
Remove Cargo Pallet From Request Console (#626)
Tmanzxd Jul 31, 2024
3a9c337
Use Correct Changelog Name (#627)
angelofallars Jul 31, 2024
d39c990
Fix Sound Params (#624)
VMSolidus Jul 31, 2024
5f73a5a
Automatic Changelog Update (#624)
SimpleStation14 Jul 31, 2024
c0114c0
Lasers Have No Recoil (#603)
VMSolidus Jul 31, 2024
8a3abcb
Automatic Changelog Update (#603)
SimpleStation14 Jul 31, 2024
fa2abfa
Fix the Uncategorized Category Not Being Hidden (#628)
DEATHB4DEFEAT Jul 31, 2024
5335dce
Automatic Changelog Update (#628)
SimpleStation14 Jul 31, 2024
b15d096
Minor Language Fixes (#618)
Mnemotechnician Jul 31, 2024
80eb456
Comms Console Announcer Fixes (#610)
VMSolidus Jul 31, 2024
3da588f
Automatic Changelog Update (#618)
SimpleStation14 Jul 31, 2024
6d1ae15
More Loadout Items: Wave 2 (#616)
angelofallars Aug 1, 2024
b3c3647
Automatic Changelog Update (#616)
SimpleStation14 Aug 1, 2024
7fb089d
Replace and Fix MedHud Icons (#631)
Tmanzxd Aug 1, 2024
5f2cae0
Manual Removal of easy_pry.yml (#632)
Tmanzxd Aug 1, 2024
00a74a2
Revert "Mirror: Restrict Door Remotes to only Being Able to Manipulat…
stellar-novas Aug 1, 2024
ac2fc06
Invert the Running/Walking States (#485)
DEATHB4DEFEAT Aug 1, 2024
a6237f3
Automatic Changelog Update (#485)
SimpleStation14 Aug 1, 2024
94098c6
Move Survival Boxes To Loadouts (#634)
VMSolidus Aug 1, 2024
11524d8
Automatic Changelog Update (#634)
SimpleStation14 Aug 1, 2024
dfdae62
Make Boxes Not Useless (#635)
VMSolidus Aug 1, 2024
437ac5a
Automatic Changelog Update (#635)
SimpleStation14 Aug 1, 2024
6bc8b60
"Buff" Vision Traits (#636)
VMSolidus Aug 1, 2024
0d1c931
Automatic Changelog Update (#636)
SimpleStation14 Aug 1, 2024
c96cfcc
More Loadout Items: Wave 3 (#633)
angelofallars Aug 1, 2024
adafe4a
Automatic Changelog Update (#633)
SimpleStation14 Aug 1, 2024
1481146
Vulpkanin Tail Wagging (#588)
FoxxoTrystan Aug 1, 2024
8ccbf7e
Automatic Changelog Update (#588)
SimpleStation14 Aug 1, 2024
172e036
Increase Combat Knife Availability (#640)
angelofallars Aug 2, 2024
3a27ee8
Automatic Changelog Update (#640)
SimpleStation14 Aug 2, 2024
9b3f1f5
Add Breaching Charges (#638)
angelofallars Aug 2, 2024
aa9664d
Automatic Changelog Update (#638)
SimpleStation14 Aug 2, 2024
6b86a6d
AHelp Sound Improvements (#585)
DEATHB4DEFEAT Aug 2, 2024
49c944d
Automatic Changelog Update (#585)
SimpleStation14 Aug 2, 2024
d25a25c
Fix Stinky Anomaly Announcement (#646)
Mnemotechnician Aug 2, 2024
58a1f88
Revert "Refactor Ramping Event Scheduler (#592)" (#644)
Mnemotechnician Aug 2, 2024
b9b3868
Automatic Changelog Update (#644)
SimpleStation14 Aug 2, 2024
80e48a5
Supermatter Engine (Port From White Dream) (#341)
VMSolidus Aug 3, 2024
d5d3942
Automatic Changelog Update (#341)
SimpleStation14 Aug 3, 2024
d2e976e
Fix NoMaterialArbitrage Test Fail (#653)
VMSolidus Aug 3, 2024
9d25d0f
Fix for Failed to Cherry-Pick PR #26217: Fix Pressure Damage Calculat…
Tmanzxd Aug 3, 2024
7e822be
Changed Rouny Sprite (#649)
SleepyScarecrow Aug 3, 2024
b5bc583
Automatic Changelog Update (#649)
SimpleStation14 Aug 3, 2024
d2fd3c3
Merge remote-tracking branch 'EE/master' into upstream-merge
FoxxoTrystan Aug 3, 2024
75b36bf
Fix Event Manager Allowing to Start Multiple Events of the Same Type …
Mnemotechnician Aug 3, 2024
dd2a0cf
Remove Clothesmate Bloat (#637)
VMSolidus Aug 4, 2024
62045ff
Automatic Changelog Update (#637)
SimpleStation14 Aug 4, 2024
fb7c4d9
Fixes Failed to Cherry-Pick PR #25986: Return Detective to Security #…
Tmanzxd Aug 4, 2024
1509caa
Update Credits (#667)
github-actions[bot] Aug 4, 2024
f6a5a2f
Add 4 Missing Vendors To Vendor Spawners (#639)
VMSolidus Aug 4, 2024
1c26a10
Automatic Changelog Update (#639)
SimpleStation14 Aug 4, 2024
23fc467
New Trait: Voracious (#668)
angelofallars Aug 4, 2024
09e11de
Automatic Changelog Update (#668)
SimpleStation14 Aug 4, 2024
0b0e5f3
Zombie Improvements Take 2 (#652)
VMSolidus Aug 4, 2024
4a6ad8c
Automatic Changelog Update (#652)
SimpleStation14 Aug 4, 2024
7f784b0
Rename Trait "Heavyweight Drunk" To "Alcohol Tolerance" (#669)
angelofallars Aug 5, 2024
812a303
Automatic Changelog Update (#669)
SimpleStation14 Aug 5, 2024
0acb879
New Trait: Light Step (#658)
angelofallars Aug 5, 2024
27c2c35
Automatic Changelog Update (#658)
SimpleStation14 Aug 5, 2024
17aca3c
New Trait: Sign Language (#677)
angelofallars Aug 5, 2024
1bd9cd8
Automatic Changelog Update (#677)
SimpleStation14 Aug 5, 2024
c976bfa
Oracle Refactor (#549)
Mnemotechnician Aug 5, 2024
22c979c
Automatic Changelog Update (#549)
SimpleStation14 Aug 5, 2024
664f482
Carrying System Refactor (#580)
VMSolidus Aug 5, 2024
636f7f5
Automatic Changelog Update (#580)
SimpleStation14 Aug 5, 2024
f177d7d
Automatic Changelog Update (#673)
SimpleStation14 Aug 5, 2024
b7384e8
Merge remote-tracking branch 'EE/master' into upstream-merge
FoxxoTrystan Aug 5, 2024
fa4c669
fixes
FoxxoTrystan Aug 5, 2024
3920adc
Revert role timers
FoxxoTrystan Aug 5, 2024
6009872
Merge branch 'master' into upstream-merge
FoxxoTrystan Aug 5, 2024
99c8c22
update playtime requirements to 4 hours
Fansana Aug 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 7 additions & 14 deletions Content.Client/Administration/Systems/AdminSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,9 @@ public sealed partial class AdminSystem : EntitySystem
{
public event Action<List<PlayerInfo>>? PlayerListChanged;

private Dictionary<NetUserId, PlayerInfo>? _playerList;
public IReadOnlyList<PlayerInfo> PlayerList
{
get
{
if (_playerList != null) return _playerList.Values.ToList();

return new List<PlayerInfo>();
}
}
public Dictionary<NetUserId, PlayerInfo> PlayerInfos = new();
public IReadOnlyList<PlayerInfo> PlayerList =>
PlayerInfos != null ? PlayerInfos.Values.ToList() : new List<PlayerInfo>();

public override void Initialize()
{
Expand All @@ -40,15 +33,15 @@ private void OnPlayerInfoChanged(PlayerInfoChangedEvent ev)
{
if(ev.PlayerInfo == null) return;

if (_playerList == null) _playerList = new();
if (PlayerInfos == null) PlayerInfos = new();

_playerList[ev.PlayerInfo.SessionId] = ev.PlayerInfo;
PlayerListChanged?.Invoke(_playerList.Values.ToList());
PlayerInfos[ev.PlayerInfo.SessionId] = ev.PlayerInfo;
PlayerListChanged?.Invoke(PlayerInfos.Values.ToList());
}

private void OnPlayerListChanged(FullPlayerListEvent msg)
{
_playerList = msg.PlayersInfo.ToDictionary(x => x.SessionId, x => x);
PlayerInfos = msg.PlayersInfo.ToDictionary(x => x.SessionId, x => x);
PlayerListChanged?.Invoke(msg.PlayersInfo);
}
}
Expand Down
11 changes: 9 additions & 2 deletions Content.Client/Administration/Systems/BwoinkSystem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#nullable enable
using Content.Client.UserInterface.Systems.Bwoink;
using Content.Shared.Administration;
using JetBrains.Annotations;
using Robust.Client.Audio;
using Robust.Shared.Network;
using Robust.Shared.Player;
using Robust.Shared.Timing;

namespace Content.Client.Administration.Systems
Expand All @@ -10,6 +13,8 @@ namespace Content.Client.Administration.Systems
public sealed class BwoinkSystem : SharedBwoinkSystem
{
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly AudioSystem _audio = default!;
[Dependency] private readonly AdminSystem _adminSystem = default!;

public event EventHandler<BwoinkTextMessage>? OnBwoinkTextMessageRecieved;
private (TimeSpan Timestamp, bool Typing) _lastTypingUpdateSent;
Expand All @@ -21,6 +26,10 @@ protected override void OnBwoinkTextMessage(BwoinkTextMessage message, EntitySes

public void Send(NetUserId channelId, string text, bool playSound)
{
var info = _adminSystem.PlayerInfos.GetValueOrDefault(channelId)?.Connected ?? true;
_audio.PlayGlobal(info ? AHelpUIController.AHelpSendSound : AHelpUIController.AHelpErrorSound,
Filter.Local(), false);

// Reuse the channel ID as the 'true sender'.
// Server will ignore this and if someone makes it not ignore this (which is bad, allows impersonation!!!), that will help.
RaiseNetworkEvent(new BwoinkTextMessage(channelId, channelId, text, playSound: playSound));
Expand All @@ -31,9 +40,7 @@ public void SendInputTextUpdated(NetUserId channel, bool typing)
{
if (_lastTypingUpdateSent.Typing == typing &&
_lastTypingUpdateSent.Timestamp + TimeSpan.FromSeconds(1) > _timing.RealTime)
{
return;
}

_lastTypingUpdateSent = (_timing.RealTime, typing);
RaiseNetworkEvent(new BwoinkClientTypingUpdated(channel, typing));
Expand Down
24 changes: 21 additions & 3 deletions Content.Client/LateJoin/LateJoinGui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
using Content.Client.GameTicking.Managers;
using Content.Client.UserInterface.Controls;
using Content.Client.Players.PlayTimeTracking;
using Content.Client.Preferences;
using Content.Shared.CCVar;
using Content.Shared.Customization.Systems;
using Content.Shared.Preferences;
using Content.Shared.Roles;
using Content.Shared.StatusIcon;
using Microsoft.Win32.SafeHandles;
using Robust.Client.Console;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
Expand All @@ -26,12 +30,15 @@ public sealed class LateJoinGui : DefaultWindow
[Dependency] private readonly IConfigurationManager _configManager = default!;
[Dependency] private readonly IEntitySystemManager _entitySystem = default!;
[Dependency] private readonly JobRequirementsManager _jobRequirements = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly IClientPreferencesManager _prefs = default!;

public event Action<(NetEntity, string)> SelectedId;

private readonly ClientGameTicker _gameTicker;
private readonly SpriteSystem _sprites;
private readonly CrewManifestSystem _crewManifest;
private readonly CharacterRequirementsSystem _characterRequirements;

private readonly Dictionary<NetEntity, Dictionary<string, List<JobButton>>> _jobButtons = new();
private readonly Dictionary<NetEntity, Dictionary<string, BoxContainer>> _jobCategories = new();
Expand All @@ -46,6 +53,7 @@ public LateJoinGui()
_sprites = _entitySystem.GetEntitySystem<SpriteSystem>();
_crewManifest = _entitySystem.GetEntitySystem<CrewManifestSystem>();
_gameTicker = _entitySystem.GetEntitySystem<ClientGameTicker>();
_characterRequirements = _entitySystem.GetEntitySystem<CharacterRequirementsSystem>();

Title = Loc.GetString("late-join-gui-title");

Expand Down Expand Up @@ -254,14 +262,24 @@ private void RebuildUI()

jobButton.OnPressed += _ => SelectedId.Invoke((id, jobButton.JobId));

if (!_jobRequirements.IsAllowed(prototype, out var reason))
if (!_characterRequirements.CheckRequirementsValid(
prototype.Requirements ?? new(),
prototype,
(HumanoidCharacterProfile) (_prefs.Preferences?.SelectedCharacter
?? HumanoidCharacterProfile.DefaultWithSpecies()),
_jobRequirements.GetRawPlayTimeTrackers(),
_jobRequirements.IsWhitelisted(),
_entityManager,
_prototypeManager,
_configManager,
out var reasons))
{
jobButton.Disabled = true;

if (!reason.IsEmpty)
if (reasons.Count > 0)
{
var tooltip = new Tooltip();
tooltip.SetMessage(reason);
tooltip.SetMessage(_characterRequirements.GetRequirementsText(reasons));
jobButton.TooltipSupplier = _ => tooltip;
}

Expand Down
12 changes: 5 additions & 7 deletions Content.Client/Lobby/LobbyUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Client.Humanoid;
using Content.Client.Inventory;
using Content.Client.Lobby.UI;
using Content.Client.Players.PlayTimeTracking;
using Content.Client.Preferences;
using Content.Client.Preferences.UI;
using Content.Shared.Clothing.Loadouts.Systems;
Expand All @@ -23,6 +24,7 @@ public sealed class LobbyUIController : UIController, IOnStateEntered<LobbyState
[Dependency] private readonly IClientPreferencesManager _preferencesManager = default!;
[Dependency] private readonly IStateManager _stateManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly JobRequirementsManager _jobRequirements = default!;
[UISystemDependency] private readonly HumanoidAppearanceSystem _humanoid = default!;
[UISystemDependency] private readonly ClientInventorySystem _inventory = default!;
[UISystemDependency] private readonly LoadoutSystem _loadouts = default!;
Expand Down Expand Up @@ -123,7 +125,8 @@ public void UpdateCharacterUI()
if (ShowClothes)
GiveDummyJobClothes(_previewDummy.Value, GetPreferredJob(maybeProfile), maybeProfile);
if (ShowLoadouts)
GiveDummyLoadouts(_previewDummy.Value, GetPreferredJob(maybeProfile), maybeProfile);
_loadouts.ApplyCharacterLoadout(_previewDummy.Value, GetPreferredJob(maybeProfile), maybeProfile,
_jobRequirements.GetRawPlayTimeTrackers(), _jobRequirements.IsWhitelisted());
UpdateClothes = false;
}

Expand Down Expand Up @@ -170,12 +173,7 @@ public void GiveDummyJobClothesLoadout(EntityUid dummy, HumanoidCharacterProfile
{
var job = GetPreferredJob(profile);
GiveDummyJobClothes(dummy, job, profile);
GiveDummyLoadouts(dummy, job, profile);
}

public void GiveDummyLoadouts(EntityUid dummy, JobPrototype job, HumanoidCharacterProfile profile)
{
_loadouts.ApplyCharacterLoadout(dummy, job, profile);
_loadouts.ApplyCharacterLoadout(dummy, job, profile, _jobRequirements.GetRawPlayTimeTrackers(), _jobRequirements.IsWhitelisted());
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Diagnostics.CodeAnalysis;
using Content.Shared.CCVar;
using Content.Shared.Customization.Systems;
using Content.Shared.Players;
using Content.Shared.Players.PlayTimeTracking;
using Content.Shared.Roles;
Expand All @@ -17,9 +18,6 @@ public sealed partial class JobRequirementsManager : ISharedPlaytimeManager
{
[Dependency] private readonly IBaseClient _client = default!;
[Dependency] private readonly IClientNetManager _net = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IPrototypeManager _prototypes = default!;

private readonly Dictionary<string, TimeSpan> _roles = new();
Expand Down Expand Up @@ -80,43 +78,6 @@ private void RxPlayTime(MsgPlayTime message)
Updated?.Invoke();
}

public bool IsAllowed(JobPrototype job, [NotNullWhen(false)] out FormattedMessage? reason)
{
reason = null;

if (_roleBans.Contains($"Job:{job.ID}"))
{
reason = FormattedMessage.FromUnformatted(Loc.GetString("role-ban"));
return false;
}

var player = _playerManager.LocalSession;
if (player == null)
return true;

return CheckRoleTime(job.Requirements, out reason);
}

public bool CheckRoleTime(HashSet<JobRequirement>? requirements, [NotNullWhen(false)] out FormattedMessage? reason, string? localePrefix = "role-timer-")
{
reason = null;

if (requirements == null || !_cfg.GetCVar(CCVars.GameRoleTimers))
return true;

var reasons = new List<string>();
foreach (var requirement in requirements)
{
if (JobRequirements.TryRequirementMet(requirement, _roles, out var jobReason, _entManager, _prototypes, _whitelisted, localePrefix))
continue;

reasons.Add(jobReason.ToMarkup());
}

reason = reasons.Count == 0 ? null : FormattedMessage.FromMarkup(string.Join('\n', reasons));
return reason == null;
}

public TimeSpan FetchOverallPlaytime()
{
return _roles.TryGetValue("Overall", out var overallPlaytime) ? overallPlaytime : TimeSpan.Zero;
Expand All @@ -137,12 +98,13 @@ public Dictionary<string, TimeSpan> FetchPlaytimeByRoles()

public Dictionary<string, TimeSpan> GetPlayTimes()
{
var dict = new Dictionary<string, TimeSpan>();

var dict = FetchPlaytimeByRoles();
dict.Add(PlayTimeTrackingShared.TrackerOverall, FetchOverallPlaytime());
foreach (var role in FetchPlaytimeByRoles())
dict.Add(role.Key, role.Value);

return dict;
}

public Dictionary<string, TimeSpan> GetRawPlayTimeTrackers()
{
return _roles;
}
}
26 changes: 23 additions & 3 deletions Content.Client/Preferences/UI/AntagPreferenceSelector.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
using Content.Client.Players.PlayTimeTracking;
using Content.Shared.Customization.Systems;
using Content.Shared.Preferences;
using Content.Shared.Roles;
using Robust.Shared.Configuration;
using Robust.Shared.Prototypes;

namespace Content.Client.Preferences.UI;

Expand All @@ -14,7 +18,7 @@ public bool Preference

public event Action<bool>? PreferenceChanged;

public AntagPreferenceSelector(AntagPrototype proto) : base(proto)
public AntagPreferenceSelector(AntagPrototype proto, JobPrototype highJob) : base(proto, highJob)
{
Options.OnItemSelected += _ => PreferenceChanged?.Invoke(Preference);

Expand All @@ -30,7 +34,23 @@ public AntagPreferenceSelector(AntagPrototype proto) : base(proto)
// Immediately lock requirements if they aren't met.
// Another function checks Disabled after creating the selector so this has to be done now
var requirements = IoCManager.Resolve<JobRequirementsManager>();
if (proto.Requirements != null && !requirements.CheckRoleTime(proto.Requirements, out var reason))
LockRequirements(reason);
var prefs = IoCManager.Resolve<IClientPreferencesManager>();
var entMan = IoCManager.Resolve<IEntityManager>();
var characterReqs = entMan.System<CharacterRequirementsSystem>();
var protoMan = IoCManager.Resolve<IPrototypeManager>();
var configMan = IoCManager.Resolve<IConfigurationManager>();

if (proto.Requirements != null
&& !characterReqs.CheckRequirementsValid(
proto.Requirements,
highJob,
(HumanoidCharacterProfile) (prefs.Preferences?.SelectedCharacter ?? HumanoidCharacterProfile.DefaultWithSpecies()),
requirements.GetRawPlayTimeTrackers(),
requirements.IsWhitelisted(),
entMan,
protoMan,
configMan,
out var reasons))
LockRequirements(characterReqs.GetRequirementsText(reasons));
}
}
Loading
Loading