Merge remote-tracking branch 'upstream/stable' into ed-30-04-2025-upstream-sync
# Conflicts: # Content.Client/Parallax/ParallaxControl.cs # Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs # Content.IntegrationTests/Tests/PostMapInitTest.cs # Content.Server/Chat/Managers/ChatManager.cs # Content.Server/Fluids/EntitySystems/PuddleSystem.Evaporation.cs # Content.Server/Labels/Label/LabelSystem.cs # Content.Shared/Actions/SharedActionsSystem.cs # Content.Shared/Fluids/Components/EvaporationComponent.cs # Content.Shared/Labels/EntitySystems/SharedLabelSystem.cs # README.md # Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml # Resources/Prototypes/Maps/Pools/deathmatch.yml # Resources/Prototypes/Maps/arenas.yml
This commit is contained in:
@@ -28,6 +28,7 @@ using Content.Shared.NameModifier.EntitySystems;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Storage.Components;
|
||||
using Content.Shared.Tag;
|
||||
using Content.Shared.Warps;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Configuration;
|
||||
@@ -53,7 +54,7 @@ namespace Content.Server.Ghost
|
||||
[Dependency] private readonly MindSystem _minds = default!;
|
||||
[Dependency] private readonly MobStateSystem _mobState = default!;
|
||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly ISharedPlayerManager _player = default!;
|
||||
[Dependency] private readonly TransformSystem _transformSystem = default!;
|
||||
[Dependency] private readonly VisibilitySystem _visibilitySystem = default!;
|
||||
[Dependency] private readonly MetaDataSystem _metaData = default!;
|
||||
@@ -369,7 +370,7 @@ namespace Content.Server.Ghost
|
||||
|
||||
private IEnumerable<GhostWarp> GetPlayerWarps(EntityUid except)
|
||||
{
|
||||
foreach (var player in _playerManager.Sessions)
|
||||
foreach (var player in _player.Sessions)
|
||||
{
|
||||
if (player.AttachedEntity is not {Valid: true} attached)
|
||||
continue;
|
||||
@@ -447,7 +448,7 @@ namespace Content.Server.Ghost
|
||||
if (spawnPosition?.IsValid(EntityManager) != true)
|
||||
return false;
|
||||
|
||||
var mapUid = spawnPosition?.GetMapUid(EntityManager);
|
||||
var mapUid = _transformSystem.GetMap(spawnPosition.Value);
|
||||
var gridUid = spawnPosition?.EntityId;
|
||||
// Test if the map is being deleted
|
||||
if (mapUid == null || TerminatingOrDeleted(mapUid.Value))
|
||||
@@ -489,15 +490,15 @@ namespace Content.Server.Ghost
|
||||
// However, that should rarely happen.
|
||||
if (!string.IsNullOrWhiteSpace(mind.Comp.CharacterName))
|
||||
_metaData.SetEntityName(ghost, mind.Comp.CharacterName);
|
||||
else if (!string.IsNullOrWhiteSpace(mind.Comp.Session?.Name))
|
||||
_metaData.SetEntityName(ghost, mind.Comp.Session.Name);
|
||||
else if (mind.Comp.UserId is { } userId && _player.TryGetSessionById(userId, out var session))
|
||||
_metaData.SetEntityName(ghost, session.Name);
|
||||
|
||||
if (mind.Comp.TimeOfDeath.HasValue)
|
||||
{
|
||||
SetTimeOfDeath(ghost, mind.Comp.TimeOfDeath!.Value, ghostComponent);
|
||||
SetTimeOfDeath((ghost, ghostComponent), mind.Comp.TimeOfDeath!.Value);
|
||||
}
|
||||
|
||||
SetCanReturnToBody(ghostComponent, canReturn);
|
||||
SetCanReturnToBody((ghost, ghostComponent), canReturn);
|
||||
|
||||
if (canReturn)
|
||||
_minds.Visit(mind.Owner, ghost, mind.Comp);
|
||||
@@ -535,9 +536,9 @@ namespace Content.Server.Ghost
|
||||
|
||||
if (mind.PreventGhosting && !forced)
|
||||
{
|
||||
if (mind.Session != null) // Logging is suppressed to prevent spam from ghost attempts caused by movement attempts
|
||||
if (_player.TryGetSessionById(mind.UserId, out var session)) // Logging is suppressed to prevent spam from ghost attempts caused by movement attempts
|
||||
{
|
||||
_chatManager.DispatchServerMessage(mind.Session, Loc.GetString("comp-mind-ghosting-prevented"),
|
||||
_chatManager.DispatchServerMessage(session, Loc.GetString("comp-mind-ghosting-prevented"),
|
||||
true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user