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 sync #1066

Merged
merged 36 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2beac02
Make CharacterPickerButton the same height for dwarves as for non-dwa…
Absotively Feb 19, 2025
5f41726
Returns Explosive Technology recipes to Protolathes (#35303)
K-Dynamic Feb 19, 2025
5148e2f
Automatic changelog update
PJBot Feb 19, 2025
9b7339e
Make OuterClothing hide PDA and belt sprites under it. (#33448)
Winkarst-cpu Feb 19, 2025
353e988
Automatic changelog update
PJBot Feb 19, 2025
9bde78a
Fixing intercom encryption key dropping (#34582)
Booblesnoot42 Feb 19, 2025
bc1c82a
Automatic changelog update
PJBot Feb 19, 2025
cc18ba7
Fix ExaminableHunger spelling (#35309)
MilenVolf Feb 19, 2025
22254a1
ports two barsigns from frontier (#35296)
robinthedragon Feb 19, 2025
201ec61
Automatic changelog update
PJBot Feb 19, 2025
33b9149
Space Lizard Plushie In-hands (#35295)
SeamLesss Feb 19, 2025
f189bdc
Removed Contraband Status from Flares (#34705)
FungiFellow Feb 20, 2025
8b50ac7
Automatic changelog update
PJBot Feb 20, 2025
3e449f7
Fix: Toys sounds (#33449)
Winkarst-cpu Feb 20, 2025
112d7c3
Automatic changelog update
PJBot Feb 20, 2025
1079da4
Update engine to v247.1.0 (#35324)
ElectroJr Feb 20, 2025
3ce81d3
Added a component that lets ranged weapons make melee attacks. (#29484)
Siigiil Feb 20, 2025
7e6e237
General storage fixes (#34845)
metalgearsloth Feb 17, 2025
5e0a1d8
Fix missing errorOnMissing arg being passed thru (#35328)
metalgearsloth Feb 20, 2025
c8dce26
Replace obsolete FromMap calls with ToCoordinates (#35304)
VerinSenpai Feb 20, 2025
a4001fb
Purge uses of TransformComponent.Anchored.set. Also adds parentheses.…
TemporalOroboros Feb 20, 2025
fa35c96
Revert "Purge uses of TransformComponent.Anchored.set. Also adds pare…
metalgearsloth Feb 20, 2025
580f908
Fix to make all corpses butcher able and better disposable (#33727)
Zokkie Feb 20, 2025
5e9e151
Automatic changelog update
PJBot Feb 20, 2025
abb20c0
Remove storage hotbar GUI bandaid (#35054)
metalgearsloth Feb 20, 2025
93021c4
Automatic changelog update
PJBot Feb 20, 2025
7f8f1bf
HOTFIX General storage fixes (#34845) (#35329)
Errant-4 Feb 20, 2025
09f7539
Require hwid (#35331)
nikthechampiongr Feb 20, 2025
53c82eb
2 lines yaml cleanup (#35338)
lzk228 Feb 20, 2025
ddeda2e
fix migration.yml (#35339)
lzk228 Feb 20, 2025
cb822fd
Merge branch 'stable' into master-merge
Errant-4 Feb 20, 2025
f3c6811
Merge stable into master (#35340)
Errant-4 Feb 20, 2025
a9054c5
Mjollnir and Singularity Hammer for Wizard (#34446)
keronshb Feb 20, 2025
d6cc167
Fixed Veggie pizza slice having 40u of reagent space (#35343)
spderman3333 Feb 21, 2025
3e09ecf
Merge remote-tracking branch 'wizard/master' into upstream-sync
Rxup Feb 21, 2025
4299ed3
fix upstream
Rxup Feb 21, 2025
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
8 changes: 5 additions & 3 deletions Content.Client/Gameplay/GameplayStateBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,12 @@ protected virtual void OnKeyBindStateChanged(ViewportBoundKeyEventArgs args)
{
entityToClick = GetClickedEntity(mousePosWorld);
}
var transformSystem = _entitySystemManager.GetEntitySystem<SharedTransformSystem>();
var mapSystem = _entitySystemManager.GetEntitySystem<MapSystem>();

coordinates = _mapManager.TryFindGridAt(mousePosWorld, out _, out var grid) ?
grid.MapToGrid(mousePosWorld) :
EntityCoordinates.FromMap(_mapManager, mousePosWorld);
coordinates = _mapManager.TryFindGridAt(mousePosWorld, out var uid, out _) ?
mapSystem.MapToGrid(uid, mousePosWorld) :
transformSystem.ToCoordinates(mousePosWorld);
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Lobby/UI/CharacterPickerButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
<SpriteView Scale="2 2"
Margin="0 4 4 4"
OverrideDirection="South"
Name="View"/>
Name="View"
SetSize="64 64"/>
<Label Name="DescriptionLabel"
ClipText="True"
HorizontalExpand="True"/>
Expand Down
8 changes: 0 additions & 8 deletions Content.Client/Storage/StorageBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,4 @@ public void Show(Vector2 position)
Show();
LayoutContainer.SetPosition(_window, position);
}

public void ReOpen()
{
_window?.Orphan();
_window = null;
Open();
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -61,39 +61,11 @@ public override void Initialize()
{
base.Initialize();

UIManager.OnScreenChanged += OnScreenChange;

_configuration.OnValueChanged(CCVars.StaticStorageUI, OnStaticStorageChanged, true);
_configuration.OnValueChanged(CCVars.OpaqueStorageWindow, OnOpaqueWindowChanged, true);
_configuration.OnValueChanged(CCVars.StorageWindowTitle, OnStorageWindowTitle, true);
}

private void OnScreenChange((UIScreen? Old, UIScreen? New) obj)
{
// Handle reconnects with hotbargui.

// Essentially HotbarGui / the screen gets loaded AFTER gamestates at the moment (because clientgameticker manually changes it via event)
// and changing this may be a massive change.
// So instead we'll just manually reload it for now.
if (!StaticStorageUIEnabled ||
obj.New == null ||
!EntityManager.TryGetComponent(_player.LocalEntity, out UserInterfaceUserComponent? userComp))
{
return;
}

// UISystemDependency not injected at this point so do it the old fashion way, I love ordering issues.
var uiSystem = EntityManager.System<SharedUserInterfaceSystem>();

foreach (var bui in uiSystem.GetActorUis((_player.LocalEntity.Value, userComp)))
{
if (!uiSystem.TryGetOpenUi<StorageBoundUserInterface>(bui.Entity, StorageComponent.StorageUiKey.Key, out var storageBui))
continue;

storageBui.ReOpen();
}
}

private void OnStorageWindowTitle(bool obj)
{
WindowTitle = obj;
Expand Down
96 changes: 56 additions & 40 deletions Content.Client/Weapons/Melee/MeleeWeaponSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Content.Shared.Mobs.Components;
using Content.Shared.StatusEffect;
using Content.Shared.Weapons.Melee;
using Content.Shared.Weapons.Melee.Components;
using Content.Shared.Weapons.Melee.Events;
using Content.Shared.Weapons.Ranged.Components;
using Robust.Client.GameObjects;
Expand Down Expand Up @@ -89,16 +90,6 @@ public override void Update(float frameTime)

// TODO using targeted actions while combat mode is enabled should NOT trigger attacks.

// TODO: Need to make alt-fire melee its own component I guess?
// Melee and guns share a lot in the middle but share virtually nothing at the start and end so
// it's kinda tricky.
// I think as long as we make secondaries their own component it's probably fine
// as long as guncomp has an alt-use key then it shouldn't be too much of a PITA to deal with.
if (TryComp<GunComponent>(weaponUid, out var gun) && gun.UseKey)
{
return;
}

var mousePos = _eyeManager.PixelToMap(_inputManager.MouseScreenPosition);

if (mousePos.MapId == MapId.Nullspace)
Expand All @@ -116,21 +107,38 @@ public override void Update(float frameTime)
{
coordinates = TransformSystem.ToCoordinates(_map.GetMap(mousePos.MapId), mousePos);
}

// If the gun has AltFireComponent, it can be used to attack.
if (TryComp<GunComponent>(weaponUid, out var gun) && gun.UseKey)
{
if (!TryComp<AltFireMeleeComponent>(weaponUid, out var altFireComponent) || altDown != BoundKeyState.Down)
return;

switch(altFireComponent.AttackType)
{
case AltFireAttackType.Light:
ClientLightAttack(entity, mousePos, coordinates, weaponUid, weapon);
break;

case AltFireAttackType.Heavy:
ClientHeavyAttack(entity, coordinates, weaponUid, weapon);
break;

case AltFireAttackType.Disarm:
ClientDisarm(entity, mousePos, coordinates);
break;
}

return;
}

// Heavy attack.
if (altDown == BoundKeyState.Down)
{
// If it's an unarmed attack then do a disarm
if (weapon.AltDisarm && weaponUid == entity)
{
EntityUid? target = null;

if (_stateManager.CurrentState is GameplayStateBase screen)
{
target = screen.GetClickedEntity(mousePos);
}

EntityManager.RaisePredictiveEvent(new DisarmAttackEvent(GetNetEntity(target), GetNetCoordinates(coordinates)));
ClientDisarm(entity, mousePos, coordinates);
return;
}

Expand All @@ -140,28 +148,7 @@ public override void Update(float frameTime)

// Light attack
if (useDown == BoundKeyState.Down)
{
var attackerPos = TransformSystem.GetMapCoordinates(entity);

if (mousePos.MapId != attackerPos.MapId ||
(attackerPos.Position - mousePos.Position).Length() > weapon.Range)
{
return;
}

EntityUid? target = null;

if (_stateManager.CurrentState is GameplayStateBase screen)
{
target = screen.GetClickedEntity(mousePos);
}

// Don't light-attack if interaction will be handling this instead
if (Interaction.CombatModeCanHandInteract(entity, target))
return;

RaisePredictiveEvent(new LightAttackEvent(GetNetEntity(target), GetNetEntity(weaponUid), GetNetCoordinates(coordinates)));
}
ClientLightAttack(entity, mousePos, coordinates, weaponUid, weapon);
}

protected override bool InRange(EntityUid user, EntityUid target, float range, ICommonSession? session)
Expand Down Expand Up @@ -235,6 +222,35 @@ private void ClientHeavyAttack(EntityUid user, EntityCoordinates coordinates, En
var entities = GetNetEntityList(ArcRayCast(userPos, direction.ToWorldAngle(), component.Angle, distance, userXform.MapID, user).ToList());
RaisePredictiveEvent(new HeavyAttackEvent(GetNetEntity(meleeUid), entities.GetRange(0, Math.Min(MaxTargets, entities.Count)), GetNetCoordinates(coordinates)));
}

private void ClientDisarm(EntityUid attacker, MapCoordinates mousePos, EntityCoordinates coordinates)
{
EntityUid? target = null;

if (_stateManager.CurrentState is GameplayStateBase screen)
target = screen.GetClickedEntity(mousePos);

RaisePredictiveEvent(new DisarmAttackEvent(GetNetEntity(target), GetNetCoordinates(coordinates)));
}

private void ClientLightAttack(EntityUid attacker, MapCoordinates mousePos, EntityCoordinates coordinates, EntityUid weaponUid, MeleeWeaponComponent meleeComponent)
{
var attackerPos = TransformSystem.GetMapCoordinates(attacker);

if (mousePos.MapId != attackerPos.MapId || (attackerPos.Position - mousePos.Position).Length() > meleeComponent.Range)
return;

EntityUid? target = null;

if (_stateManager.CurrentState is GameplayStateBase screen)
target = screen.GetClickedEntity(mousePos);

// Don't light-attack if interaction will be handling this instead
if (Interaction.CombatModeCanHandInteract(attacker, target))
return;

RaisePredictiveEvent(new LightAttackEvent(GetNetEntity(target), GetNetEntity(weaponUid), GetNetCoordinates(coordinates)));
}

private void OnMeleeLunge(MeleeLungeEvent ev)
{
Expand Down
5 changes: 3 additions & 2 deletions Content.Client/Weapons/Misc/TetherGunSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public sealed class TetherGunSystem : SharedTetherGunSystem
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IOverlayManager _overlay = default!;
[Dependency] private readonly IPlayerManager _player = default!;
[Dependency] private readonly MapSystem _mapSystem = default!;

public override void Initialize()
{
Expand Down Expand Up @@ -73,11 +74,11 @@ public override void Update(float frameTime)

if (_mapManager.TryFindGridAt(mouseWorldPos, out var gridUid, out _))
{
coords = EntityCoordinates.FromMap(gridUid, mouseWorldPos, TransformSystem);
coords = TransformSystem.ToCoordinates(gridUid, mouseWorldPos);
}
else
{
coords = EntityCoordinates.FromMap(_mapManager.GetMapEntityId(mouseWorldPos.MapId), mouseWorldPos, TransformSystem);
coords = TransformSystem.ToCoordinates(_mapSystem.GetMap(mouseWorldPos.MapId), mouseWorldPos);
}

const float BufferDistance = 0.1f;
Expand Down
2 changes: 2 additions & 0 deletions Content.Server.Database/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,8 @@ public enum ConnectionDenyReason : byte
BabyJail = 4,
/// Results from rejected connections with external API checking tools
IPChecks = 5,
/// Results from rejected connections who are authenticated but have no modern hwid associated with them.
NoHwid = 6
}

public class ServerBanHit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private void AddSmiteVerbs(GetVerbsEvent<Verb> args)
Filter.PvsExcept(args.Target), true, PopupType.MediumCaution);
var board = Spawn("ChessBoard", xform.Coordinates);
var session = _tabletopSystem.EnsureSession(Comp<TabletopGameComponent>(board));
xform.Coordinates = EntityCoordinates.FromMap(_mapManager, session.Position);
xform.Coordinates = _transformSystem.ToCoordinates(session.Position);
_transformSystem.SetWorldRotationNoLerp((args.Target, xform), Angle.Zero);
},
Impact = LogImpact.Extreme,
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Backmen/EnergyDome/EnergyDomeSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ private void OnComponentRemove(Entity<EnergyDomeGeneratorComponent> generator, r
// Functional
public bool AttemptToggle(Entity<EnergyDomeGeneratorComponent> generator, bool status)
{
if (TryComp<UseDelayComponent>(generator, out var useDelay) && _useDelay.IsDelayed(new Entity<UseDelayComponent>(generator, useDelay)))
if (TryComp<UseDelayComponent>(generator, out var useDelay) && _useDelay.IsDelayed((generator, useDelay)))
{
_audio.PlayPvs(generator.Comp.TurnOffSound, generator);
_popup.PopupEntity(
Expand Down
5 changes: 5 additions & 0 deletions Content.Server/Connection/ConnectionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ session.Status is SessionStatus.Connected or SessionStatus.InGame

var modernHwid = e.UserData.ModernHWIds;

if (modernHwid.Length == 0 && e.AuthType == LoginType.LoggedIn && _cfg.GetCVar(CCVars.RequireModernHardwareId))
{
return (ConnectionDenyReason.NoHwid, Loc.GetString("hwid-required"), null);
}

var bans = await _db.GetServerBansAsync(addr, userId, hwId, modernHwid, includeUnbanned: false);
if (bans.Count > 0)
{
Expand Down
4 changes: 3 additions & 1 deletion Content.Server/Explosion/EntitySystems/ExplosionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using Content.Shared.Inventory;
using Content.Shared.Projectiles;
using Content.Shared.Throwing;
using Robust.Server.GameObjects;
using Robust.Server.GameStates;
using Robust.Server.Player;
using Robust.Shared.Audio.Systems;
Expand All @@ -38,6 +39,7 @@ public sealed partial class ExplosionSystem : SharedExplosionSystem
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;

[Dependency] private readonly MapSystem _mapSystem = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
[Dependency] private readonly NodeGroupSystem _nodeGroupSystem = default!;
Expand Down Expand Up @@ -356,7 +358,7 @@ public void QueueExplosion(MapCoordinates epicenter,
CameraShake(iterationIntensity.Count * 4f, pos, queued.TotalIntensity);

//For whatever bloody reason, sound system requires ENTITY coordinates.
var mapEntityCoords = EntityCoordinates.FromMap(_mapManager.GetMapEntityId(pos.MapId), pos, _transformSystem, EntityManager);
var mapEntityCoords = _transformSystem.ToCoordinates(_mapSystem.GetMap(pos.MapId), pos);

// play sound.
// for the normal audio, we want everyone in pvs range
Expand Down
6 changes: 3 additions & 3 deletions Content.Shared/Anomaly/SharedAnomalyCoreSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ private void OnAttemptMeleeThrowOnHit(Entity<CorePoweredThrowerComponent> ent, r
var (uid, comp) = ent;

// don't waste charges on non-anchorable non-anomalous static bodies.
if (!HasComp<AnomalyComponent>(args.Hit)
&& !HasComp<AnchorableComponent>(args.Hit)
&& TryComp<PhysicsComponent>(args.Hit, out var body)
if (!HasComp<AnomalyComponent>(args.Target)
&& !HasComp<AnchorableComponent>(args.Target)
&& TryComp<PhysicsComponent>(args.Target, out var body)
&& body.BodyType == BodyType.Static)
return;

Expand Down
10 changes: 7 additions & 3 deletions Content.Shared/Anomaly/SharedAnomalySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Content.Shared.Database;
using Content.Shared.Physics;
using Content.Shared.Popups;
using Content.Shared.Throwing;
using Content.Shared.Weapons.Melee.Components;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Map;
Expand Down Expand Up @@ -41,19 +42,22 @@ public override void Initialize()
base.Initialize();

SubscribeLocalEvent<AnomalyComponent, MeleeThrowOnHitStartEvent>(OnAnomalyThrowStart);
SubscribeLocalEvent<AnomalyComponent, MeleeThrowOnHitEndEvent>(OnAnomalyThrowEnd);
SubscribeLocalEvent<AnomalyComponent, LandEvent>(OnLand);
}

private void OnAnomalyThrowStart(Entity<AnomalyComponent> ent, ref MeleeThrowOnHitStartEvent args)
{
if (!TryComp<CorePoweredThrowerComponent>(args.Used, out var corePowered) || !TryComp<PhysicsComponent>(ent, out var body))
if (!TryComp<CorePoweredThrowerComponent>(args.Weapon, out var corePowered) || !TryComp<PhysicsComponent>(ent, out var body))
return;

// anomalies are static by default, so we have set them to dynamic to be throwable
_physics.SetBodyType(ent, BodyType.Dynamic, body: body);
ChangeAnomalyStability(ent, Random.NextFloat(corePowered.StabilityPerThrow.X, corePowered.StabilityPerThrow.Y), ent.Comp);
}

private void OnAnomalyThrowEnd(Entity<AnomalyComponent> ent, ref MeleeThrowOnHitEndEvent args)
private void OnLand(Entity<AnomalyComponent> ent, ref LandEvent args)
{
// revert back to static
_physics.SetBodyType(ent, BodyType.Static);
}

Expand Down
6 changes: 6 additions & 0 deletions Content.Shared/CCVar/CCVars.Admin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ public sealed partial class CCVars
public static readonly CVarDef<bool> BanHardwareIds =
CVarDef.Create("ban.hardware_ids", true, CVar.SERVERONLY);

/// <summary>
/// Determines if we'll reject connections from clients who don't have a modern hwid.
/// </summary>
public static readonly CVarDef<bool> RequireModernHardwareId =
CVarDef.Create("admin.require_modern_hwid", true, CVar.SERVERONLY);

/// <summary>
/// If true, players are allowed to connect to multiple game servers at once.
/// If false, they will be kicked from the first when connecting to another.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public bool TryGetSolution(
[NotNullWhen(true)] out Solution? solution,
bool errorOnMissing = false)
{
if (!TryGetSolution(container, name, out entity))
if (!TryGetSolution(container, name, out entity, errorOnMissing: errorOnMissing))
{
solution = null;
return false;
Expand Down
4 changes: 2 additions & 2 deletions Content.Shared/Coordinates/Helpers/SnapgridHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ public static EntityCoordinates SnapToGrid(this EntityCoordinates coordinates, I
if (gridId == null)
{
var xformSys = entMan.System<SharedTransformSystem>();
var mapPos = coordinates.ToMap(entMan, xformSys);
var mapPos = xformSys.ToMapCoordinates(coordinates);
var mapX = (int)Math.Floor(mapPos.X) + 0.5f;
var mapY = (int)Math.Floor(mapPos.Y) + 0.5f;
mapPos = new MapCoordinates(new Vector2(mapX, mapY), mapPos.MapId);
return EntityCoordinates.FromMap(coordinates.EntityId, mapPos, xformSys);
return xformSys.ToCoordinates(coordinates.EntityId, mapPos);
}

var grid = entMan.GetComponent<MapGridComponent>(gridId.Value);
Expand Down
Loading
Loading