]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Un-revert IPlayerManager refactor (#21244)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Fri, 27 Oct 2023 22:59:53 +0000 (09:59 +1100)
committerGitHub <noreply@github.com>
Fri, 27 Oct 2023 22:59:53 +0000 (09:59 +1100)
245 files changed:
Content.Client/Actions/ActionsSystem.cs
Content.Client/Administration/Managers/ClientAdminManager.cs
Content.Client/Administration/UI/Tabs/AdminTab/TeleportWindow.xaml.cs
Content.Client/Alerts/ClientAlertsSystem.cs
Content.Client/CharacterInfo/CharacterInfoSystem.cs
Content.Client/Construction/ConstructionSystem.cs
Content.Client/Drugs/DrugOverlaySystem.cs
Content.Client/Drunk/DrunkSystem.cs
Content.Client/Eye/Blinding/BlindingSystem.cs
Content.Client/Eye/Blinding/BlurryVisionSystem.cs
Content.Client/Eye/EyeLerpingSystem.cs
Content.Client/Fullscreen/FullscreenHook.cs
Content.Client/Gameplay/GameplayStateBase.cs
Content.Client/Ghost/GhostSystem.cs
Content.Client/Hands/Systems/HandsSystem.cs
Content.Client/HealthOverlay/HealthOverlaySystem.cs
Content.Client/Inventory/ClientInventorySystem.cs
Content.Client/Overlays/EquipmentHudSystem.cs
Content.Client/Physics/Controllers/MoverController.cs
Content.Client/Players/PlayerSystem.cs
Content.Client/Popups/PopupSystem.cs
Content.Client/Replay/Spectator/ReplaySpectatorSystem.Movement.cs
Content.Client/Replay/Spectator/ReplaySpectatorSystem.Position.cs
Content.Client/Replay/Spectator/ReplaySpectatorSystem.Spectate.cs
Content.Client/Replay/Spectator/ReplaySpectatorSystem.cs
Content.Client/Sandbox/SandboxSystem.cs
Content.Client/Traits/ParacusiaSystem.cs
Content.Client/UserInterface/Systems/Character/CharacterUIController.cs
Content.Client/UserInterface/Systems/Chat/ChatUIController.cs
Content.Client/UserInterface/Systems/DamageOverlays/DamageOverlayUiController.cs
Content.Client/UserInterface/Systems/Sandbox/SandboxUIController.cs
Content.Client/Weapons/Melee/MeleeWeaponSystem.cs
Content.IntegrationTests/Pair/TestPair.cs
Content.IntegrationTests/Tests/Actions/ActionsAddedTest.cs
Content.IntegrationTests/Tests/Administration/Logs/AddTests.cs
Content.IntegrationTests/Tests/Administration/Logs/QueryTests.cs
Content.IntegrationTests/Tests/Cleanup/EuiManagerTest.cs
Content.IntegrationTests/Tests/Interaction/InteractionTest.cs
Content.IntegrationTests/Tests/Minds/GhostRoleTests.cs
Content.IntegrationTests/Tests/Minds/MindTests.EntityDeletion.cs
Content.IntegrationTests/Tests/Minds/MindTests.Helpers.cs
Content.IntegrationTests/Tests/Minds/MindTests.ReconnectTests.cs
Content.IntegrationTests/Tests/Minds/MindTests.cs
Content.IntegrationTests/Tests/Toolshed/ToolshedTest.cs
Content.MapRenderer/Painters/MapPainter.cs
Content.Server/Administration/AdminPermsChangedEventArgs.cs
Content.Server/Administration/Commands/AGhost.cs
Content.Server/Administration/Commands/AdminWhoCommand.cs
Content.Server/Administration/Commands/AnnounceUiCommand.cs
Content.Server/Administration/Commands/BanCommand.cs
Content.Server/Administration/Commands/BanListCommand.cs
Content.Server/Administration/Commands/BanPanelCommand.cs
Content.Server/Administration/Commands/ControlMob.cs
Content.Server/Administration/Commands/DSay.cs
Content.Server/Administration/Commands/DeAdminCommand.cs
Content.Server/Administration/Commands/ExplosionCommand.cs
Content.Server/Administration/Commands/FaxUiCommand.cs
Content.Server/Administration/Commands/OpenAdminLogsCommand.cs
Content.Server/Administration/Commands/OpenAdminNotesCommand.cs
Content.Server/Administration/Commands/OpenPermissionsCommand.cs
Content.Server/Administration/Commands/OpenUserVisibleNotesCommand.cs
Content.Server/Administration/Commands/PardonCommand.cs
Content.Server/Administration/Commands/PlayGlobalSoundCommand.cs
Content.Server/Administration/Commands/ReAdminCommand.cs
Content.Server/Administration/Commands/SetAdminOOC.cs
Content.Server/Administration/Commands/SetMindCommand.cs
Content.Server/Administration/Commands/SetOutfitCommand.cs
Content.Server/Administration/Commands/WarpCommand.cs
Content.Server/Administration/ContentNetworkResourceManager.cs
Content.Server/Administration/Logs/AdminLogManager.Json.cs
Content.Server/Administration/Logs/Converters/PlayerSessionConverter.cs
Content.Server/Administration/Managers/AdminManager.cs
Content.Server/Administration/Managers/BanManager.cs
Content.Server/Administration/Managers/IAdminManager.cs
Content.Server/Administration/Managers/IBanManager.cs
Content.Server/Administration/Notes/AdminNotesManager.cs
Content.Server/Administration/Notes/AdminNotesSystem.cs
Content.Server/Administration/Notes/IAdminNotesManager.cs
Content.Server/Administration/QuickDialogSystem.OpenDialog.cs
Content.Server/Administration/QuickDialogSystem.cs
Content.Server/Administration/Systems/AdminSystem.cs
Content.Server/Administration/Systems/AdminTestArenaSystem.cs
Content.Server/Administration/Systems/AdminVerbSystem.cs
Content.Server/Administration/Systems/BwoinkSystem.cs
Content.Server/Administration/Toolshed/AdminsCommand.cs
Content.Server/Afk/AFKSystem.cs
Content.Server/Afk/AfkManager.cs
Content.Server/Afk/Events/AFKEvent.cs
Content.Server/Afk/Events/UnAFKEvent.cs
Content.Server/Alert/Commands/ClearAlert.cs
Content.Server/Alert/Commands/ShowAlert.cs
Content.Server/AlertLevel/Commands/SetAlertLevelCommand.cs
Content.Server/Antag/AntagSelectionSystem.cs
Content.Server/Arcade/BlockGame/BlockGame.Ui.cs
Content.Server/Arcade/BlockGame/BlockGameArcadeComponent.cs
Content.Server/Arcade/BlockGame/BlockGameArcadeSystem.cs
Content.Server/Atmos/Commands/DeleteGasCommand.cs
Content.Server/Atmos/Commands/ShowAtmosCommand.cs
Content.Server/Atmos/EntitySystems/AtmosDebugOverlaySystem.cs
Content.Server/Atmos/EntitySystems/GasTankSystem.cs
Content.Server/Atmos/EntitySystems/GasTileOverlaySystem.cs
Content.Server/Body/Commands/AddHandCommand.cs
Content.Server/Body/Commands/AttachBodyPartCommand.cs
Content.Server/Body/Commands/DestroyMechanismCommand.cs
Content.Server/Body/Commands/RemoveHandCommand.cs
Content.Server/Body/Systems/BodySystem.cs
Content.Server/Cargo/Systems/CargoSystem.Orders.cs
Content.Server/CartridgeLoader/CartridgeLoaderSystem.cs
Content.Server/Chat/Commands/AdminChatCommand.cs
Content.Server/Chat/Commands/LOOCCommand.cs
Content.Server/Chat/Commands/MeCommand.cs
Content.Server/Chat/Commands/OOCCommand.cs
Content.Server/Chat/Commands/SayCommand.cs
Content.Server/Chat/Commands/SuicideCommand.cs
Content.Server/Chat/Commands/WhisperCommand.cs
Content.Server/Chat/Managers/ChatManager.cs
Content.Server/Chat/Managers/IChatManager.cs
Content.Server/Chat/Systems/ChatSystem.cs
Content.Server/Chemistry/EntitySystems/ChemistryGuideDataSystem.cs
Content.Server/Chunking/ChunkingSystem.cs
Content.Server/Commands/CommandUtils.cs
Content.Server/Construction/Commands/FixRotationsCommand.cs
Content.Server/Construction/Commands/TileReplaceCommand.cs
Content.Server/Construction/Commands/TileWallsCommand.cs
Content.Server/Construction/ConstructionSystem.Initial.cs
Content.Server/CrewManifest/CrewManifestSystem.cs
Content.Server/Damage/Commands/GodModeCommand.cs
Content.Server/Damage/ForceSay/DamageForceSaySystem.cs
Content.Server/Database/UserDbDataManager.cs
Content.Server/Decals/DecalSystem.cs
Content.Server/Disposal/TubeConnectionsCommand.cs
Content.Server/EUI/BaseEui.cs
Content.Server/EUI/EuiManager.cs
Content.Server/EntityList/SpawnEntityListCommand.cs
Content.Server/Examine/ExamineSystem.cs
Content.Server/Fluids/EntitySystems/PuddleDebugDebugOverlaySystem.cs
Content.Server/Fluids/ShowFluidsCommand.cs
Content.Server/GameTicking/Commands/JoinGameCommand.cs
Content.Server/GameTicking/Commands/ObserveCommand.cs
Content.Server/GameTicking/Commands/RespawnCommand.cs
Content.Server/GameTicking/Commands/ToggleReadyCommand.cs
Content.Server/GameTicking/GameTicker.GamePreset.cs
Content.Server/GameTicking/GameTicker.Lobby.cs
Content.Server/GameTicking/GameTicker.Player.cs
Content.Server/GameTicking/GameTicker.RoundFlow.cs
Content.Server/GameTicking/GameTicker.Spawning.cs
Content.Server/GameTicking/Rules/Components/TraitorRuleComponent.cs
Content.Server/GameTicking/Rules/InactivityTimeRestartRuleSystem.cs
Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs
Content.Server/GameTicking/Rules/PiratesRuleSystem.cs
Content.Server/GameTicking/Rules/RespawnRuleSystem.cs
Content.Server/GameTicking/Rules/TraitorRuleSystem.cs
Content.Server/GameTicking/Rules/ZombieRuleSystem.cs
Content.Server/Ghost/Ghost.cs
Content.Server/Ghost/Roles/Components/TakeGhostRoleEvent.cs
Content.Server/Ghost/Roles/GhostRoleSystem.cs
Content.Server/Gravity/GravityGeneratorSystem.cs
Content.Server/Hands/Systems/HandsSystem.cs
Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.Modifier.cs
Content.Server/Instruments/InstrumentComponent.cs
Content.Server/Instruments/InstrumentSystem.cs
Content.Server/Interaction/InteractionSystem.cs
Content.Server/Interaction/TilePryCommand.cs
Content.Server/MagicMirror/MagicMirrorSystem.cs
Content.Server/Mapping/MappingCommand.cs
Content.Server/Maps/GridDraggingSystem.cs
Content.Server/Medical/DefibrillatorSystem.cs
Content.Server/Mind/MindSystem.cs
Content.Server/Mind/Toolshed/MindCommand.cs
Content.Server/Motd/MOTDCommand.cs
Content.Server/Motd/MOTDSystem.cs
Content.Server/Motd/SetMOTDCommand.cs
Content.Server/Movement/Systems/LagCompensationSystem.cs
Content.Server/NPC/Commands/NPCCommand.cs
Content.Server/NPC/HTN/HTNSystem.cs
Content.Server/NPC/Pathfinding/PathfindingSystem.cs
Content.Server/NPC/Systems/NPCSteeringSystem.cs
Content.Server/NodeContainer/EntitySystems/NodeGroupSystem.cs
Content.Server/Nutrition/Hungry.cs
Content.Server/Objectives/Commands/ListObjectivesCommand.cs
Content.Server/PDA/PdaSystem.cs
Content.Server/PDA/Ringer/RingerSystem.cs
Content.Server/Paper/PaperSystem.cs
Content.Server/Parallax/BiomeSystem.cs
Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs
Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.Parts.cs
Content.Server/Players/PlayTimeTracking/PlayTimeTrackingManager.cs
Content.Server/Players/PlayTimeTracking/PlayTimeTrackingSystem.cs
Content.Server/Players/PlayerData.cs [deleted file]
Content.Server/Players/PlayerSystem.cs
Content.Server/Pointing/EntitySystems/PointingSystem.cs
Content.Server/Popups/PopupSystem.cs
Content.Server/Prayer/PrayerSystem.cs
Content.Server/Preferences/Managers/IServerPreferencesManager.cs
Content.Server/Preferences/Managers/ServerPreferencesManager.cs
Content.Server/Pulling/PullingSystem.cs
Content.Server/Radiation/Systems/RadiationSystem.Debug.cs
Content.Server/Research/Systems/ResearchSystem.Client.cs
Content.Server/Salvage/SalvageRulerCommand.cs
Content.Server/Sandbox/Commands/ColorNetworkCommand.cs
Content.Server/Sandbox/SandboxSystem.cs
Content.Server/SensorMonitoring/SensorMonitoringConsoleComponent.cs
Content.Server/SensorMonitoring/SensorMonitoringConsoleSystem.UI.cs
Content.Server/ServerUpdates/ServerUpdateManager.cs
Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs
Content.Server/Silicons/Borgs/BorgSystem.Modules.cs
Content.Server/Silicons/Borgs/BorgSystem.cs
Content.Server/Silicons/Laws/SiliconLawSystem.cs
Content.Server/Station/Systems/StationJobsSystem.cs
Content.Server/Storage/EntitySystems/StorageSystem.cs
Content.Server/Tabletop/TabletopSession.cs
Content.Server/Tabletop/TabletopSystem.Session.cs
Content.Server/Tabletop/TabletopSystem.cs
Content.Server/Toolshed/Commands/AdminDebug/ACmdCommand.cs
Content.Server/Toolshed/Commands/VisualizeCommand.cs
Content.Server/Traitor/Uplink/Commands/AddUplinkCommand.cs
Content.Server/UserInterface/ActivatableUIComponent.cs
Content.Server/UserInterface/ActivatableUISystem.cs
Content.Server/UserInterface/StatValuesCommand.cs
Content.Server/Verbs/VerbSystem.cs
Content.Server/Voting/IVoteHandle.cs
Content.Server/Voting/Managers/IVoteManager.cs
Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs
Content.Server/Voting/Managers/VoteManager.cs
Content.Server/Voting/VoteCommands.cs
Content.Server/Voting/VoteOptions.cs
Content.Server/Weapons/Melee/MeleeWeaponSystem.cs
Content.Server/Wires/WiresSystem.cs
Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs
Content.Shared/Administration/Managers/ISharedAdminManager.cs
Content.Shared/Buckle/SharedBuckleSystem.cs
Content.Shared/Hands/EntitySystems/SharedHandsSystem.Interactions.cs
Content.Shared/Interaction/SharedInteractionSystem.cs
Content.Shared/Mind/MindComponent.cs
Content.Shared/Mind/SharedMindSystem.cs
Content.Shared/Movement/Events/MoveInputEvent.cs
Content.Shared/Movement/Systems/SharedContentEyeSystem.cs
Content.Shared/Movement/Systems/SharedMoverController.Input.cs
Content.Shared/Players/ContentPlayerData.cs [moved from Content.Shared/Players/PlayerData.cs with 73% similarity]
Content.Shared/Players/PlayerDataExt.cs [new file with mode: 0644]
Content.Shared/Players/SharedPlayerSystem.cs
Content.Shared/Popups/SharedPopupSystem.cs
Content.Shared/Pulling/Systems/SharedPullingSystem.cs
Content.Shared/Roles/Jobs/SharedJobSystem.cs
Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs

index 83d927c94bb357d3aa3231f5e83fd5685a130cd8..a487e5d8d8ab969c720cab19fc5edd51e5d0c3a7 100644 (file)
@@ -2,7 +2,6 @@ using System.IO;
 using System.Linq;
 using Content.Shared.Actions;
 using JetBrains.Annotations;
-using Robust.Client.GameObjects;
 using Robust.Client.Player;
 using Robust.Shared.ContentPack;
 using Robust.Shared.GameStates;
@@ -41,8 +40,8 @@ namespace Content.Client.Actions
         public override void Initialize()
         {
             base.Initialize();
-            SubscribeLocalEvent<ActionsComponent, PlayerAttachedEvent>(OnPlayerAttached);
-            SubscribeLocalEvent<ActionsComponent, PlayerDetachedEvent>(OnPlayerDetached);
+            SubscribeLocalEvent<ActionsComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
+            SubscribeLocalEvent<ActionsComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
             SubscribeLocalEvent<ActionsComponent, ComponentHandleState>(HandleComponentState);
 
             SubscribeLocalEvent<InstantActionComponent, ComponentHandleState>(OnInstantHandleState);
@@ -196,12 +195,12 @@ namespace Content.Client.Actions
             return GetActions(user);
         }
 
-        private void OnPlayerAttached(EntityUid uid, ActionsComponent component, PlayerAttachedEvent args)
+        private void OnPlayerAttached(EntityUid uid, ActionsComponent component, LocalPlayerAttachedEvent args)
         {
             LinkAllActions(component);
         }
 
-        private void OnPlayerDetached(EntityUid uid, ActionsComponent component, PlayerDetachedEvent? args = null)
+        private void OnPlayerDetached(EntityUid uid, ActionsComponent component, LocalPlayerDetachedEvent? args = null)
         {
             UnlinkAllActions();
         }
index 8978e2fd6dd982f94a20557fc72289955faf6eb3..1a1366c6f2ebadb3245c9aa302feb1ede5b1fb0b 100644 (file)
@@ -4,7 +4,7 @@ using Robust.Client.Console;
 using Robust.Client.Player;
 using Robust.Shared.ContentPack;
 using Robust.Shared.Network;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Utility;
 
 namespace Content.Client.Administration.Managers
index c5a9bd036a469100aaa7c2c983b563f8a2a755ae..1978b5c3c06501aaeda454d3e9ecab4a30e5e0e3 100644 (file)
@@ -5,7 +5,6 @@ using Robust.Client.Console;
 using Robust.Client.UserInterface.Controls;
 using Robust.Client.UserInterface.CustomControls;
 using Robust.Shared.IoC;
-using Robust.Shared.Players;
 
 namespace Content.Client.Administration.UI.Tabs.AdminTab
 {
index bb6d2d4df4ed12498b42bb3b32ef3cece47846e6..5089022415331a112fa0ee14f510dc41f19036a3 100644 (file)
@@ -1,7 +1,6 @@
 using System.Linq;
 using Content.Shared.Alert;
 using JetBrains.Annotations;
-using Robust.Client.GameObjects;
 using Robust.Client.Player;
 using Robust.Shared.Prototypes;
 
@@ -22,8 +21,8 @@ public sealed class ClientAlertsSystem : AlertsSystem
     {
         base.Initialize();
 
-        SubscribeLocalEvent<AlertsComponent, PlayerAttachedEvent>(OnPlayerAttached);
-        SubscribeLocalEvent<AlertsComponent, PlayerDetachedEvent>(OnPlayerDetached);
+        SubscribeLocalEvent<AlertsComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
+        SubscribeLocalEvent<AlertsComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
 
         SubscribeLocalEvent<AlertsComponent, AfterAutoHandleStateEvent>(ClientAlertsHandleState);
     }
@@ -69,7 +68,7 @@ public sealed class ClientAlertsSystem : AlertsSystem
             SyncAlerts?.Invoke(this, component.Alerts);
     }
 
-    private void OnPlayerAttached(EntityUid uid, AlertsComponent component, PlayerAttachedEvent args)
+    private void OnPlayerAttached(EntityUid uid, AlertsComponent component, LocalPlayerAttachedEvent args)
     {
         if (_playerManager.LocalPlayer?.ControlledEntity != uid)
             return;
@@ -87,7 +86,7 @@ public sealed class ClientAlertsSystem : AlertsSystem
         ClearAlerts?.Invoke(this, EventArgs.Empty);
     }
 
-    private void OnPlayerDetached(EntityUid uid, AlertsComponent component, PlayerDetachedEvent args)
+    private void OnPlayerDetached(EntityUid uid, AlertsComponent component, LocalPlayerDetachedEvent args)
     {
         ClearAlerts?.Invoke(this, EventArgs.Empty);
     }
index 93bd86d140bb2739c5e2a5edf03ca6e67ecf4dcc..844a352a184463bcef8715fa5c8011042f044f2f 100644 (file)
@@ -1,6 +1,5 @@
 using Content.Shared.CharacterInfo;
 using Content.Shared.Objectives;
-using Robust.Client.GameObjects;
 using Robust.Client.Player;
 using Robust.Client.UserInterface;
 
@@ -11,14 +10,11 @@ public sealed class CharacterInfoSystem : EntitySystem
     [Dependency] private readonly IPlayerManager _players = default!;
 
     public event Action<CharacterData>? OnCharacterUpdate;
-    public event Action? OnCharacterDetached;
 
     public override void Initialize()
     {
         base.Initialize();
 
-        SubscribeLocalEvent<PlayerAttachSysMessage>(OnPlayerAttached);
-
         SubscribeNetworkEvent<CharacterInfoEvent>(OnCharacterInfoEvent);
     }
 
@@ -33,14 +29,6 @@ public sealed class CharacterInfoSystem : EntitySystem
         RaiseNetworkEvent(new RequestCharacterInfoEvent(GetNetEntity(entity.Value)));
     }
 
-    private void OnPlayerAttached(PlayerAttachSysMessage msg)
-    {
-        if (msg.AttachedEntity == default)
-        {
-            OnCharacterDetached?.Invoke();
-        }
-    }
-
     private void OnCharacterInfoEvent(CharacterInfoEvent msg, EntitySessionEventArgs args)
     {
         var entity = GetEntity(msg.NetEntity);
index 98d2dfd414d7f1a798165a92a90029e7654ae759..9fc638cea22b094d6b54030a8cfb07ef10321f73 100644 (file)
@@ -38,7 +38,7 @@ namespace Content.Client.Construction
             base.Initialize();
 
             UpdatesOutsidePrediction = true;
-            SubscribeLocalEvent<PlayerAttachSysMessage>(HandlePlayerAttached);
+            SubscribeLocalEvent<LocalPlayerAttachedEvent>(HandlePlayerAttached);
             SubscribeNetworkEvent<AckStructureConstructionMessage>(HandleAckStructure);
             SubscribeNetworkEvent<ResponseConstructionGuide>(OnConstructionGuideReceived);
 
@@ -110,9 +110,9 @@ namespace Content.Client.Construction
             ClearGhost(msg.GhostId);
         }
 
-        private void HandlePlayerAttached(PlayerAttachSysMessage msg)
+        private void HandlePlayerAttached(LocalPlayerAttachedEvent msg)
         {
-            var available = IsCraftingAvailable(msg.AttachedEntity);
+            var available = IsCraftingAvailable(msg.Entity);
             UpdateCraftingAvailability(available);
         }
 
index 7be63b4c50e154b41365be9afc468a14dbaad58c..ec0d0140720d4336e71fbc13886cd0236214daa1 100644 (file)
@@ -1,5 +1,4 @@
 using Content.Shared.Drugs;
-using Robust.Client.GameObjects;
 using Robust.Client.Graphics;
 using Robust.Client.Player;
 
@@ -24,18 +23,18 @@ public sealed class DrugOverlaySystem : EntitySystem
         SubscribeLocalEvent<SeeingRainbowsComponent, ComponentInit>(OnInit);
         SubscribeLocalEvent<SeeingRainbowsComponent, ComponentShutdown>(OnShutdown);
 
-        SubscribeLocalEvent<SeeingRainbowsComponent, PlayerAttachedEvent>(OnPlayerAttached);
-        SubscribeLocalEvent<SeeingRainbowsComponent, PlayerDetachedEvent>(OnPlayerDetached);
+        SubscribeLocalEvent<SeeingRainbowsComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
+        SubscribeLocalEvent<SeeingRainbowsComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
 
         _overlay = new();
     }
 
-    private void OnPlayerAttached(EntityUid uid, SeeingRainbowsComponent component, PlayerAttachedEvent args)
+    private void OnPlayerAttached(EntityUid uid, SeeingRainbowsComponent component, LocalPlayerAttachedEvent args)
     {
         _overlayMan.AddOverlay(_overlay);
     }
 
-    private void OnPlayerDetached(EntityUid uid, SeeingRainbowsComponent component, PlayerDetachedEvent args)
+    private void OnPlayerDetached(EntityUid uid, SeeingRainbowsComponent component, LocalPlayerDetachedEvent args)
     {
         _overlay.Intoxication = 0;
         _overlayMan.RemoveOverlay(_overlay);
index 0573b2ff3eb6cb201f17f0e22aacede991c86004..4f2ec70b56b92ec7c02b32a9715191de9b57e2f5 100644 (file)
@@ -1,5 +1,4 @@
 using Content.Shared.Drunk;
-using Robust.Client.GameObjects;
 using Robust.Client.Graphics;
 using Robust.Client.Player;
 
@@ -19,18 +18,18 @@ public sealed class DrunkSystem : SharedDrunkSystem
         SubscribeLocalEvent<DrunkComponent, ComponentInit>(OnDrunkInit);
         SubscribeLocalEvent<DrunkComponent, ComponentShutdown>(OnDrunkShutdown);
 
-        SubscribeLocalEvent<DrunkComponent, PlayerAttachedEvent>(OnPlayerAttached);
-        SubscribeLocalEvent<DrunkComponent, PlayerDetachedEvent>(OnPlayerDetached);
+        SubscribeLocalEvent<DrunkComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
+        SubscribeLocalEvent<DrunkComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
 
         _overlay = new();
     }
 
-    private void OnPlayerAttached(EntityUid uid, DrunkComponent component, PlayerAttachedEvent args)
+    private void OnPlayerAttached(EntityUid uid, DrunkComponent component, LocalPlayerAttachedEvent args)
     {
         _overlayMan.AddOverlay(_overlay);
     }
 
-    private void OnPlayerDetached(EntityUid uid, DrunkComponent component, PlayerDetachedEvent args)
+    private void OnPlayerDetached(EntityUid uid, DrunkComponent component, LocalPlayerDetachedEvent args)
     {
         _overlay.CurrentBoozePower = 0;
         _overlayMan.RemoveOverlay(_overlay);
index f0b760d838b53e003303461760e57102522f752e..f255f7ef016a17cecdd843a6383f4002097b9381 100644 (file)
@@ -1,17 +1,7 @@
-
-using Content.Shared.Eye.Blinding;
-using Robust.Client.GameObjects;
 using Robust.Client.Graphics;
 using Robust.Client.Player;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Content.Shared.Administration;
-using Content.Shared.Administration.Events;
 using Content.Shared.Eye.Blinding.Components;
 using Content.Shared.GameTicking;
-using Robust.Shared.GameObjects;
-using Robust.Shared.Network;
 
 namespace Content.Client.Eye.Blinding;
 
@@ -31,20 +21,20 @@ public sealed class BlindingSystem : EntitySystem
         SubscribeLocalEvent<BlindableComponent, ComponentInit>(OnBlindInit);
         SubscribeLocalEvent<BlindableComponent, ComponentShutdown>(OnBlindShutdown);
 
-        SubscribeLocalEvent<BlindableComponent, PlayerAttachedEvent>(OnPlayerAttached);
-        SubscribeLocalEvent<BlindableComponent, PlayerDetachedEvent>(OnPlayerDetached);
+        SubscribeLocalEvent<BlindableComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
+        SubscribeLocalEvent<BlindableComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
 
         SubscribeNetworkEvent<RoundRestartCleanupEvent>(RoundRestartCleanup);
 
         _overlay = new();
     }
 
-    private void OnPlayerAttached(EntityUid uid, BlindableComponent component, PlayerAttachedEvent args)
+    private void OnPlayerAttached(EntityUid uid, BlindableComponent component, LocalPlayerAttachedEvent args)
     {
         _overlayMan.AddOverlay(_overlay);
     }
 
-    private void OnPlayerDetached(EntityUid uid, BlindableComponent component, PlayerDetachedEvent args)
+    private void OnPlayerDetached(EntityUid uid, BlindableComponent component, LocalPlayerDetachedEvent args)
     {
         _overlayMan.RemoveOverlay(_overlay);
         _lightManager.Enabled = true;
index 1bac2a97bf45c0ba92ad8bb08c17140622cc21b5..8be5b4ed930028d69e91a566110edef753e7a871 100644 (file)
@@ -1,9 +1,6 @@
-using Content.Shared.Eye.Blinding;
 using Content.Shared.Eye.Blinding.Components;
-using Robust.Client.GameObjects;
 using Robust.Client.Graphics;
 using Robust.Client.Player;
-using Robust.Shared.GameStates;
 
 namespace Content.Client.Eye.Blinding;
 
@@ -20,18 +17,18 @@ public sealed class BlurryVisionSystem : EntitySystem
         SubscribeLocalEvent<BlurryVisionComponent, ComponentInit>(OnBlurryInit);
         SubscribeLocalEvent<BlurryVisionComponent, ComponentShutdown>(OnBlurryShutdown);
 
-        SubscribeLocalEvent<BlurryVisionComponent, PlayerAttachedEvent>(OnPlayerAttached);
-        SubscribeLocalEvent<BlurryVisionComponent, PlayerDetachedEvent>(OnPlayerDetached);
+        SubscribeLocalEvent<BlurryVisionComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
+        SubscribeLocalEvent<BlurryVisionComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
 
         _overlay = new();
     }
 
-    private void OnPlayerAttached(EntityUid uid, BlurryVisionComponent component, PlayerAttachedEvent args)
+    private void OnPlayerAttached(EntityUid uid, BlurryVisionComponent component, LocalPlayerAttachedEvent args)
     {
         _overlayMan.AddOverlay(_overlay);
     }
 
-    private void OnPlayerDetached(EntityUid uid, BlurryVisionComponent component, PlayerDetachedEvent args)
+    private void OnPlayerDetached(EntityUid uid, BlurryVisionComponent component, LocalPlayerDetachedEvent args)
     {
         _overlayMan.RemoveOverlay(_overlay);
     }
index 8e54196b81d40de432487657df44a6844d17d9f9..b46921a9b48e6e1d2adf4fb38fa7e61aa296c0ef 100644 (file)
@@ -30,7 +30,7 @@ public sealed class EyeLerpingSystem : EntitySystem
         SubscribeLocalEvent<EyeAttachedEvent>(OnAttached);
 
         SubscribeLocalEvent<LerpingEyeComponent, EntParentChangedMessage>(HandleMapChange);
-        SubscribeLocalEvent<LerpingEyeComponent, PlayerDetachedEvent>(OnDetached);
+        SubscribeLocalEvent<LerpingEyeComponent, LocalPlayerDetachedEvent>(OnDetached);
 
         UpdatesAfter.Add(typeof(TransformSystem));
         UpdatesAfter.Add(typeof(PhysicsSystem));
@@ -94,7 +94,7 @@ public sealed class EyeLerpingSystem : EntitySystem
         AddEye(ev.Entity, ev.Component, true);
     }
 
-    private void OnDetached(EntityUid uid, LerpingEyeComponent component, PlayerDetachedEvent args)
+    private void OnDetached(EntityUid uid, LerpingEyeComponent component, LocalPlayerDetachedEvent args)
     {
         if (!component.ManuallyAdded)
             RemCompDeferred(uid, component);
index 78a01517361bf3fc074a1095024bf09c9869e4ac..7917fddfbb0c144df7b5004668c5f4b1dd72a0d9 100644 (file)
@@ -4,7 +4,7 @@ using Robust.Client.Input;
 using Robust.Shared.Input.Binding;
 using Robust.Shared;
 using Robust.Shared.Configuration;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 
 namespace Content.Client.Fullscreen;
 public sealed class FullscreenHook
index 788a4e5dfff93a3e238d537f28a9d37f90a60530..454c063260510d62aaefe077625adceecb7267c7 100644 (file)
@@ -16,7 +16,7 @@ using Robust.Shared.Console;
 using Robust.Shared.Input;
 using Robust.Shared.Input.Binding;
 using Robust.Shared.Map;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Timing;
 
 namespace Content.Client.Gameplay
index 5727534109efdd4da2858139947b6a933336fe8a..a89d0858d9dd411173063e22bae339d6ec428c66 100644 (file)
@@ -58,10 +58,10 @@ namespace Content.Client.Ghost
             SubscribeLocalEvent<GhostComponent, ComponentRemove>(OnGhostRemove);
             SubscribeLocalEvent<GhostComponent, AfterAutoHandleStateEvent>(OnGhostState);
 
-            SubscribeLocalEvent<GhostComponent, PlayerAttachedEvent>(OnGhostPlayerAttach);
-            SubscribeLocalEvent<GhostComponent, PlayerDetachedEvent>(OnGhostPlayerDetach);
+            SubscribeLocalEvent<GhostComponent, LocalPlayerAttachedEvent>(OnGhostPlayerAttach);
+            SubscribeLocalEvent<GhostComponent, LocalPlayerDetachedEvent>(OnGhostPlayerDetach);
 
-            SubscribeLocalEvent<PlayerAttachedEvent>(OnPlayerAttach);
+            SubscribeLocalEvent<LocalPlayerAttachedEvent>(OnPlayerAttach);
 
             SubscribeNetworkEvent<GhostWarpsResponseEvent>(OnGhostWarpsResponse);
             SubscribeNetworkEvent<GhostUpdateGhostRoleCountEvent>(OnUpdateGhostRoleCount);
@@ -130,7 +130,7 @@ namespace Content.Client.Ghost
             PlayerRemoved?.Invoke(component);
         }
 
-        private void OnGhostPlayerAttach(EntityUid uid, GhostComponent component, PlayerAttachedEvent playerAttachedEvent)
+        private void OnGhostPlayerAttach(EntityUid uid, GhostComponent component, LocalPlayerAttachedEvent localPlayerAttachedEvent)
         {
             if (uid != _playerManager.LocalPlayer?.ControlledEntity)
                 return;
@@ -161,13 +161,13 @@ namespace Content.Client.Ghost
             return true;
         }
 
-        private void OnGhostPlayerDetach(EntityUid uid, GhostComponent component, PlayerDetachedEvent args)
+        private void OnGhostPlayerDetach(EntityUid uid, GhostComponent component, LocalPlayerDetachedEvent args)
         {
             if (PlayerDetach(uid))
                 component.IsAttached = false;
         }
 
-        private void OnPlayerAttach(PlayerAttachedEvent ev)
+        private void OnPlayerAttach(LocalPlayerAttachedEvent ev)
         {
             if (!HasComp<GhostComponent>(ev.Entity))
                 PlayerDetach(ev.Entity);
index ed40589f7fd4eb7c430a4bc9b537adc3bce3ecbe..31de7ec14334ee6935183ad529f9e95d02666479 100644 (file)
@@ -42,8 +42,8 @@ namespace Content.Client.Hands.Systems
         {
             base.Initialize();
 
-            SubscribeLocalEvent<HandsComponent, PlayerAttachedEvent>(HandlePlayerAttached);
-            SubscribeLocalEvent<HandsComponent, PlayerDetachedEvent>(HandlePlayerDetached);
+            SubscribeLocalEvent<HandsComponent, LocalPlayerAttachedEvent>(HandlePlayerAttached);
+            SubscribeLocalEvent<HandsComponent, LocalPlayerDetachedEvent>(HandlePlayerDetached);
             SubscribeLocalEvent<HandsComponent, ComponentStartup>(OnHandsStartup);
             SubscribeLocalEvent<HandsComponent, ComponentShutdown>(OnHandsShutdown);
             SubscribeLocalEvent<HandsComponent, ComponentHandleState>(HandleComponentState);
@@ -361,12 +361,12 @@ namespace Content.Client.Hands.Systems
 
         #region Gui
 
-        private void HandlePlayerAttached(EntityUid uid, HandsComponent component, PlayerAttachedEvent args)
+        private void HandlePlayerAttached(EntityUid uid, HandsComponent component, LocalPlayerAttachedEvent args)
         {
             OnPlayerHandsAdded?.Invoke(component);
         }
 
-        private void HandlePlayerDetached(EntityUid uid, HandsComponent component, PlayerDetachedEvent args)
+        private void HandlePlayerDetached(EntityUid uid, HandsComponent component, LocalPlayerDetachedEvent args)
         {
             OnPlayerHandsRemoved?.Invoke();
         }
index baeb4fe0259e66f904d1c6fd2e76e6883da6c633..29ac937199de1a2817fae38bffdf792c4eef0d28 100644 (file)
@@ -3,8 +3,8 @@ using Content.Shared.Damage;
 using Content.Shared.GameTicking;
 using Content.Shared.Mobs.Components;
 using JetBrains.Annotations;
-using Robust.Client.GameObjects;
 using Robust.Client.Graphics;
+using Robust.Client.Player;
 
 namespace Content.Client.HealthOverlay
 {
@@ -13,9 +13,9 @@ namespace Content.Client.HealthOverlay
     {
         [Dependency] private readonly IEyeManager _eyeManager = default!;
         [Dependency] private readonly IEntityManager _entities = default!;
+        [Dependency] private readonly IPlayerManager _player = default!;
 
         private readonly Dictionary<EntityUid, HealthOverlayGui> _guis = new();
-        private EntityUid? _attachedEntity;
         private bool _enabled;
 
         public bool Enabled
@@ -42,7 +42,6 @@ namespace Content.Client.HealthOverlay
             base.Initialize();
 
             SubscribeNetworkEvent<RoundRestartCleanupEvent>(Reset);
-            SubscribeLocalEvent<PlayerAttachSysMessage>(HandlePlayerAttached);
         }
 
         public void Reset(RoundRestartCleanupEvent ev)
@@ -53,12 +52,6 @@ namespace Content.Client.HealthOverlay
             }
 
             _guis.Clear();
-            _attachedEntity = default;
-        }
-
-        private void HandlePlayerAttached(PlayerAttachSysMessage message)
-        {
-            _attachedEntity = message.AttachedEntity;
         }
 
         public override void FrameUpdate(float frameTime)
@@ -70,7 +63,7 @@ namespace Content.Client.HealthOverlay
                 return;
             }
 
-            if (_attachedEntity is not {} ent || Deleted(ent))
+            if (_player.LocalEntity is not {} ent || Deleted(ent))
             {
                 return;
             }
index ffff392aa4683a13aeb28e3c672624d424308574..f0a12b3b1f6d09ffc0ed7a2fee1b8f8e1f0dcb38 100644 (file)
@@ -10,7 +10,6 @@ using Content.Shared.Inventory;
 using Content.Shared.Inventory.Events;
 using Content.Shared.Storage;
 using JetBrains.Annotations;
-using Robust.Client.GameObjects;
 using Robust.Client.Player;
 using Robust.Client.UserInterface;
 using Robust.Shared.Containers;
@@ -43,8 +42,8 @@ namespace Content.Client.Inventory
             UpdatesOutsidePrediction = true;
             base.Initialize();
 
-            SubscribeLocalEvent<InventorySlotsComponent, PlayerAttachedEvent>(OnPlayerAttached);
-            SubscribeLocalEvent<InventorySlotsComponent, PlayerDetachedEvent>(OnPlayerDetached);
+            SubscribeLocalEvent<InventorySlotsComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
+            SubscribeLocalEvent<InventorySlotsComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
 
             SubscribeLocalEvent<InventoryComponent, ComponentShutdown>(OnShutdown);
 
@@ -113,12 +112,12 @@ namespace Content.Client.Inventory
             OnUnlinkInventory?.Invoke();
         }
 
-        private void OnPlayerDetached(EntityUid uid, InventorySlotsComponent component, PlayerDetachedEvent args)
+        private void OnPlayerDetached(EntityUid uid, InventorySlotsComponent component, LocalPlayerDetachedEvent args)
         {
             OnUnlinkInventory?.Invoke();
         }
 
-        private void OnPlayerAttached(EntityUid uid, InventorySlotsComponent component, PlayerAttachedEvent args)
+        private void OnPlayerAttached(EntityUid uid, InventorySlotsComponent component, LocalPlayerAttachedEvent args)
         {
             if (TryGetSlots(uid, out var definitions))
             {
index 1d5ec03291821847cf225b3c3df8450a0cc69da1..ac618691d8b6da9da9477a1f2e06569956811a5e 100644 (file)
@@ -1,7 +1,6 @@
 using Content.Shared.GameTicking;
 using Content.Shared.Inventory;
 using Content.Shared.Inventory.Events;
-using Robust.Client.GameObjects;
 using Robust.Client.Player;
 
 namespace Content.Client.Overlays;
@@ -24,8 +23,8 @@ public abstract class EquipmentHudSystem<T> : EntitySystem where T : IComponent
         SubscribeLocalEvent<T, ComponentStartup>(OnStartup);
         SubscribeLocalEvent<T, ComponentRemove>(OnRemove);
 
-        SubscribeLocalEvent<PlayerAttachedEvent>(OnPlayerAttached);
-        SubscribeLocalEvent<PlayerDetachedEvent>(OnPlayerDetached);
+        SubscribeLocalEvent<LocalPlayerAttachedEvent>(OnPlayerAttached);
+        SubscribeLocalEvent<LocalPlayerDetachedEvent>(OnPlayerDetached);
 
         SubscribeLocalEvent<T, GotEquippedEvent>(OnCompEquip);
         SubscribeLocalEvent<T, GotUnequippedEvent>(OnCompUnequip);
@@ -65,12 +64,12 @@ public abstract class EquipmentHudSystem<T> : EntitySystem where T : IComponent
         RefreshOverlay(uid);
     }
 
-    private void OnPlayerAttached(PlayerAttachedEvent args)
+    private void OnPlayerAttached(LocalPlayerAttachedEvent args)
     {
         RefreshOverlay(args.Entity);
     }
 
-    private void OnPlayerDetached(PlayerDetachedEvent args)
+    private void OnPlayerDetached(LocalPlayerDetachedEvent args)
     {
         if (_player.LocalPlayer?.ControlledEntity == null)
             Deactivate();
index 54c5c3de15b2fc9a0a6938fe81faca4a85b8dce7..52340b33918033136e7b59a873941c888089a1df 100644 (file)
@@ -1,7 +1,6 @@
 using Content.Shared.Movement.Components;
 using Content.Shared.Movement.Systems;
 using Content.Shared.Pulling.Components;
-using Robust.Client.GameObjects;
 using Robust.Client.Physics;
 using Robust.Client.Player;
 using Robust.Shared.Physics.Components;
@@ -17,10 +16,10 @@ namespace Content.Client.Physics.Controllers
         public override void Initialize()
         {
             base.Initialize();
-            SubscribeLocalEvent<RelayInputMoverComponent, PlayerAttachedEvent>(OnRelayPlayerAttached);
-            SubscribeLocalEvent<RelayInputMoverComponent, PlayerDetachedEvent>(OnRelayPlayerDetached);
-            SubscribeLocalEvent<InputMoverComponent, PlayerAttachedEvent>(OnPlayerAttached);
-            SubscribeLocalEvent<InputMoverComponent, PlayerDetachedEvent>(OnPlayerDetached);
+            SubscribeLocalEvent<RelayInputMoverComponent, LocalPlayerAttachedEvent>(OnRelayPlayerAttached);
+            SubscribeLocalEvent<RelayInputMoverComponent, LocalPlayerDetachedEvent>(OnRelayPlayerDetached);
+            SubscribeLocalEvent<InputMoverComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
+            SubscribeLocalEvent<InputMoverComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
 
             SubscribeLocalEvent<InputMoverComponent, UpdateIsPredictedEvent>(OnUpdatePredicted);
             SubscribeLocalEvent<MovementRelayTargetComponent, UpdateIsPredictedEvent>(OnUpdateRelayTargetPredicted);
@@ -54,7 +53,7 @@ namespace Content.Client.Physics.Controllers
             // What if the entity is being pulled by a vehicle controlled by the player?
         }
 
-        private void OnRelayPlayerAttached(EntityUid uid, RelayInputMoverComponent component, PlayerAttachedEvent args)
+        private void OnRelayPlayerAttached(EntityUid uid, RelayInputMoverComponent component, LocalPlayerAttachedEvent args)
         {
             Physics.UpdateIsPredicted(uid);
             Physics.UpdateIsPredicted(component.RelayEntity);
@@ -62,7 +61,7 @@ namespace Content.Client.Physics.Controllers
                 SetMoveInput(inputMover, MoveButtons.None);
         }
 
-        private void OnRelayPlayerDetached(EntityUid uid, RelayInputMoverComponent component, PlayerDetachedEvent args)
+        private void OnRelayPlayerDetached(EntityUid uid, RelayInputMoverComponent component, LocalPlayerDetachedEvent args)
         {
             Physics.UpdateIsPredicted(uid);
             Physics.UpdateIsPredicted(component.RelayEntity);
@@ -70,12 +69,12 @@ namespace Content.Client.Physics.Controllers
                 SetMoveInput(inputMover, MoveButtons.None);
         }
 
-        private void OnPlayerAttached(EntityUid uid, InputMoverComponent component, PlayerAttachedEvent args)
+        private void OnPlayerAttached(EntityUid uid, InputMoverComponent component, LocalPlayerAttachedEvent args)
         {
             SetMoveInput(component, MoveButtons.None);
         }
 
-        private void OnPlayerDetached(EntityUid uid, InputMoverComponent component, PlayerDetachedEvent args)
+        private void OnPlayerDetached(EntityUid uid, InputMoverComponent component, LocalPlayerDetachedEvent args)
         {
             SetMoveInput(component, MoveButtons.None);
         }
index d5ce4ec197f725e8a3287bf80a9dfda33c655ecc..dba95ef7a65f323893bd65eb28ba10301cfb318b 100644 (file)
@@ -1,11 +1,11 @@
 using Content.Shared.Players;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 
 namespace Content.Client.Players;
 
 public sealed class PlayerSystem : SharedPlayerSystem
 {
-    public override PlayerData? ContentData(ICommonSession? session)
+    public override ContentPlayerData? ContentData(ICommonSession? session)
     {
         return null;
     }
index 1d4ca19ce269d75c2f898fff5b0a1f6985f73394..d68272a107e4f5541b79edc767237a8e677f637e 100644 (file)
@@ -9,7 +9,6 @@ using Robust.Client.UserInterface;
 using Robust.Shared.Configuration;
 using Robust.Shared.Map;
 using Robust.Shared.Player;
-using Robust.Shared.Players;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Replays;
 using Robust.Shared.Timing;
index 3bb2afe1221869ca255b6b1c53ec4cfdab1282b9..d48a1eab46676caaa9c21865d993bca4d858e783 100644 (file)
@@ -2,7 +2,7 @@ using Content.Shared.Movement.Components;
 using Robust.Shared.Input;
 using Robust.Shared.Input.Binding;
 using Robust.Shared.Map;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 
 namespace Content.Client.Replay.Spectator;
 
index 45a175e688458d9fbe3aa653fa4c8cb2ff0e9ec7..479e2eff976fb6550d24ff46ee6b72ca3419a7e9 100644 (file)
@@ -1,5 +1,5 @@
 using Content.Shared.Movement.Components;
-using Robust.Client.GameObjects;
+using Robust.Client.Player;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Network;
@@ -79,7 +79,7 @@ public sealed partial class ReplaySpectatorSystem
 
     public void SetSpectatorPosition(SpectatorData data)
     {
-        if (_player.LocalPlayer == null)
+        if (_player.LocalSession == null)
             return;
 
         if (data.Controller != null
@@ -87,13 +87,13 @@ public sealed partial class ReplaySpectatorSystem
             && Exists(session.AttachedEntity)
             && Transform(session.AttachedEntity.Value).MapID != MapId.Nullspace)
         {
-            _player.LocalPlayer.AttachEntity(session.AttachedEntity.Value, EntityManager, _client);
+            _player.SetAttachedEntity(_player.LocalSession, session.AttachedEntity);
             return;
         }
 
         if (Exists(data.Entity) && Transform(data.Entity).MapID != MapId.Nullspace)
         {
-            _player.LocalPlayer.AttachEntity(data.Entity, EntityManager, _client);
+            _player.SetAttachedEntity(_player.LocalSession, data.Entity);
             return;
         }
 
@@ -118,7 +118,7 @@ public sealed partial class ReplaySpectatorSystem
             return;
         }
 
-        if (data.Eye != null && TryComp(_player.LocalPlayer.ControlledEntity, out InputMoverComponent? newMover))
+        if (data.Eye != null && TryComp(_player.LocalSession.AttachedEntity, out InputMoverComponent? newMover))
         {
             newMover.RelativeEntity = data.Eye.Value.Ent;
             newMover.TargetRelativeRotation = newMover.RelativeRotation = data.Eye.Value.Rot;
@@ -177,7 +177,7 @@ public sealed partial class ReplaySpectatorSystem
         SetSpectatorPosition(default);
     }
 
-    private void OnDetached(EntityUid uid, ReplaySpectatorComponent component, PlayerDetachedEvent args)
+    private void OnDetached(EntityUid uid, ReplaySpectatorComponent component, LocalPlayerDetachedEvent args)
     {
         if (IsClientSide(uid))
             QueueDel(uid);
index f3475c5479c05fe204426cd9a3ad98150103c59f..80a8429055f449af484c3f5677e1f6fd0cd10e1f 100644 (file)
@@ -32,10 +32,10 @@ public sealed partial class ReplaySpectatorSystem
 
     public void SpectateEntity(EntityUid target)
     {
-        if (_player.LocalPlayer == null)
+        if (_player.LocalSession == null)
             return;
 
-        var old = _player.LocalPlayer.ControlledEntity;
+        var old = _player.LocalSession.AttachedEntity;
 
         if (old == target)
         {
@@ -44,7 +44,7 @@ public sealed partial class ReplaySpectatorSystem
             return;
         }
 
-        _player.LocalPlayer.AttachEntity(target, EntityManager, _client);
+        _player.SetAttachedEntity(_player.LocalSession, target);
         EnsureComp<ReplaySpectatorComponent>(target);
 
         _stateMan.RequestStateChange<ReplaySpectateEntityState>();
@@ -59,10 +59,10 @@ public sealed partial class ReplaySpectatorSystem
 
     public TransformComponent SpawnSpectatorGhost(EntityCoordinates coords, bool gridAttach)
     {
-        if (_player.LocalPlayer == null)
+        if (_player.LocalSession == null)
             throw new InvalidOperationException();
 
-        var old = _player.LocalPlayer.ControlledEntity;
+        var old = _player.LocalSession.AttachedEntity;
 
         var ent = Spawn("ReplayObserver", coords);
         _eye.SetMaxZoom(ent, Vector2.One * 5);
@@ -73,7 +73,7 @@ public sealed partial class ReplaySpectatorSystem
         if (gridAttach)
             _transform.AttachToGridOrMap(ent);
 
-        _player.LocalPlayer.AttachEntity(ent, EntityManager, _client);
+        _player.SetAttachedEntity(_player.LocalSession, ent);
 
         if (old != null)
         {
@@ -93,7 +93,7 @@ public sealed partial class ReplaySpectatorSystem
     {
         if (args.Length == 0)
         {
-            if (_player.LocalPlayer?.ControlledEntity is { } current)
+            if (_player.LocalSession?.AttachedEntity is { } current)
                 SpawnSpectatorGhost(new EntityCoordinates(current, default), true);
             else
                 SpawnSpectatorGhost(default, true);
index c75529c037fcd4f96c29ac133a1df8468fe5a6a0..3b9662ed8c674a1aa2318fa33e90249b2f2f5879 100644 (file)
@@ -6,7 +6,6 @@ using Robust.Client.Player;
 using Robust.Client.Replays.Playback;
 using Robust.Client.State;
 using Robust.Shared.Console;
-using Robust.Shared.Network;
 using Robust.Shared.Serialization.Markdown.Mapping;
 
 namespace Content.Client.Replay.Spectator;
@@ -40,7 +39,7 @@ public sealed partial class ReplaySpectatorSystem : EntitySystem
 
         SubscribeLocalEvent<GetVerbsEvent<AlternativeVerb>>(OnGetAlternativeVerbs);
         SubscribeLocalEvent<ReplaySpectatorComponent, EntityTerminatingEvent>(OnTerminating);
-        SubscribeLocalEvent<ReplaySpectatorComponent, PlayerDetachedEvent>(OnDetached);
+        SubscribeLocalEvent<ReplaySpectatorComponent, LocalPlayerDetachedEvent>(OnDetached);
         SubscribeLocalEvent<ReplaySpectatorComponent, EntParentChangedMessage>(OnParentChanged);
 
         InitializeBlockers();
index 7dcbfa0ee02ee300c16598d116ec00c490877bcd..d16751e3715d2bfbeaff5d275fb256eba9589d39 100644 (file)
@@ -5,7 +5,7 @@ using Robust.Client.Console;
 using Robust.Client.Placement;
 using Robust.Client.Placement.Modes;
 using Robust.Shared.Map;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 
 namespace Content.Client.Sandbox
 {
index 34c7d6859e2ab15aff87fc6f2aeefa6b74e995d5..87abec80bb9e94a876e6058663fadcee543645e1 100644 (file)
@@ -1,8 +1,6 @@
 using System.Numerics;
 using Content.Shared.Traits.Assorted;
-using Content.Client.Camera;
 using Robust.Shared.Random;
-using Robust.Client.GameObjects;
 using Robust.Client.Player;
 using Robust.Shared.Timing;
 
@@ -19,7 +17,7 @@ public sealed class ParacusiaSystem : SharedParacusiaSystem
     {
         base.Initialize();
         SubscribeLocalEvent<ParacusiaComponent, ComponentStartup>(OnComponentStartup);
-        SubscribeLocalEvent<ParacusiaComponent, PlayerDetachedEvent>(OnPlayerDetach);
+        SubscribeLocalEvent<ParacusiaComponent, LocalPlayerDetachedEvent>(OnPlayerDetach);
     }
 
     public override void Update(float frameTime)
@@ -40,7 +38,7 @@ public sealed class ParacusiaSystem : SharedParacusiaSystem
         component.NextIncidentTime = _timing.CurTime + TimeSpan.FromSeconds(_random.NextFloat(component.MinTimeBetweenIncidents, component.MaxTimeBetweenIncidents));
     }
 
-    private void OnPlayerDetach(EntityUid uid, ParacusiaComponent component, PlayerDetachedEvent args)
+    private void OnPlayerDetach(EntityUid uid, ParacusiaComponent component, LocalPlayerDetachedEvent args)
     {
         component.Stream?.Stop();
     }
index 925b2dae4fd45da80b7d1be60fa56585a5fb71fa..45bdada6e7af322fc7c775cf688439e1e851f9ea 100644 (file)
@@ -8,6 +8,7 @@ using Content.Client.UserInterface.Systems.Objectives.Controls;
 using Content.Shared.Input;
 using JetBrains.Annotations;
 using Robust.Client.GameObjects;
+using Robust.Client.Player;
 using Robust.Client.UserInterface;
 using Robust.Client.UserInterface.Controllers;
 using Robust.Client.UserInterface.Controls;
@@ -21,6 +22,7 @@ namespace Content.Client.UserInterface.Systems.Character;
 [UsedImplicitly]
 public sealed class CharacterUIController : UIController, IOnStateEntered<GameplayState>, IOnStateExited<GameplayState>, IOnSystemChanged<CharacterInfoSystem>
 {
+    [Dependency] private readonly IPlayerManager _player = default!;
     [UISystemDependency] private readonly CharacterInfoSystem _characterInfo = default!;
     [UISystemDependency] private readonly SpriteSystem _sprite = default!;
 
@@ -56,13 +58,13 @@ public sealed class CharacterUIController : UIController, IOnStateEntered<Gamepl
     public void OnSystemLoaded(CharacterInfoSystem system)
     {
         system.OnCharacterUpdate += CharacterUpdated;
-        system.OnCharacterDetached += CharacterDetached;
+        _player.LocalPlayerDetached += CharacterDetached;
     }
 
     public void OnSystemUnloaded(CharacterInfoSystem system)
     {
         system.OnCharacterUpdate -= CharacterUpdated;
-        system.OnCharacterDetached -= CharacterDetached;
+        _player.LocalPlayerDetached -= CharacterDetached;
     }
 
     public void UnloadButton()
@@ -160,7 +162,7 @@ public sealed class CharacterUIController : UIController, IOnStateEntered<Gamepl
         _window.RolePlaceholder.Visible = briefing == null && !controls.Any() && !objectives.Any();
     }
 
-    private void CharacterDetached()
+    private void CharacterDetached(EntityUid uid)
     {
         CloseWindow();
     }
index 6d86e458c5c846b24d28decc8db46758ae09ca4d..9334f85c00697e211703759b71b8782ba15a9381 100644 (file)
@@ -162,7 +162,8 @@ public sealed class ChatUIController : UIController
         _sawmill = Logger.GetSawmill("chat");
         _sawmill.Level = LogLevel.Info;
         _admin.AdminStatusUpdated += UpdateChannelPermissions;
-        _player.LocalPlayerChanged += OnLocalPlayerChanged;
+        _player.LocalPlayerAttached += OnAttachedChanged;
+        _player.LocalPlayerDetached += OnAttachedChanged;
         _state.OnStateChanged += StateChanged;
         _net.RegisterNetMessage<MsgChatMessage>(OnChatMessage);
         _net.RegisterNetMessage<MsgDeleteChatMessagesBy>(OnDeleteChatMessagesBy);
@@ -170,7 +171,7 @@ public sealed class ChatUIController : UIController
 
         _speechBubbleRoot = new LayoutContainer();
 
-        OnLocalPlayerChanged(new LocalPlayerChangedEventArgs(null, _player.LocalPlayer));
+        UpdateChannelPermissions();
 
         _input.SetInputCommand(ContentKeyFunctions.FocusChat,
             InputCmdHandler.FromDelegate(_ => FocusChat()));
@@ -363,29 +364,7 @@ public sealed class ChatUIController : UIController
         _speechBubbleRoot.SetPositionLast();
     }
 
-    private void OnLocalPlayerChanged(LocalPlayerChangedEventArgs obj)
-    {
-        if (obj.OldPlayer != null)
-        {
-            obj.OldPlayer.EntityAttached -= OnLocalPlayerEntityAttached;
-            obj.OldPlayer.EntityDetached -= OnLocalPlayerEntityDetached;
-        }
-
-        if (obj.NewPlayer != null)
-        {
-            obj.NewPlayer.EntityAttached += OnLocalPlayerEntityAttached;
-            obj.NewPlayer.EntityDetached += OnLocalPlayerEntityDetached;
-        }
-
-        UpdateChannelPermissions();
-    }
-
-    private void OnLocalPlayerEntityAttached(EntityAttachedEventArgs obj)
-    {
-        UpdateChannelPermissions();
-    }
-
-    private void OnLocalPlayerEntityDetached(EntityDetachedEventArgs obj)
+    private void OnAttachedChanged(EntityUid uid)
     {
         UpdateChannelPermissions();
     }
index 0836314dbc46a18ef5385628b2ddbe796076fdf6..ba4a871199ddd108fb97b0544f795f39dccb3aca 100644 (file)
@@ -1,11 +1,9 @@
-using Content.Client.Alerts;
 using Content.Shared.Damage;
 using Content.Shared.FixedPoint;
 using Content.Shared.Mobs;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Mobs.Systems;
 using JetBrains.Annotations;
-using Robust.Client.GameObjects;
 using Robust.Client.Graphics;
 using Robust.Client.Player;
 using Robust.Client.UserInterface;
@@ -25,13 +23,13 @@ public sealed class DamageOverlayUiController : UIController
     public override void Initialize()
     {
         _overlay = new Overlays.DamageOverlay();
-        SubscribeLocalEvent<PlayerAttachedEvent>(OnPlayerAttach);
-        SubscribeLocalEvent<PlayerDetachedEvent>(OnPlayerDetached);
+        SubscribeLocalEvent<LocalPlayerAttachedEvent>(OnPlayerAttach);
+        SubscribeLocalEvent<LocalPlayerDetachedEvent>(OnPlayerDetached);
         SubscribeLocalEvent<MobStateChangedEvent>(OnMobStateChanged);
         SubscribeLocalEvent<MobThresholdChecked>(OnThresholdCheck);
     }
 
-    private void OnPlayerAttach(PlayerAttachedEvent args)
+    private void OnPlayerAttach(LocalPlayerAttachedEvent args)
     {
         ClearOverlay();
         if (!EntityManager.TryGetComponent<MobStateComponent>(args.Entity, out var mobState))
@@ -41,7 +39,7 @@ public sealed class DamageOverlayUiController : UIController
         _overlayManager.AddOverlay(_overlay);
     }
 
-    private void OnPlayerDetached(PlayerDetachedEvent args)
+    private void OnPlayerDetached(LocalPlayerDetachedEvent args)
     {
         _overlayManager.RemoveOverlay(_overlay);
         ClearOverlay();
index d7ec9f3497c718f8d68495b60f2992cb4c2ab21d..778de82210a8f3fe9832396b58cb764b2af92fc8 100644 (file)
@@ -17,7 +17,7 @@ using Robust.Client.UserInterface.Controllers;
 using Robust.Client.UserInterface.Controllers.Implementations;
 using Robust.Shared.Input.Binding;
 using Robust.Shared.Map;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Utility;
 using static Robust.Client.UserInterface.Controls.BaseButton;
 
index 397032cd1545559782148e8c1084062afaf78bf0..2d2883d8b7698ad0acf3d01f166001c0df28f03b 100644 (file)
@@ -16,7 +16,8 @@ using Robust.Client.State;
 using Robust.Shared.Input;
 using Robust.Shared.Map;
 using Robust.Shared.Player;
-using Robust.Shared.Players;
+using Robust.Shared.Prototypes;
+using Robust.Shared.Timing;
 
 namespace Content.Client.Weapons.Melee;
 
index 2971573ff28ebafbcef25fb791c947e975b298b4..2672b4db56e454de1dbffe093697daaf1b4233a8 100644 (file)
@@ -3,13 +3,11 @@ using System.Collections.Generic;
 using System.IO;
 using System.Linq;
 using Content.Server.GameTicking;
-using Content.Server.Players;
-using Content.Shared.Mind;
 using Content.Shared.Players;
-using Robust.Server.Player;
 using Robust.Shared.GameObjects;
 using Robust.Shared.IoC;
 using Robust.Shared.Network;
+using Robust.Shared.Player;
 using Robust.Shared.Timing;
 using Robust.UnitTesting;
 
@@ -30,8 +28,8 @@ public sealed partial class TestPair
     public RobustIntegrationTest.ServerIntegrationInstance Server { get; private set; } = default!;
     public RobustIntegrationTest.ClientIntegrationInstance Client { get;  private set; } = default!;
 
-    public IPlayerSession? Player => (IPlayerSession?) Server.PlayerMan.Sessions.FirstOrDefault();
-    public PlayerData? PlayerData => Player?.Data.ContentData();
+    public ICommonSession? Player => Server.PlayerMan.Sessions.FirstOrDefault();
+    public ContentPlayerData? PlayerData => Player?.Data.ContentData();
 
     public PoolTestLogHandler ServerLogHandler { get;  private set; } = default!;
     public PoolTestLogHandler ClientLogHandler { get;  private set; } = default!;
index 01f8bdd9387f2c4dc9141af87e7095797410acb6..01daeea93c53a176510871e8a5013d6374f54550 100644 (file)
@@ -3,8 +3,6 @@ using Content.Shared.Actions;
 using Content.Shared.CombatMode;
 using Robust.Server.Player;
 using Robust.Shared.GameObjects;
-using Robust.Shared.Players;
-using PlayerManager = Robust.Client.Player.PlayerManager;
 
 namespace Content.IntegrationTests.Tests.Actions;
 
@@ -26,7 +24,7 @@ public sealed class ActionsAddedTest
         var sEntMan = server.ResolveDependency<IEntityManager>();
         var cEntMan = client.ResolveDependency<IEntityManager>();
         var clientSession = client.ResolveDependency<Robust.Client.Player.IPlayerManager>().LocalPlayer?.Session;
-        var serverSession = server.ResolveDependency<IPlayerManager>().ServerSessions.Single();
+        var serverSession = server.ResolveDependency<IPlayerManager>().Sessions.Single();
         var sActionSystem = server.System<SharedActionsSystem>();
         var cActionSystem = client.System<SharedActionsSystem>();
 
index 6562a26b5e10ad740e6d093ae88436ba35f8fbe6..98c7363a6c4977522f8d11cc4f1fe0e3efe26f26 100644 (file)
@@ -7,8 +7,6 @@ using Content.Shared.Administration.Logs;
 using Content.Shared.Database;
 using Robust.Server.Player;
 using Robust.Shared.GameObjects;
-using Robust.Shared.Map;
-using Robust.Shared.Utility;
 
 namespace Content.IntegrationTests.Tests.Administration.Logs;
 
@@ -177,7 +175,7 @@ public sealed class AddTests
 
         await server.WaitPost(() =>
         {
-            var player = sPlayers.ServerSessions.First();
+            var player = sPlayers.Sessions.First();
             playerGuid = player.UserId;
 
             Assert.DoesNotThrow(() =>
@@ -280,7 +278,7 @@ public sealed class AddTests
 
         await server.WaitPost(() =>
         {
-            var player = sPlayers.ServerSessions.Single();
+            var player = sPlayers.Sessions.Single();
 
             sAdminLogSystem.Add(LogType.Unknown, $"{player} {player} test log: {guid}");
         });
@@ -318,7 +316,7 @@ public sealed class AddTests
 
         await server.WaitPost(() =>
         {
-            var player = sPlayers.ServerSessions.Single();
+            var player = sPlayers.Sessions.Single();
 
             sAdminLogSystem.Add(LogType.Unknown, $"{player:first} {player:second} test log: {guid}");
         });
index 1155edfad2ddc4cc47bfbc88f0687f21064f7ab4..5a58757d531531df1c6e6cd6bb530000607227ba 100644 (file)
@@ -5,6 +5,7 @@ using Content.Server.GameTicking;
 using Content.Shared.Database;
 using Robust.Server.Player;
 using Robust.Shared.GameObjects;
+using Robust.Shared.Player;
 
 namespace Content.IntegrationTests.Tests.Administration.Logs;
 
@@ -27,11 +28,11 @@ public sealed class QueryTests
         var date = DateTime.UtcNow;
         var guid = Guid.NewGuid();
 
-        IPlayerSession player = default;
+        ICommonSession player = default;
 
         await server.WaitPost(() =>
         {
-            player = sPlayers.ServerSessions.First();
+            player = sPlayers.Sessions.First();
 
             sAdminLogSystem.Add(LogType.Unknown, $"{player.AttachedEntity:Entity} test log: {guid}");
         });
index 9aac4e2892a9a203ea4f09672a14a7838c0c19a4..e2bff03501a230ddfaff61c7dd1866aed118ad5b 100644 (file)
@@ -25,7 +25,7 @@ public sealed class EuiManagerTest
 
             await server.WaitAssertion(() =>
             {
-                var clientSession = sPlayerManager.ServerSessions.Single();
+                var clientSession = sPlayerManager.Sessions.Single();
                 var ui = new AdminAnnounceEui();
                 eui.OpenEui(ui, clientSession);
             });
index b4b6c2239fbec3e66fbe79b9eb3bef04bd4076bf..df77410e540c8e274b4fbfb5bc069ff95d3510be 100644 (file)
@@ -14,6 +14,7 @@ using Content.Shared.Hands.Components;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction;
 using Content.Shared.Mind;
+using Content.Shared.Players;
 using Robust.Client.Input;
 using Robust.Client.UserInterface;
 using Robust.Server.GameObjects;
@@ -21,7 +22,7 @@ using Robust.Server.Player;
 using Robust.Shared.GameObjects;
 using Robust.Shared.Log;
 using Robust.Shared.Map;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;
 using Robust.UnitTesting;
@@ -67,7 +68,7 @@ public abstract partial class InteractionTest
     protected NetEntity Player;
 
     protected ICommonSession ClientSession = default!;
-    protected IPlayerSession ServerSession = default!;
+    protected ICommonSession ServerSession = default!;
 
     public EntityUid? ClientTarget;
 
index 28e49645c970abcef3d554e4e8b27b641aa2c9d8..22a185798e97c7406c0ba2e34a7190c23350bb95 100644 (file)
@@ -5,6 +5,7 @@ using Content.Server.Ghost.Roles.Components;
 using Content.Server.Players;
 using Content.Shared.Ghost;
 using Content.Shared.Mind;
+using Content.Shared.Players;
 using Robust.Shared.Console;
 using Robust.Shared.GameObjects;
 using Robust.Shared.Map;
@@ -43,7 +44,7 @@ public sealed class GhostRoleTests
         var sPlayerMan = server.ResolveDependency<Robust.Server.Player.IPlayerManager>();
         var conHost = client.ResolveDependency<IConsoleHost>();
         var mindSystem = entMan.System<SharedMindSystem>();
-        var session = sPlayerMan.ServerSessions.Single();
+        var session = sPlayerMan.Sessions.Single();
         var originalMindId = session.ContentData()!.Mind!.Value;
 
         // Spawn player entity & attach
index 9fc68ef93d45f0f596c66eb762e3989e487bbd5b..a67a45ecb4c8ec386430757f0ce71ce28d164eff 100644 (file)
@@ -2,6 +2,7 @@ using System.Linq;
 using Content.Server.Players;
 using Content.Shared.Ghost;
 using Content.Shared.Mind;
+using Content.Shared.Players;
 using Robust.Server.Console;
 using Robust.Server.GameObjects;
 using Robust.Server.Player;
@@ -35,7 +36,7 @@ public sealed partial class MindTests
         MindComponent mind = default!;
         await server.WaitAssertion(() =>
         {
-            var player = playerMan.ServerSessions.Single();
+            var player = playerMan.Sessions.Single();
 
             playerEnt = entMan.SpawnEntity(null, MapCoordinates.Nullspace);
             visitEnt = entMan.SpawnEntity(null, MapCoordinates.Nullspace);
@@ -81,7 +82,7 @@ public sealed partial class MindTests
         var entMan = server.ResolveDependency<IServerEntityManager>();
         var mapManager = server.ResolveDependency<IMapManager>();
         var playerMan = server.ResolveDependency<IPlayerManager>();
-        var player = playerMan.ServerSessions.Single();
+        var player = playerMan.Sessions.Single();
 
         var mindSystem = entMan.EntitySysManager.GetEntitySystem<SharedMindSystem>();
 
@@ -128,7 +129,7 @@ public sealed partial class MindTests
         var entMan = server.ResolveDependency<IServerEntityManager>();
         var playerMan = server.ResolveDependency<IPlayerManager>();
 
-        var player = playerMan.ServerSessions.Single();
+        var player = playerMan.Sessions.Single();
 
         Assert.That(!entMan.HasComponent<GhostComponent>(player.AttachedEntity), "Player was initially a ghost?");
 
@@ -162,7 +163,7 @@ public sealed partial class MindTests
         var mindSystem = entMan.EntitySysManager.GetEntitySystem<SharedMindSystem>();
         var mind = GetMind(pair);
 
-        var player = playerMan.ServerSessions.Single();
+        var player = playerMan.Sessions.Single();
 #pragma warning disable NUnit2045 // Interdependent assertions.
         Assert.That(player.AttachedEntity, Is.Not.Null);
         Assert.That(entMan.EntityExists(player.AttachedEntity));
@@ -218,7 +219,7 @@ public sealed partial class MindTests
         var playerMan = server.ResolveDependency<IPlayerManager>();
         var serverConsole = server.ResolveDependency<IServerConsoleHost>();
 
-        var player = playerMan.ServerSessions.Single();
+        var player = playerMan.Sessions.Single();
 
         var ghost = await BecomeGhost(pair);
 
@@ -263,7 +264,7 @@ public sealed partial class MindTests
         var playerMan = server.ResolveDependency<IPlayerManager>();
         var serverConsole = server.ResolveDependency<IServerConsoleHost>();
 
-        var player = playerMan.ServerSessions.Single();
+        var player = playerMan.Sessions.Single();
 
         EntityUid ghost = default!;
 
index f71a6ad5f98e34b249afcaa67394bd1cd8e71586..d6b30d60a0f9e6d5f3ddb424de8e17476f3e7ab3 100644 (file)
@@ -1,14 +1,17 @@
 using System.Linq;
 using Content.IntegrationTests.Pair;
+using Content.Server.Mind;
 using Content.Server.Players;
 using Content.Shared.Ghost;
 using Content.Shared.Mind;
+using Content.Shared.Players;
 using Robust.Server.GameObjects;
 using Robust.Server.Player;
 using Robust.Shared.Enums;
 using Robust.Shared.GameObjects;
 using Robust.Shared.Map;
 using Robust.Shared.Network;
+using Robust.Shared.Player;
 
 namespace Content.IntegrationTests.Tests.Minds;
 
@@ -36,7 +39,7 @@ public sealed partial class MindTests
         var playerMan = pair.Server.ResolveDependency<IPlayerManager>();
         var mindSys = entMan.System<SharedMindSystem>();
 
-        var player = playerMan.ServerSessions.Single();
+        var player = playerMan.Sessions.Single();
 
         EntityUid entity = default;
         EntityUid mindId = default!;
@@ -71,7 +74,7 @@ public sealed partial class MindTests
         EntityUid mindId = default!;
         MindComponent mind = default!;
 
-        var player = playerMan.ServerSessions.Single();
+        var player = playerMan.Sessions.Single();
         await pair.Server.WaitAssertion(() =>
         {
             var oldUid = player.AttachedEntity;
@@ -116,20 +119,25 @@ public sealed partial class MindTests
     /// </summary>
     private static (EntityUid Id, MindComponent Comp) GetMind(Pair.TestPair pair)
     {
-        var playerMan = pair.Server.ResolveDependency<IPlayerManager>();
-        var entMan = pair.Server.ResolveDependency<IEntityManager>();
-        var player = playerMan.ServerSessions.SingleOrDefault();
+        var playerMan = pair.Server.PlayerMan;
+        var entMan = pair.Server.EntMan;
+        var player = playerMan.Sessions.SingleOrDefault();
         Assert.That(player, Is.Not.Null);
 
         var mindId = player.ContentData()!.Mind!.Value;
         Assert.That(mindId, Is.Not.EqualTo(default(EntityUid)));
         var mind = entMan.GetComponent<MindComponent>(mindId);
+        ActorComponent actor = default!;
         Assert.Multiple(() =>
         {
+            Assert.That(player, Is.EqualTo(mind.Session), "Player session does not match mind session");
+            Assert.That(entMan.System<MindSystem>().GetMind(player.UserId), Is.EqualTo(mindId));
             Assert.That(player.AttachedEntity, Is.EqualTo(mind.CurrentEntity), "Player is not attached to the mind's current entity.");
             Assert.That(entMan.EntityExists(mind.OwnedEntity), "The mind's current entity does not exist");
             Assert.That(mind.VisitingEntity == null || entMan.EntityExists(mind.VisitingEntity), "The minds visited entity does not exist.");
+            Assert.That(entMan.TryGetComponent(mind.CurrentEntity, out actor));
         });
+        Assert.That(actor.PlayerSession, Is.EqualTo(mind.Session));
 
         return (mindId, mind);
     }
@@ -139,7 +147,7 @@ public sealed partial class MindTests
         var netManager = pair.Client.ResolveDependency<IClientNetManager>();
         var playerMan = pair.Server.ResolveDependency<IPlayerManager>();
         var entMan = pair.Server.ResolveDependency<IEntityManager>();
-        var player = playerMan.ServerSessions.Single();
+        var player = playerMan.Sessions.Single();
         var mindId = player.ContentData()!.Mind!.Value;
         var mind = entMan.GetComponent<MindComponent>(mindId);
 
@@ -161,21 +169,21 @@ public sealed partial class MindTests
     {
         var netManager = pair.Client.ResolveDependency<IClientNetManager>();
         var playerMan = pair.Server.ResolveDependency<IPlayerManager>();
-        Assert.That(!playerMan.ServerSessions.Any());
+        Assert.That(!playerMan.Sessions.Any());
 
         await Task.WhenAll(pair.Client.WaitIdleAsync(), pair.Client.WaitIdleAsync());
         pair.Client.SetConnectTarget(pair.Server);
         await pair.Client.WaitPost(() => netManager.ClientConnect(null!, 0, username));
         await pair.RunTicksSync(5);
 
-        var player = playerMan.ServerSessions.Single();
+        var player = playerMan.Sessions.Single();
         Assert.That(player.Status, Is.EqualTo(SessionStatus.InGame));
     }
 
-    private static async Task<IPlayerSession> DisconnectReconnect(Pair.TestPair pair)
+    private static async Task<ICommonSession> DisconnectReconnect(Pair.TestPair pair)
     {
         var playerMan = pair.Server.ResolveDependency<IPlayerManager>();
-        var player = playerMan.ServerSessions.Single();
+        var player = playerMan.Sessions.Single();
         var name = player.Name;
         var id = player.UserId;
 
@@ -183,7 +191,7 @@ public sealed partial class MindTests
         await Connect(pair, name);
 
         // Session has changed
-        var newSession = playerMan.ServerSessions.Single();
+        var newSession = playerMan.Sessions.Single();
         Assert.Multiple(() =>
         {
             Assert.That(newSession, Is.Not.EqualTo(player));
index ea2110c03a6ae3f3a1e830245ff5cb38aafda26f..3cac766825d0cc5abed4778858502fe58137f2f8 100644 (file)
@@ -1,6 +1,8 @@
 using System.Linq;
 using Content.Shared.Ghost;
 using Content.Shared.Mind;
+using NUnit.Framework.Interfaces;
+using Robust.Server.GameObjects;
 using Robust.Server.Player;
 using Robust.Shared.GameObjects;
 using Robust.Shared.Map;
@@ -49,7 +51,7 @@ public sealed partial class MindTests
         var mind = GetMind(pair);
 
         var playerMan = pair.Server.ResolveDependency<IPlayerManager>();
-        var player = playerMan.ServerSessions.Single();
+        var player = playerMan.Sessions.Single();
         var name = player.Name;
         var user = player.UserId;
         Assert.That(mind.Comp.OwnedEntity, Is.Not.Null);
@@ -72,7 +74,7 @@ public sealed partial class MindTests
 
         // Reconnect
         await Connect(pair, name);
-        player = playerMan.ServerSessions.Single();
+        player = playerMan.Sessions.Single();
         Assert.Multiple(() =>
         {
             Assert.That(user, Is.EqualTo(player.UserId));
@@ -127,8 +129,10 @@ public sealed partial class MindTests
         var mindSys = entMan.System<SharedMindSystem>();
         var mind = GetMind(pair);
 
+        Assert.Null(mind.Comp.VisitingEntity);
+
         // Make player visit a new mob
-        var original = mind.Comp.CurrentEntity;
+        var original = mind.Comp.OwnedEntity;
         EntityUid visiting = default;
         await pair.Server.WaitAssertion(() =>
         {
@@ -137,6 +141,7 @@ public sealed partial class MindTests
         });
         await pair.RunTicksSync(5);
 
+        Assert.That(mind.Comp.VisitingEntity, Is.EqualTo(visiting));
         await DisconnectReconnect(pair);
 
         // Player is back in control of the visited mob, mind was preserved
@@ -150,4 +155,32 @@ public sealed partial class MindTests
 
         await pair.CleanReturnAsync();
     }
+
+    // This test will do the following
+    // - connect as a normal player
+    // - disconnect
+    // - reconnect
+    // - assert that they return to the original entity.
+    [Test]
+    public async Task TestReconnect()
+    {
+        await using var pair = await SetupPair();
+        var mind = GetMind(pair);
+
+        Assert.Null(mind.Comp.VisitingEntity);
+        Assert.NotNull(mind.Comp.OwnedEntity);
+        var entity = mind.Comp.OwnedEntity;
+
+        await pair.RunTicksSync(5);
+        await DisconnectReconnect(pair);
+        await pair.RunTicksSync(5);
+
+        var newMind = GetMind(pair);
+
+        Assert.Null(newMind.Comp.VisitingEntity);
+        Assert.That(newMind.Comp.OwnedEntity, Is.EqualTo(entity));
+        Assert.That(newMind.Id, Is.EqualTo(mind.Id));
+
+        await pair.CleanReturnAsync();
+    }
 }
index 3ad61bcdf05ddbf04f795cec7f788c26c72665d3..c9788b80a6d75e46cf7d694316ea6db7a962d71a 100644 (file)
@@ -11,6 +11,7 @@ using Content.Shared.Damage.Prototypes;
 using Content.Shared.FixedPoint;
 using Content.Shared.Mind;
 using Content.Shared.Mind.Components;
+using Content.Shared.Players;
 using Content.Shared.Roles;
 using Content.Shared.Roles.Jobs;
 using Robust.Server.Console;
@@ -345,7 +346,7 @@ public sealed partial class MindTests
         EntityUid entity = default!;
         EntityUid mindId = default!;
         MindComponent mind = default!;
-        var player = playerMan.ServerSessions.Single();
+        var player = playerMan.Sessions.Single();
 
         await server.WaitAssertion(() =>
         {
@@ -406,12 +407,6 @@ public sealed partial class MindTests
         await pair.CleanReturnAsync();
     }
 
-    // TODO Implement
-    /*[Test]
-    public async Task TestPlayerCanReturnFromGhostWhenDead()
-    {
-    }*/
-
     [Test]
     public async Task TestGhostDoesNotInfiniteLoop()
     {
@@ -432,7 +427,7 @@ public sealed partial class MindTests
         EntityUid ghost = default!;
         EntityUid mindId = default!;
         MindComponent mind = default!;
-        var player = playerMan.ServerSessions.Single();
+        var player = playerMan.Sessions.Single();
 
         await server.WaitAssertion(() =>
         {
index ca7eeac199d033932cff8f685dda41ad4c881139..d6aec781a99e7bd410bd9b814a85666e9e20ca67 100644 (file)
@@ -2,8 +2,7 @@
 using System.Collections.Generic;
 using Content.IntegrationTests.Pair;
 using Content.Server.Administration.Managers;
-using Robust.Server.Player;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Toolshed;
 using Robust.Shared.Toolshed.Errors;
 using Robust.Shared.Toolshed.Syntax;
@@ -60,7 +59,7 @@ public abstract class ToolshedTest : IInvocationContext
         AdminManager = Server.ResolveDependency<IAdminManager>();
     }
 
-    protected bool InvokeCommand(string command, out object? result, IPlayerSession? session = null)
+    protected bool InvokeCommand(string command, out object? result, ICommonSession? session = null)
     {
         return Toolshed.InvokeCommand(this, command, null, out result);
     }
@@ -95,7 +94,7 @@ public abstract class ToolshedTest : IInvocationContext
         return true;
     }
 
-    protected IPlayerSession? InvocationSession { get; set; }
+    protected ICommonSession? InvocationSession { get; set; }
 
     public ICommonSession? Session
     {
index b799db78a5f45827aca541433e3c770b055c5bd3..8f3dd59baf8f31cd4b10458f826f8233cd0f7063 100644 (file)
@@ -68,7 +68,7 @@ namespace Content.MapRenderer.Painters
 
             await server.WaitPost(() =>
             {
-                var playerEntity = sPlayerManager.ServerSessions.Single().AttachedEntity;
+                var playerEntity = sPlayerManager.Sessions.Single().AttachedEntity;
 
                 if (playerEntity.HasValue)
                 {
index 24ca7aca6841cff99ae80de8ab6000405d9bece8..07eb416be64c3eb05f4071b9629cf2ad154ac4b1 100644 (file)
@@ -1,5 +1,5 @@
 using Content.Shared.Administration;
-using Robust.Server.Player;
+using Robust.Shared.Player;
 
 namespace Content.Server.Administration
 {
@@ -8,7 +8,7 @@ namespace Content.Server.Administration
     /// </summary>
     public sealed class AdminPermsChangedEventArgs : EventArgs
     {
-        public AdminPermsChangedEventArgs(IPlayerSession player, AdminFlags? flags)
+        public AdminPermsChangedEventArgs(ICommonSession player, AdminFlags? flags)
         {
             Player = player;
             Flags = flags;
@@ -17,7 +17,7 @@ namespace Content.Server.Administration
         /// <summary>
         ///     The player that had their admin permissions changed.
         /// </summary>
-        public IPlayerSession Player { get; }
+        public ICommonSession Player { get; }
 
         /// <summary>
         ///     The admin flags of the player. Null if the player is no longer an admin.
index 42a8600ff17ff4396e547184910a0086519dd83d..2d1a15a0bed00dc78cef48b900414de465df43ff 100644 (file)
@@ -2,7 +2,6 @@
 using Content.Shared.Administration;
 using Content.Shared.Ghost;
 using Content.Shared.Mind;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Administration.Commands
@@ -18,7 +17,7 @@ namespace Content.Server.Administration.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (player == null)
             {
                 shell.WriteLine("Nah");
index 8e6c402c4e2e51562e67abc78a25efac9a217300..9765e8385f0240ef1e3b2e528249249934728624 100644 (file)
@@ -2,7 +2,6 @@
 using Content.Server.Administration.Managers;
 using Content.Server.Afk;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Utility;
 
@@ -35,7 +34,7 @@ public sealed class AdminWhoCommand : IConsoleCommand
             if (adminData.Title is { } title)
                 sb.Append($": [{title}]");
 
-            if (shell.Player is IPlayerSession player && adminMgr.HasAdminFlag(player, AdminFlags.Admin))
+            if (shell.Player is { } player && adminMgr.HasAdminFlag(player, AdminFlags.Admin))
             {
                 if (afk.IsAfk(admin))
                     sb.Append(" [AFK]");
index c4cd7f13e417216b78b71cf8636893adeb4aeb45..d80db96686357693a5f8c9eb9fb0e7cfe42d7d9a 100644 (file)
@@ -1,7 +1,6 @@
 using Content.Server.Administration.UI;
 using Content.Server.EUI;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Administration.Commands
@@ -17,7 +16,7 @@ namespace Content.Server.Administration.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (player == null)
             {
                 shell.WriteLine("This does not work from the server console.");
index 58a801e4105640774457f26d3d99495c7733e8cd..156fdf496a9a086584ef8cafc56fa7ee22735962 100644 (file)
@@ -1,15 +1,8 @@
 using System.Linq;
-using System.Net;
-using System.Net.Sockets;
-using System.Text;
 using Content.Server.Administration.Managers;
-using Content.Server.Administration.Notes;
-using Content.Server.Database;
-using Content.Server.GameTicking;
 using Content.Shared.Administration;
 using Content.Shared.CCVar;
 using Content.Shared.Database;
-using Content.Shared.Players.PlayTimeTracking;
 using Robust.Server.Player;
 using Robust.Shared.Configuration;
 using Robust.Shared.Console;
@@ -84,7 +77,7 @@ public sealed class BanCommand : LocalizedCommands
         }
 
         var located = await _locator.LookupIdByNameOrIdAsync(target);
-        var player = shell.Player as IPlayerSession;
+        var player = shell.Player;
 
         if (located == null)
         {
@@ -102,7 +95,7 @@ public sealed class BanCommand : LocalizedCommands
     {
         if (args.Length == 1)
         {
-            var options = _playerManager.ServerSessions.Select(c => c.Name).OrderBy(c => c).ToArray();
+            var options = _playerManager.Sessions.Select(c => c.Name).OrderBy(c => c).ToArray();
             return CompletionResult.FromHintOptions(options, LocalizationManager.GetString("cmd-ban-hint"));
         }
 
index 1c2be523949f3b2485cdf02d901a40f54ad862df..a5bc97dce3edb2d1326dda10c342c97543c8bbf8 100644 (file)
@@ -36,7 +36,7 @@ public sealed class BanListCommand : LocalizedCommands
             return;
         }
 
-        if (shell.Player is not IPlayerSession player)
+        if (shell.Player is not { } player)
         {
             var bans = await _dbManager.GetServerBansAsync(data.LastAddress, data.UserId, data.LastHWId, false);
 
@@ -67,7 +67,7 @@ public sealed class BanListCommand : LocalizedCommands
             return CompletionResult.Empty;
 
         var playerMgr = IoCManager.Resolve<IPlayerManager>();
-        var options = playerMgr.ServerSessions.Select(c => c.Name).OrderBy(c => c).ToArray();
+        var options = playerMgr.Sessions.Select(c => c.Name).OrderBy(c => c).ToArray();
         return CompletionResult.FromHintOptions(options, Loc.GetString("cmd-banlist-hint"));
     }
 }
index 6036e5aa6ea5817ea4500792754a6a6b8f915ba1..9f9ec9e89fa4177100d9ef1f03d4caf0848aa1ad 100644 (file)
@@ -1,12 +1,6 @@
 using Content.Shared.Administration;
 using Robust.Shared.Console;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 using Content.Server.EUI;
-using Robust.Server.Player;
 
 namespace Content.Server.Administration.Commands;
 
@@ -21,7 +15,7 @@ public sealed class BanPanelCommand : LocalizedCommands
 
     public override async void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        if (shell.Player is not IPlayerSession player)
+        if (shell.Player is not { } player)
         {
             shell.WriteError(Loc.GetString("cmd-banpanel-server"));
             return;
index 8fc74c61d468f8f3de4032aef432e2a607b18d93..317461a3736dfb2ac119471ce29f99e5e1177ab2 100644 (file)
@@ -1,6 +1,5 @@
 using Content.Server.Mind;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Administration.Commands
@@ -16,7 +15,7 @@ namespace Content.Server.Administration.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            if (shell.Player is not IPlayerSession player)
+            if (shell.Player is not { } player)
             {
                 shell.WriteLine("shell-server-cannot");
                 return;
index 79b0e8db7d68d33e64495bd1eaf00491a2e710ce..61b47d785674de2c31e4a8eab00239ec18a077a3 100644 (file)
@@ -1,7 +1,5 @@
-using Content.Server.Chat;
 using Content.Server.Chat.Systems;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Administration.Commands
@@ -17,7 +15,7 @@ namespace Content.Server.Administration.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (player == null)
             {
                 shell.WriteLine("shell-only-players-can-run-this-command");
index c2bbfa7a339667754974a8622e3ba0d7c07210b8..cf659412008ecbae77ee24d37284af8948084c46 100644 (file)
@@ -1,10 +1,8 @@
 using Content.Server.Administration.Managers;
 using Content.Shared.Administration;
 using JetBrains.Annotations;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
-
 namespace Content.Server.Administration.Commands
 {
     [UsedImplicitly]
@@ -17,7 +15,7 @@ namespace Content.Server.Administration.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (player == null)
             {
                 shell.WriteLine("You cannot use this command from the server console.");
index d48b69a5ad296a63404e2d8a72fbbbc5c518cd98..56ed78b2e2e3909ecd87b902a10a65ecd915450e 100644 (file)
@@ -3,7 +3,6 @@ using Content.Server.EUI;
 using Content.Server.Explosion.EntitySystems;
 using Content.Shared.Administration;
 using Content.Shared.Explosion;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Map;
 using Robust.Shared.Prototypes;
@@ -21,7 +20,7 @@ public sealed class OpenExplosionEui : IConsoleCommand
 
     public void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        var player = shell.Player as IPlayerSession;
+        var player = shell.Player;
         if (player == null)
         {
             shell.WriteError("This does not work from the server console.");
index b06d36d08b79d05f1eb232fb74678091556144a0..cf9e97e3997e627208f95d9572e866881d068f1c 100644 (file)
@@ -1,7 +1,6 @@
 using Content.Server.EUI;
 using Content.Server.Fax.AdminUI;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Administration.Commands;
@@ -16,7 +15,7 @@ public sealed class FaxUiCommand : IConsoleCommand
 
     public void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        var player = shell.Player as IPlayerSession;
+        var player = shell.Player;
         if (player == null)
         {
             shell.WriteLine("shell-only-players-can-run-this-command");
index 9f28dc907c7959b42f36fb0ad0a35411864b4be5..47ff3e1a1c89374f8cb681b2cce7281abeba6742 100644 (file)
@@ -1,7 +1,6 @@
 using Content.Server.Administration.Logs;
 using Content.Server.EUI;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Administration.Commands;
@@ -15,7 +14,7 @@ public sealed class OpenAdminLogsCommand : IConsoleCommand
 
     public void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        if (shell.Player is not IPlayerSession player)
+        if (shell.Player is not { } player)
         {
             shell.WriteLine("This does not work from the server console.");
             return;
index 147c0d6a82e27f773d905a1683e8b118249c3a9a..e6ae4f7616754df70bc455c43f0ffbc1868832b2 100644 (file)
@@ -1,7 +1,5 @@
 using Content.Server.Administration.Notes;
-using Content.Server.Database;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Administration.Commands;
@@ -17,7 +15,7 @@ public sealed class OpenAdminNotesCommand : IConsoleCommand
 
     public async void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        if (shell.Player is not IPlayerSession player)
+        if (shell.Player is not { } player)
         {
             shell.WriteError("This does not work from the server console.");
             return;
index 78d56cb4fbc34c272010430b0ed6d860c2877a67..fd3227d4aafa7ff88ef3b44017f13ee2a732f87b 100644 (file)
@@ -1,10 +1,8 @@
 using Content.Server.Administration.UI;
 using Content.Server.EUI;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
-
 namespace Content.Server.Administration.Commands
 {
     [AdminCommand(AdminFlags.Permissions)]
@@ -16,7 +14,7 @@ namespace Content.Server.Administration.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (player == null)
             {
                 shell.WriteLine("This does not work from the server console.");
index d61114fcae8f3eae39b2a0ec7892dd02ab0ebfb2..507c7ab2799f59afdaa9938f8209642507028b51 100644 (file)
@@ -1,7 +1,6 @@
 using Content.Server.Administration.Notes;
 using Content.Shared.Administration;
 using Content.Shared.CCVar;
-using Robust.Server.Player;
 using Robust.Shared.Configuration;
 using Robust.Shared.Console;
 
@@ -27,7 +26,7 @@ public sealed class OpenUserVisibleNotesCommand : IConsoleCommand
             return;
         }
 
-        if (shell.Player is not IPlayerSession player)
+        if (shell.Player is not { } player)
         {
             shell.WriteError("This does not work from the server console.");
             return;
index 869024eb7c0c74967147b12ce9fb74f95c07a00a..9cbaaece310fc4264b3481f85898d3752efaabdf 100644 (file)
@@ -1,7 +1,6 @@
 using System.Text;
 using Content.Server.Database;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Administration.Commands
@@ -15,7 +14,7 @@ namespace Content.Server.Administration.Commands
 
         public async void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             var dbMan = IoCManager.Resolve<IServerDbManager>();
 
             if (args.Length != 1)
index ec5b21dcee8e84fba49fbc2c53c857a7d8f16f80..fdf067181dba7859918d0532eebeec8d6dd54716 100644 (file)
@@ -6,7 +6,6 @@ using Robust.Shared.Audio;
 using Robust.Shared.Console;
 using Robust.Shared.ContentPack;
 using Robust.Shared.Player;
-using Robust.Shared.Players;
 using Robust.Shared.Prototypes;
 
 namespace Content.Server.Administration.Commands;
index 12ff13221a065f0c24c26a8a00b4796b720d67e4..a3f5993766370ff0e40ba5d9ac761050a0c5ee0a 100644 (file)
@@ -1,9 +1,7 @@
 using Content.Server.Administration.Managers;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
-
 namespace Content.Server.Administration.Commands
 {
     [AnyCommand]
@@ -15,7 +13,7 @@ namespace Content.Server.Administration.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (player == null)
             {
                 shell.WriteLine("You cannot use this command from the server console.");
index bb11b938d85e2ca11d21b998382bc010d41dd944..27528e1940f9e20521d5c1a99d03cd497542c98f 100644 (file)
@@ -1,8 +1,6 @@
-
 using Content.Server.Database;
 using Content.Server.Preferences.Managers;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Administration.Commands
@@ -16,7 +14,7 @@ namespace Content.Server.Administration.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            if (!(shell.Player is IPlayerSession))
+            if (shell.Player == null)
             {
                 shell.WriteError(Loc.GetString("shell-only-players-can-run-this-command"));
                 return;
index b9ff329ed2e6a6aeca5cda035c1abc32105ed6b8..5310c2dd7f5c73df0f3942ce38ec390ca91e93cc 100644 (file)
@@ -2,6 +2,7 @@ using Content.Server.Players;
 using Content.Shared.Administration;
 using Content.Shared.Mind;
 using Content.Shared.Mind.Components;
+using Content.Shared.Players;
 using Robust.Server.Player;
 using Robust.Shared.Console;
 
index 28172ee6c5c8585101208aca10d7fbbe80fb3b22..b2e7f4e6cc0443545ae603310aeeec1b6476e8d3 100644 (file)
@@ -10,7 +10,6 @@ using Content.Shared.PDA;
 using Content.Shared.Preferences;
 using Content.Shared.Roles;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Prototypes;
 
@@ -57,7 +56,7 @@ namespace Content.Server.Administration.Commands
 
             if (args.Length == 1)
             {
-                if (shell.Player is not IPlayerSession player)
+                if (shell.Player is not { } player)
                 {
                     shell.WriteError(Loc.GetString("set-outfit-command-is-not-player-error"));
                     return;
index 30a6d127aa36bc597240b7e3d8e3f3c5dbafc5a6..0d6da0d993735f65ab6248e96f3b92144f354710 100644 (file)
@@ -4,11 +4,9 @@ using Content.Server.Warps;
 using Content.Shared.Administration;
 using Content.Shared.Follower;
 using Content.Shared.Ghost;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Enums;
 using Robust.Shared.Map;
-using Robust.Shared.Physics;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Systems;
 
@@ -28,7 +26,7 @@ namespace Content.Server.Administration.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (player == null)
             {
                 shell.WriteLine("Only players can use this command");
index 0d3f3291e6b7420e9bc70befd58b4c9e8db1d0aa..dd95a2d897134b13ee389b706aab3854a07457a0 100644 (file)
@@ -1,8 +1,8 @@
 using Content.Server.Database;
 using Content.Shared.CCVar;
-using Robust.Server.Player;
 using Robust.Server.Upload;
 using Robust.Shared.Configuration;
+using Robust.Shared.Player;
 using Robust.Shared.Upload;
 
 namespace Content.Server.Administration;
@@ -22,7 +22,7 @@ public sealed class ContentNetworkResourceManager
         _netRes.OnResourceUploaded += OnUploadResource;
     }
 
-    private async void OnUploadResource(IPlayerSession session, NetworkResourceUploadMessage msg)
+    private async void OnUploadResource(ICommonSession session, NetworkResourceUploadMessage msg)
     {
         if (StoreUploaded)
             await _serverDb.AddUploadedResourceLogAsync(session.UserId, DateTime.Now, msg.RelativePath.ToString(), msg.Data);
index 63f30c7a66d20dbae80141e3927962d0ec5c194b..0a67d61cefe7fb1c25e7a576094ae76a2781ed06 100644 (file)
@@ -3,8 +3,8 @@ using System.Text.Json;
 using System.Text.Json.Serialization;
 using Content.Server.Administration.Logs.Converters;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
 using Robust.Shared.Map;
+using Robust.Shared.Player;
 
 namespace Content.Server.Administration.Logs;
 
@@ -44,7 +44,7 @@ public sealed partial class AdminLogManager
             var value = properties[key];
             value = value switch
             {
-                IPlayerSession player => new SerializablePlayer(player),
+                ICommonSession player => new SerializablePlayer(player),
                 EntityCoordinates entityCoordinates => new SerializableEntityCoordinates(_entityManager, entityCoordinates),
                 _ => value
             };
@@ -56,7 +56,7 @@ public sealed partial class AdminLogManager
             {
                 EntityUid id => id,
                 EntityStringRepresentation rep => rep.Uid,
-                IPlayerSession {AttachedEntity: {Valid: true}} session => session.AttachedEntity,
+                ICommonSession {AttachedEntity: {Valid: true}} session => session.AttachedEntity,
                 IComponent component => component.Owner,
                 _ => null
             };
index 0605c2db2a31467ddb00dde6827d7e7a69ada090..c1567448ccb8420b3da412681aa78ef18b86c1e7 100644 (file)
@@ -1,5 +1,5 @@
 using System.Text.Json;
-using Robust.Server.Player;
+using Robust.Shared.Player;
 
 namespace Content.Server.Administration.Logs.Converters;
 
@@ -36,9 +36,9 @@ public sealed class PlayerSessionConverter : AdminLogConverter<SerializablePlaye
 
 public readonly struct SerializablePlayer
 {
-    public readonly IPlayerSession Player;
+    public readonly ICommonSession Player;
 
-    public SerializablePlayer(IPlayerSession player)
+    public SerializablePlayer(ICommonSession player)
     {
         Player = player;
     }
index 4aa6074b1095b981eac95335602624260f2975d6..0895183215ed49480a404212d57dcefbc320999d 100644 (file)
@@ -7,15 +7,15 @@ using Content.Server.Database;
 using Content.Server.Players;
 using Content.Shared.Administration;
 using Content.Shared.CCVar;
+using Content.Shared.Players;
 using Robust.Server.Console;
 using Robust.Server.Player;
 using Robust.Shared.Configuration;
 using Robust.Shared.Console;
 using Robust.Shared.ContentPack;
 using Robust.Shared.Enums;
-using Robust.Shared.Map;
 using Robust.Shared.Network;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Toolshed;
 using Robust.Shared.Toolshed.Errors;
 using Robust.Shared.Utility;
@@ -35,16 +35,16 @@ namespace Content.Server.Administration.Managers
         [Dependency] private readonly IChatManager _chat = default!;
         [Dependency] private readonly ToolshedManager _toolshed = default!;
 
-        private readonly Dictionary<IPlayerSession, AdminReg> _admins = new();
+        private readonly Dictionary<ICommonSession, AdminReg> _admins = new();
         private readonly HashSet<NetUserId> _promotedPlayers = new();
 
         public event Action<AdminPermsChangedEventArgs>? OnPermsChanged;
 
-        public IEnumerable<IPlayerSession> ActiveAdmins => _admins
+        public IEnumerable<ICommonSession> ActiveAdmins => _admins
             .Where(p => p.Value.Data.Active)
             .Select(p => p.Key);
 
-        public IEnumerable<IPlayerSession> AllAdmins => _admins.Select(p => p.Key);
+        public IEnumerable<ICommonSession> AllAdmins => _admins.Select(p => p.Key);
 
         private readonly AdminCommandPermissions _commandPermissions = new();
         private readonly AdminCommandPermissions _toolshedCommandPermissions = new();
@@ -56,7 +56,7 @@ namespace Content.Server.Administration.Managers
 
         public AdminData? GetAdminData(ICommonSession session, bool includeDeAdmin = false)
         {
-            if (_admins.TryGetValue((IPlayerSession)session, out var reg) && (reg.Data.Active || includeDeAdmin))
+            if (_admins.TryGetValue(session, out var reg) && (reg.Data.Active || includeDeAdmin))
             {
                 return reg.Data;
             }
@@ -66,13 +66,13 @@ namespace Content.Server.Administration.Managers
 
         public AdminData? GetAdminData(EntityUid uid, bool includeDeAdmin = false)
         {
-            if (_playerManager.TryGetSessionByEntity(uid, out var session) && session is IPlayerSession playerSession)
-                return GetAdminData(playerSession, includeDeAdmin);
+            if (_playerManager.TryGetSessionByEntity(uid, out var session))
+                return GetAdminData(session, includeDeAdmin);
 
             return null;
         }
 
-        public void DeAdmin(IPlayerSession session)
+        public void DeAdmin(ICommonSession session)
         {
             if (!_admins.TryGetValue(session, out var reg))
             {
@@ -95,7 +95,7 @@ namespace Content.Server.Administration.Managers
             UpdateAdminStatus(session);
         }
 
-        public void ReAdmin(IPlayerSession session)
+        public void ReAdmin(ICommonSession session)
         {
             if (!_admins.TryGetValue(session, out var reg))
             {
@@ -119,7 +119,7 @@ namespace Content.Server.Administration.Managers
             UpdateAdminStatus(session);
         }
 
-        public async void ReloadAdmin(IPlayerSession player)
+        public async void ReloadAdmin(ICommonSession player)
         {
             var data = await LoadAdminData(player);
             var curAdmin = _admins.GetValueOrDefault(player);
@@ -236,7 +236,7 @@ namespace Content.Server.Administration.Managers
             _toolshed.ActivePermissionController = this;
         }
 
-        public void PromoteHost(IPlayerSession player)
+        public void PromoteHost(ICommonSession player)
         {
             _promotedPlayers.Add(player.UserId);
 
@@ -250,7 +250,7 @@ namespace Content.Server.Administration.Managers
         }
 
         // NOTE: Also sends commands list for non admins..
-        private void UpdateAdminStatus(IPlayerSession session)
+        private void UpdateAdminStatus(ICommonSession session)
         {
             var msg = new MsgUpdateAdminStatus();
 
@@ -290,7 +290,7 @@ namespace Content.Server.Administration.Managers
             }
         }
 
-        private async void LoginAdminMaybe(IPlayerSession session)
+        private async void LoginAdminMaybe(ICommonSession session)
         {
             var adminDat = await LoadAdminData(session);
             if (adminDat == null)
@@ -323,7 +323,7 @@ namespace Content.Server.Administration.Managers
             UpdateAdminStatus(session);
         }
 
-        private async Task<(AdminData dat, int? rankId, bool specialLogin)?> LoadAdminData(IPlayerSession session)
+        private async Task<(AdminData dat, int? rankId, bool specialLogin)?> LoadAdminData(ICommonSession session)
         {
             var promoteHost = IsLocal(session) && _cfg.GetCVar(CCVars.ConsoleLoginLocal)
                               || _promotedPlayers.Contains(session.UserId)
@@ -387,7 +387,7 @@ namespace Content.Server.Administration.Managers
             }
         }
 
-        private static bool IsLocal(IPlayerSession player)
+        private static bool IsLocal(ICommonSession player)
         {
             var ep = player.ConnectedClient.RemoteEndPoint;
             var addr = ep.Address;
@@ -419,7 +419,7 @@ namespace Content.Server.Administration.Managers
             return false;
         }
 
-        public bool CanCommand(IPlayerSession session, string cmdName)
+        public bool CanCommand(ICommonSession session, string cmdName)
         {
             if (_commandPermissions.AnyCommands.Contains(cmdName))
             {
@@ -474,7 +474,7 @@ namespace Content.Server.Administration.Managers
                 return true;
             }
 
-            var data = GetAdminData((IPlayerSession)user);
+            var data = GetAdminData(user);
             if (data == null)
             {
                 // Player isn't an admin.
@@ -520,32 +520,32 @@ namespace Content.Server.Administration.Managers
             return (attribs.Length != 0, attribs);
         }
 
-        public bool CanViewVar(IPlayerSession session)
+        public bool CanViewVar(ICommonSession session)
         {
             return CanCommand(session, "vv");
         }
 
-        public bool CanAdminPlace(IPlayerSession session)
+        public bool CanAdminPlace(ICommonSession session)
         {
             return GetAdminData(session)?.CanAdminPlace() ?? false;
         }
 
-        public bool CanScript(IPlayerSession session)
+        public bool CanScript(ICommonSession session)
         {
             return GetAdminData(session)?.CanScript() ?? false;
         }
 
-        public bool CanAdminMenu(IPlayerSession session)
+        public bool CanAdminMenu(ICommonSession session)
         {
             return GetAdminData(session)?.CanAdminMenu() ?? false;
         }
 
-        public bool CanAdminReloadPrototypes(IPlayerSession session)
+        public bool CanAdminReloadPrototypes(ICommonSession session)
         {
             return GetAdminData(session)?.CanAdminReloadPrototypes() ?? false;
         }
 
-        private void SendPermsChangedEvent(IPlayerSession session)
+        private void SendPermsChangedEvent(ICommonSession session)
         {
             var flags = GetAdminData(session)?.Flags;
             OnPermsChanged?.Invoke(new AdminPermsChangedEventArgs(session, flags));
@@ -553,7 +553,7 @@ namespace Content.Server.Administration.Managers
 
         private sealed class AdminReg
         {
-            public readonly IPlayerSession Session;
+            public readonly ICommonSession Session;
 
             public AdminData Data;
             public int? RankId;
@@ -561,7 +561,7 @@ namespace Content.Server.Administration.Managers
             // Such as console.loginlocal or promotehost
             public bool IsSpecialLogin;
 
-            public AdminReg(IPlayerSession session, AdminData data)
+            public AdminReg(ICommonSession session, AdminData data)
             {
                 Data = data;
                 Session = session;
index 765df17b179fabc31bbaf86493c642239c826b15..4d51d35576ac9f423829c87eb8e34db4ddb12691 100644 (file)
@@ -15,6 +15,7 @@ using Robust.Server.Player;
 using Robust.Shared.Configuration;
 using Robust.Shared.Enums;
 using Robust.Shared.Network;
+using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Utility;
 
@@ -283,7 +284,7 @@ public sealed class BanManager : IBanManager, IPostInjectInit
         SendRoleBans(player);
     }
 
-    public void SendRoleBans(IPlayerSession pSession)
+    public void SendRoleBans(ICommonSession pSession)
     {
         var roleBans = _cachedRoleBans.GetValueOrDefault(pSession.UserId) ?? new HashSet<ServerRoleBanDef>();
         var bans = new MsgRoleBans()
index eeed5cc36e066fdb44d42a79fc4a8581d5fd1f5c..a52ec7b099cd1fafa46eaee7775fc9270f5b2c33 100644 (file)
@@ -1,9 +1,8 @@
 using Content.Shared.Administration;
 using Content.Shared.Administration.Managers;
-using Robust.Server.Player;
+using Robust.Shared.Player;
 using Robust.Shared.Toolshed;
 
-
 namespace Content.Server.Administration.Managers
 {
     /// <summary>
@@ -22,12 +21,12 @@ namespace Content.Server.Administration.Managers
         /// <remarks>
         ///     This does not include admins that are de-adminned.
         /// </remarks>
-        IEnumerable<IPlayerSession> ActiveAdmins { get; }
+        IEnumerable<ICommonSession> ActiveAdmins { get; }
 
         /// <summary>
         /// Gets all admins currently on the server, even de-adminned ones.
         /// </summary>
-        IEnumerable<IPlayerSession> AllAdmins { get; }
+        IEnumerable<ICommonSession> AllAdmins { get; }
 
         /// <summary>
         ///     De-admins an admin temporarily so they are effectively a normal player.
@@ -35,18 +34,18 @@ namespace Content.Server.Administration.Managers
         /// <remarks>
         ///     De-adminned admins are able to re-admin at any time if they so desire.
         /// </remarks>
-        void DeAdmin(IPlayerSession session);
+        void DeAdmin(ICommonSession session);
 
         /// <summary>
         ///     Re-admins a de-adminned admin.
         /// </summary>
-        void ReAdmin(IPlayerSession session);
+        void ReAdmin(ICommonSession session);
 
         /// <summary>
         ///     Re-loads the permissions of an player in case their admin data changed DB-side.
         /// </summary>
         /// <seealso cref="ReloadAdminsWithRank"/>
-        void ReloadAdmin(IPlayerSession player);
+        void ReloadAdmin(ICommonSession player);
 
         /// <summary>
         ///     Reloads admin permissions for all admins with a certain rank.
@@ -57,7 +56,7 @@ namespace Content.Server.Administration.Managers
 
         void Initialize();
 
-        void PromoteHost(IPlayerSession player);
+        void PromoteHost(ICommonSession player);
 
         bool TryGetCommandFlags(CommandSpec command, out AdminFlags[]? flags);
     }
index 8458feac8d0614293d5e83abbe8e6a91bb6fef13..dafe3d35bdd49db9171e31a8311e1c29831a826c 100644 (file)
@@ -2,8 +2,8 @@ using System.Collections.Immutable;
 using System.Net;
 using System.Threading.Tasks;
 using Content.Shared.Database;
-using Robust.Server.Player;
 using Robust.Shared.Network;
+using Robust.Shared.Player;
 
 namespace Content.Server.Administration.Managers;
 
@@ -55,5 +55,5 @@ public interface IBanManager
     /// Sends role bans to the target
     /// </summary>
     /// <param name="pSession">Player's session</param>
-    public void SendRoleBans(IPlayerSession pSession);
+    public void SendRoleBans(ICommonSession pSession);
 }
index 8a7846663f350ec21b54dfd45b51794b0f44f929..0c1e7f3daade17b296cfc3a4b5db4b48e4e26669 100644 (file)
@@ -11,7 +11,7 @@ using Content.Shared.Database;
 using Content.Shared.Players.PlayTimeTracking;
 using Robust.Shared.Configuration;
 using Robust.Shared.Network;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 
 namespace Content.Server.Administration.Notes;
 
index fd9f3f6bfae597ae462025cf8b2ad91b201e3f87..f2eb033dcaa7a3d2c6c6d7a5ac6da1b32b0b945d 100644 (file)
@@ -1,13 +1,13 @@
 using Content.Server.Administration.Commands;
 using Content.Server.Chat.Managers;
 using Content.Server.EUI;
-using Content.Shared.Chat;
 using Content.Shared.Database;
 using Content.Shared.Verbs;
 using Robust.Server.GameObjects;
 using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Enums;
+using Robust.Shared.Player;
 using Robust.Shared.Utility;
 
 namespace Content.Server.Administration.Notes;
index ae7133c56d96d554d8973572231de95e83a42146..a726bd11c82b76e82e1585e56d3aac4b4bbabee6 100644 (file)
@@ -2,7 +2,7 @@ using System.Threading.Tasks;
 using Content.Server.Database;
 using Content.Shared.Administration.Notes;
 using Content.Shared.Database;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 
 namespace Content.Server.Administration.Notes;
 
index 521bee776f03a797142f90486838ae83122c1763..fb013a88ad974eee98a1ee05328f0043ef89e8d7 100644 (file)
@@ -1,6 +1,6 @@
 using Content.Shared.Administration;
 using JetBrains.Annotations;
-using Robust.Server.Player;
+using Robust.Shared.Player;
 
 namespace Content.Server.Administration;
 
@@ -16,7 +16,7 @@ public sealed partial class QuickDialogSystem
     /// <param name="cancelAction">The action to execute upon the dialog being cancelled.</param>
     /// <typeparam name="T1">Type of the input.</typeparam>
     [PublicAPI]
-    public void OpenDialog<T1>(IPlayerSession session, string title, string prompt, Action<T1> okAction,
+    public void OpenDialog<T1>(ICommonSession session, string title, string prompt, Action<T1> okAction,
         Action? cancelAction = null)
     {
         OpenDialogInternal(
@@ -53,7 +53,7 @@ public sealed partial class QuickDialogSystem
     /// <typeparam name="T1">Type of the first input.</typeparam>
     /// <typeparam name="T2">Type of the second input.</typeparam>
     [PublicAPI]
-    public void OpenDialog<T1, T2>(IPlayerSession session, string title, string prompt1, string prompt2,
+    public void OpenDialog<T1, T2>(ICommonSession session, string title, string prompt1, string prompt2,
         Action<T1, T2> okAction, Action? cancelAction = null)
     {
         OpenDialogInternal(
@@ -96,7 +96,7 @@ public sealed partial class QuickDialogSystem
     /// <typeparam name="T2">Type of the second input.</typeparam>
     /// <typeparam name="T3">Type of the third input.</typeparam>
     [PublicAPI]
-    public void OpenDialog<T1, T2, T3>(IPlayerSession session, string title, string prompt1, string prompt2,
+    public void OpenDialog<T1, T2, T3>(ICommonSession session, string title, string prompt1, string prompt2,
         string prompt3, Action<T1, T2, T3> okAction, Action? cancelAction = null)
     {
         OpenDialogInternal(
@@ -142,7 +142,7 @@ public sealed partial class QuickDialogSystem
     /// <typeparam name="T3">Type of the third input.</typeparam>
     /// <typeparam name="T4">Type of the fourth input.</typeparam>
     [PublicAPI]
-    public void OpenDialog<T1, T2, T3, T4>(IPlayerSession session, string title, string prompt1, string prompt2,
+    public void OpenDialog<T1, T2, T3, T4>(ICommonSession session, string title, string prompt1, string prompt2,
         string prompt3, string prompt4, Action<T1, T2, T3, T4> okAction, Action? cancelAction = null)
     {
         OpenDialogInternal(
index 51b8cf79c2a1e4c7e6e20dbf5bb841adfca8dd7b..96423e52238ca494b18bb7ad56c98e3ac0f0ae80 100644 (file)
@@ -1,12 +1,9 @@
-using System.ComponentModel;
-using System.Diagnostics.CodeAnalysis;
+using System.Diagnostics.CodeAnalysis;
 using Content.Shared.Administration;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
 using Robust.Server.Player;
 using Robust.Shared.Enums;
 using Robust.Shared.Network;
 using Robust.Shared.Player;
-using Robust.Shared.Serialization.TypeSerializers.Interfaces;
 
 namespace Content.Server.Administration;
 
@@ -87,7 +84,7 @@ public sealed partial class QuickDialogSystem : EntitySystem
         _openDialogsByUser.Remove(user);
     }
 
-    private void OpenDialogInternal(IPlayerSession session, string title, List<QuickDialogEntry> entries, QuickDialogButtonFlag buttons, Action<QuickDialogResponseEvent> okAction, Action cancelAction)
+    private void OpenDialogInternal(ICommonSession session, string title, List<QuickDialogEntry> entries, QuickDialogButtonFlag buttons, Action<QuickDialogResponseEvent> okAction, Action cancelAction)
     {
         var did = GetDialogId();
         RaiseNetworkEvent(
index 66f7a8999b33cabfa6e30edbc551f702cd5f47fa..feabaa2aad6e5da1e7421cb21d7944573563b244 100644 (file)
@@ -109,7 +109,7 @@ namespace Content.Server.Administration.Systems
             }
         }
 
-        public void UpdatePlayerList(IPlayerSession player)
+        public void UpdatePlayerList(ICommonSession player)
         {
             _playerList[player.UserId] = GetPlayerInfo(player.Data, player);
 
@@ -203,7 +203,7 @@ namespace Content.Server.Administration.Systems
             UpdatePanicBunker();
         }
 
-        private void SendFullPlayerList(IPlayerSession playerSession)
+        private void SendFullPlayerList(ICommonSession playerSession)
         {
             var ev = new FullPlayerListEvent();
 
@@ -212,7 +212,7 @@ namespace Content.Server.Administration.Systems
             RaiseNetworkEvent(ev, playerSession.ConnectedClient);
         }
 
-        private PlayerInfo GetPlayerInfo(IPlayerData data, IPlayerSession? session)
+        private PlayerInfo GetPlayerInfo(SessionData data, ICommonSession? session)
         {
             var name = data.UserName;
             var entityName = string.Empty;
@@ -326,7 +326,7 @@ namespace Content.Server.Administration.Systems
         ///     chat messages and showing a popup to other players.
         ///     Their items are dropped on the ground.
         /// </summary>
-        public void Erase(IPlayerSession player)
+        public void Erase(ICommonSession player)
         {
             var entity = player.AttachedEntity;
             _chat.DeleteMessagesBy(player);
index e65acf571cbeb0245edfa0b1d4e69e11379b85e9..e3671bcdfb348fc259b51c966060774db5dd275c 100644 (file)
@@ -1,8 +1,8 @@
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Network;
+using Robust.Shared.Player;
 
 namespace Content.Server.Administration.Systems;
 
@@ -20,7 +20,7 @@ public sealed class AdminTestArenaSystem : EntitySystem
     public Dictionary<NetUserId, EntityUid> ArenaMap { get; private set; } = new();
     public Dictionary<NetUserId, EntityUid?> ArenaGrid { get; private set; } = new();
 
-    public (EntityUid Map, EntityUid? Grid) AssertArenaLoaded(IPlayerSession admin)
+    public (EntityUid Map, EntityUid? Grid) AssertArenaLoaded(ICommonSession admin)
     {
         if (ArenaMap.TryGetValue(admin.UserId, out var arenaMap) && !Deleted(arenaMap) && !Terminating(arenaMap))
         {
index 0f0c562356260afe098f52ba180dbec28597b874..bc065745f5ea0a594558ca62422efab4d1f660a6 100644 (file)
@@ -24,11 +24,10 @@ using Content.Shared.Popups;
 using Content.Shared.Verbs;
 using Robust.Server.Console;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;
 using Robust.Shared.Toolshed;
@@ -427,7 +426,7 @@ namespace Content.Server.Administration.Systems
             }
         }
 
-        public void OpenEditSolutionsEui(IPlayerSession session, EntityUid uid)
+        public void OpenEditSolutionsEui(ICommonSession session, EntityUid uid)
         {
             if (session.AttachedEntity == null)
                 return;
index 98e5af1126b40b3429594fab548f21c6e8cdb0dd..31ef285a882165aad829c0ef22a9f87ab6db7f1a 100644 (file)
@@ -17,6 +17,7 @@ using Robust.Shared;
 using Robust.Shared.Configuration;
 using Robust.Shared.Enums;
 using Robust.Shared.Network;
+using Robust.Shared.Player;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
 
@@ -119,7 +120,7 @@ namespace Content.Server.Administration.Systems
             _typingUpdateTimestamps[args.SenderSession.UserId] = (_timing.RealTime, msg.Typing);
 
             // Non-admins can only ever type on their own ahelp, guard against fake messages
-            var isAdmin = _adminManager.GetAdminData((IPlayerSession) args.SenderSession)?.HasFlag(AdminFlags.Adminhelp) ?? false;
+            var isAdmin = _adminManager.GetAdminData(args.SenderSession)?.HasFlag(AdminFlags.Adminhelp) ?? false;
             var channel = isAdmin ? msg.Channel : args.SenderSession.UserId;
             var update = new BwoinkPlayerTypingUpdated(channel, args.SenderSession.Name, msg.Typing);
 
@@ -376,7 +377,7 @@ namespace Content.Server.Administration.Systems
         protected override void OnBwoinkTextMessage(BwoinkTextMessage message, EntitySessionEventArgs eventArgs)
         {
             base.OnBwoinkTextMessage(message, eventArgs);
-            var senderSession = (IPlayerSession) eventArgs.SenderSession;
+            var senderSession = eventArgs.SenderSession;
 
             // TODO: Sanitize text?
             // Confirm that this person is actually allowed to send a message here.
index aa82e0f1d93297edd69db8302a206ee8bd46e102..1d64f748fd261ca9a5770b6f826e188705fc06de 100644 (file)
@@ -1,6 +1,6 @@
 using Content.Server.Administration.Managers;
 using Content.Shared.Administration;
-using Robust.Server.Player;
+using Robust.Shared.Player;
 using Robust.Shared.Toolshed;
 
 namespace Content.Server.Administration.Toolshed;
@@ -11,13 +11,13 @@ public sealed class AdminsCommand : ToolshedCommand
     [Dependency] private readonly IAdminManager _admin = default!;
 
     [CommandImplementation("active")]
-    public IEnumerable<IPlayerSession> Active()
+    public IEnumerable<ICommonSession> Active()
     {
         return _admin.ActiveAdmins;
     }
 
     [CommandImplementation("all")]
-    public IEnumerable<IPlayerSession> All()
+    public IEnumerable<ICommonSession> All()
     {
         return _admin.AllAdmins;
     }
index 0938f45f73eb69748b93fa2c89d532e5cc764582..f634a415dc51a5a4da4d631efd2602a859adf968 100644 (file)
@@ -1,4 +1,3 @@
-using System.Linq;
 using Content.Server.Afk.Events;
 using Content.Server.GameTicking;
 using Content.Shared.CCVar;
@@ -24,7 +23,7 @@ public sealed class AFKSystem : EntitySystem
     private float _checkDelay;
     private TimeSpan _checkTime;
 
-    private readonly HashSet<IPlayerSession> _afkPlayers = new();
+    private readonly HashSet<ICommonSession> _afkPlayers = new();
 
     public override void Initialize()
     {
@@ -73,11 +72,9 @@ public sealed class AFKSystem : EntitySystem
 
         _checkTime = _timing.CurTime + TimeSpan.FromSeconds(_checkDelay);
 
-        foreach (var session in Filter.GetAllPlayers())
+        foreach (var pSession in Filter.GetAllPlayers())
         {
-            if (session.Status != SessionStatus.InGame) continue;
-
-            var pSession = (IPlayerSession) session;
+            if (pSession.Status != SessionStatus.InGame) continue;
             var isAfk = _afkManager.IsAfk(pSession);
 
             if (isAfk && _afkPlayers.Add(pSession))
index 24cd1e28cecd11bf80b2951a2ff55ab7fce1f8f5..52dc7715df384e2c4135d6524210cc7cb7cfdb23 100644 (file)
@@ -5,6 +5,7 @@ using Robust.Shared.Configuration;
 using Robust.Shared.Console;
 using Robust.Shared.Enums;
 using Robust.Shared.Input;
+using Robust.Shared.Player;
 using Robust.Shared.Timing;
 
 namespace Content.Server.Afk
@@ -20,13 +21,13 @@ namespace Content.Server.Afk
         /// </summary>
         /// <param name="player">The player to check.</param>
         /// <returns>True if the player is AFK, false otherwise.</returns>
-        bool IsAfk(IPlayerSession player);
+        bool IsAfk(ICommonSession player);
 
         /// <summary>
         /// Resets AFK status for the player as if they just did an action and are definitely not AFK.
         /// </summary>
         /// <param name="player">The player to set AFK status for.</param>
-        void PlayerDidAction(IPlayerSession player);
+        void PlayerDidAction(ICommonSession player);
 
         void Initialize();
     }
@@ -40,7 +41,7 @@ namespace Content.Server.Afk
         [Dependency] private readonly IConfigurationManager _cfg = default!;
         [Dependency] private readonly IConsoleHost _consoleHost = default!;
 
-        private readonly Dictionary<IPlayerSession, TimeSpan> _lastActionTimes = new();
+        private readonly Dictionary<ICommonSession, TimeSpan> _lastActionTimes = new();
 
         public void Initialize()
         {
@@ -55,7 +56,7 @@ namespace Content.Server.Afk
                 HandleInputCmd);
         }
 
-        public void PlayerDidAction(IPlayerSession player)
+        public void PlayerDidAction(ICommonSession player)
         {
             if (player.Status == SessionStatus.Disconnected)
                 // Make sure we don't re-add to the dictionary if the player is disconnected now.
@@ -64,7 +65,7 @@ namespace Content.Server.Afk
             _lastActionTimes[player] = _gameTiming.RealTime;
         }
 
-        public bool IsAfk(IPlayerSession player)
+        public bool IsAfk(ICommonSession player)
         {
             if (!_lastActionTimes.TryGetValue(player, out var time))
                 // Some weird edge case like disconnected clients. Just say true I guess.
@@ -87,13 +88,13 @@ namespace Content.Server.Afk
 
         private void ConsoleHostOnAnyCommandExecuted(IConsoleShell shell, string commandname, string argstr, string[] args)
         {
-            if (shell.Player is IPlayerSession player)
+            if (shell.Player is { } player)
                 PlayerDidAction(player);
         }
 
         private void HandleInputCmd(FullInputCmdMessage msg, EntitySessionEventArgs args)
         {
-            PlayerDidAction((IPlayerSession) args.SenderSession);
+            PlayerDidAction(args.SenderSession);
         }
     }
 }
index 6adb950e47561ad96ac9da6e10eb09aefbf3892b..ee9d548043fbd7543690d03d8086760e12ac6b17 100644 (file)
@@ -1,4 +1,4 @@
-using Robust.Server.Player;
+using Robust.Shared.Player;
 
 namespace Content.Server.Afk.Events;
 
@@ -8,9 +8,9 @@ namespace Content.Server.Afk.Events;
 [ByRefEvent]
 public readonly struct AFKEvent
 {
-    public readonly IPlayerSession Session;
+    public readonly ICommonSession Session;
 
-    public AFKEvent(IPlayerSession playerSession)
+    public AFKEvent(ICommonSession playerSession)
     {
         Session = playerSession;
     }
index 3dd034583c533de89ef0b1bbfb6e951e1b13ee71..0983c256f0580e0f1c86a0a2125a9427953ba34b 100644 (file)
@@ -1,4 +1,4 @@
-using Robust.Server.Player;
+using Robust.Shared.Player;
 
 namespace Content.Server.Afk.Events;
 
@@ -8,9 +8,9 @@ namespace Content.Server.Afk.Events;
 [ByRefEvent]
 public readonly struct UnAFKEvent
 {
-    public readonly IPlayerSession Session;
+    public readonly ICommonSession Session;
 
-    public UnAFKEvent(IPlayerSession playerSession)
+    public UnAFKEvent(ICommonSession playerSession)
     {
         Session = playerSession;
     }
index e43f06413c30886b35ef6ba1cce2d935e477a009..1759612702f789d69f4e8c2ce9ebea36c977d33b 100644 (file)
@@ -2,7 +2,6 @@ using Content.Server.Administration;
 using Content.Server.Commands;
 using Content.Shared.Administration;
 using Content.Shared.Alert;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Alert.Commands
@@ -16,7 +15,7 @@ namespace Content.Server.Alert.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (player?.AttachedEntity == null)
             {
                 shell.WriteLine("You don't have an entity.");
index edb634b546c087b7c62fa3167e67b54ace223c72..11901e9af0021f5ff81a82c48ab2bfe23077d4f4 100644 (file)
@@ -2,7 +2,6 @@ using Content.Server.Administration;
 using Content.Server.Commands;
 using Content.Shared.Administration;
 using Content.Shared.Alert;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Alert.Commands
@@ -16,7 +15,7 @@ namespace Content.Server.Alert.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (player?.AttachedEntity == null)
             {
                 shell.WriteLine("You cannot run this from the server or without an attached entity.");
index 009a8b5f236d7c3e3abcfa596d5767030aec871a..2c432a24190d8b6787d8493258e3e53e35e27596 100644 (file)
@@ -3,7 +3,6 @@ using Content.Server.Administration;
 using Content.Server.Station.Systems;
 using Content.Shared.Administration;
 using JetBrains.Annotations;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.AlertLevel.Commands
@@ -19,7 +18,7 @@ namespace Content.Server.AlertLevel.Commands
         public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
         {
             var levelNames = new string[] {};
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (player?.AttachedEntity != null)
             {
                 var stationUid = EntitySystem.Get<StationSystem>().GetOwningStation(player.AttachedEntity.Value);
@@ -54,7 +53,7 @@ namespace Content.Server.AlertLevel.Commands
                 return;
             }
 
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (player?.AttachedEntity == null)
             {
                 shell.WriteLine(Loc.GetString("shell-only-players-can-run-this-command"));
index 5e323f5ab8eb2da3a07cd592dcf14f78b94dadfe..737b723d390abcfe8bf9321e39ebd2c1b748e9fa 100644 (file)
@@ -22,6 +22,7 @@ using Content.Server.Station.Systems;
 using Content.Server.Shuttles.Systems;
 using Content.Shared.Mobs;
 using Robust.Server.Containers;
+using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 
 namespace Content.Server.Antag;
@@ -88,9 +89,9 @@ public sealed class AntagSelectionSystem : GameRuleSystem<GameRuleComponent>
         out List<EntityUid> chosen,
         bool includeHeads = false)
     {
-        var allPlayers = _playerSystem.ServerSessions.ToList();
-        var playerList = new List<IPlayerSession>();
-        var prefList = new List<IPlayerSession>();
+        var allPlayers = _playerSystem.Sessions.ToList();
+        var playerList = new List<ICommonSession>();
+        var prefList = new List<ICommonSession>();
         chosen = new List<EntityUid>();
         foreach (var player in allPlayers)
         {
@@ -116,7 +117,7 @@ public sealed class AntagSelectionSystem : GameRuleSystem<GameRuleComponent>
         var antags = Math.Clamp(allPlayers.Count / antagsPerPlayer, 1, maxAntags);
         for (var antag = 0; antag < antags; antag++)
         {
-            IPlayerSession chosenPlayer = null!;
+            ICommonSession? chosenPlayer = null;
             if (prefList.Count == 0)
             {
                 if (playerList.Count == 0)
index 92a96ea2266655e2b93f4ab7953b2f78e301930c..ef69600783b5c5df6bb4401ebd5e3e361b7b6696 100644 (file)
@@ -1,6 +1,6 @@
 using Content.Shared.Arcade;
-using Robust.Server.Player;
 using System.Linq;
+using Robust.Shared.Player;
 
 namespace Content.Server.Arcade.BlockGame;
 
@@ -166,7 +166,7 @@ public sealed partial class BlockGame
     /// </summary>
     /// <param name="message">The message to send to a specific player/spectator.</param>
     /// <param name="session">The target recipient.</param>
-    private void SendMessage(BoundUserInterfaceMessage message, IPlayerSession session)
+    private void SendMessage(BoundUserInterfaceMessage message, ICommonSession session)
     {
         if (_uiSystem.TryGetUi(_owner, BlockGameUiKey.Key, out var bui))
             _uiSystem.TrySendUiMessage(bui, message, session);
@@ -176,7 +176,7 @@ public sealed partial class BlockGame
     /// Handles sending the current state of the game to a player that has just opened the UI.
     /// </summary>
     /// <param name="session">The target recipient.</param>
-    public void UpdateNewPlayerUI(IPlayerSession session)
+    public void UpdateNewPlayerUI(ICommonSession session)
     {
         if (_gameOver)
         {
@@ -209,7 +209,7 @@ public sealed partial class BlockGame
     /// Handles broadcasting the full player-visible game state to a specific player/spectator.
     /// </summary>
     /// <param name="session">The target recipient.</param>
-    private void FullUpdate(IPlayerSession session)
+    private void FullUpdate(ICommonSession session)
     {
         UpdateFieldUI(session);
         SendNextPieceUpdate(session);
@@ -235,7 +235,7 @@ public sealed partial class BlockGame
     /// Handles broadcasting the current location of all of the blocks in the playfield + the active piece to a specific player/spectator.
     /// </summary>
     /// <param name="session">The target recipient.</param>
-    public void UpdateFieldUI(IPlayerSession session)
+    public void UpdateFieldUI(ICommonSession session)
     {
         if (!Started)
             return;
@@ -283,7 +283,7 @@ public sealed partial class BlockGame
     /// Broadcasts the state of the next queued piece to a specific viewer.
     /// </summary>
     /// <param name="session">The target recipient.</param>
-    private void SendNextPieceUpdate(IPlayerSession session)
+    private void SendNextPieceUpdate(ICommonSession session)
     {
         SendMessage(new BlockGameMessages.BlockGameVisualUpdateMessage(NextPiece.BlocksForPreview(), BlockGameMessages.BlockGameVisualType.NextBlock), session);
     }
@@ -303,7 +303,7 @@ public sealed partial class BlockGame
     /// Broadcasts the state of the currently held piece to a specific viewer.
     /// </summary>
     /// <param name="session">The target recipient.</param>
-    private void SendHoldPieceUpdate(IPlayerSession session)
+    private void SendHoldPieceUpdate(ICommonSession session)
     {
         if (HeldPiece.HasValue)
             SendMessage(new BlockGameMessages.BlockGameVisualUpdateMessage(HeldPiece.Value.BlocksForPreview(), BlockGameMessages.BlockGameVisualType.HoldBlock), session);
@@ -323,7 +323,7 @@ public sealed partial class BlockGame
     /// Broadcasts the current game level to a specific viewer.
     /// </summary>
     /// <param name="session">The target recipient.</param>
-    private void SendLevelUpdate(IPlayerSession session)
+    private void SendLevelUpdate(ICommonSession session)
     {
         SendMessage(new BlockGameMessages.BlockGameLevelUpdateMessage(Level), session);
     }
@@ -340,7 +340,7 @@ public sealed partial class BlockGame
     /// Broadcasts the current game score to a specific viewer.
     /// </summary>
     /// <param name="session">The target recipient.</param>
-    private void SendPointsUpdate(IPlayerSession session)
+    private void SendPointsUpdate(ICommonSession session)
     {
         SendMessage(new BlockGameMessages.BlockGameScoreUpdateMessage(Points), session);
     }
@@ -357,7 +357,7 @@ public sealed partial class BlockGame
     /// Broadcasts the current game high score positions to a specific viewer.
     /// </summary>
     /// <param name="session">The target recipient.</param>
-    private void SendHighscoreUpdate(IPlayerSession session)
+    private void SendHighscoreUpdate(ICommonSession session)
     {
         SendMessage(new BlockGameMessages.BlockGameHighScoreUpdateMessage(_arcadeSystem.GetLocalHighscores(), _arcadeSystem.GetGlobalHighscores()), session);
     }
index 268d5be4d2e881e8ac6b8d3fae0990b1344a5acf..5613d9154441a5908b61317176be1f8aba3e6e2b 100644 (file)
@@ -1,4 +1,4 @@
-using Robust.Server.Player;
+using Robust.Shared.Player;
 
 namespace Content.Server.Arcade.BlockGame;
 
@@ -13,10 +13,10 @@ public sealed partial class BlockGameArcadeComponent : Component
     /// <summary>
     /// The player currently playing the active session of NT-BG.
     /// </summary>
-    public IPlayerSession? Player = null;
+    public ICommonSession? Player = null;
 
     /// <summary>
     /// The players currently viewing (but not playing) the active session of NT-BG.
     /// </summary>
-    public readonly List<IPlayerSession> Spectators = new();
+    public readonly List<ICommonSession> Spectators = new();
 }
index dac29accc968c7d3915ee6428242c43f9f929607..ecc5bfd3e2c786a9360dfefd2287c35a9c33e206 100644 (file)
@@ -2,7 +2,7 @@ using Content.Server.Power.Components;
 using Content.Server.UserInterface;
 using Content.Shared.Arcade;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
+using Robust.Shared.Player;
 
 namespace Content.Server.Arcade.BlockGame;
 
@@ -30,7 +30,7 @@ public sealed class BlockGameArcadeSystem : EntitySystem
         }
     }
 
-    private void UpdatePlayerStatus(EntityUid uid, IPlayerSession session, PlayerBoundUserInterface? bui = null, BlockGameArcadeComponent? blockGame = null)
+    private void UpdatePlayerStatus(EntityUid uid, ICommonSession session, PlayerBoundUserInterface? bui = null, BlockGameArcadeComponent? blockGame = null)
     {
         if (!Resolve(uid, ref blockGame))
             return;
@@ -67,7 +67,7 @@ public sealed class BlockGameArcadeSystem : EntitySystem
 
     private void OnAfterUiClose(EntityUid uid, BlockGameArcadeComponent component, BoundUIClosedEvent args)
     {
-        if (args.Session is not IPlayerSession session)
+        if (args.Session is not { } session)
             return;
 
         if (component.Player != session)
index 0f0c399b11a4b8dec3eb5902c7b27b717024d6dd..9e7594c024b84cde1ae84ed74f8eac309da500d7 100644 (file)
@@ -2,7 +2,6 @@ using Content.Server.Administration;
 using Content.Server.Atmos.EntitySystems;
 using Content.Shared.Administration;
 using Content.Shared.Atmos;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Map;
 
@@ -20,7 +19,7 @@ namespace Content.Server.Atmos.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             EntityUid? gridId;
             Gas? gas = null;
 
index 5ad73ec90634886a3e9d4bd508aeddfa834d0627..263ef947d0a08f491722e76cfbe6d5ef2b472a54 100644 (file)
@@ -1,7 +1,6 @@
 using Content.Server.Administration;
 using Content.Server.Atmos.EntitySystems;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Atmos.Commands
@@ -15,7 +14,7 @@ namespace Content.Server.Atmos.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (player == null)
             {
                 shell.WriteLine("You must be a player to use this command.");
index 34f558a2521c55a2fc022b1490b04050de3c07f6..90edd4caed52b04690da5c57e5a5701a60ad2ca2 100644 (file)
@@ -10,6 +10,7 @@ using Robust.Shared.Configuration;
 using Robust.Shared.Enums;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
+using Robust.Shared.Player;
 
 namespace Content.Server.Atmos.EntitySystems
 {
@@ -27,7 +28,7 @@ namespace Content.Server.Atmos.EntitySystems
         ///     To modify it see <see cref="AddObserver"/> and
         ///     <see cref="RemoveObserver"/>.
         /// </summary>
-        private readonly HashSet<IPlayerSession> _playerObservers = new();
+        private readonly HashSet<ICommonSession> _playerObservers = new();
 
         /// <summary>
         ///     Overlay update ticks per second.
@@ -48,17 +49,17 @@ namespace Content.Server.Atmos.EntitySystems
             _playerManager.PlayerStatusChanged -= OnPlayerStatusChanged;
         }
 
-        public bool AddObserver(IPlayerSession observer)
+        public bool AddObserver(ICommonSession observer)
         {
             return _playerObservers.Add(observer);
         }
 
-        public bool HasObserver(IPlayerSession observer)
+        public bool HasObserver(ICommonSession observer)
         {
             return _playerObservers.Contains(observer);
         }
 
-        public bool RemoveObserver(IPlayerSession observer)
+        public bool RemoveObserver(ICommonSession observer)
         {
             if (!_playerObservers.Remove(observer))
             {
@@ -76,7 +77,7 @@ namespace Content.Server.Atmos.EntitySystems
         /// </summary>
         /// <param name="observer">The observer to toggle.</param>
         /// <returns>true if added, false if removed.</returns>
-        public bool ToggleObserver(IPlayerSession observer)
+        public bool ToggleObserver(ICommonSession observer)
         {
             if (HasObserver(observer))
             {
index df867d351638ac0ace78f9ac41b2be4b31626e03..17715435b2fea46f3e12c11fa96eb91b1914dbf7 100644 (file)
@@ -12,7 +12,6 @@ using Content.Shared.Toggleable;
 using Content.Shared.Verbs;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
 using Robust.Shared.Audio;
 using Robust.Shared.Containers;
 using Robust.Shared.Physics.Systems;
@@ -60,12 +59,6 @@ namespace Content.Server.Atmos.EntitySystems
 
         private void OnGasTankToggleInternals(Entity<GasTankComponent> ent, ref GasTankToggleInternalsMessage args)
         {
-            if (args.Session is not IPlayerSession playerSession ||
-                playerSession.AttachedEntity == null)
-            {
-                return;
-            }
-
             ToggleInternals(ent);
         }
 
index c229ef50c9adae325371ce7e2ff63f1d0ce1ddec..b0e8cf71c79403236e3d28510f2a1094862db3c0 100644 (file)
@@ -16,6 +16,7 @@ using Robust.Shared;
 using Robust.Shared.Configuration;
 using Robust.Shared.Enums;
 using Robust.Shared.Map;
+using Robust.Shared.Player;
 using Robust.Shared.Threading;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
@@ -35,7 +36,7 @@ namespace Content.Server.Atmos.EntitySystems
         [Robust.Shared.IoC.Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
         [Robust.Shared.IoC.Dependency] private readonly ChunkingSystem _chunkingSys = default!;
 
-        private readonly Dictionary<IPlayerSession, Dictionary<NetEntity, HashSet<Vector2i>>> _lastSentChunks = new();
+        private readonly Dictionary<ICommonSession, Dictionary<NetEntity, HashSet<Vector2i>>> _lastSentChunks = new();
 
         // Oh look its more duplicated decal system code!
         private ObjectPool<HashSet<Vector2i>> _chunkIndexPool =
@@ -286,12 +287,12 @@ namespace Content.Server.Atmos.EntitySystems
             // Now we'll go through each player, then through each chunk in range of that player checking if the player is still in range
             // If they are, check if they need the new data to send (i.e. if there's an overlay for the gas).
             // Afterwards we reset all the chunk data for the next time we tick.
-            var players = _playerManager.ServerSessions.Where(x => x.Status == SessionStatus.InGame).ToArray();
+            var players = _playerManager.Sessions.Where(x => x.Status == SessionStatus.InGame).ToArray();
             var opts = new ParallelOptions { MaxDegreeOfParallelism = _parMan.ParallelProcessCount };
             Parallel.ForEach(players, opts, p => UpdatePlayer(p, curTick));
         }
 
-        private void UpdatePlayer(IPlayerSession playerSession, GameTick curTick)
+        private void UpdatePlayer(ICommonSession playerSession, GameTick curTick)
         {
             var chunksInRange = _chunkingSys.GetChunksForSession(playerSession, ChunkSize, _chunkIndexPool, _chunkViewerPool);
             var previouslySent = _lastSentChunks[playerSession];
index 308295c06ccf9d392703146d8591a741b4347dfb..655d0c88f9ba10bca9fa948a3c9c64fb91d4d2f7 100644 (file)
@@ -4,7 +4,6 @@ using Content.Server.Body.Systems;
 using Content.Shared.Administration;
 using Content.Shared.Body.Components;
 using Content.Shared.Body.Part;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
@@ -27,7 +26,7 @@ namespace Content.Server.Body.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
 
             EntityUid entity;
             EntityUid hand;
index 267b5208086184e0d46438d54a90d82f0145a14e..24604b88b7a9599231f286eadbb2f456cf4ccb7d 100644 (file)
@@ -1,10 +1,8 @@
-using System.Linq;
 using Content.Server.Administration;
 using Content.Server.Body.Systems;
 using Content.Shared.Administration;
 using Content.Shared.Body.Components;
 using Content.Shared.Body.Part;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Body.Commands
@@ -20,7 +18,7 @@ namespace Content.Server.Body.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
 
             EntityUid bodyId;
             EntityUid? partUid;
index 6ad0631150a3d82918605912f20809688571b99a..3aa28f40720b2f29b21cccfeb129c7bd033be39a 100644 (file)
@@ -2,7 +2,6 @@ using Content.Server.Administration;
 using Content.Server.Body.Systems;
 using Content.Shared.Administration;
 using Content.Shared.Body.Components;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Random;
 
@@ -17,7 +16,7 @@ namespace Content.Server.Body.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (player == null)
             {
                 shell.WriteLine("Only a player can run this command.");
index 729db4bc44686ee74ead3f941dc509c2cea76a1a..4a2956ae7ab16bc99bb5b85a261b7f84cb5fd366 100644 (file)
@@ -4,7 +4,6 @@ using Content.Server.Body.Systems;
 using Content.Shared.Administration;
 using Content.Shared.Body.Components;
 using Content.Shared.Body.Part;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Random;
 
@@ -22,7 +21,7 @@ namespace Content.Server.Body.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (player == null)
             {
                 shell.WriteLine("Only a player can run this command.");
index f2f848c488d7d961ffa2fb5fdbb9e8fec5b4f3e0..242b02d78c1059239db5ab611ea6db4d643dc5dc 100644 (file)
@@ -116,7 +116,7 @@ public sealed class BodySystem : SharedBodySystem
         if (!Resolve(bodyId, ref body, false))
             return new HashSet<EntityUid>();
 
-        if (LifeStage(bodyId) >= EntityLifeStage.Terminating || EntityManager.IsQueuedForDeletion(bodyId))
+        if (TerminatingOrDeleted(bodyId) || EntityManager.IsQueuedForDeletion(bodyId))
             return new HashSet<EntityUid>();
 
         var xform = Transform(bodyId);
index d9327b51505c152c24d4938cd2b13890ccc1aea4..f659357ad382ba933bd7a79446decc3fedd03407 100644 (file)
@@ -8,7 +8,7 @@ using Content.Shared.Cargo.Events;
 using Content.Shared.Cargo.Prototypes;
 using Content.Shared.Database;
 using Robust.Shared.Map;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Utility;
 
index 9f7acce4fd2ac528b0281a55147ecc1d1786086a..02b2eee7712cf9e1d936d676eb4d12dfe811010d 100644 (file)
@@ -6,9 +6,9 @@ using Content.Shared.CartridgeLoader;
 using Content.Shared.Interaction;
 using Robust.Server.Containers;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
+using Robust.Shared.Player;
 
 namespace Content.Server.CartridgeLoader;
 
@@ -98,7 +98,7 @@ public sealed class CartridgeLoaderSystem : SharedCartridgeLoaderSystem
     /// and use this method to update its state so the cartridge loaders state can be added to it.
     /// </remarks>
     /// <seealso cref="PDA.PdaSystem.UpdatePdaUserInterface"/>
-    public void UpdateUiState(EntityUid loaderUid, IPlayerSession? session, CartridgeLoaderComponent? loader)
+    public void UpdateUiState(EntityUid loaderUid, ICommonSession? session, CartridgeLoaderComponent? loader)
     {
         if (!Resolve(loaderUid, ref loader))
             return;
@@ -122,7 +122,7 @@ public sealed class CartridgeLoaderSystem : SharedCartridgeLoaderSystem
     /// This method is called "UpdateCartridgeUiState" but cartridges and a programs are the same. A cartridge is just a program as a visible item.
     /// </remarks>
     /// <seealso cref="Cartridges.NotekeeperCartridgeSystem.UpdateUiState"/>
-    public void UpdateCartridgeUiState(EntityUid loaderUid, BoundUserInterfaceState state, IPlayerSession? session = default!, CartridgeLoaderComponent? loader = default!)
+    public void UpdateCartridgeUiState(EntityUid loaderUid, BoundUserInterfaceState state, ICommonSession? session = default!, CartridgeLoaderComponent? loader = default!)
     {
         if (!Resolve(loaderUid, ref loader))
             return;
index 8aa95ffee18c5e0943edccd9ac2da0b9515f2b08..979051e9d3eba45aeeee30b2c9d0f3f25ee34409 100644 (file)
@@ -1,7 +1,6 @@
 using Content.Server.Administration;
 using Content.Server.Chat.Managers;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Chat.Commands
@@ -15,7 +14,7 @@ namespace Content.Server.Chat.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = (IPlayerSession?) shell.Player;
+            var player = shell.Player;
 
             if (player == null)
             {
index a897a0b2bfb87151870433f99c50e7c80bb0cc7a..9e16193fc38a4ee9f14354b3b770a16f7e5a960d 100644 (file)
@@ -1,6 +1,5 @@
 using Content.Server.Chat.Systems;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Enums;
 
@@ -15,7 +14,7 @@ namespace Content.Server.Chat.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            if (shell.Player is not IPlayerSession player)
+            if (shell.Player is not { } player)
             {
                 shell.WriteError("This command cannot be run from the server.");
                 return;
index 36f86cf4d6b2658faeeaecac420f4a609fae2cb2..e763d5656e16da01049c225892671787d8fd3484 100644 (file)
@@ -1,6 +1,5 @@
 using Content.Server.Chat.Systems;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Enums;
 
@@ -15,7 +14,7 @@ namespace Content.Server.Chat.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            if (shell.Player is not IPlayerSession player)
+            if (shell.Player is not { } player)
             {
                 shell.WriteError("This command cannot be run from the server.");
                 return;
index bef2024608d53b78c28f7a4ec8e74aa65a3b9532..36f6303fbd145c29e0ec0ca7fcb2269c6bfff2f0 100644 (file)
@@ -1,6 +1,5 @@
 using Content.Server.Chat.Managers;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Chat.Commands
@@ -14,7 +13,7 @@ namespace Content.Server.Chat.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            if (shell.Player is not IPlayerSession player)
+            if (shell.Player is not { } player)
             {
                 shell.WriteError("This command cannot be run from the server.");
                 return;
index 7c2125d8c1ce9f1729347ae4e4409c4b32bed824..273f908c9ab273b5a21580bb248b425cff024726 100644 (file)
@@ -1,6 +1,5 @@
 using Content.Server.Chat.Systems;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Enums;
 
@@ -15,7 +14,7 @@ namespace Content.Server.Chat.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            if (shell.Player is not IPlayerSession player)
+            if (shell.Player is not { } player)
             {
                 shell.WriteError("This command cannot be run from the server.");
                 return;
index 389ff039bf0efdcd4e7bbf4f2c1d67ef960252fe..c967ba78d7fa78f7c8c28d8276cf50503129ecdd 100644 (file)
@@ -1,7 +1,6 @@
 using Content.Server.GameTicking;
 using Content.Shared.Administration;
 using Content.Shared.Mind;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Enums;
 
@@ -18,7 +17,7 @@ namespace Content.Server.Chat.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            if (shell.Player is not IPlayerSession player)
+            if (shell.Player is not { } player)
             {
                 shell.WriteLine(Loc.GetString("shell-cannot-run-command-from-server"));
                 return;
index 41eba8b38428e1296dcb1ad56100a10e3463f0d3..c88e2519ee6ede5a036d5e2fecc37a01986e57dc 100644 (file)
@@ -1,6 +1,5 @@
 using Content.Server.Chat.Systems;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Enums;
 
@@ -15,7 +14,7 @@ namespace Content.Server.Chat.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            if (shell.Player is not IPlayerSession player)
+            if (shell.Player is not { } player)
             {
                 shell.WriteError("This command cannot be run from the server.");
                 return;
index 88e143d24e37eb6c5998b25fa9e73f41099343b7..59a9d305bd29c04f1c9169db0248dd7f3bfccb14 100644 (file)
@@ -10,11 +10,9 @@ using Content.Shared.CCVar;
 using Content.Shared.Chat;
 using Content.Shared.Database;
 using Content.Shared.Mind;
-using Robust.Server.Player;
 using Robust.Shared.Configuration;
 using Robust.Shared.Network;
 using Robust.Shared.Player;
-using Robust.Shared.Players;
 using Robust.Shared.Replays;
 using Robust.Shared.Utility;
 
@@ -51,8 +49,8 @@ namespace Content.Server.Chat.Managers
         private bool _oocEnabled = true;
         private bool _adminOocEnabled = true;
 
-        public Dictionary<IPlayerSession, int> SenderKeys { get; } = new();
-        public Dictionary<IPlayerSession, HashSet<NetEntity>> SenderEntities { get; } = new();
+        public Dictionary<ICommonSession, int> SenderKeys { get; } = new();
+        public Dictionary<ICommonSession, HashSet<NetEntity>> SenderEntities { get; } = new();
 
         public void Initialize()
         {
@@ -79,7 +77,7 @@ namespace Content.Server.Chat.Managers
             DispatchServerAnnouncement(Loc.GetString(val ? "chat-manager-admin-ooc-chat-enabled-message" : "chat-manager-admin-ooc-chat-disabled-message"));
         }
 
-        public void DeleteMessagesBy(IPlayerSession player)
+        public void DeleteMessagesBy(ICommonSession player)
         {
             var key = SenderKeys.GetValueOrDefault(player);
             var entities = SenderEntities.GetValueOrDefault(player) ?? new HashSet<NetEntity>();
@@ -165,7 +163,7 @@ namespace Content.Server.Chat.Managers
         /// <param name="player">The player sending the message.</param>
         /// <param name="message">The message.</param>
         /// <param name="type">The type of message.</param>
-        public void TrySendOOCMessage(IPlayerSession player, string message, OOCChatType type)
+        public void TrySendOOCMessage(ICommonSession player, string message, OOCChatType type)
         {
             // Check if message exceeds the character limit
             if (message.Length > MaxMessageLength)
@@ -189,7 +187,7 @@ namespace Content.Server.Chat.Managers
 
         #region Private API
 
-        private void SendOOC(IPlayerSession player, string message)
+        private void SendOOC(ICommonSession player, string message)
         {
             if (_adminManager.IsAdmin(player))
             {
@@ -226,7 +224,7 @@ namespace Content.Server.Chat.Managers
             _adminLogger.Add(LogType.Chat, LogImpact.Low, $"OOC from {player:Player}: {message}");
         }
 
-        private void SendAdminChat(IPlayerSession player, string message)
+        private void SendAdminChat(ICommonSession player, string message)
         {
             if (!_adminManager.IsAdmin(player))
             {
@@ -326,7 +324,7 @@ namespace Content.Server.Chat.Managers
             }
         }
 
-        public bool MessageCharacterLimit(IPlayerSession? player, string message)
+        public bool MessageCharacterLimit(ICommonSession? player, string message)
         {
             var isOverLength = false;
 
index 10103f011df2f7b2fd4ec6fb50df58db47e7bc27..5317b3054e4eddd61e7101ffa7c88e4205947d83 100644 (file)
@@ -1,8 +1,6 @@
 using Content.Shared.Chat;
-using Robust.Server.Player;
 using Robust.Shared.Network;
 using Robust.Shared.Player;
-using Robust.Shared.Players;
 
 namespace Content.Server.Chat.Managers
 {
@@ -12,12 +10,12 @@ namespace Content.Server.Chat.Managers
         ///     Keys identifying messages sent by a specific player, used when sending
         ///     <see cref="MsgChatMessage"/>
         /// </summary>
-        Dictionary<IPlayerSession, int> SenderKeys { get; }
+        Dictionary<ICommonSession, int> SenderKeys { get; }
 
         /// <summary>
         ///     Tracks which entities a player was attached to while sending messages.
         /// </summary>
-        Dictionary<IPlayerSession, HashSet<NetEntity>> SenderEntities { get; }
+        Dictionary<ICommonSession, HashSet<NetEntity>> SenderEntities { get; }
 
         void Initialize();
 
@@ -30,7 +28,7 @@ namespace Content.Server.Chat.Managers
 
         void DispatchServerMessage(ICommonSession player, string message, bool suppressLog = false);
 
-        void TrySendOOCMessage(IPlayerSession player, string message, OOCChatType type);
+        void TrySendOOCMessage(ICommonSession player, string message, OOCChatType type);
 
         void SendHookOOC(string sender, string message);
         void SendAdminAnnouncement(string message);
@@ -47,8 +45,8 @@ namespace Content.Server.Chat.Managers
 
         void ChatMessageToAll(ChatChannel channel, string message, string wrappedMessage, EntityUid source, bool hideChat, bool recordReplay, Color? colorOverride = null, string? audioPath = null, float audioVolume = 0, int? senderKey = null);
 
-        bool MessageCharacterLimit(IPlayerSession player, string message);
+        bool MessageCharacterLimit(ICommonSession player, string message);
 
-        void DeleteMessagesBy(IPlayerSession player);
+        void DeleteMessagesBy(ICommonSession player);
     }
 }
index 455d34c907f56585f0dde741211815ab47954a17..3315f61c2fb597b79e200fcc1cc6b67e0a708788 100644 (file)
@@ -7,7 +7,6 @@ using Content.Server.Administration.Logs;
 using Content.Server.Administration.Managers;
 using Content.Server.Chat.Managers;
 using Content.Server.GameTicking;
-using Content.Server.Players;
 using Content.Server.Station.Components;
 using Content.Server.Station.Systems;
 using Content.Shared.ActionBlocker;
@@ -18,6 +17,7 @@ using Content.Shared.Ghost;
 using Content.Shared.IdentityManagement;
 using Content.Shared.Interaction;
 using Content.Shared.Mobs.Systems;
+using Content.Shared.Players;
 using Content.Shared.Radio;
 using Robust.Server.GameObjects;
 using Robust.Server.Player;
@@ -26,7 +26,6 @@ using Robust.Shared.Configuration;
 using Robust.Shared.Console;
 using Robust.Shared.Network;
 using Robust.Shared.Player;
-using Robust.Shared.Players;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using Robust.Shared.Replays;
@@ -147,7 +146,7 @@ public sealed partial class ChatSystem : SharedChatSystem
         InGameICChatType desiredType,
         bool hideChat, bool hideLog = false,
         IConsoleShell? shell = null,
-        IPlayerSession? player = null, string? nameOverride = null,
+        ICommonSession? player = null, string? nameOverride = null,
         bool checkRadioPrefix = true,
         bool ignoreActionBlocker = false)
     {
@@ -172,7 +171,7 @@ public sealed partial class ChatSystem : SharedChatSystem
         ChatTransmitRange range,
         bool hideLog = false,
         IConsoleShell? shell = null,
-        IPlayerSession? player = null,
+        ICommonSession? player = null,
         string? nameOverride = null,
         bool checkRadioPrefix = true,
         bool ignoreActionBlocker = false
@@ -253,7 +252,7 @@ public sealed partial class ChatSystem : SharedChatSystem
         InGameOOCChatType type,
         bool hideChat,
         IConsoleShell? shell = null,
-        IPlayerSession? player = null
+        ICommonSession? player = null
         )
     {
         if (!CanSendInGame(message, shell, player))
@@ -547,7 +546,7 @@ public sealed partial class ChatSystem : SharedChatSystem
     }
 
     // ReSharper disable once InconsistentNaming
-    private void SendLOOC(EntityUid source, IPlayerSession player, string message, bool hideChat)
+    private void SendLOOC(EntityUid source, ICommonSession player, string message, bool hideChat)
     {
         var name = FormattedMessage.EscapeText(Identity.Name(source, EntityManager));
 
@@ -571,7 +570,7 @@ public sealed partial class ChatSystem : SharedChatSystem
         _adminLogger.Add(LogType.Chat, LogImpact.Low, $"LOOC from {player:Player}: {message}");
     }
 
-    private void SendDeadChat(EntityUid source, IPlayerSession player, string message, bool hideChat)
+    private void SendDeadChat(EntityUid source, ICommonSession player, string message, bool hideChat)
     {
         var clients = GetDeadChatClients();
         var playerName = Name(source);
@@ -628,13 +627,13 @@ public sealed partial class ChatSystem : SharedChatSystem
                 initialResult = MessageRangeCheckResult.Full;
                 break;
             case ChatTransmitRange.GhostRangeLimit:
-                initialResult = (data.Observer && data.Range < 0 && !_adminManager.IsAdmin((IPlayerSession) session)) ? MessageRangeCheckResult.HideChat : MessageRangeCheckResult.Full;
+                initialResult = (data.Observer && data.Range < 0 && !_adminManager.IsAdmin(session)) ? MessageRangeCheckResult.HideChat : MessageRangeCheckResult.Full;
                 break;
             case ChatTransmitRange.HideChat:
                 initialResult = MessageRangeCheckResult.HideChat;
                 break;
             case ChatTransmitRange.NoGhosts:
-                initialResult = (data.Observer && !_adminManager.IsAdmin((IPlayerSession) session)) ? MessageRangeCheckResult.Disallowed : MessageRangeCheckResult.Full;
+                initialResult = (data.Observer && !_adminManager.IsAdmin(session)) ? MessageRangeCheckResult.Disallowed : MessageRangeCheckResult.Full;
                 break;
         }
         var insistHideChat = data.HideChatOverride ?? false;
@@ -666,7 +665,7 @@ public sealed partial class ChatSystem : SharedChatSystem
     /// <summary>
     ///     Returns true if the given player is 'allowed' to send the given message, false otherwise.
     /// </summary>
-    private bool CanSendInGame(string message, IConsoleShell? shell = null, IPlayerSession? player = null)
+    private bool CanSendInGame(string message, IConsoleShell? shell = null, ICommonSession? player = null)
     {
         // Non-players don't have to worry about these restrictions.
         if (player == null)
@@ -694,7 +693,7 @@ public sealed partial class ChatSystem : SharedChatSystem
     {
         var newMessage = message.Trim();
         newMessage = SanitizeMessageReplaceWords(newMessage);
-        
+
         if (capitalize)
             newMessage = SanitizeMessageCapital(newMessage);
         if (capitalizeTheWordI)
index 8cbdd82f079c511db39ce761d5fba5f972f17475..7485c0e9016338d825627bdbe7ec8dc704ebf6e4 100644 (file)
@@ -2,6 +2,7 @@
 using Content.Shared.Chemistry.Reagent;
 using Robust.Server.Player;
 using Robust.Shared.Enums;
+using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 
 namespace Content.Server.Chemistry.EntitySystems;
index 4ef44d1678d4bca4908a6b3a4a01f5bbed050a3f..6f44c43be85a8ecd0dc49bc0148dd474f34b9658 100644 (file)
@@ -1,12 +1,12 @@
 using System.Linq;
 using Content.Shared.Decals;
 using Microsoft.Extensions.ObjectPool;
-using Robust.Server.Player;
 using Robust.Shared;
 using Robust.Shared.Configuration;
 using Robust.Shared.Enums;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
+using Robust.Shared.Player;
 using Robust.Shared.Utility;
 
 namespace Content.Shared.Chunking;
@@ -41,7 +41,7 @@ public sealed class ChunkingSystem : EntitySystem
     private void OnPvsRangeChanged(float value) => _baseViewBounds = Box2.UnitCentered.Scale(value);
 
     public Dictionary<NetEntity, HashSet<Vector2i>> GetChunksForSession(
-        IPlayerSession session,
+        ICommonSession session,
         int chunkSize,
         ObjectPool<HashSet<Vector2i>> indexPool,
         ObjectPool<Dictionary<NetEntity, HashSet<Vector2i>>> viewerPool,
@@ -52,7 +52,7 @@ public sealed class ChunkingSystem : EntitySystem
         return chunks;
     }
 
-    private HashSet<EntityUid> GetSessionViewers(IPlayerSession session)
+    private HashSet<EntityUid> GetSessionViewers(ICommonSession session)
     {
         var viewers = new HashSet<EntityUid>();
         if (session.Status != SessionStatus.InGame || session.AttachedEntity is null)
index 11adaec9a2f0087872b83152864b59503a12e9c4..172f3324e35d8ba09bc673f36efceba68aaeece8 100644 (file)
@@ -3,6 +3,7 @@ using System.Globalization;
 using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Network;
+using Robust.Shared.Player;
 
 namespace Content.Server.Commands
 {
@@ -16,7 +17,7 @@ namespace Content.Server.Commands
         /// sending a failure to the performer if unable to.
         /// </summary>
         public static bool TryGetSessionByUsernameOrId(IConsoleShell shell,
-            string usernameOrId, IPlayerSession performer, [NotNullWhen(true)] out IPlayerSession? session)
+            string usernameOrId, ICommonSession performer, [NotNullWhen(true)] out ICommonSession? session)
         {
             var plyMgr = IoCManager.Resolve<IPlayerManager>();
             if (plyMgr.TryGetSessionByUsername(usernameOrId, out session)) return true;
@@ -36,7 +37,7 @@ namespace Content.Server.Commands
         /// sending a failure to the performer if unable to.
         /// </summary>
         public static bool TryGetAttachedEntityByUsernameOrId(IConsoleShell shell,
-            string usernameOrId, IPlayerSession performer, out EntityUid attachedEntity)
+            string usernameOrId, ICommonSession performer, out EntityUid attachedEntity)
         {
             attachedEntity = default;
             if (!TryGetSessionByUsernameOrId(shell, usernameOrId, performer, out var session)) return false;
@@ -67,7 +68,7 @@ namespace Content.Server.Commands
                 transform.LocalPosition.Y.ToString(CultureInfo.InvariantCulture));
             ruleString = ruleString.Replace("$NAME", entMan.GetComponent<MetaDataComponent>(ent).EntityName);
 
-            if (shell.Player is IPlayerSession player)
+            if (shell.Player is { } player)
             {
                 if (player.AttachedEntity is {Valid: true} p)
                 {
index d23fa0a31b19102a6b168837dd3d58d0ae0b0572..bdbfaf170d476cc676007adc3b44f6008dbdb8a0 100644 (file)
@@ -3,7 +3,6 @@ using Content.Server.Power.Components;
 using Content.Shared.Administration;
 using Content.Shared.Construction;
 using Content.Shared.Tag;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Map.Components;
 
@@ -21,7 +20,7 @@ namespace Content.Server.Construction.Commands
 
         public void Execute(IConsoleShell shell, string argsOther, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             EntityUid? gridId;
             var xformQuery = _entManager.GetEntityQuery<TransformComponent>();
 
index ed1fba2424ae22d6e7bb72b20b7fe22286ea0156..f63fd4c13e016f8445616ddd95219d30164788d5 100644 (file)
@@ -1,6 +1,5 @@
 using Content.Server.Administration;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
@@ -20,7 +19,7 @@ sealed class TileReplaceCommand : IConsoleCommand
 
     public void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        var player = shell.Player as IPlayerSession;
+        var player = shell.Player;
         EntityUid? gridId;
         string tileIdA;
         string tileIdB;
index 55389e41cc74909e0a1a0d24821766f1dbb7f1de..731d4da7f8442fa8ee02d874c059ce743ba52ce2 100644 (file)
@@ -2,10 +2,9 @@ using Content.Server.Administration;
 using Content.Shared.Administration;
 using Content.Shared.Maps;
 using Content.Shared.Tag;
-using Robust.Server.GameObjects;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Map;
+using Robust.Server.GameObjects;
 using Robust.Shared.Map.Components;
 
 namespace Content.Server.Construction.Commands
@@ -29,7 +28,7 @@ namespace Content.Server.Construction.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             EntityUid? gridId;
 
             switch (args.Length)
index e74edb5da2406d461864b5bbed1a30ab8beb077b..21978f2d0cb2a23b4a012a7a1bb90af72cb96f3a 100644 (file)
@@ -16,7 +16,7 @@ using Content.Shared.Interaction;
 using Content.Shared.Inventory;
 using Content.Shared.Storage;
 using Robust.Shared.Containers;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Timing;
 
 namespace Content.Server.Construction
index aed0575324f5ff00d9e8e772761d243b15fa5507..4c4f17f61d4934b4f8c114b1e7a27bbc739734e5 100644 (file)
@@ -10,10 +10,9 @@ using Content.Shared.CCVar;
 using Content.Shared.CrewManifest;
 using Content.Shared.GameTicking;
 using Content.Shared.StationRecords;
-using Robust.Server.Player;
 using Robust.Shared.Configuration;
 using Robust.Shared.Console;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 
 namespace Content.Server.CrewManifest;
 
@@ -60,7 +59,7 @@ public sealed class CrewManifestSystem : EntitySystem
 
     private void OnRequestCrewManifest(RequestCrewManifestMessage message, EntitySessionEventArgs args)
     {
-        if (args.SenderSession is not IPlayerSession sessionCast
+        if (args.SenderSession is not { } sessionCast
             || !_configManager.GetCVar(CCVars.CrewManifestWithoutEntity))
         {
             return;
@@ -93,12 +92,12 @@ public sealed class CrewManifestSystem : EntitySystem
     private void OnBoundUiClose(EntityUid uid, CrewManifestViewerComponent component, BoundUIClosedEvent ev)
     {
         var owningStation = _stationSystem.GetOwningStation(uid);
-        if (owningStation == null || ev.Session is not IPlayerSession sessionCast)
+        if (owningStation == null || ev.Session is not { } session)
         {
             return;
         }
 
-        CloseEui(owningStation.Value, sessionCast, uid);
+        CloseEui(owningStation.Value, session, uid);
     }
 
     /// <summary>
@@ -126,7 +125,7 @@ public sealed class CrewManifestSystem : EntitySystem
     private void OpenEuiFromBui(EntityUid uid, CrewManifestViewerComponent component, CrewManifestOpenUiMessage msg)
     {
         var owningStation = _stationSystem.GetOwningStation(uid);
-        if (owningStation == null || msg.Session is not IPlayerSession sessionCast)
+        if (owningStation == null || msg.Session is not { } session)
         {
             return;
         }
@@ -136,7 +135,7 @@ public sealed class CrewManifestSystem : EntitySystem
             return;
         }
 
-        OpenEui(owningStation.Value, sessionCast, uid);
+        OpenEui(owningStation.Value, session, uid);
     }
 
     /// <summary>
@@ -145,7 +144,7 @@ public sealed class CrewManifestSystem : EntitySystem
     /// <param name="station">Station that we're displaying the crew manifest for.</param>
     /// <param name="session">The player's session.</param>
     /// <param name="owner">If this EUI should be 'owned' by an entity.</param>
-    public void OpenEui(EntityUid station, IPlayerSession session, EntityUid? owner = null)
+    public void OpenEui(EntityUid station, ICommonSession session, EntityUid? owner = null)
     {
         if (!HasComp<StationRecordsComponent>(station))
         {
@@ -252,7 +251,7 @@ public sealed class CrewManifestCommand : IConsoleCommand
             return;
         }
 
-        if (shell.Player == null || shell.Player is not IPlayerSession session)
+        if (shell.Player == null || shell.Player is not { } session)
         {
             shell.WriteLine("You must run this from a client.");
             return;
index 92a0e53f0f0b0778e361ae95fe1b0b57525a7171..866737f17a9e9ca5558ced7b3d18f205e790d599 100644 (file)
@@ -1,8 +1,6 @@
 using Content.Server.Administration;
-using Content.Server.Damage.Systems;
 using Content.Shared.Administration;
 using Content.Shared.Damage.Systems;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Damage.Commands
@@ -18,7 +16,7 @@ namespace Content.Server.Damage.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             EntityUid entity;
 
             switch (args.Length)
index 3d3346403ad7e47791633a9545e8bbb4d2c9ae9e..457fab4bb28414dc027a38ea04442194460b43ff 100644 (file)
@@ -6,7 +6,6 @@ using Content.Shared.Mobs.Systems;
 using Content.Shared.Stunnable;
 using Robust.Server.GameObjects;
 using Robust.Server.Player;
-using Robust.Shared.Players;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
index f2c506240bfb0ea482782a893d8274a0c60f6bf7..f8b1611fd57548404a72a0cfcca3758e265790f7 100644 (file)
@@ -2,8 +2,8 @@
 using System.Threading.Tasks;
 using Content.Server.Players.PlayTimeTracking;
 using Content.Server.Preferences.Managers;
-using Robust.Server.Player;
 using Robust.Shared.Network;
+using Robust.Shared.Player;
 using Robust.Shared.Utility;
 
 namespace Content.Server.Database;
@@ -25,7 +25,7 @@ public sealed class UserDbDataManager
 
     // TODO: Ideally connected/disconnected would be subscribed to IPlayerManager directly,
     // but this runs into ordering issues with game ticker.
-    public void ClientConnected(IPlayerSession session)
+    public void ClientConnected(ICommonSession session)
     {
         DebugTools.Assert(!_users.ContainsKey(session.UserId), "We should not have any cached data on client connect.");
 
@@ -36,7 +36,7 @@ public sealed class UserDbDataManager
         _users.Add(session.UserId, data);
     }
 
-    public void ClientDisconnected(IPlayerSession session)
+    public void ClientDisconnected(ICommonSession session)
     {
         _users.Remove(session.UserId, out var data);
         if (data == null)
@@ -49,24 +49,24 @@ public sealed class UserDbDataManager
         _playTimeTracking.ClientDisconnected(session);
     }
 
-    private async Task Load(IPlayerSession session, CancellationToken cancel)
+    private async Task Load(ICommonSession session, CancellationToken cancel)
     {
         await Task.WhenAll(
             _prefs.LoadData(session, cancel),
             _playTimeTracking.LoadData(session, cancel));
     }
 
-    public Task WaitLoadComplete(IPlayerSession session)
+    public Task WaitLoadComplete(ICommonSession session)
     {
         return _users[session.UserId].Task;
     }
 
-    public bool IsLoadComplete(IPlayerSession session)
+    public bool IsLoadComplete(ICommonSession session)
     {
         return GetLoadTask(session).IsCompleted;
     }
 
-    public Task GetLoadTask(IPlayerSession session)
+    public Task GetLoadTask(ICommonSession session)
     {
         return _users[session.UserId].Task;
     }
index ed281e05ba79bea0787ff30680599d49c2786eec..ce2e0711e74a1a940edb1998adfc237d138610ff 100644 (file)
@@ -16,6 +16,7 @@ using Robust.Shared.Configuration;
 using Robust.Shared.Enums;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
+using Robust.Shared.Player;
 using Robust.Shared.Threading;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
@@ -36,7 +37,7 @@ namespace Content.Server.Decals
         [Dependency] private readonly MapSystem _mapSystem = default!;
 
         private readonly Dictionary<NetEntity, HashSet<Vector2i>> _dirtyChunks = new();
-        private readonly Dictionary<IPlayerSession, Dictionary<NetEntity, HashSet<Vector2i>>> _previousSentChunks = new();
+        private readonly Dictionary<ICommonSession, Dictionary<NetEntity, HashSet<Vector2i>>> _previousSentChunks = new();
         private static readonly Vector2 _boundsMinExpansion = new(0.01f, 0.01f);
         private static readonly Vector2 _boundsMaxExpansion = new(1.01f, 1.01f);
 
@@ -197,7 +198,7 @@ namespace Content.Server.Decals
 
         private void OnDecalPlacementRequest(RequestDecalPlacementEvent ev, EntitySessionEventArgs eventArgs)
         {
-            if (eventArgs.SenderSession is not IPlayerSession session)
+            if (eventArgs.SenderSession is not { } session)
                 return;
 
             // bad
@@ -226,7 +227,7 @@ namespace Content.Server.Decals
 
         private void OnDecalRemovalRequest(RequestDecalRemovalEvent ev, EntitySessionEventArgs eventArgs)
         {
-            if (eventArgs.SenderSession is not IPlayerSession session)
+            if (eventArgs.SenderSession is not { } session)
                 return;
 
             // bad
@@ -427,7 +428,7 @@ namespace Content.Server.Decals
 
             if (PvsEnabled)
             {
-                var players = _playerManager.ServerSessions.Where(x => x.Status == SessionStatus.InGame).ToArray();
+                var players = _playerManager.Sessions.Where(x => x.Status == SessionStatus.InGame).ToArray();
                 var opts = new ParallelOptions { MaxDegreeOfParallelism = _parMan.ParallelProcessCount };
                 Parallel.ForEach(players, opts, UpdatePlayer);
             }
@@ -435,7 +436,7 @@ namespace Content.Server.Decals
             _dirtyChunks.Clear();
         }
 
-        public void UpdatePlayer(IPlayerSession player)
+        public void UpdatePlayer(ICommonSession player)
         {
             var chunksInRange = _chunking.GetChunksForSession(player, ChunkSize, _chunkIndexPool, _chunkViewerPool);
             var staleChunks = _chunkViewerPool.Get();
@@ -530,7 +531,7 @@ namespace Content.Server.Decals
         }
 
         private void SendChunkUpdates(
-            IPlayerSession session,
+            ICommonSession session,
             Dictionary<NetEntity, HashSet<Vector2i>> updatedChunks,
             Dictionary<NetEntity, HashSet<Vector2i>> staleChunks)
         {
index 7895dcbca665727101b74af8b947fa6901dd828f..55e64659379ded95c6417d6fd867d0f7051a23da 100644 (file)
@@ -2,7 +2,6 @@ using Content.Server.Administration;
 using Content.Server.Disposal.Tube;
 using Content.Server.Disposal.Tube.Components;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Disposal
@@ -18,7 +17,7 @@ namespace Content.Server.Disposal
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (player?.AttachedEntity == null)
             {
                 shell.WriteLine(Loc.GetString("shell-only-players-can-run-this-command"));
index 4a41ad40a5501cf420e5173328d31921e0c02f87..70cbfc377503dacb1fc652b512e2f3b3b98ed8d3 100644 (file)
@@ -1,6 +1,6 @@
 using Content.Shared.Eui;
 using Robust.Shared.Network;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 
 namespace Content.Server.EUI
 {
index 4d997195252fe08377fe82fc9be3798d98436bec..fe8e486b68029025db3b4d19a5b8ffe852ec6b9e 100644 (file)
@@ -2,7 +2,7 @@
 using Robust.Server.Player;
 using Robust.Shared.Enums;
 using Robust.Shared.Network;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Utility;
 
 namespace Content.Server.EUI
index 0891bbd12acb214600d2ada1e0bbc812e4e5eae5..027d25dc2c22c07dd489a16e0556dfec04918bed 100644 (file)
@@ -1,7 +1,6 @@
 using Content.Server.Administration;
 using Content.Shared.Administration;
 using Content.Shared.EntityList;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Prototypes;
 
@@ -22,7 +21,7 @@ namespace Content.Server.EntityList
                 return;
             }
 
-            if (shell.Player is not IPlayerSession player)
+            if (shell.Player is not { } player)
             {
                 shell.WriteError("You must be a player to run this command.");
                 return;
index 98aa806885d06dc33d4afeb52a3e6b4d910506fc..3447810896f7ed2a9a9f313a0055f7514a5fef94 100644 (file)
@@ -4,7 +4,6 @@ using Content.Shared.Examine;
 using Content.Shared.Verbs;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
 using Robust.Shared.Utility;
 
 namespace Content.Server.Examine
@@ -46,7 +45,7 @@ namespace Content.Server.Examine
 
         private void ExamineInfoRequest(ExamineSystemMessages.RequestExamineInfoMessage request, EntitySessionEventArgs eventArgs)
         {
-            var player = (IPlayerSession) eventArgs.SenderSession;
+            var player = eventArgs.SenderSession;
             var session = eventArgs.SenderSession;
             var channel = player.ConnectedClient;
             var entity = GetEntity(request.NetEntity);
index 59f0a13695eb9292e5ccc8e9f99d3f0efd686cf4..c17eea684db34f4ab1442d066683caf16014db38 100644 (file)
@@ -1,9 +1,9 @@
 using System.Numerics;
 using Content.Shared.Fluids;
 using Content.Shared.Fluids.Components;
-using Robust.Server.Player;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
+using Robust.Shared.Player;
 using Robust.Shared.Timing;
 
 namespace Content.Server.Fluids.EntitySystems;
@@ -14,10 +14,10 @@ public sealed class PuddleDebugDebugOverlaySystem : SharedPuddleDebugOverlaySyst
     [Dependency] private readonly IMapManager _mapManager = default!;
     [Dependency] private readonly PuddleSystem _puddle = default!;
 
-    private readonly HashSet<IPlayerSession> _playerObservers = new();
+    private readonly HashSet<ICommonSession> _playerObservers = new();
     private List<Entity<MapGridComponent>> _grids = new();
 
-    public bool ToggleObserver(IPlayerSession observer)
+    public bool ToggleObserver(ICommonSession observer)
     {
         NextTick ??= _timing.CurTime + Cooldown;
 
@@ -31,7 +31,7 @@ public sealed class PuddleDebugDebugOverlaySystem : SharedPuddleDebugOverlaySyst
         return true;
     }
 
-    private void RemoveObserver(IPlayerSession observer)
+    private void RemoveObserver(ICommonSession observer)
     {
         if (!_playerObservers.Remove(observer))
         {
index f122eadea790fe42ebf02d06fd1475bad0b89be6..71ac273a45b9124bf9294e09fb1342e3b20ec6b9 100644 (file)
@@ -1,7 +1,6 @@
 using Content.Server.Administration;
 using Content.Server.Fluids.EntitySystems;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Fluids;
@@ -15,7 +14,7 @@ public sealed class ShowFluidsCommand : IConsoleCommand
     public string Help => $"Usage: {Command}";
     public void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        var player = shell.Player as IPlayerSession;
+        var player = shell.Player;
         if (player == null)
         {
             shell.WriteLine("You must be a player to use this command.");
index 366e6c4e772bcd3cddc680b75fa5ee2ca23d42f4..3276b91200324d9fc6492fc63a3a4b0b44508701 100644 (file)
@@ -2,7 +2,6 @@ using Content.Server.Station.Systems;
 using Content.Shared.Administration;
 using Content.Shared.GameTicking;
 using Content.Shared.Roles;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Prototypes;
 
@@ -30,7 +29,7 @@ namespace Content.Server.GameTicking.Commands
                 return;
             }
 
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
 
             if (player == null)
             {
index d608dda9c1756b3a15f46ffff2d9cd9a7efe77ff..747e54e28becacbe38b75baa123161c90f58b52a 100644 (file)
@@ -1,6 +1,5 @@
 using Content.Shared.Administration;
 using Content.Shared.GameTicking;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.GameTicking.Commands
@@ -14,7 +13,7 @@ namespace Content.Server.GameTicking.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            if (shell.Player is not IPlayerSession player)
+            if (shell.Player is not { } player)
             {
                 return;
             }
index 057572297f91364618a3acf7b228e87421e504ea..4f101d0939ad65cc78d5ec3daf8120a4847608e1 100644 (file)
@@ -14,7 +14,7 @@ namespace Content.Server.GameTicking.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (args.Length > 1)
             {
                 shell.WriteLine("Must provide <= 1 argument.");
index e68c4c5fa7fe3bf8706a2dddb0732a0692a941b0..df418c27ee1af1d640168f9593c6b08d28dd5e69 100644 (file)
@@ -1,5 +1,4 @@
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.GameTicking.Commands
@@ -13,7 +12,7 @@ namespace Content.Server.GameTicking.Commands
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (args.Length != 1)
             {
                 shell.WriteError(Loc.GetString("shell-wrong-arguments-number"));
index a5e6d7a60566c37321eb85bd0959a007572daa7f..2d7539bd0f119fd90ce56de58566a27b968c1ad5 100644 (file)
@@ -11,7 +11,7 @@ using Content.Shared.Ghost;
 using Content.Shared.Mind;
 using Content.Shared.Mobs.Components;
 using JetBrains.Annotations;
-using Robust.Server.Player;
+using Robust.Shared.Player;
 
 namespace Content.Server.GameTicking
 {
@@ -29,7 +29,7 @@ namespace Content.Server.GameTicking
         /// </summary>
         public GamePresetPrototype? CurrentPreset { get; private set; }
 
-        private bool StartPreset(IPlayerSession[] origReadyPlayers, bool force)
+        private bool StartPreset(ICommonSession[] origReadyPlayers, bool force)
         {
             var startAttempt = new RoundStartAttemptEvent(origReadyPlayers, force);
             RaiseLocalEvent(startAttempt);
@@ -214,7 +214,7 @@ namespace Content.Server.GameTicking
             {
                 if (mind.Session != null) // Logging is suppressed to prevent spam from ghost attempts caused by movement attempts
                 {
-                    _chatManager.DispatchServerMessage((IPlayerSession) mind.Session, Loc.GetString("comp-mind-ghosting-prevented"),
+                    _chatManager.DispatchServerMessage(mind.Session, Loc.GetString("comp-mind-ghosting-prevented"),
                         true);
                 }
 
index b7b6a29a5a7b313242c836837708eb858f96966d..1943a82617ade2edb103ce410f68ceef05064c25 100644 (file)
@@ -1,10 +1,8 @@
 using System.Linq;
 using Content.Shared.GameTicking;
 using Content.Server.Station.Components;
-using Robust.Server.Player;
 using Robust.Shared.Network;
 using Robust.Shared.Player;
-using Robust.Shared.Players;
 using System.Text;
 
 namespace Content.Server.GameTicking
@@ -79,7 +77,7 @@ namespace Content.Server.GameTicking
                 ("roundId", RoundId), ("playerCount", playerCount), ("readyCount", readyCount), ("mapName", stationNames.ToString()),("gmTitle", gmTitle),("desc", desc));
         }
 
-        private TickerLobbyStatusEvent GetStatusMsg(IPlayerSession session)
+        private TickerLobbyStatusEvent GetStatusMsg(ICommonSession session)
         {
             _playerGameStatuses.TryGetValue(session.UserId, out var status);
             return new TickerLobbyStatusEvent(RunLevel != GameRunLevel.PreRoundLobby, LobbySong, LobbyBackground,status == PlayerGameStatus.ReadyToPlay, _roundStartTime, RoundPreloadTime, _roundStartTimeSpan, Paused);
@@ -87,7 +85,7 @@ namespace Content.Server.GameTicking
 
         private void SendStatusToAll()
         {
-            foreach (var player in _playerManager.ServerSessions)
+            foreach (var player in _playerManager.Sessions)
             {
                 RaiseNetworkEvent(GetStatusMsg(player), player.ConnectedClient);
             }
@@ -148,7 +146,7 @@ namespace Content.Server.GameTicking
             }
         }
 
-        public void ToggleReady(IPlayerSession player, bool ready)
+        public void ToggleReady(ICommonSession player, bool ready)
         {
             if (!_playerGameStatuses.ContainsKey(player.UserId))
                 return;
index 3aef1bbe78525a964f1f7916fb2b9dedcd679a6b..dfd2e98499c25fc27c1387d18dede76f78a7d68e 100644 (file)
@@ -1,12 +1,13 @@
 using Content.Server.Database;
-using Content.Server.Players;
 using Content.Shared.GameTicking;
 using Content.Shared.GameWindow;
 using Content.Shared.Players;
 using Content.Shared.Preferences;
 using JetBrains.Annotations;
+using Robust.Server.GameObjects;
 using Robust.Server.Player;
 using Robust.Shared.Enums;
+using Robust.Shared.Player;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
 
@@ -17,6 +18,7 @@ namespace Content.Server.GameTicking
     {
         [Dependency] private readonly IPlayerManager _playerManager = default!;
         [Dependency] private readonly IServerDbManager _dbManager = default!;
+        [Dependency] private readonly ActorSystem _actor = default!;
 
         private void InitializePlayer()
         {
@@ -49,14 +51,14 @@ namespace Content.Server.GameTicking
                     // Always make sure the client has player data.
                     if (session.Data.ContentDataUncast == null)
                     {
-                        var data = new PlayerData(session.UserId, args.Session.Name);
+                        var data = new ContentPlayerData(session.UserId, args.Session.Name);
                         data.Mind = mindId;
                         session.Data.ContentDataUncast = data;
                     }
 
                     // Make the player actually join the game.
                     // timer time must be > tick length
-                    Timer.Spawn(0, args.Session.JoinGame);
+                    Timer.Spawn(0, () => _playerManager.JoinGame(args.Session));
 
                     var record = await _dbManager.GetPlayerRecordByUserId(args.Session.UserId);
                     var firstConnection = record != null &&
@@ -100,9 +102,16 @@ namespace Content.Server.GameTicking
                     }
                     else
                     {
-                        // Simply re-attach to existing entity.
-                        session.AttachToEntity(mind.CurrentEntity);
-                        PlayerJoinGame(session);
+                        if (_actor.Attach(mind.CurrentEntity, session))
+                        {
+                            PlayerJoinGame(session);
+                        }
+                        else
+                        {
+                            Log.Error(
+                                $"Failed to attach player {session} with mind {ToPrettyString(mindId)} to its current entity {ToPrettyString(mind.CurrentEntity)}");
+                            SpawnObserverWaitDb();
+                        }
                     }
 
                     break;
@@ -146,12 +155,12 @@ namespace Content.Server.GameTicking
             }
         }
 
-        private HumanoidCharacterProfile GetPlayerProfile(IPlayerSession p)
+        private HumanoidCharacterProfile GetPlayerProfile(ICommonSession p)
         {
             return (HumanoidCharacterProfile) _prefsManager.GetPreferences(p.UserId).SelectedCharacter;
         }
 
-        public void PlayerJoinGame(IPlayerSession session, bool silent = false)
+        public void PlayerJoinGame(ICommonSession session, bool silent = false)
         {
             if (!silent)
                 _chatManager.DispatchServerMessage(session, Loc.GetString("game-ticker-player-join-game-message"));
@@ -162,7 +171,7 @@ namespace Content.Server.GameTicking
             RaiseNetworkEvent(new TickerJoinGameEvent(), session.ConnectedClient);
         }
 
-        private void PlayerJoinLobby(IPlayerSession session)
+        private void PlayerJoinLobby(ICommonSession session)
         {
             _playerGameStatuses[session.UserId] = LobbyEnabled ? PlayerGameStatus.NotReadyToPlay : PlayerGameStatus.ReadyToPlay;
             _db.AddRoundPlayers(RoundId, session.UserId);
@@ -182,9 +191,9 @@ namespace Content.Server.GameTicking
 
     public sealed class PlayerJoinedLobbyEvent : EntityEventArgs
     {
-        public readonly IPlayerSession PlayerSession;
+        public readonly ICommonSession PlayerSession;
 
-        public PlayerJoinedLobbyEvent(IPlayerSession playerSession)
+        public PlayerJoinedLobbyEvent(ICommonSession playerSession)
         {
             PlayerSession = playerSession;
         }
index a10196a43e1ef6402ce2624221b928b8c097a7bb..85f833bd1c3264111f6f49c60b3e188eeb934806 100644 (file)
@@ -12,7 +12,6 @@ using Content.Shared.Preferences;
 using JetBrains.Annotations;
 using Prometheus;
 using Robust.Server.Maps;
-using Robust.Server.Player;
 using Robust.Shared.Asynchronous;
 using Robust.Shared.Audio;
 using Robust.Shared.Map;
@@ -205,7 +204,7 @@ namespace Content.Server.GameTicking
 
             var startingEvent = new RoundStartingEvent(RoundId);
             RaiseLocalEvent(startingEvent);
-            var readyPlayers = new List<IPlayerSession>();
+            var readyPlayers = new List<ICommonSession>();
             var readyPlayerProfiles = new Dictionary<NetUserId, HumanoidCharacterProfile>();
 
             foreach (var (userId, status) in _playerGameStatuses)
@@ -344,7 +343,7 @@ namespace Content.Server.GameTicking
                 {
                     connected = true;
                 }
-                PlayerData? contentPlayerData = null;
+                ContentPlayerData? contentPlayerData = null;
                 if (userId != null && _playerManager.TryGetPlayerData(userId.Value, out var playerData))
                 {
                     contentPlayerData = playerData.ContentData();
@@ -493,7 +492,7 @@ namespace Content.Server.GameTicking
         private void ResettingCleanup()
         {
             // Move everybody currently in the server to lobby.
-            foreach (var player in _playerManager.ServerSessions)
+            foreach (var player in _playerManager.Sessions)
             {
                 PlayerJoinLobby(player);
             }
@@ -541,7 +540,7 @@ namespace Content.Server.GameTicking
 
             DisallowLateJoin = false;
             _playerGameStatuses.Clear();
-            foreach (var session in _playerManager.ServerSessions)
+            foreach (var session in _playerManager.Sessions)
             {
                 _playerGameStatuses[session.UserId] = LobbyEnabled ?  PlayerGameStatus.NotReadyToPlay : PlayerGameStatus.ReadyToPlay;
             }
@@ -735,10 +734,10 @@ namespace Content.Server.GameTicking
     /// </summary>
     public sealed class RoundStartAttemptEvent : CancellableEntityEventArgs
     {
-        public IPlayerSession[] Players { get; }
+        public ICommonSession[] Players { get; }
         public bool Forced { get; }
 
-        public RoundStartAttemptEvent(IPlayerSession[] players, bool forced)
+        public RoundStartAttemptEvent(ICommonSession[] players, bool forced)
         {
             Players = players;
             Forced = forced;
@@ -757,11 +756,11 @@ namespace Content.Server.GameTicking
         ///     If you want to handle a specific player being spawned, remove it from this list and do what you need.
         /// </summary>
         /// <remarks>If you spawn a player by yourself from this event, don't forget to call <see cref="GameTicker.PlayerJoinGame"/> on them.</remarks>
-        public List<IPlayerSession> PlayerPool { get; }
+        public List<ICommonSession> PlayerPool { get; }
         public IReadOnlyDictionary<NetUserId, HumanoidCharacterProfile> Profiles { get; }
         public bool Forced { get; }
 
-        public RulePlayerSpawningEvent(List<IPlayerSession> playerPool, IReadOnlyDictionary<NetUserId, HumanoidCharacterProfile> profiles, bool forced)
+        public RulePlayerSpawningEvent(List<ICommonSession> playerPool, IReadOnlyDictionary<NetUserId, HumanoidCharacterProfile> profiles, bool forced)
         {
             PlayerPool = playerPool;
             Profiles = profiles;
@@ -775,11 +774,11 @@ namespace Content.Server.GameTicking
     /// </summary>
     public sealed class RulePlayerJobsAssignedEvent
     {
-        public IPlayerSession[] Players { get; }
+        public ICommonSession[] Players { get; }
         public IReadOnlyDictionary<NetUserId, HumanoidCharacterProfile> Profiles { get; }
         public bool Forced { get; }
 
-        public RulePlayerJobsAssignedEvent(IPlayerSession[] players, IReadOnlyDictionary<NetUserId, HumanoidCharacterProfile> profiles, bool forced)
+        public RulePlayerJobsAssignedEvent(ICommonSession[] players, IReadOnlyDictionary<NetUserId, HumanoidCharacterProfile> profiles, bool forced)
         {
             Players = players;
             Profiles = profiles;
index 0c59f93bb021fad55e1dff01e155ad7a5caad399..c2bf523657ca3516bf71e70e79ba41e99f54fc1a 100644 (file)
@@ -3,20 +3,20 @@ using System.Linq;
 using System.Numerics;
 using Content.Server.Administration.Managers;
 using Content.Server.Ghost;
-using Content.Server.Players;
 using Content.Server.Spawners.Components;
 using Content.Server.Speech.Components;
 using Content.Server.Station.Components;
 using Content.Shared.CCVar;
 using Content.Shared.Database;
+using Content.Shared.Players;
 using Content.Shared.Preferences;
 using Content.Shared.Roles;
 using Content.Shared.Roles.Jobs;
 using JetBrains.Annotations;
-using Robust.Server.Player;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Network;
+using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using Robust.Shared.Utility;
@@ -29,7 +29,7 @@ namespace Content.Server.GameTicking
         [Dependency] private readonly SharedJobSystem _jobs = default!;
 
         [ValidatePrototypeId<EntityPrototype>]
-        private const string ObserverPrototypeName = "MobObserver";
+        public const string ObserverPrototypeName = "MobObserver";
 
         /// <summary>
         /// How many players have joined the round through normal methods.
@@ -52,7 +52,7 @@ namespace Content.Server.GameTicking
             return spawnableStations;
         }
 
-        private void SpawnPlayers(List<IPlayerSession> readyPlayers, Dictionary<NetUserId, HumanoidCharacterProfile> profiles, bool force)
+        private void SpawnPlayers(List<ICommonSession> readyPlayers, Dictionary<NetUserId, HumanoidCharacterProfile> profiles, bool force)
         {
             // Allow game rules to spawn players by themselves if needed. (For example, nuke ops or wizard)
             RaiseLocalEvent(new RulePlayerSpawningEvent(readyPlayers, profiles, force));
@@ -116,7 +116,7 @@ namespace Content.Server.GameTicking
             RaiseLocalEvent(new RulePlayerJobsAssignedEvent(assignedJobs.Keys.Select(x => _playerManager.GetSessionByUserId(x)).ToArray(), profiles, force));
         }
 
-        private void SpawnPlayer(IPlayerSession player, EntityUid station, string? jobId = null, bool lateJoin = true, bool silent = false)
+        private void SpawnPlayer(ICommonSession player, EntityUid station, string? jobId = null, bool lateJoin = true, bool silent = false)
         {
             var character = GetPlayerProfile(player);
 
@@ -129,7 +129,7 @@ namespace Content.Server.GameTicking
             SpawnPlayer(player, character, station, jobId, lateJoin, silent);
         }
 
-        private void SpawnPlayer(IPlayerSession player, HumanoidCharacterProfile character, EntityUid station, string? jobId = null, bool lateJoin = true, bool silent = false)
+        private void SpawnPlayer(ICommonSession player, HumanoidCharacterProfile character, EntityUid station, string? jobId = null, bool lateJoin = true, bool silent = false)
         {
             // Can't spawn players with a dummy ticker!
             if (DummyTicker)
@@ -271,7 +271,7 @@ namespace Content.Server.GameTicking
             RaiseLocalEvent(mob, aev, true);
         }
 
-        public void Respawn(IPlayerSession player)
+        public void Respawn(ICommonSession player)
         {
             _mind.WipeMind(player);
             _adminLogger.Add(LogType.Respawn, LogImpact.Medium, $"Player {player} was respawned.");
@@ -289,7 +289,7 @@ namespace Content.Server.GameTicking
         /// <param name="station">The station they're spawning on</param>
         /// <param name="jobId">An optional job for them to spawn as</param>
         /// <param name="silent">Whether or not the player should be greeted upon joining</param>
-        public void MakeJoinGame(IPlayerSession player, EntityUid station, string? jobId = null, bool silent = false)
+        public void MakeJoinGame(ICommonSession player, EntityUid station, string? jobId = null, bool silent = false)
         {
             if (!_playerGameStatuses.ContainsKey(player.UserId))
                 return;
@@ -303,7 +303,7 @@ namespace Content.Server.GameTicking
         /// <summary>
         /// Causes the given player to join the current game as observer ghost. See also <see cref="SpawnObserver"/>
         /// </summary>
-        public void JoinAsObserver(IPlayerSession player)
+        public void JoinAsObserver(ICommonSession player)
         {
             // Can't spawn players with a dummy ticker!
             if (DummyTicker)
@@ -317,7 +317,7 @@ namespace Content.Server.GameTicking
         /// Spawns an observer ghost and attaches the given player to it. If the player does not yet have a mind, the
         /// player is given a new mind with the observer role. Otherwise, the current mind is transferred to the ghost.
         /// </summary>
-        public void SpawnObserver(IPlayerSession player)
+        public void SpawnObserver(ICommonSession player)
         {
             if (DummyTicker)
                 return;
@@ -430,13 +430,13 @@ namespace Content.Server.GameTicking
     [PublicAPI]
     public sealed class PlayerBeforeSpawnEvent : HandledEntityEventArgs
     {
-        public IPlayerSession Player { get; }
+        public ICommonSession Player { get; }
         public HumanoidCharacterProfile Profile { get; }
         public string? JobId { get; }
         public bool LateJoin { get; }
         public EntityUid Station { get; }
 
-        public PlayerBeforeSpawnEvent(IPlayerSession player, HumanoidCharacterProfile profile, string? jobId, bool lateJoin, EntityUid station)
+        public PlayerBeforeSpawnEvent(ICommonSession player, HumanoidCharacterProfile profile, string? jobId, bool lateJoin, EntityUid station)
         {
             Player = player;
             Profile = profile;
@@ -455,7 +455,7 @@ namespace Content.Server.GameTicking
     public sealed class PlayerSpawnCompleteEvent : EntityEventArgs
     {
         public EntityUid Mob { get; }
-        public IPlayerSession Player { get; }
+        public ICommonSession Player { get; }
         public string? JobId { get; }
         public bool LateJoin { get; }
         public EntityUid Station { get; }
@@ -464,7 +464,7 @@ namespace Content.Server.GameTicking
         // Ex. If this is the 27th person to join, this will be 27.
         public int JoinOrder { get; }
 
-        public PlayerSpawnCompleteEvent(EntityUid mob, IPlayerSession player, string? jobId, bool lateJoin, int joinOrder, EntityUid station, HumanoidCharacterProfile profile)
+        public PlayerSpawnCompleteEvent(EntityUid mob, ICommonSession player, string? jobId, bool lateJoin, int joinOrder, EntityUid station, HumanoidCharacterProfile profile)
         {
             Mob = mob;
             Player = player;
index 883abef52fa7a6dff52201e27e512a2dc0933e36..7af87179d65495debd5163a76f7aef2a6523235e 100644 (file)
@@ -1,7 +1,7 @@
 using Content.Shared.Preferences;
 using Content.Shared.Roles;
-using Robust.Server.Player;
 using Robust.Shared.Audio;
+using Robust.Shared.Player;
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
 
 namespace Content.Server.GameTicking.Rules.Components;
@@ -26,7 +26,7 @@ public sealed partial class TraitorRuleComponent : Component
 
     public SelectionState SelectionStatus = SelectionState.WaitingForSpawn;
     public TimeSpan AnnounceAt = TimeSpan.Zero;
-    public Dictionary<IPlayerSession, HumanoidCharacterProfile> StartCandidates = new();
+    public Dictionary<ICommonSession, HumanoidCharacterProfile> StartCandidates = new();
 
     /// <summary>
     ///     Path to antagonist alert sound.
index c2e91ba4a5d01da30a11f0715b3074d6789e0eb3..b775b7af5640e12ea11f6d7f93549826b4e893ad 100644 (file)
@@ -2,6 +2,7 @@ using System.Threading;
 using Content.Server.Chat.Managers;
 using Content.Server.GameTicking.Rules.Components;
 using Robust.Server.Player;
+using Robust.Shared.Player;
 using Timer = Robust.Shared.Timing.Timer;
 
 namespace Content.Server.GameTicking.Rules;
index 13d4ed71c8e0b34c583a33e41cec645d6248010e..4d3eee81e2af90d4556d64fdb9f7a12e770aecfc 100644 (file)
@@ -602,11 +602,11 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
             var maxOperatives = nukeops.MaxOps;
 
             // Dear lord what is happening HERE.
-            var everyone = new List<IPlayerSession>(ev.PlayerPool);
-            var prefList = new List<IPlayerSession>();
-            var medPrefList = new List<IPlayerSession>();
-            var cmdrPrefList = new List<IPlayerSession>();
-            var operatives = new List<IPlayerSession>();
+            var everyone = new List<ICommonSession>(ev.PlayerPool);
+            var prefList = new List<ICommonSession>();
+            var medPrefList = new List<ICommonSession>();
+            var cmdrPrefList = new List<ICommonSession>();
+            var operatives = new List<ICommonSession>();
 
             // The LINQ expression ReSharper keeps suggesting is completely unintelligible so I'm disabling it
             // ReSharper disable once ForeachCanBeConvertedToQueryUsingAnotherGetEnumerator
@@ -637,7 +637,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
             for (var i = 0; i < numNukies; i++)
             {
                 // TODO: Please fix this if you touch it.
-                IPlayerSession nukeOp;
+                ICommonSession nukeOp;
                 // Only one commander, so we do it at the start
                 if (i == 0)
                 {
@@ -908,7 +908,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
         _npcFaction.AddFaction(mob, "Syndicate");
     }
 
-    private void SpawnOperatives(int spawnCount, List<IPlayerSession> sessions, bool addSpawnPoints, NukeopsRuleComponent component)
+    private void SpawnOperatives(int spawnCount, List<ICommonSession> sessions, bool addSpawnPoints, NukeopsRuleComponent component)
     {
         if (component.NukieOutpost == null)
             return;
@@ -987,10 +987,10 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
         var playersPerOperative = component.PlayersPerOperative;
         var maxOperatives = component.MaxOps;
 
-        var playerPool = _playerManager.ServerSessions.ToList();
+        var playerPool = _playerManager.Sessions.ToList();
         var numNukies = MathHelper.Clamp(playerPool.Count / playersPerOperative, 1, maxOperatives);
 
-        var operatives = new List<IPlayerSession>();
+        var operatives = new List<ICommonSession>();
         SpawnOperatives(numNukies, operatives, true, component);
     }
 
index b223161c10e2763361f9ae2fa1d65318dbd810cd..0785d81d09b7bc1ea720eb412cf36cdb6aa1b24e 100644 (file)
@@ -15,10 +15,10 @@ using Content.Shared.Preferences;
 using Content.Shared.Roles;
 using Robust.Server.GameObjects;
 using Robust.Server.Maps;
-using Robust.Server.Player;
 using Robust.Shared.Configuration;
 using Robust.Shared.Enums;
 using Robust.Shared.Map;
+using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using Robust.Shared.Utility;
@@ -141,7 +141,7 @@ public sealed class PiratesRuleSystem : GameRuleSystem<PiratesRuleComponent>
                 (int) Math.Min(
                     Math.Floor((double) ev.PlayerPool.Count / _cfg.GetCVar(CCVars.PiratesPlayersPerOp)),
                     _cfg.GetCVar(CCVars.PiratesMaxOps)));
-            var ops = new IPlayerSession[numOps];
+            var ops = new ICommonSession[numOps];
             for (var i = 0; i < numOps; i++)
             {
                 ops[i] = _random.PickAndTake(ev.PlayerPool);
index a286808623778ac6b509ea66508f8babd0b78a3d..738883fff38fff807c27a7020984e7740aadaf57 100644 (file)
@@ -6,6 +6,7 @@ using Content.Shared.Chat;
 using Content.Shared.Interaction.Events;
 using Content.Shared.Mind;
 using Content.Shared.Mobs;
+using Content.Shared.Players;
 using Robust.Server.GameObjects;
 using Robust.Server.Player;
 using Robust.Shared.Network;
index 01317dbfc11b240c3603fa61ac3c48fadac9ca70..ef949d09fc98d5f1faf871970a796bdb50ad3aaf 100644 (file)
@@ -17,9 +17,8 @@ using Content.Shared.PDA;
 using Content.Shared.Preferences;
 using Content.Shared.Roles;
 using Content.Shared.Roles.Jobs;
-using Robust.Server.Player;
 using Robust.Shared.Configuration;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
@@ -151,9 +150,9 @@ public sealed class TraitorRuleSystem : GameRuleSystem<TraitorRuleComponent>
         }
     }
 
-    private List<IPlayerSession> FindPotentialTraitors(in Dictionary<IPlayerSession, HumanoidCharacterProfile> candidates, TraitorRuleComponent component)
+    private List<ICommonSession> FindPotentialTraitors(in Dictionary<ICommonSession, HumanoidCharacterProfile> candidates, TraitorRuleComponent component)
     {
-        var list = new List<IPlayerSession>();
+        var list = new List<ICommonSession>();
         var pendingQuery = GetEntityQuery<PendingClockInComponent>();
 
         foreach (var player in candidates.Keys)
@@ -171,7 +170,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem<TraitorRuleComponent>
             list.Add(player);
         }
 
-        var prefList = new List<IPlayerSession>();
+        var prefList = new List<ICommonSession>();
 
         foreach (var player in list)
         {
@@ -189,9 +188,9 @@ public sealed class TraitorRuleSystem : GameRuleSystem<TraitorRuleComponent>
         return prefList;
     }
 
-    private List<IPlayerSession> PickTraitors(int traitorCount, List<IPlayerSession> prefList)
+    private List<ICommonSession> PickTraitors(int traitorCount, List<ICommonSession> prefList)
     {
-        var results = new List<IPlayerSession>(traitorCount);
+        var results = new List<ICommonSession>(traitorCount);
         if (prefList.Count == 0)
         {
             Log.Info("Insufficient ready players to fill up with traitors, stopping the selection.");
index 82ae4b8fa660e4d53db352cc011c2cdcb4b99b93..a4febc385c1dae8e73c17f1446fbd5ce290e0668 100644 (file)
@@ -23,7 +23,7 @@ using Content.Shared.Zombies;
 using Robust.Server.GameObjects;
 using Robust.Server.Player;
 using Robust.Shared.Configuration;
-using Robust.Shared.Prototypes;
+using Robust.Shared.Player;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
 
@@ -264,9 +264,9 @@ public sealed class ZombieRuleSystem : GameRuleSystem<ZombieRuleComponent>
             return;
         component.InfectedChosen = true;
 
-        var allPlayers = _playerManager.ServerSessions.ToList();
-        var playerList = new List<IPlayerSession>();
-        var prefList = new List<IPlayerSession>();
+        var allPlayers = _playerManager.Sessions.ToList();
+        var playerList = new List<ICommonSession>();
+        var prefList = new List<ICommonSession>();
         foreach (var player in allPlayers)
         {
             if (player.AttachedEntity == null || !HasComp<HumanoidAppearanceComponent>(player.AttachedEntity) || HasComp<ZombieImmuneComponent>(player.AttachedEntity))
@@ -288,7 +288,7 @@ public sealed class ZombieRuleSystem : GameRuleSystem<ZombieRuleComponent>
         var totalInfected = 0;
         while (totalInfected < numInfected)
         {
-            IPlayerSession zombie;
+            ICommonSession zombie;
             if (prefList.Count == 0)
             {
                 if (playerList.Count == 0)
index d04b1197afa95c6d83d5876b4b00104ae2049250..1453bf3faa9108ad527d582fa228b957ae269dcf 100644 (file)
@@ -1,7 +1,6 @@
 using Content.Server.GameTicking;
 using Content.Shared.Administration;
 using Content.Shared.Mind;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Ghost
@@ -17,7 +16,7 @@ namespace Content.Server.Ghost
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (player == null)
             {
                 shell.WriteLine("You have no session, you can't ghost.");
index c97e3be9dc4372e1fe5f5f67e6131e2504434154..16d46871fede9a67de088eccbf396d9979c59e7f 100644 (file)
@@ -1,4 +1,4 @@
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 
 namespace Content.Server.Ghost.Roles.Components;
 
index 5a4cc176f2a549f26272ef1f814dad92d1c0f8cf..f372cb4f62a171a12f12dd7b7c32f8449174f846 100644 (file)
@@ -4,7 +4,6 @@ using Content.Server.Ghost.Roles.Components;
 using Content.Server.Ghost.Roles.Events;
 using Content.Server.Ghost.Roles.UI;
 using Content.Server.Mind.Commands;
-using Content.Server.Players;
 using Content.Shared.Administration;
 using Content.Shared.Database;
 using Content.Shared.Follower;
@@ -14,13 +13,14 @@ using Content.Shared.Ghost.Roles;
 using Content.Shared.Mind;
 using Content.Shared.Mind.Components;
 using Content.Shared.Mobs;
+using Content.Shared.Players;
 using Content.Shared.Roles;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
 using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Enums;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Random;
 using Robust.Shared.Utility;
 
@@ -97,7 +97,7 @@ namespace Content.Server.Ghost.Roles
             return unchecked(_nextRoleIdentifier++);
         }
 
-        public void OpenEui(IPlayerSession session)
+        public void OpenEui(ICommonSession session)
         {
             if (session.AttachedEntity is not {Valid: true} attached ||
                 !EntityManager.HasComponent<GhostComponent>(attached))
@@ -111,7 +111,7 @@ namespace Content.Server.Ghost.Roles
             eui.StateDirty();
         }
 
-        public void OpenMakeGhostRoleEui(IPlayerSession session, EntityUid uid)
+        public void OpenMakeGhostRoleEui(ICommonSession session, EntityUid uid)
         {
             if (session.AttachedEntity == null)
                 return;
@@ -420,7 +420,7 @@ namespace Content.Server.Ghost.Roles
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
             if(shell.Player != null)
-                EntitySystem.Get<GhostRoleSystem>().OpenEui((IPlayerSession)shell.Player);
+                EntitySystem.Get<GhostRoleSystem>().OpenEui(shell.Player);
             else
                 shell.WriteLine("You can only open the ghost roles UI on a client.");
         }
index 48002fb823de6cba77cdabadc7f078ad9e1ca20a..0bd159f61afa8a5d486644bab8f0cc945cd1d321 100644 (file)
@@ -6,7 +6,7 @@ using Content.Shared.Database;
 using Content.Shared.Gravity;
 using Content.Shared.Interaction;
 using Robust.Server.GameObjects;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 
 namespace Content.Server.Gravity
 {
@@ -139,7 +139,7 @@ namespace Content.Server.Gravity
                 return;
 
             if (session is { AttachedEntity: { } })
-                _adminLogger.Add(LogType.Action, on ? LogImpact.Medium : LogImpact.High, $"{ToPrettyString(session.AttachedEntity.Value):player} set ${ToPrettyString(uid):target} to {(on ? "on" : "off")}");
+                _adminLogger.Add(LogType.Action, on ? LogImpact.Medium : LogImpact.High, $"{session:player} set ${ToPrettyString(uid):target} to {(on ? "on" : "off")}");
 
             component.SwitchedOn = on;
             UpdatePowerState(component, powerReceiver);
index b5b01ac001de4ebb33fa803f61f35646370c17df..e3e66995373101c8169d2c0888142dcc14380a08 100644 (file)
@@ -18,12 +18,11 @@ using Content.Shared.Pulling.Components;
 using Content.Shared.Stacks;
 using Content.Shared.Storage;
 using Content.Shared.Throwing;
-using Robust.Server.Player;
 using Robust.Shared.Containers;
 using Robust.Shared.GameStates;
 using Robust.Shared.Input.Binding;
 using Robust.Shared.Map;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Utility;
 
 namespace Content.Server.Hands.Systems
@@ -159,9 +158,9 @@ namespace Content.Server.Hands.Systems
         #endregion
 
         #region interactions
-        private bool HandleThrowItem(ICommonSession? session, EntityCoordinates coordinates, EntityUid entity)
+        private bool HandleThrowItem(ICommonSession? playerSession, EntityCoordinates coordinates, EntityUid entity)
         {
-            if (session is not IPlayerSession playerSession)
+            if (playerSession == null)
                 return false;
 
             if (playerSession.AttachedEntity is not {Valid: true} player ||
@@ -220,7 +219,7 @@ namespace Content.Server.Hands.Systems
         // TODO: move to storage or inventory
         private void HandleSmartEquip(ICommonSession? session, string equipmentSlot)
         {
-            if (session is not IPlayerSession playerSession)
+            if (session is not { } playerSession)
                 return;
 
             if (playerSession.AttachedEntity is not {Valid: true} plyEnt || !Exists(plyEnt))
index 7c0bb7383b9c68af7b93f5031cb391c719585e6d..b47fe71714083645a88d22dc75ed6ba0beca6f51 100644 (file)
@@ -3,7 +3,6 @@ using Content.Shared.Administration;
 using Content.Shared.Humanoid;
 using Content.Shared.Verbs;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
 using Robust.Shared.Utility;
 
 namespace Content.Server.Humanoid;
@@ -48,7 +47,7 @@ public sealed partial class HumanoidAppearanceSystem
     private void OnBaseLayersSet(EntityUid uid, HumanoidAppearanceComponent component,
         HumanoidMarkingModifierBaseLayersSetMessage message)
     {
-        if (message.Session is not IPlayerSession player
+        if (message.Session is not { } player
             || !_adminManager.HasAdminFlag(player, AdminFlags.Fun))
         {
             return;
@@ -81,7 +80,7 @@ public sealed partial class HumanoidAppearanceSystem
     private void OnMarkingsSet(EntityUid uid, HumanoidAppearanceComponent component,
         HumanoidMarkingModifierMarkingSetMessage message)
     {
-        if (message.Session is not IPlayerSession player
+        if (message.Session is not { } player
             || !_adminManager.HasAdminFlag(player, AdminFlags.Fun))
         {
             return;
index 810d265314662132d64e171ec97625e2eabe3f64..4302ab6791b1ba8b25ba730e58d409079f0eb665 100644 (file)
@@ -1,7 +1,7 @@
 using Content.Server.UserInterface;
 using Content.Shared.Instruments;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
+using Robust.Shared.Player;
 
 namespace Content.Server.Instruments;
 
@@ -17,7 +17,7 @@ public sealed partial class InstrumentComponent : SharedInstrumentComponent
     [ViewVariables] public uint LastSequencerTick = 0;
 
     // TODO Instruments: Make this ECS
-    public IPlayerSession? InstrumentPlayer =>
+    public ICommonSession? InstrumentPlayer =>
         _entMan.GetComponentOrNull<ActivatableUIComponent>(Owner)?.CurrentSingleUser
         ?? _entMan.GetComponentOrNull<ActorComponent>(Owner)?.PlayerSession;
 }
index ec233821051b8d25dd60976aba8392bfae9f5cfc..6f8369182cbb8491a7044b06f91f49d7d1bcd36d 100644 (file)
@@ -9,12 +9,12 @@ using Content.Shared.Physics;
 using Content.Shared.Popups;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
 using Robust.Shared.Audio.Midi;
 using Robust.Shared.Collections;
 using Robust.Shared.Configuration;
 using Robust.Shared.Console;
 using Robust.Shared.GameStates;
+using Robust.Shared.Player;
 using Robust.Shared.Timing;
 
 namespace Content.Server.Instruments;
@@ -385,7 +385,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
 
                 var nearby = GetBands(entity);
                 _bui.TrySendUiMessage(entity, request.UiKey, new InstrumentBandResponseBuiMessage(nearby),
-                    (IPlayerSession)request.Session);
+                    request.Session);
             }
 
             _bandRequestQueue.Clear();
@@ -447,7 +447,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
         }
     }
 
-    public void ToggleInstrumentUi(EntityUid uid, IPlayerSession session, InstrumentComponent? component = null)
+    public void ToggleInstrumentUi(EntityUid uid, ICommonSession session, InstrumentComponent? component = null)
     {
         if (!Resolve(uid, ref component))
             return;
index a612b738400a20a1fa155b0ef1dc0b81e4f42c0d..9237a1f7dd40e4a7300b64b230971d2936f19eea 100644 (file)
@@ -13,7 +13,6 @@ using Robust.Server.GameObjects;
 using Robust.Shared.Containers;
 using Robust.Shared.Input.Binding;
 using Robust.Shared.Map;
-using Robust.Shared.Players;
 using Robust.Shared.Random;
 
 namespace Content.Server.Interaction
index 4fe3599df97e9ebfcc2d1ab13115deafcfb2fbec..fa75b6d9e4777b4d259d8577eaabd123ae3539be 100644 (file)
@@ -1,10 +1,7 @@
 using System.Numerics;
 using Content.Server.Administration;
-using Content.Server.Tools.Components;
 using Content.Shared.Administration;
 using Content.Shared.Maps;
-using Content.Shared.Tools.Components;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Map;
 
@@ -24,7 +21,7 @@ namespace Content.Server.Interaction
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (player?.AttachedEntity is not {} attached)
             {
                 return;
index 90a0b19b7ddd713216ac2bfc5d7fdb9cb99b3e84..a599a2c868a90eb0180e0248dd750be25af66ca3 100644 (file)
@@ -5,8 +5,7 @@ using Content.Shared.Humanoid;
 using Content.Shared.Humanoid.Markings;
 using Content.Shared.MagicMirror;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 
 namespace Content.Server.MagicMirror;
 
@@ -147,7 +146,7 @@ public sealed class MagicMirrorSystem : EntitySystem
 
     private void UpdateInterface(EntityUid uid, EntityUid playerUid, ICommonSession session, HumanoidAppearanceComponent? humanoid = null)
     {
-        if (!Resolve(playerUid, ref humanoid) || session is not IPlayerSession player)
+        if (!Resolve(playerUid, ref humanoid) || session is not { } player)
         {
             return;
         }
index e4a4cd8942498f7199b627436258450333eddfee..d72a5c4178e61a7a61b6d864dc684425c016ff5b 100644 (file)
@@ -40,7 +40,7 @@ namespace Content.Server.Mapping
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            if (shell.Player is not IPlayerSession player)
+            if (shell.Player is not { } player)
             {
                 shell.WriteError(Loc.GetString("cmd-savemap-server"));
                 return;
index 90770af1ad229b84e8005d2e333f7280ac50507b..7d7b61955b4e4154406c08da1ad7ed936d08316e 100644 (file)
@@ -1,10 +1,9 @@
 using Content.Shared.Maps;
 using Robust.Server.Console;
-using Robust.Server.Player;
-using Robust.Shared.Players;
 using Robust.Shared.Utility;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Systems;
+using Robust.Shared.Player;
 
 namespace Content.Server.Maps;
 
@@ -27,7 +26,7 @@ public sealed class GridDraggingSystem : SharedGridDraggingSystem
 
     public void Toggle(ICommonSession session)
     {
-        if (session is not IPlayerSession pSession)
+        if (session is not { } pSession)
             return;
 
         DebugTools.Assert(_admin.CanCommand(pSession, CommandName));
@@ -52,7 +51,7 @@ public sealed class GridDraggingSystem : SharedGridDraggingSystem
     {
         var grid = GetEntity(ev.Grid);
 
-        if (args.SenderSession is not IPlayerSession playerSession ||
+        if (args.SenderSession is not { } playerSession ||
             !_admin.CanCommand(playerSession, CommandName) ||
             !Exists(grid) ||
             Deleted(grid))
@@ -69,7 +68,7 @@ public sealed class GridDraggingSystem : SharedGridDraggingSystem
     {
         var grid = GetEntity(msg.Grid);
 
-        if (args.SenderSession is not IPlayerSession playerSession ||
+        if (args.SenderSession is not { } playerSession ||
             !_admin.CanCommand(playerSession, CommandName) ||
             !Exists(grid) ||
             Deleted(grid))
index 4ffa9f558da0699ed6820d8f33f05aacbf82d02e..d041f8ee9d7548f5b1339f60a7c0b43b3e85bd71 100644 (file)
@@ -18,7 +18,7 @@ using Content.Shared.Mobs.Components;
 using Content.Shared.Mobs.Systems;
 using Content.Shared.Timing;
 using Content.Shared.Toggleable;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Timing;
 
 namespace Content.Server.Medical;
index d2721db7b627637e180ce60ca3d9c8d1b769c4c3..f23e9b640735dca05e963dcb23ed16be3874e65c 100644 (file)
@@ -11,7 +11,9 @@ using Robust.Server.GameObjects;
 using Robust.Server.GameStates;
 using Robust.Server.Player;
 using Robust.Shared.Map;
+using Robust.Shared.Map.Components;
 using Robust.Shared.Network;
+using Robust.Shared.Player;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
 
@@ -71,51 +73,45 @@ public sealed class MindSystem : SharedMindSystem
         }
 
         TransferTo(mindId, null, createGhost: false, mind: mind);
+        DebugTools.AssertNull(mind.OwnedEntity);
 
-        // Let's not create ghosts if not in the middle of the round.
-        if (_gameTicker.RunLevel == GameRunLevel.PreRoundLobby)
+        if (!component.GhostOnShutdown || mind.Session == null || _gameTicker.RunLevel == GameRunLevel.PreRoundLobby)
             return;
 
-        // I just love convoluted entity shutdown logic that results in more entities being spawned.
-        if (component.GhostOnShutdown && mind.Session != null)
-        {
-            var xform = Transform(uid);
-            var gridId = xform.GridUid;
-            var spawnPosition = Transform(uid).Coordinates;
-
-            // Use a regular timer here because the entity has probably been deleted.
-            Timer.Spawn(0, () =>
-            {
-                // Make extra sure the round didn't end between spawning the timer and it being executed.
-                if (_gameTicker.RunLevel == GameRunLevel.PreRoundLobby)
-                    return;
+        var xform = Transform(uid);
+        var gridId = xform.GridUid;
+        var spawnPosition = Transform(uid).Coordinates;
 
-                // Async this so that we don't throw if the grid we're on is being deleted.
-                if (!_maps.GridExists(gridId))
-                    spawnPosition = _gameTicker.GetObserverSpawnPoint();
+        // Use a regular timer here because the entity has probably been deleted.
+        Timer.Spawn(0, () =>
+        {
+            // Make extra sure the round didn't end between spawning the timer and it being executed.
+            if (_gameTicker.RunLevel == GameRunLevel.PreRoundLobby)
+                return;
 
-                // TODO refactor observer spawning.
-                // please.
-                if (!spawnPosition.IsValid(EntityManager))
-                {
-                    // This should be an error, if it didn't cause tests to start erroring when they delete a player.
-                    Log.Warning($"Entity \"{ToPrettyString(uid)}\" for {mind.CharacterName} was deleted, and no applicable spawn location is available.");
-                    TransferTo(mindId, null, createGhost: false, mind: mind);
-                    return;
-                }
+            // Async this so that we don't throw if the grid we're on is being deleted.
+            if (!HasComp<MapGridComponent>(gridId))
+                spawnPosition = _gameTicker.GetObserverSpawnPoint();
 
-                var ghost = Spawn("MobObserver", spawnPosition);
-                var ghostComponent = Comp<GhostComponent>(ghost);
-                _ghosts.SetCanReturnToBody(ghostComponent, false);
+            // TODO refactor observer spawning.
+            // please.
+            if (!spawnPosition.IsValid(EntityManager))
+            {
+                // This should be an error, if it didn't cause tests to start erroring when they delete a player.
+                Log.Warning($"Entity \"{ToPrettyString(uid)}\" for {mind.CharacterName} was deleted, and no applicable spawn location is available.");
+                TransferTo(mindId, null, createGhost: false, mind: mind);
+                return;
+            }
 
-                // Log these to make sure they're not causing the GameTicker round restart bugs...
-                Log.Debug($"Entity \"{ToPrettyString(uid)}\" for {mind.CharacterName} was deleted, spawned \"{ToPrettyString(ghost)}\".");
+            var ghost = Spawn(GameTicker.ObserverPrototypeName, spawnPosition);
+            var ghostComponent = Comp<GhostComponent>(ghost);
+            _ghosts.SetCanReturnToBody(ghostComponent, false);
 
-                var val = mind.CharacterName ?? string.Empty;
-                _metaData.SetEntityName(ghost, val);
-                TransferTo(mindId, ghost, mind: mind);
-            });
-        }
+            // Log these to make sure they're not causing the GameTicker round restart bugs...
+            Log.Debug($"Entity \"{ToPrettyString(uid)}\" for {mind.CharacterName} was deleted, spawned \"{ToPrettyString(ghost)}\".");
+            _metaData.SetEntityName(ghost, mind.CharacterName ?? string.Empty);
+            TransferTo(mindId, ghost, mind: mind);
+        });
     }
 
     public override bool TryGetMind(NetUserId user, [NotNullWhen(true)] out EntityUid? mindId, [NotNullWhen(true)] out MindComponent? mind)
@@ -130,18 +126,18 @@ public sealed class MindSystem : SharedMindSystem
         return false;
     }
 
-    public bool TryGetSession(EntityUid? mindId, [NotNullWhen(true)] out IPlayerSession? session)
+    public bool TryGetSession(EntityUid? mindId, [NotNullWhen(true)] out ICommonSession? session)
     {
         session = null;
-        return TryComp(mindId, out MindComponent? mind) && (session = (IPlayerSession?) mind.Session) != null;
+        return TryComp(mindId, out MindComponent? mind) && (session = mind.Session) != null;
     }
 
-    public IPlayerSession? GetSession(MindComponent mind)
+    public ICommonSession? GetSession(MindComponent mind)
     {
-        return (IPlayerSession?) mind.Session;
+        return mind.Session;
     }
 
-    public bool TryGetSession(MindComponent mind, [NotNullWhen(true)] out IPlayerSession? session)
+    public bool TryGetSession(MindComponent mind, [NotNullWhen(true)] out ICommonSession? session)
     {
         return (session = GetSession(mind)) != null;
     }
@@ -179,7 +175,9 @@ public sealed class MindSystem : SharedMindSystem
             return;
         }
 
-        GetSession(mind)?.AttachToEntity(entity);
+        if (GetSession(mind) is { } session)
+            _actor.Attach(entity, session);
+
         mind.VisitingEntity = entity;
 
         // EnsureComp instead of AddComp to deal with deferred deletions.
@@ -204,7 +202,8 @@ public sealed class MindSystem : SharedMindSystem
             return;
 
         var owned = mind.OwnedEntity;
-        GetSession(mind)?.AttachToEntity(owned);
+        if (GetSession(mind) is { } session)
+            _actor.Attach(owned, session);
 
         if (owned.HasValue)
         {
@@ -294,6 +293,7 @@ public sealed class MindSystem : SharedMindSystem
         if (session != null && !alreadyAttached && mind.VisitingEntity == null)
         {
             _actor.Attach(entity, session, true);
+            DebugTools.Assert(session.AttachedEntity == entity, $"Failed to attach entity.");
             Log.Info($"Session {session.Name} transferred to entity {entity}.");
         }
 
index b53f9a6a9cd62e3f94b0ba8f80a9fe2e8235d48d..917e6fb7f1ad66207894f9cbc56c4da988635eed 100644 (file)
@@ -1,5 +1,5 @@
 using Content.Shared.Mind;
-using Robust.Server.Player;
+using Robust.Shared.Player;
 using Robust.Shared.Toolshed;
 using Robust.Shared.Toolshed.Errors;
 using Robust.Shared.Toolshed.Syntax;
@@ -15,7 +15,7 @@ public sealed class MindCommand : ToolshedCommand
     private SharedMindSystem? _mind;
 
     [CommandImplementation("get")]
-    public MindComponent? Get([PipedArgument] IPlayerSession session)
+    public MindComponent? Get([PipedArgument] ICommonSession session)
     {
         _mind ??= GetSys<SharedMindSystem>();
         return _mind.TryGetMind(session, out _, out var mind) ? mind : null;
@@ -32,7 +32,7 @@ public sealed class MindCommand : ToolshedCommand
     public EntityUid Control(
             [CommandInvocationContext] IInvocationContext ctx,
             [PipedArgument] EntityUid target,
-            [CommandArgument] ValueRef<IPlayerSession> playerRef)
+            [CommandArgument] ValueRef<ICommonSession> playerRef)
     {
         _mind ??= GetSys<SharedMindSystem>();
 
index a1aa4d2df593a2421466a0edeeda4af8139f3a27..9e59589b95bd0302e5628ec8d7303b1ab19e7484 100644 (file)
@@ -1,6 +1,5 @@
 using Content.Server.Administration.Managers;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Motd;
@@ -14,10 +13,10 @@ internal sealed class MOTDCommand : LocalizedCommands
     [Dependency] private readonly IAdminManager _adminManager = default!;
 
     public override string Command => "motd";
-    
+
     public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        var player = (IPlayerSession?)shell.Player;
+        var player = shell.Player;
         if (args.Length < 1 || (player != null && _adminManager is AdminManager aMan && !aMan.CanCommand(player, "set-motd")))
             shell.ConsoleHost.ExecuteCommand(shell.Player, "get-motd");
         else
@@ -26,7 +25,7 @@ internal sealed class MOTDCommand : LocalizedCommands
 
     public override CompletionResult GetCompletion(IConsoleShell shell, string[] args)
     {
-        var player = (IPlayerSession?)shell.Player;
+        var player = shell.Player;
         if (player != null && _adminManager is AdminManager aMan && !aMan.CanCommand(player, "set-motd"))
             return CompletionResult.Empty;
         if (args.Length == 1)
index e749fe48f308c9e6b5cb53ed9ad7ef1f0cf9c4b0..39d780f108c50fabb0692794d3032ba4209d1a9c 100644 (file)
@@ -2,9 +2,9 @@ using Content.Server.Chat.Managers;
 using Content.Server.GameTicking;
 using Content.Shared.CCVar;
 using Content.Shared.Chat;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Configuration;
+using Robust.Shared.Player;
 
 namespace Content.Server.Motd;
 
@@ -41,7 +41,7 @@ public sealed class MOTDSystem : EntitySystem
     {
         if (string.IsNullOrEmpty(_messageOfTheDay))
             return;
-        
+
         var wrappedMessage = Loc.GetString("motd-wrap-message", ("motd", _messageOfTheDay));
         _chatManager.ChatMessageToAll(ChatChannel.Server, _messageOfTheDay, wrappedMessage, source: EntityUid.Invalid, hideChat: false, recordReplay: true);
     }
@@ -49,11 +49,11 @@ public sealed class MOTDSystem : EntitySystem
     /// <summary>
     /// Sends the Message Of The Day, if any, to a specific player.
     /// </summary>
-    public void TrySendMOTD(IPlayerSession player)
+    public void TrySendMOTD(ICommonSession player)
     {
         if (string.IsNullOrEmpty(_messageOfTheDay))
             return;
-        
+
         var wrappedMessage = Loc.GetString("motd-wrap-message", ("motd", _messageOfTheDay));
         _chatManager.ChatMessageToOne(ChatChannel.Server, _messageOfTheDay, wrappedMessage, source: EntityUid.Invalid, hideChat: false, client: player.ConnectedClient);
     }
@@ -68,10 +68,10 @@ public sealed class MOTDSystem : EntitySystem
     {
         if (string.IsNullOrEmpty(_messageOfTheDay))
             return;
-        
+
         var wrappedMessage = Loc.GetString("motd-wrap-message", ("motd", _messageOfTheDay));
         shell.WriteLine(wrappedMessage);
-        if (shell.Player is IPlayerSession player)
+        if (shell.Player is { } player)
             _chatManager.ChatMessageToOne(ChatChannel.Server, _messageOfTheDay, wrappedMessage, source: EntityUid.Invalid, hideChat: false, client: player.ConnectedClient);
     }
 
@@ -92,7 +92,7 @@ public sealed class MOTDSystem : EntitySystem
     {
         if (val == _messageOfTheDay)
             return;
-        
+
         _messageOfTheDay = val;
         TrySendMOTD();
     }
index f3f52b067029acea56a7ccb02b035d163abba462..9678781c87a5fcde8481ab0449d556c4aec6635d 100644 (file)
@@ -4,7 +4,6 @@ using Content.Shared.Administration;
 using Content.Shared.Database;
 using Content.Shared.CCVar;
 using Content.Server.Chat.Managers;
-using Robust.Server.Player;
 using Robust.Shared.Configuration;
 using Robust.Shared.Console;
 
@@ -21,18 +20,18 @@ public sealed class SetMotdCommand : LocalizedCommands
     [Dependency] private readonly IConfigurationManager _configurationManager = default!;
 
     public override string Command => "set-motd";
-    
+
     public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
         string motd = "";
-        var player = (IPlayerSession?)shell.Player;
+        var player = shell.Player;
         if (args.Length > 0)
         {
             motd = string.Join(" ", args).Trim();
             if (player != null && _chatManager.MessageCharacterLimit(player, motd))
                 return; // check function prints its own error response
         }
-        
+
         _configurationManager.SetCVar(CCVars.MOTD, motd); // A hook in MOTDSystem broadcasts changes to the MOTD to everyone so we don't need to do it here.
         if (string.IsNullOrEmpty(motd))
         {
index 64965c2fee79969a7d6fdea989c531403d067444..0576fe8f2553c8faf9ec2c0514eec673e3a53b3f 100644 (file)
@@ -1,7 +1,7 @@
 using Content.Server.Movement.Components;
 using Robust.Server.Player;
 using Robust.Shared.Map;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Timing;
 
 namespace Content.Server.Movement.Systems;
index 57fe223b66963febc6bbced790d093c668976fe5..7f9e56b8cac29ee2f457abc9068103bdc326467a 100644 (file)
@@ -2,7 +2,6 @@ using Content.Server.Administration;
 using Content.Server.EUI;
 using Content.Server.NPC.UI;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.NPC.Commands;
@@ -15,7 +14,7 @@ public sealed class NPCCommand : IConsoleCommand
     public string Help => $"{Command}";
     public void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        if (shell.Player is not IPlayerSession playerSession)
+        if (shell.Player is not { } playerSession)
         {
             return;
         }
index 2c1dadb12797e913a186086651118590a3ceaf75..a7689fbabed07c36ab57d283005ec79ba011992e 100644 (file)
@@ -4,17 +4,14 @@ using System.Threading;
 using Content.Server.Administration.Managers;
 using Robust.Shared.CPUJob.JobQueues;
 using Robust.Shared.CPUJob.JobQueues.Queues;
-using Content.Server.NPC.Components;
 using Content.Server.NPC.HTN.PrimitiveTasks;
 using Content.Server.NPC.Systems;
 using Content.Shared.Administration;
 using Content.Shared.Mobs;
 using Content.Shared.NPC;
-using Content.Shared.NPC;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Utility;
 
@@ -48,7 +45,7 @@ public sealed class HTNSystem : EntitySystem
 
     private void OnHTNMessage(RequestHTNMessage msg, EntitySessionEventArgs args)
     {
-        if (!_admin.HasAdminFlag((IPlayerSession) args.SenderSession, AdminFlags.Debug))
+        if (!_admin.HasAdminFlag(args.SenderSession, AdminFlags.Debug))
         {
             _subscribers.Remove(args.SenderSession);
             return;
index bb0eff7b39116c52e31dcdb913685187588484e3..1b1f6f54761f4a943f5b45c5099c963c74091adb 100644 (file)
@@ -13,7 +13,7 @@ using Robust.Shared.Enums;
 using Robust.Shared.Map;
 using Robust.Shared.Physics;
 using Robust.Shared.Physics.Systems;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Random;
 using Robust.Shared.Threading;
 using Robust.Shared.Timing;
@@ -528,7 +528,7 @@ namespace Content.Server.NPC.Pathfinding
 
         private void OnBreadcrumbs(RequestPathfindingDebugMessage msg, EntitySessionEventArgs args)
         {
-            var pSession = (IPlayerSession) args.SenderSession;
+            var pSession = args.SenderSession;
 
             if (!_adminManager.HasAdminFlag(pSession, AdminFlags.Debug))
             {
index 61b43df6f0023faf61128a2c680e1c070928fd76..e5b62acfe80cb8c221d2c3b47e2ef173a1cdc0d0 100644 (file)
@@ -17,14 +17,12 @@ using Content.Shared.NPC;
 using Content.Shared.NPC.Events;
 using Content.Shared.Physics;
 using Content.Shared.Weapons.Melee;
-using Robust.Server.Player;
 using Robust.Shared.Configuration;
 using Robust.Shared.Map;
 using Robust.Shared.Physics;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Systems;
 using Robust.Shared.Player;
-using Robust.Shared.Players;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
@@ -147,7 +145,7 @@ public sealed partial class NPCSteeringSystem : SharedNPCSteeringSystem
 
     private void OnDebugRequest(RequestNPCSteeringDebugEvent msg, EntitySessionEventArgs args)
     {
-        if (!_admin.IsAdmin((IPlayerSession)args.SenderSession))
+        if (!_admin.IsAdmin(args.SenderSession))
             return;
 
         if (msg.Enabled)
index e4bd303150b8f44f48e347b07a705fa66c1189f8..9ee9702c5bfc259add24e4de29e7d28698171f83 100644 (file)
@@ -9,6 +9,7 @@ using JetBrains.Annotations;
 using Robust.Server.Player;
 using Robust.Shared.Enums;
 using Robust.Shared.Map;
+using Robust.Shared.Player;
 using Robust.Shared.Utility;
 
 namespace Content.Server.NodeContainer.EntitySystems
@@ -29,7 +30,7 @@ namespace Content.Server.NodeContainer.EntitySystems
         private readonly List<int> _visDeletes = new();
         private readonly List<BaseNodeGroup> _visSends = new();
 
-        private readonly HashSet<IPlayerSession> _visPlayers = new();
+        private readonly HashSet<ICommonSession> _visPlayers = new();
         private readonly HashSet<BaseNodeGroup> _toRemake = new();
         private readonly HashSet<BaseNodeGroup> _nodeGroups = new();
         private readonly HashSet<Node> _toRemove = new();
@@ -74,7 +75,7 @@ namespace Content.Server.NodeContainer.EntitySystems
 
         private void HandleEnableMsg(NodeVis.MsgEnable msg, EntitySessionEventArgs args)
         {
-            var session = (IPlayerSession) args.SenderSession;
+            var session = args.SenderSession;
             if (!_adminManager.HasAdminFlag(session, AdminFlags.Debug))
                 return;
 
@@ -397,7 +398,7 @@ namespace Content.Server.NodeContainer.EntitySystems
             }
         }
 
-        private void VisSendFullStateImmediate(IPlayerSession player)
+        private void VisSendFullStateImmediate(ICommonSession player)
         {
             var msg = new NodeVis.MsgData();
 
index c27f302a8d1f3a1bf1b5c4314385daafac2b3531..ae68dcd2fdadb0ceb4f6bd77eb4de9318682baba 100644 (file)
@@ -1,9 +1,7 @@
 using Content.Server.Administration;
-using Content.Server.Nutrition.Components;
 using Content.Shared.Administration;
 using Content.Shared.Nutrition.Components;
 using Content.Shared.Nutrition.EntitySystems;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Nutrition
@@ -19,7 +17,7 @@ namespace Content.Server.Nutrition
 
         public void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (player == null)
             {
                 shell.WriteLine("You cannot use this command unless you are a player.");
index 93dec3fa44d97b2709ae7a3045c8d99f933b64f9..97fc943269a44933ab90fc1d5c1efda66763f62b 100644 (file)
@@ -18,7 +18,7 @@ namespace Content.Server.Objectives.Commands
 
         public override void Execute(IConsoleShell shell, string argStr, string[] args)
         {
-            var player = shell.Player as IPlayerSession;
+            var player = shell.Player;
             if (player == null || !_players.TryGetSessionByUsername(args[0], out player))
             {
                 shell.WriteError(LocalizationManager.GetString("shell-target-player-does-not-exist"));
index 6c506dc3dd2990f3bc3ce0756d144d3ab943bc33..44e26598412a7e4dab2648759bee77f4b9093f18 100644 (file)
@@ -4,9 +4,6 @@ using Content.Server.DeviceNetwork.Components;
 using Content.Server.Instruments;
 using Content.Server.Light.EntitySystems;
 using Content.Server.Light.Events;
-using Content.Server.MassMedia.Components;
-using Content.Server.MassMedia.Systems;
-using Content.Server.Mind;
 using Content.Server.PDA.Ringer;
 using Content.Server.Station.Systems;
 using Content.Server.Store.Components;
@@ -16,7 +13,6 @@ using Content.Shared.CartridgeLoader;
 using Content.Shared.Light.Components;
 using Content.Shared.PDA;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
 using Robust.Shared.Containers;
 
 namespace Content.Server.PDA
@@ -180,7 +176,7 @@ namespace Content.Server.PDA
                 return;
 
             if (HasComp<RingerComponent>(uid))
-                _ringer.ToggleRingerUI(uid, (IPlayerSession) msg.Session);
+                _ringer.ToggleRingerUI(uid, msg.Session);
         }
 
         private void OnUiMessage(EntityUid uid, PdaComponent pda, PdaShowMusicMessage msg)
@@ -189,7 +185,7 @@ namespace Content.Server.PDA
                 return;
 
             if (TryComp<InstrumentComponent>(uid, out var instrument))
-                _instrument.ToggleInstrumentUi(uid, (IPlayerSession) msg.Session, instrument);
+                _instrument.ToggleInstrumentUi(uid, msg.Session, instrument);
         }
 
         private void OnUiMessage(EntityUid uid, PdaComponent pda, PdaShowUplinkMessage msg)
index a772e76bc45367ae3964df4a42644810d7d0e14b..7494d5e12ceffbf6e3fb4e41fa5076ee347e93eb 100644 (file)
@@ -7,7 +7,6 @@ using Content.Shared.PDA.Ringer;
 using Content.Shared.Popups;
 using Content.Shared.Store;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
 using Robust.Shared.Audio;
 using Robust.Shared.Network;
 using Robust.Shared.Player;
@@ -182,7 +181,7 @@ namespace Content.Server.PDA.Ringer
                 _ui.SetUiState(bui, new RingerUpdateState(isPlaying, ringer.Ringtone));
         }
 
-        public bool ToggleRingerUI(EntityUid uid, IPlayerSession session)
+        public bool ToggleRingerUI(EntityUid uid, ICommonSession session)
         {
             if (_ui.TryGetUi(uid, RingerUiKey.Key, out var bui))
                 _ui.ToggleUi(bui, session);
index f38013e14d11db099de6ff66c41be1a4049f8f68..553bcaa0a217541d430f9c93de291c9171697bc8 100644 (file)
@@ -4,15 +4,11 @@ using Content.Server.Popups;
 using Content.Server.UserInterface;
 using Content.Shared.Database;
 using Content.Shared.Examine;
-using Content.Shared.IdentityManagement;
 using Content.Shared.Interaction;
 using Content.Shared.Paper;
 using Content.Shared.Tag;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
 using Robust.Shared.Player;
-using Robust.Shared.Utility;
-using Robust.Shared.Audio;
 using static Content.Shared.Paper.SharedPaperComponent;
 
 namespace Content.Server.Paper
@@ -207,7 +203,7 @@ namespace Content.Server.Paper
             _appearance.SetData(uid, PaperVisuals.Status, status, appearance);
         }
 
-        public void UpdateUserInterface(EntityUid uid, PaperComponent? paperComp = null, IPlayerSession? session = null)
+        public void UpdateUserInterface(EntityUid uid, PaperComponent? paperComp = null, ICommonSession? session = null)
         {
             if (!Resolve(uid, ref paperComp))
                 return;
index a9d78afa865e20d15d126d701a28af3369973276..c9017ac821e191a29b716cb8556d81b18de57900 100644 (file)
@@ -282,9 +282,8 @@ public sealed partial class BiomeSystem : SharedBiomeSystem
         }
 
         // Get chunks in range
-        foreach (var client in Filter.GetAllPlayers(_playerManager))
+        foreach (var pSession in Filter.GetAllPlayers(_playerManager))
         {
-            var pSession = (IPlayerSession) client;
 
             if (xformQuery.TryGetComponent(pSession.AttachedEntity, out var xform) &&
                 _handledEntities.Add(pSession.AttachedEntity.Value) &&
index 20ed27696706dcb283d9093002454fe7be1715ce..f200c991d7f1323fa475626dc352725e498d4154 100644 (file)
@@ -2,11 +2,10 @@ using Content.Server.ParticleAccelerator.Components;
 using Content.Server.Power.Components;
 using Content.Shared.Database;
 using Content.Shared.Singularity.Components;
-using Robust.Server.Player;
-using Robust.Server.GameObjects;
 using Robust.Shared.Utility;
 using System.Diagnostics;
 using Content.Shared.CCVar;
+using Robust.Shared.Player;
 
 namespace Content.Server.ParticleAccelerator.EntitySystems;
 
@@ -60,7 +59,7 @@ public sealed partial class ParticleAcceleratorSystem
         FireEmitter(comp.StarboardEmitter!.Value, strength);
     }
 
-    public void SwitchOn(EntityUid uid, IPlayerSession? user = null, ParticleAcceleratorControlBoxComponent? comp = null)
+    public void SwitchOn(EntityUid uid, ICommonSession? user = null, ParticleAcceleratorControlBoxComponent? comp = null)
     {
         if (!Resolve(uid, ref comp))
             return;
@@ -83,7 +82,7 @@ public sealed partial class ParticleAcceleratorSystem
         UpdateUI(uid, comp);
     }
 
-    public void SwitchOff(EntityUid uid, IPlayerSession? user = null, ParticleAcceleratorControlBoxComponent? comp = null)
+    public void SwitchOff(EntityUid uid, ICommonSession? user = null, ParticleAcceleratorControlBoxComponent? comp = null)
     {
         if (!Resolve(uid, ref comp))
             return;
@@ -131,7 +130,7 @@ public sealed partial class ParticleAcceleratorSystem
         UpdateUI(uid, comp);
     }
 
-    public void SetStrength(EntityUid uid, ParticleAcceleratorPowerState strength, IPlayerSession? user = null, ParticleAcceleratorControlBoxComponent? comp = null)
+    public void SetStrength(EntityUid uid, ParticleAcceleratorPowerState strength, ICommonSession? user = null, ParticleAcceleratorControlBoxComponent? comp = null)
     {
         if (!Resolve(uid, ref comp))
             return;
@@ -347,10 +346,10 @@ public sealed partial class ParticleAcceleratorSystem
         if (msg.Enabled)
         {
             if (comp.Assembled)
-                SwitchOn(uid, (IPlayerSession?) msg.Session, comp);
+                SwitchOn(uid, msg.Session, comp);
         }
         else
-            SwitchOff(uid, (IPlayerSession?) msg.Session, comp);
+            SwitchOff(uid, msg.Session, comp);
 
         UpdateUI(uid, comp);
     }
@@ -364,7 +363,7 @@ public sealed partial class ParticleAcceleratorSystem
         if (TryComp<ApcPowerReceiverComponent>(uid, out var apcPower) && !apcPower.Powered)
             return;
 
-        SetStrength(uid, msg.State, (IPlayerSession?) msg.Session, comp);
+        SetStrength(uid, msg.State, msg.Session, comp);
 
         UpdateUI(uid, comp);
     }
@@ -378,7 +377,7 @@ public sealed partial class ParticleAcceleratorSystem
         if (TryComp<ApcPowerReceiverComponent>(uid, out var apcPower) && !apcPower.Powered)
             return;
 
-        RescanParts(uid, (IPlayerSession?) msg.Session, comp);
+        RescanParts(uid, msg.Session, comp);
 
         UpdateUI(uid, comp);
     }
index 271d17a0c49beb100f888e035e6fac1c1a6ad2fe..abc68543ff3b8404b121dbd4809a2090ffd33994 100644 (file)
@@ -2,9 +2,9 @@ using System.Diagnostics.CodeAnalysis;
 using System.Numerics;
 using Content.Server.ParticleAccelerator.Components;
 using JetBrains.Annotations;
-using Robust.Server.Player;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Physics.Events;
+using Robust.Shared.Player;
 
 namespace Content.Server.ParticleAccelerator.EntitySystems;
 
@@ -18,7 +18,7 @@ public sealed partial class ParticleAcceleratorSystem
         SubscribeLocalEvent<ParticleAcceleratorPartComponent, PhysicsBodyTypeChangedEvent>(BodyTypeChanged);
     }
 
-    public void RescanParts(EntityUid uid, IPlayerSession? user = null, ParticleAcceleratorControlBoxComponent? controller = null)
+    public void RescanParts(EntityUid uid, ICommonSession? user = null, ParticleAcceleratorControlBoxComponent? controller = null)
     {
         if (!Resolve(uid, ref controller))
             return;
index 50c64e718c3e1e1e8860b78d24ed4879458705ac..bcc6f211ed80a49811b7e15e8eb6e65d8d0d7dec 100644 (file)
@@ -5,18 +5,18 @@ using System.Threading.Tasks;
 using Content.Server.Database;
 using Content.Shared.CCVar;
 using Content.Shared.Players.PlayTimeTracking;
-using Robust.Server.Player;
 using Robust.Shared.Asynchronous;
 using Robust.Shared.Collections;
 using Robust.Shared.Configuration;
 using Robust.Shared.Exceptions;
 using Robust.Shared.Network;
+using Robust.Shared.Player;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
 
 namespace Content.Server.Players.PlayTimeTracking;
 
-public delegate void CalcPlayTimeTrackersCallback(IPlayerSession player, HashSet<string> trackers);
+public delegate void CalcPlayTimeTrackersCallback(ICommonSession player, HashSet<string> trackers);
 
 /// <summary>
 /// Tracks play time for players, across all roles.
@@ -66,7 +66,7 @@ public sealed class PlayTimeTrackingManager
     private ISawmill _sawmill = default!;
 
     // List of players that need some kind of update (refresh timers or resend).
-    private ValueList<IPlayerSession> _playersDirty;
+    private ValueList<ICommonSession> _playersDirty;
 
     // DB auto-saving logic.
     private TimeSpan _saveInterval;
@@ -76,7 +76,7 @@ public sealed class PlayTimeTrackingManager
     // We must block server shutdown on these to avoid losing data.
     private readonly List<Task> _pendingSaveTasks = new();
 
-    private readonly Dictionary<IPlayerSession, PlayTimeData> _playTimeData = new();
+    private readonly Dictionary<ICommonSession, PlayTimeData> _playTimeData = new();
 
     public event CalcPlayTimeTrackersCallback? CalcTrackers;
 
@@ -139,7 +139,7 @@ public sealed class PlayTimeTrackingManager
         _playersDirty.Clear();
     }
 
-    private void RefreshSingleTracker(IPlayerSession dirty, PlayTimeData data, TimeSpan time)
+    private void RefreshSingleTracker(ICommonSession dirty, PlayTimeData data, TimeSpan time)
     {
         DebugTools.Assert(data.Initialized);
 
@@ -181,7 +181,7 @@ public sealed class PlayTimeTrackingManager
     /// so APIs like <see cref="GetPlayTimeForTracker"/> return up-to-date info.
     /// </summary>
     /// <seealso cref="FlushAllTrackers"/>
-    public void FlushTracker(IPlayerSession player)
+    public void FlushTracker(ICommonSession player)
     {
         var time = _timing.RealTime;
         var data = _playTimeData[player];
@@ -201,7 +201,7 @@ public sealed class PlayTimeTrackingManager
         }
     }
 
-    private void SendPlayTimes(IPlayerSession pSession)
+    private void SendPlayTimes(ICommonSession pSession)
     {
         var roles = GetTrackerTimes(pSession);
 
@@ -228,7 +228,7 @@ public sealed class PlayTimeTrackingManager
     /// <summary>
     /// Save all modified time trackers for a player to the database.
     /// </summary>
-    public async void SaveSession(IPlayerSession session)
+    public async void SaveSession(ICommonSession session)
     {
         // This causes all trackers to refresh, ah well.
         FlushAllTrackers();
@@ -278,7 +278,7 @@ public sealed class PlayTimeTrackingManager
         _sawmill.Debug($"Saved {log.Count} trackers");
     }
 
-    private async Task DoSaveSessionAsync(IPlayerSession session)
+    private async Task DoSaveSessionAsync(ICommonSession session)
     {
         var log = new List<PlayTimeUpdate>();
 
@@ -299,7 +299,7 @@ public sealed class PlayTimeTrackingManager
         _sawmill.Debug($"Saved {log.Count} trackers for {session.Name}");
     }
 
-    public async Task LoadData(IPlayerSession session, CancellationToken cancel)
+    public async Task LoadData(ICommonSession session, CancellationToken cancel)
     {
         var data = new PlayTimeData();
         _playTimeData.Add(session, data);
@@ -318,14 +318,14 @@ public sealed class PlayTimeTrackingManager
         QueueSendTimers(session);
     }
 
-    public void ClientDisconnected(IPlayerSession session)
+    public void ClientDisconnected(ICommonSession session)
     {
         SaveSession(session);
 
         _playTimeData.Remove(session);
     }
 
-    public void AddTimeToTracker(IPlayerSession id, string tracker, TimeSpan time)
+    public void AddTimeToTracker(ICommonSession id, string tracker, TimeSpan time)
     {
         if (!_playTimeData.TryGetValue(id, out var data) || !data.Initialized)
             throw new InvalidOperationException("Play time info is not yet loaded for this player!");
@@ -341,17 +341,17 @@ public sealed class PlayTimeTrackingManager
         data.DbTrackersDirty.Add(tracker);
     }
 
-    public void AddTimeToOverallPlaytime(IPlayerSession id, TimeSpan time)
+    public void AddTimeToOverallPlaytime(ICommonSession id, TimeSpan time)
     {
         AddTimeToTracker(id, PlayTimeTrackingShared.TrackerOverall, time);
     }
 
-    public TimeSpan GetOverallPlaytime(IPlayerSession id)
+    public TimeSpan GetOverallPlaytime(ICommonSession id)
     {
         return GetPlayTimeForTracker(id, PlayTimeTrackingShared.TrackerOverall);
     }
 
-    public bool TryGetTrackerTimes(IPlayerSession id, [NotNullWhen(true)] out Dictionary<string, TimeSpan>? time)
+    public bool TryGetTrackerTimes(ICommonSession id, [NotNullWhen(true)] out Dictionary<string, TimeSpan>? time)
     {
         time = null;
 
@@ -364,7 +364,7 @@ public sealed class PlayTimeTrackingManager
         return true;
     }
 
-    public Dictionary<string, TimeSpan> GetTrackerTimes(IPlayerSession id)
+    public Dictionary<string, TimeSpan> GetTrackerTimes(ICommonSession id)
     {
         if (!_playTimeData.TryGetValue(id, out var data) || !data.Initialized)
             throw new InvalidOperationException("Play time info is not yet loaded for this player!");
@@ -372,7 +372,7 @@ public sealed class PlayTimeTrackingManager
         return data.TrackerTimes;
     }
 
-    public TimeSpan GetPlayTimeForTracker(IPlayerSession id, string tracker)
+    public TimeSpan GetPlayTimeForTracker(ICommonSession id, string tracker)
     {
         if (!_playTimeData.TryGetValue(id, out var data) || !data.Initialized)
             throw new InvalidOperationException("Play time info is not yet loaded for this player!");
@@ -383,7 +383,7 @@ public sealed class PlayTimeTrackingManager
     /// <summary>
     /// Queue for play time trackers to be refreshed on a player, in case the set of active trackers may have changed.
     /// </summary>
-    public void QueueRefreshTrackers(IPlayerSession player)
+    public void QueueRefreshTrackers(ICommonSession player)
     {
         if (DirtyPlayer(player) is { } data)
             data.NeedRefreshTackers = true;
@@ -392,13 +392,13 @@ public sealed class PlayTimeTrackingManager
     /// <summary>
     /// Queue for play time information to be sent to a client, for showing in UIs etc.
     /// </summary>
-    public void QueueSendTimers(IPlayerSession player)
+    public void QueueSendTimers(ICommonSession player)
     {
         if (DirtyPlayer(player) is { } data)
             data.NeedSendTimers = true;
     }
 
-    private PlayTimeData? DirtyPlayer(IPlayerSession player)
+    private PlayTimeData? DirtyPlayer(ICommonSession player)
     {
         if (!_playTimeData.TryGetValue(player, out var data) || !data.Initialized)
             return null;
index 13d0794dd5ebd1c121433952b7e2f8bc8501ce64..f865b25bacfef410df8d6ecb90382a330d0af0ba 100644 (file)
@@ -14,6 +14,7 @@ using Robust.Server.GameObjects;
 using Robust.Server.Player;
 using Robust.Shared.Configuration;
 using Robust.Shared.Network;
+using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Utility;
 
@@ -55,7 +56,7 @@ public sealed class PlayTimeTrackingSystem : EntitySystem
         _tracking.CalcTrackers -= CalcTrackers;
     }
 
-    private void CalcTrackers(IPlayerSession player, HashSet<string> trackers)
+    private void CalcTrackers(ICommonSession player, HashSet<string> trackers)
     {
         if (_afk.IsAfk(player))
             return;
@@ -67,7 +68,7 @@ public sealed class PlayTimeTrackingSystem : EntitySystem
         trackers.UnionWith(GetTimedRoles(player));
     }
 
-    private bool IsPlayerAlive(IPlayerSession session)
+    private bool IsPlayerAlive(ICommonSession session)
     {
         var attached = session.AttachedEntity;
         if (attached == null)
@@ -93,7 +94,7 @@ public sealed class PlayTimeTrackingSystem : EntitySystem
         }
     }
 
-    private IEnumerable<string> GetTimedRoles(IPlayerSession session)
+    private IEnumerable<string> GetTimedRoles(ICommonSession session)
     {
         var contentData = _playerManager.GetPlayerData(session.UserId).ContentData();
 
@@ -156,7 +157,7 @@ public sealed class PlayTimeTrackingSystem : EntitySystem
         _tracking.QueueSendTimers(ev.PlayerSession);
     }
 
-    public bool IsAllowed(IPlayerSession player, string role)
+    public bool IsAllowed(ICommonSession player, string role)
     {
         if (!_prototypes.TryIndex<JobPrototype>(role, out var job) ||
             job.Requirements == null ||
@@ -168,7 +169,7 @@ public sealed class PlayTimeTrackingSystem : EntitySystem
         return JobRequirements.TryRequirementsMet(job, playTimes, out _, EntityManager, _prototypes);
     }
 
-    public HashSet<string> GetDisallowedJobs(IPlayerSession player)
+    public HashSet<string> GetDisallowedJobs(ICommonSession player)
     {
         var roles = new HashSet<string>();
         if (!_cfg.GetCVar(CCVars.GameRoleTimers))
@@ -230,7 +231,7 @@ public sealed class PlayTimeTrackingSystem : EntitySystem
         }
     }
 
-    public void PlayerRolesChanged(IPlayerSession player)
+    public void PlayerRolesChanged(ICommonSession player)
     {
         _tracking.QueueRefreshTrackers(player);
     }
diff --git a/Content.Server/Players/PlayerData.cs b/Content.Server/Players/PlayerData.cs
deleted file mode 100644 (file)
index b0ca6f3..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-using Content.Shared.Players;
-using Robust.Server.Player;
-using Robust.Shared.Players;
-
-namespace Content.Server.Players
-{
-    public static class PlayerDataExt
-    {
-        /// <summary>
-        ///     Gets the correctly cast instance of content player data from an engine player data storage.
-        /// </summary>
-        public static PlayerData? ContentData(this IPlayerSession session)
-        {
-            return session.Data.ContentData();
-        }
-
-        public static PlayerData? ContentData(this ICommonSession session)
-        {
-            return ((IPlayerSession) session).ContentData();
-        }
-
-        /// <summary>
-        ///     Gets the mind that is associated with this player.
-        /// </summary>
-        public static EntityUid? GetMind(this IPlayerSession session)
-        {
-            return session.Data.ContentData()?.Mind;
-        }
-    }
-}
index 0c407aa876b0b5fbfc67d2d3df226128dcf25cc7..c79683c338586f082ba32c31c09c1475055b3676 100644 (file)
@@ -1,11 +1,11 @@
 using Content.Shared.Players;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 
 namespace Content.Server.Players;
 
 public sealed class PlayerSystem : SharedPlayerSystem
 {
-    public override PlayerData? ContentData(ICommonSession? session)
+    public override ContentPlayerData? ContentData(ICommonSession? session)
     {
         return session?.ContentData();
     }
index b253e32e3713f29b8becb290497d6dab219f7ceb..6fcdfcf994b2f6949d9d19b96717273efe4d1dc8 100644 (file)
@@ -20,7 +20,6 @@ using Robust.Shared.Enums;
 using Robust.Shared.Input.Binding;
 using Robust.Shared.Map;
 using Robust.Shared.Player;
-using Robust.Shared.Players;
 using Robust.Shared.Replays;
 using Robust.Shared.Timing;
 
@@ -170,7 +169,7 @@ namespace Content.Server.Pointing.EntitySystems
             }
 
             // Get players that are in range and whose visibility layer matches the arrow's.
-            bool ViewerPredicate(IPlayerSession playerSession)
+            bool ViewerPredicate(ICommonSession playerSession)
             {
                 if (!_minds.TryGetMind(playerSession, out _, out var mind) ||
                     mind.CurrentEntity is not { Valid: true } ent ||
@@ -182,7 +181,7 @@ namespace Content.Server.Pointing.EntitySystems
             }
 
             var viewers = Filter.Empty()
-                .AddWhere(session1 => ViewerPredicate((IPlayerSession) session1))
+                .AddWhere(session1 => ViewerPredicate(session1))
                 .Recipients;
 
             string selfMessage;
index 483d4f3d3f7a72ba903720aefad0d43b5fd31078..61ccaf4423afe28029284425e0c593907ea5faba 100644 (file)
@@ -4,7 +4,6 @@ using Robust.Server.Player;
 using Robust.Shared.Configuration;
 using Robust.Shared.Map;
 using Robust.Shared.Player;
-using Robust.Shared.Players;
 
 namespace Content.Server.Popups
 {
index be6ae80bfda85ae735b88e1dd3d11c8e687b2c45..e20291cc0657e9c3be720c90e14ddf279a20ee59 100644 (file)
@@ -5,12 +5,11 @@ using Content.Server.Chat.Managers;
 using Content.Server.Popups;
 using Content.Shared.Database;
 using Content.Shared.Popups;
-using Robust.Server.Player;
-using Robust.Shared.Player;
 using Content.Shared.Chat;
 using Content.Shared.Prayer;
 using Content.Shared.Verbs;
 using Robust.Server.GameObjects;
+using Robust.Shared.Player;
 
 namespace Content.Server.Prayer;
 /// <summary>
@@ -74,7 +73,7 @@ public sealed class PrayerSystem : EntitySystem
     /// <param name="source">The IPlayerSession that sent the message</param>
     /// <param name="messageString">The main message sent to the player via the chatbox</param>
     /// <param name="popupMessage">The popup to notify the player, also prepended to the messageString</param>
-    public void SendSubtleMessage(IPlayerSession target, IPlayerSession source, string messageString, string popupMessage)
+    public void SendSubtleMessage(ICommonSession target, ICommonSession source, string messageString, string popupMessage)
     {
         if (target.AttachedEntity == null)
             return;
@@ -96,7 +95,7 @@ public sealed class PrayerSystem : EntitySystem
     /// You may be wondering, "Why the admin chat, specifically? Nobody even reads it!"
     /// Exactly.
     ///  </remarks>
-    public void Pray(IPlayerSession sender, PrayableComponent comp, string message)
+    public void Pray(ICommonSession sender, PrayableComponent comp, string message)
     {
         if (sender.AttachedEntity == null)
             return;
index 8c06e00ab139c104a0d70440524d4bf6af2a2aa1..a36b053717f7acc13eab989558ff51631554e542 100644 (file)
@@ -2,8 +2,8 @@ using System.Diagnostics.CodeAnalysis;
 using System.Threading;
 using System.Threading.Tasks;
 using Content.Shared.Preferences;
-using Robust.Server.Player;
 using Robust.Shared.Network;
+using Robust.Shared.Player;
 
 namespace Content.Server.Preferences.Managers
 {
@@ -11,12 +11,12 @@ namespace Content.Server.Preferences.Managers
     {
         void Init();
 
-        Task LoadData(IPlayerSession session, CancellationToken cancel);
-        void OnClientDisconnected(IPlayerSession session);
+        Task LoadData(ICommonSession session, CancellationToken cancel);
+        void OnClientDisconnected(ICommonSession session);
 
         bool TryGetCachedPreferences(NetUserId userId, [NotNullWhen(true)] out PlayerPreferences? playerPreferences);
         PlayerPreferences GetPreferences(NetUserId userId);
         IEnumerable<KeyValuePair<NetUserId, ICharacterProfile>> GetSelectedProfilesForPlayers(List<NetUserId> userIds);
-        bool HavePreferencesLoaded(IPlayerSession session);
+        bool HavePreferencesLoaded(ICommonSession session);
     }
 }
index ea04d00e828f427a7b93d7c9d9c3835d47f24273..a0b5e8ce652e76265fb8e08218f44f3c4dc46bf3 100644 (file)
@@ -8,9 +8,9 @@ using Content.Shared.CCVar;
 using Content.Shared.Humanoid.Prototypes;
 using Content.Shared.Preferences;
 using Content.Shared.Roles;
-using Robust.Server.Player;
 using Robust.Shared.Configuration;
 using Robust.Shared.Network;
+using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 
 
@@ -167,7 +167,7 @@ namespace Content.Server.Preferences.Managers
         }
 
         // Should only be called via UserDbDataManager.
-        public async Task LoadData(IPlayerSession session, CancellationToken cancel)
+        public async Task LoadData(ICommonSession session, CancellationToken cancel)
         {
             if (!ShouldStorePrefs(session.ConnectedClient.AuthType))
             {
@@ -207,12 +207,12 @@ namespace Content.Server.Preferences.Managers
             }
         }
 
-        public void OnClientDisconnected(IPlayerSession session)
+        public void OnClientDisconnected(ICommonSession session)
         {
             _cachedPlayerPrefs.Remove(session.UserId);
         }
 
-        public bool HavePreferencesLoaded(IPlayerSession session)
+        public bool HavePreferencesLoaded(ICommonSession session)
         {
             return _cachedPlayerPrefs.ContainsKey(session.UserId);
         }
index f7ea0aae57f7d13714d4e34def534f13e76c07f1..69bb7c93704ede878c445bd6679b3ef1454779d7 100644 (file)
@@ -4,7 +4,7 @@ using Content.Shared.Pulling.Components;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
 using Robust.Shared.Input.Binding;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 
 namespace Content.Server.Pulling
 {
index 97f2e485ca3cfbb3e7da6c29a99dc4a0e9c606af..56806d8c9c1bb89185bfc7bd50ea28e6624fb649 100644 (file)
@@ -7,7 +7,7 @@ using Content.Shared.Radiation.Systems;
 using Robust.Shared.Console;
 using Robust.Shared.Enums;
 using Robust.Shared.Map.Components;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 
 namespace Content.Server.Radiation.Systems;
 
index e813f09ff9f060a5ef5522468f5849fedec3f922..135ef8fe8892e0c507b29e127dbc466faf96b4a2 100644 (file)
@@ -1,7 +1,6 @@
 using System.Diagnostics.CodeAnalysis;
 using Content.Server.Power.EntitySystems;
 using Content.Shared.Research.Components;
-using Robust.Server.Player;
 
 namespace Content.Server.Research.Systems;
 
@@ -46,7 +45,7 @@ public sealed partial class ResearchSystem
         if (!this.IsPowered(uid, EntityManager))
             return;
 
-        _uiSystem.TryToggleUi(uid, ResearchClientUiKey.Key, (IPlayerSession) args.Session);
+        _uiSystem.TryToggleUi(uid, ResearchClientUiKey.Key, args.Session);
     }
     #endregion
 
index b0a64508c563cf380992cd6f3601caa8cb1d5bd9..a1fd60974116e393d40db21b85ccea64dcbe7dcd 100644 (file)
@@ -1,6 +1,5 @@
 using Content.Server.Administration;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Map;
 
@@ -26,7 +25,7 @@ sealed class SalvageRulerCommand : IConsoleCommand
             return;
         }
 
-        if (shell.Player is not IPlayerSession player)
+        if (shell.Player is not { } player)
         {
             shell.WriteError(Loc.GetString("shell-only-players-can-run-this-command"));
             return;
index 0b9148f0fbbc87c23c682d0fe195e689dd4107e5..cc20b7194691ca24cb5632bf1ab41ef6c3793f60 100644 (file)
@@ -4,7 +4,6 @@ using Content.Server.Atmos.Piping.EntitySystems;
 using Content.Server.NodeContainer;
 using Content.Server.NodeContainer.NodeGroups;
 using Content.Shared.Administration;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Sandbox.Commands
@@ -20,7 +19,7 @@ namespace Content.Server.Sandbox.Commands
         {
             var sandboxManager = EntitySystem.Get<SandboxSystem>();
             var adminManager = IoCManager.Resolve<IAdminManager>();
-            if (shell.IsClient && (!sandboxManager.IsSandboxEnabled && !adminManager.HasAdminFlag((IPlayerSession)shell.Player!, AdminFlags.Mapping)))
+            if (shell.IsClient && (!sandboxManager.IsSandboxEnabled && !adminManager.HasAdminFlag(shell.Player!, AdminFlags.Mapping)))
             {
                 shell.WriteError("You are not currently able to use mapping commands.");
             }
index ec9b1a0c3c9548c7065d16e988a5dae82ccb7e37..194cf5984386f2cba82e887bc5803722af8f53d8 100644 (file)
@@ -13,6 +13,7 @@ using Robust.Server.Console;
 using Robust.Server.Placement;
 using Robust.Server.Player;
 using Robust.Shared.Enums;
+using Robust.Shared.Player;
 
 namespace Content.Server.Sandbox
 {
index cd4f2ea23b9dbfd07e368c49ba33cc3197857acc..63b4d9daef91b443020e32cb95ebadfa201065cd 100644 (file)
@@ -1,7 +1,7 @@
 using Content.Shared.SensorMonitoring;
 using Robust.Server.Player;
 using Robust.Shared.Collections;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 
 namespace Content.Server.SensorMonitoring;
 
index a09badcd59599f4c13d20c6e92c7d32a21cb419e..6c0dddeb266958bd1e29a11d5a6866f2a4183db5 100644 (file)
@@ -1,7 +1,5 @@
 using Content.Server.DeviceNetwork.Components;
 using Content.Shared.SensorMonitoring;
-using Robust.Server.GameObjects;
-using Robust.Server.Player;
 using Robust.Shared.Collections;
 using ConsoleUIState = Content.Shared.SensorMonitoring.SensorMonitoringConsoleBoundInterfaceState;
 using IncrementalUIState = Content.Shared.SensorMonitoring.SensorMonitoringIncrementalUpdate;
@@ -130,7 +128,7 @@ public sealed partial class SensorMonitoringConsoleSystem
         if (!args.UiKey.Equals(SensorMonitoringConsoleUiKey.Key))
             return;
 
-        if (args.Session is not IPlayerSession player)
+        if (args.Session is not { } player)
             return;
 
         component.InitialUIStateSent.Remove(player);
index 769c5d58d7e90cb8044611ee666c1bced36ba978..f4e54984e9be0c9014892226eba15d4f534ba561 100644 (file)
@@ -6,6 +6,7 @@ using Robust.Server.Player;
 using Robust.Server.ServerStatus;
 using Robust.Shared.Configuration;
 using Robust.Shared.Enums;
+using Robust.Shared.Player;
 using Robust.Shared.Timing;
 
 namespace Content.Server.ServerUpdates;
index 1a1debc9e3bd3c914ffe134c07bd9ef7ddf459f0..3ef3d97a21aa6e350b43c8399936add84b1459cf 100644 (file)
@@ -20,7 +20,6 @@ using Content.Shared.Tag;
 using Content.Shared.Tiles;
 using Robust.Server.GameObjects;
 using Robust.Server.Maps;
-using Robust.Server.Player;
 using Robust.Shared.Configuration;
 using Robust.Shared.Map;
 using Robust.Shared.Map.Components;
@@ -140,7 +139,7 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
     /// </summary>
     private void OnShuttleRequestPosition(EmergencyShuttleRequestPositionMessage msg, EntitySessionEventArgs args)
     {
-        if (!_admin.IsAdmin((IPlayerSession) args.SenderSession))
+        if (!_admin.IsAdmin(args.SenderSession))
             return;
 
         var player = args.SenderSession.AttachedEntity;
index 31d826087d55242adb32eece5ad25b818a1c0a67..c0804202669144bdfe3ae096f10e1ed2207bb16a 100644 (file)
@@ -229,7 +229,7 @@ public sealed partial class BorgSystem
         if (!TryComp<HandsComponent>(chassis, out var hands))
             return;
 
-        if (LifeStage(uid) >= EntityLifeStage.Terminating)
+        if (TerminatingOrDeleted(uid))
         {
             foreach (var (hand, item) in component.ProvidedItems)
             {
index 611dfa6ea2a40b10d4614a4cf6cdef700ca4cc77..883cb3b3d84a87caf576cca802a9a700b556855d 100644 (file)
@@ -21,7 +21,7 @@ using Content.Shared.Throwing;
 using Content.Shared.Wires;
 using Robust.Server.GameObjects;
 using Robust.Shared.Containers;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Random;
 
 namespace Content.Server.Silicons.Borgs;
index 45c944884e715db32da388978ae0996c0b286fbe..b1ab1ac020b8bd062706708f8d3ecacc4feaa9f8 100644 (file)
@@ -18,7 +18,6 @@ using Content.Shared.Silicons.Laws.Components;
 using Content.Shared.Stunnable;
 using Content.Shared.Wires;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Toolshed;
 
@@ -96,7 +95,7 @@ public sealed class SiliconLawSystem : SharedSiliconLawSystem
         HashSet<string>? radioChannels = intrinsicRadio?.Channels;
 
         var state = new SiliconLawBuiState(GetLaws(uid).Laws, radioChannels);
-        _userInterface.TrySetUiState(args.Entity, SiliconLawsUiKey.Key, state, (IPlayerSession) args.Session);
+        _userInterface.TrySetUiState(args.Entity, SiliconLawsUiKey.Key, state, args.Session);
     }
 
     private void OnPlayerSpawnComplete(EntityUid uid, SiliconLawBoundComponent component, PlayerSpawnCompleteEvent args)
index 2709bc2072b1ffbcc8464697340d6dabf6162fd7..eeaace03b2cb5c53252a9bd3623179752c0de20b 100644 (file)
@@ -41,7 +41,7 @@ public sealed partial class StationJobsSystem : EntitySystem
         if (_availableJobsDirty)
         {
             _cachedAvailableJobs = GenerateJobsAvailableEvent();
-            RaiseNetworkEvent(_cachedAvailableJobs, Filter.Empty().AddPlayers(_playerManager.ServerSessions));
+            RaiseNetworkEvent(_cachedAvailableJobs, Filter.Empty().AddPlayers(_playerManager.Sessions));
             _availableJobsDirty = false;
         }
     }
index 3430449957e0040cd72d151fbad7bdd84dd33364..8b4ae1c76f9f4fd42b8570ebfa467179da72f92a 100644 (file)
@@ -9,7 +9,6 @@ using Content.Shared.Storage.EntitySystems;
 using Content.Shared.Timing;
 using Content.Shared.Verbs;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
 using Robust.Shared.Map;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
@@ -135,7 +134,7 @@ public sealed partial class StorageSystem : SharedStorageSystem
     ///     If the user has nested-UIs open (e.g., PDA UI open when pda is in a backpack), close them.
     /// </summary>
     /// <param name="session"></param>
-    public void CloseNestedInterfaces(EntityUid uid, IPlayerSession session, StorageComponent? storageComp = null)
+    public void CloseNestedInterfaces(EntityUid uid, ICommonSession session, StorageComponent? storageComp = null)
     {
         if (!Resolve(uid, ref storageComp))
             return;
index d94b4fd6575581f0e0ba2b6e682f6a7c230a971f..5e7c6ac02e610caf9f4fed1ecaf0fdcd489b0572 100644 (file)
@@ -1,6 +1,6 @@
 using System.Numerics;
-using Robust.Server.Player;
 using Robust.Shared.Map;
+using Robust.Shared.Player;
 
 namespace Content.Server.Tabletop
 {
@@ -17,7 +17,7 @@ namespace Content.Server.Tabletop
         /// <summary>
         ///     The set of players currently playing this tabletop game.
         /// </summary>
-        public readonly Dictionary<IPlayerSession, TabletopSessionPlayerData> Players = new();
+        public readonly Dictionary<ICommonSession, TabletopSessionPlayerData> Players = new();
 
         /// <summary>
         ///     All entities bound to this session. If you create an entity for this session, you have to add it here.
index e9dea0c66a21f9886469cd002f4806f4acb9de5a..8f1bc7005dc032455f08b8e6c371821401472a94 100644 (file)
@@ -1,7 +1,7 @@
 using System.Numerics;
 using Content.Server.Tabletop.Components;
 using Content.Shared.Tabletop.Events;
-using Robust.Server.Player;
+using Robust.Shared.Player;
 using Robust.Shared.Utility;
 
 namespace Content.Server.Tabletop
@@ -66,7 +66,7 @@ namespace Content.Server.Tabletop
         /// </summary>
         /// <param name="player">The player session in question.</param>
         /// <param name="uid">The UID of the tabletop game entity.</param>
-        public void OpenSessionFor(IPlayerSession player, EntityUid uid)
+        public void OpenSessionFor(ICommonSession player, EntityUid uid)
         {
             if (!EntityManager.TryGetComponent(uid, out TabletopGameComponent? tabletop) || player.AttachedEntity is not {Valid: true} attachedEntity)
                 return;
@@ -98,7 +98,7 @@ namespace Content.Server.Tabletop
         /// <param name="player">The player in question.</param>
         /// <param name="uid">The UID of the tabletop game entity.</param>
         /// <param name="removeGamerComponent">Whether to remove the <see cref="TabletopGamerComponent"/> from the player's attached entity.</param>
-        public void CloseSessionFor(IPlayerSession player, EntityUid uid, bool removeGamerComponent = true)
+        public void CloseSessionFor(ICommonSession player, EntityUid uid, bool removeGamerComponent = true)
         {
             if (!EntityManager.TryGetComponent(uid, out TabletopGameComponent? tabletop) || tabletop.Session is not { } session)
                 return;
@@ -129,7 +129,7 @@ namespace Content.Server.Tabletop
         /// <param name="player">The player in question.</param>
         /// <param name="offset">An offset from the tabletop position for the camera. Zero by default.</param>
         /// <returns>The UID of the camera entity.</returns>
-        private EntityUid CreateCamera(TabletopGameComponent tabletop, IPlayerSession player, Vector2 offset = default)
+        private EntityUid CreateCamera(TabletopGameComponent tabletop, ICommonSession player, Vector2 offset = default)
         {
             DebugTools.AssertNotNull(tabletop.Session);
 
index 2e271080d07f5c21569263cc86c19f50a75eb5d4..b81331d62ee2c56132053f7cb49d4f47119e1fc7 100644 (file)
@@ -9,7 +9,6 @@ using Content.Shared.Tabletop.Events;
 using Content.Shared.Verbs;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
 using Robust.Shared.Enums;
 using Robust.Shared.Map;
 using Robust.Shared.Utility;
@@ -42,7 +41,7 @@ namespace Content.Server.Tabletop
 
         private void OnTabletopRequestTakeOut(TabletopRequestTakeOut msg, EntitySessionEventArgs args)
         {
-            if (args.SenderSession is not IPlayerSession playerSession)
+            if (args.SenderSession is not { } playerSession)
                 return;
 
             var table = GetEntity(msg.TableUid);
@@ -105,7 +104,7 @@ namespace Content.Server.Tabletop
 
         protected override void OnTabletopMove(TabletopMoveEvent msg, EntitySessionEventArgs args)
         {
-            if (args.SenderSession is not IPlayerSession playerSession)
+            if (args.SenderSession is not { } playerSession)
                 return;
 
             if (!TryComp(GetEntity(msg.TableUid), out TabletopGameComponent? tabletop) || tabletop.Session is not { } session)
@@ -155,7 +154,7 @@ namespace Content.Server.Tabletop
 
         private void OnStopPlaying(TabletopStopPlayingEvent msg, EntitySessionEventArgs args)
         {
-            CloseSessionFor((IPlayerSession)args.SenderSession, GetEntity(msg.TableUid));
+            CloseSessionFor(args.SenderSession, GetEntity(msg.TableUid));
         }
 
         private void OnPlayerDetached(EntityUid uid, TabletopGamerComponent component, PlayerDetachedEvent args)
index d2b3cc261cd53caed4c0f72a89547d12eb956f22..f113e496555cfb37c45a81829c99a0c22c8fc005 100644 (file)
@@ -1,7 +1,7 @@
 using Content.Server.Administration;
 using Content.Server.Administration.Managers;
 using Content.Shared.Administration;
-using Robust.Server.Player;
+using Robust.Shared.Player;
 using Robust.Shared.Toolshed;
 using Robust.Shared.Toolshed.Syntax;
 
@@ -25,7 +25,7 @@ public sealed class ACmdCommand : ToolshedCommand
     public bool CanInvoke(
         [CommandInvocationContext] IInvocationContext ctx,
         [PipedArgument] CommandSpec command,
-        [CommandArgument] ValueRef<IPlayerSession> player
+        [CommandArgument] ValueRef<ICommonSession> player
         )
     {
         // Deliberately discard the error.
index 4ef08a91bf015d122090b43ae2b8ce764660c0c4..2225bfaf4474787159ea44912efe7214fa618dcd 100644 (file)
@@ -4,7 +4,6 @@ using Content.Server.EUI;
 using Content.Shared.Administration;
 using Content.Shared.Bql;
 using Content.Shared.Eui;
-using Robust.Server.Player;
 using Robust.Shared.Toolshed;
 using Robust.Shared.Toolshed.Errors;
 
@@ -30,7 +29,7 @@ public sealed class VisualizeCommand : ToolshedCommand
         var ui = new ToolshedVisualizeEui(
             input.Select(e => (EntName(e), EntityManager.GetNetEntity(e))).ToArray()
         );
-        _euiManager.OpenEui(ui, (IPlayerSession) ctx.Session);
+        _euiManager.OpenEui(ui, ctx.Session);
         _euiManager.QueueStateUpdate(ui);
     }
 }
index 1feab11b99ad141ae1aa7b01e5cec638a5f1b255..fd656a9f7174173d1878fde789d37d2f2cc47cc8 100644 (file)
@@ -5,6 +5,7 @@ using Content.Shared.FixedPoint;
 using Robust.Server.Player;
 using Robust.Shared.Configuration;
 using Robust.Shared.Console;
+using Robust.Shared.Player;
 
 namespace Content.Server.Traitor.Uplink.Commands
 {
@@ -36,7 +37,7 @@ namespace Content.Server.Traitor.Uplink.Commands
                 return;
             }
 
-            IPlayerSession? session;
+            ICommonSession? session;
             if (args.Length > 0)
             {
                 // Get player entity
@@ -48,7 +49,7 @@ namespace Content.Server.Traitor.Uplink.Commands
             }
             else
             {
-                session = (IPlayerSession?) shell.Player;
+                session = shell.Player;
             }
 
             if (session?.AttachedEntity is not { } user)
index bb020608e2042e1d0531aaebd34fd25ef08e13fa..34f9c0f3970c42dc159820e1a411510881d94dc7 100644 (file)
@@ -1,4 +1,4 @@
-using Robust.Server.Player;
+using Robust.Shared.Player;
 using Robust.Shared.Reflection;
 using Robust.Shared.Serialization;
 
@@ -65,7 +65,7 @@ namespace Content.Server.UserInterface
         ///     NOTE: DO NOT DIRECTLY SET, USE ActivatableUISystem.SetCurrentSingleUser
         /// </summary>
         [ViewVariables]
-        public IPlayerSession? CurrentSingleUser;
+        public ICommonSession? CurrentSingleUser;
 
         void ISerializationHooks.AfterDeserialization()
         {
index 59086415b46ca6221ce972808a7cb084541c650d..adeeed7c19d3933913939b55b7c4121380d11f54 100644 (file)
@@ -8,7 +8,7 @@ using Content.Shared.Interaction.Events;
 using Content.Shared.UserInterface;
 using Content.Shared.Verbs;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
+using Robust.Shared.Player;
 
 namespace Content.Server.UserInterface;
 
@@ -173,7 +173,7 @@ public sealed partial class ActivatableUISystem : EntitySystem
         return true;
     }
 
-    public void SetCurrentSingleUser(EntityUid uid, IPlayerSession? v, ActivatableUIComponent? aui = null)
+    public void SetCurrentSingleUser(EntityUid uid, ICommonSession? v, ActivatableUIComponent? aui = null)
     {
         if (!Resolve(uid, ref aui))
             return;
@@ -231,9 +231,9 @@ public sealed class UserOpenActivatableUIAttemptEvent : CancellableEntityEventAr
 public sealed class AfterActivatableUIOpenEvent : EntityEventArgs
 {
     public EntityUid User { get; }
-    public readonly IPlayerSession Session;
+    public readonly ICommonSession Session;
 
-    public AfterActivatableUIOpenEvent(EntityUid who, IPlayerSession session)
+    public AfterActivatableUIOpenEvent(EntityUid who, ICommonSession session)
     {
         User = who;
         Session = session;
index b13b596323136504e878041420fc77b9fdf5719a..fe2ee380feaebf95ab4d0f9ae00b5dd48ef241bf 100644 (file)
@@ -8,7 +8,6 @@ using Content.Shared.Materials;
 using Content.Shared.Research.Prototypes;
 using Content.Shared.UserInterface;
 using Content.Shared.Weapons.Melee;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Prototypes;
 
@@ -27,7 +26,7 @@ public sealed class StatValuesCommand : IConsoleCommand
     public string Help => $"{Command} <cargosell / lathesell / melee>";
     public void Execute(IConsoleShell shell, string argStr, string[] args)
     {
-        if (shell.Player is not IPlayerSession pSession)
+        if (shell.Player is not { } pSession)
         {
             shell.WriteError(Loc.GetString("stat-values-server"));
             return;
index 6d12b08e8651478365dbf8fbbeed38385c8f8112..e304c6b4af07393fbc5ab6069504a9647ce8378f 100644 (file)
@@ -6,7 +6,6 @@ using Content.Shared.Administration.Logs;
 using Content.Shared.Database;
 using Content.Shared.Hands.Components;
 using Content.Shared.Verbs;
-using Robust.Server.Player;
 
 namespace Content.Server.Verbs
 {
@@ -25,7 +24,7 @@ namespace Content.Server.Verbs
 
         private void HandleVerbRequest(RequestServerVerbsEvent args, EntitySessionEventArgs eventArgs)
         {
-            var player = (IPlayerSession) eventArgs.SenderSession;
+            var player = eventArgs.SenderSession;
 
             if (!EntityManager.EntityExists(GetEntity(args.EntityUid)))
             {
@@ -43,7 +42,7 @@ namespace Content.Server.Verbs
             // this, and some verbs (e.g. view variables) won't even care about whether an entity is accessible through
             // the entity menu or not.
 
-            var force = args.AdminRequest && eventArgs.SenderSession is IPlayerSession playerSession &&
+            var force = args.AdminRequest && eventArgs.SenderSession is { } playerSession &&
                         _adminMgr.HasAdminFlag(playerSession, AdminFlags.Admin);
 
             List<Type> verbTypes = new();
index 13f64e6ef8addd0f9adb52d23de1cf3b110fc79c..869f2017d70304bc22eedef51ae23e7bf74eef24 100644 (file)
@@ -1,5 +1,5 @@
 using Content.Server.Voting.Managers;
-using Robust.Server.Player;
+using Robust.Shared.Player;
 
 namespace Content.Server.Voting
 {
@@ -75,7 +75,7 @@ namespace Content.Server.Voting
         /// <exception cref="ArgumentOutOfRangeException">
         /// <paramref name="optionId"/> is not a valid option ID.
         /// </exception>
-        void CastVote(IPlayerSession session, int? optionId);
+        void CastVote(ICommonSession session, int? optionId);
 
         /// <summary>
         /// Cancel this vote.
index 6a92e70fff7096869def5570b2a7af1f5a7189e4..d95fac9ae9212093490e392c20400e1f3506dd4c 100644 (file)
@@ -1,6 +1,6 @@
 using System.Diagnostics.CodeAnalysis;
 using Content.Shared.Voting;
-using Robust.Server.Player;
+using Robust.Shared.Player;
 
 namespace Content.Server.Voting.Managers
 {
@@ -41,7 +41,7 @@ namespace Content.Server.Voting.Managers
         /// True if <paramref name="initiator"/> can start votes right now,
         /// and if provided if they can start votes of type <paramref name="voteType"/>.
         /// </returns>
-        bool CanCallVote(IPlayerSession initiator, StandardVoteType? voteType = null);
+        bool CanCallVote(ICommonSession initiator, StandardVoteType? voteType = null);
 
         /// <summary>
         /// Initiate a standard vote such as restart round, that can be initiated by players.
@@ -51,7 +51,7 @@ namespace Content.Server.Voting.Managers
         /// If null it is assumed to be an automatic vote by the server.
         /// </param>
         /// <param name="voteType">The type of standard vote to make.</param>
-        void CreateStandardVote(IPlayerSession? initiator, StandardVoteType voteType);
+        void CreateStandardVote(ICommonSession? initiator, StandardVoteType voteType);
 
         /// <summary>
         /// Create a non-standard vote with special parameters.
index 55e88e2a8c77d7fc453ce6b3bdd0d97a37ef276c..e1bffa769da5f61e2b5b75fd9934cd220f492a73 100644 (file)
@@ -6,8 +6,8 @@ using Content.Server.RoundEnd;
 using Content.Shared.CCVar;
 using Content.Shared.Database;
 using Content.Shared.Voting;
-using Robust.Server.Player;
 using Robust.Shared.Configuration;
+using Robust.Shared.Player;
 using Robust.Shared.Random;
 
 namespace Content.Server.Voting.Managers
@@ -21,7 +21,7 @@ namespace Content.Server.Voting.Managers
             {StandardVoteType.Map, CCVars.VoteMapEnabled},
         };
 
-        public void CreateStandardVote(IPlayerSession? initiator, StandardVoteType voteType)
+        public void CreateStandardVote(ICommonSession? initiator, StandardVoteType voteType)
         {
             if (initiator != null)
                 _adminLogger.Add(LogType.Vote, LogImpact.Medium, $"{initiator} initiated a {voteType.ToString()} vote");
@@ -47,7 +47,7 @@ namespace Content.Server.Voting.Managers
             TimeoutStandardVote(voteType);
         }
 
-        private void CreateRestartVote(IPlayerSession? initiator)
+        private void CreateRestartVote(ICommonSession? initiator)
         {
             var alone = _playerManager.PlayerCount == 1 && initiator != null;
             var options = new VoteOptions
@@ -100,7 +100,7 @@ namespace Content.Server.Voting.Managers
                 vote.CastVote(initiator, 0);
             }
 
-            foreach (var player in _playerManager.ServerSessions)
+            foreach (var player in _playerManager.Sessions)
             {
                 if (player != initiator)
                 {
@@ -110,7 +110,7 @@ namespace Content.Server.Voting.Managers
             }
         }
 
-        private void CreatePresetVote(IPlayerSession? initiator)
+        private void CreatePresetVote(ICommonSession? initiator)
         {
             var presets = GetGamePresets();
 
@@ -156,7 +156,7 @@ namespace Content.Server.Voting.Managers
             };
         }
 
-        private void CreateMapVote(IPlayerSession? initiator)
+        private void CreateMapVote(ICommonSession? initiator)
         {
             var maps = _gameMapManager.CurrentlyEligibleMaps().ToDictionary(map => map, map => map.MapName);
 
index 98ad8d8341f45281eba412d1b2fadd7410f87871..90089afb544d4edbd724d068c07372b0b7e836ae 100644 (file)
@@ -16,6 +16,7 @@ using Robust.Server.Player;
 using Robust.Shared.Configuration;
 using Robust.Shared.Enums;
 using Robust.Shared.Network;
+using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
@@ -45,7 +46,7 @@ namespace Content.Server.Voting.Managers
 
         private readonly Dictionary<StandardVoteType, TimeSpan> _standardVoteTimeout = new();
         private readonly Dictionary<NetUserId, TimeSpan> _voteTimeout = new();
-        private readonly HashSet<IPlayerSession> _playerCanCallVoteDirty = new();
+        private readonly HashSet<ICommonSession> _playerCanCallVoteDirty = new();
         private readonly StandardVoteType[] _standardVoteTypeValues = Enum.GetValues<StandardVoteType>();
 
         public void Initialize()
@@ -106,7 +107,7 @@ namespace Content.Server.Voting.Managers
             }
         }
 
-        private void CastVote(VoteReg v, IPlayerSession player, int? option)
+        private void CastVote(VoteReg v, ICommonSession player, int? option)
         {
             if (!IsValidOption(v, option))
                 throw new ArgumentOutOfRangeException(nameof(option), "Invalid vote option ID");
@@ -228,7 +229,7 @@ namespace Content.Server.Voting.Managers
 
         private void SendUpdates(VoteReg v)
         {
-            foreach (var player in _playerManager.ServerSessions)
+            foreach (var player in _playerManager.Sessions)
             {
                 SendSingleUpdate(v, player);
             }
@@ -237,7 +238,7 @@ namespace Content.Server.Voting.Managers
             v.Dirty = false;
         }
 
-        private void SendSingleUpdate(VoteReg v, IPlayerSession player)
+        private void SendSingleUpdate(VoteReg v, ICommonSession player)
         {
             var msg = new MsgVoteData();
 
@@ -277,10 +278,10 @@ namespace Content.Server.Voting.Managers
 
         private void DirtyCanCallVoteAll()
         {
-            _playerCanCallVoteDirty.UnionWith(_playerManager.ServerSessions);
+            _playerCanCallVoteDirty.UnionWith(_playerManager.Sessions);
         }
 
-        private void SendUpdateCanCallVote(IPlayerSession player)
+        private void SendUpdateCanCallVote(ICommonSession player)
         {
             var msg = new MsgVoteCanCall();
             msg.CanCall = CanCallVote(player, null, out var isAdmin, out var timeSpan);
@@ -306,7 +307,7 @@ namespace Content.Server.Voting.Managers
         }
 
         private bool CanCallVote(
-            IPlayerSession initiator,
+            ICommonSession initiator,
             StandardVoteType? voteType,
             out bool isAdmin,
             out TimeSpan timeSpan)
@@ -353,7 +354,7 @@ namespace Content.Server.Voting.Managers
             return !_voteTimeout.TryGetValue(initiator.UserId, out timeSpan);
         }
 
-        public bool CanCallVote(IPlayerSession initiator, StandardVoteType? voteType = null)
+        public bool CanCallVote(ICommonSession initiator, StandardVoteType? voteType = null)
         {
             return CanCallVote(initiator, voteType, out _, out _);
         }
@@ -406,14 +407,14 @@ namespace Content.Server.Voting.Managers
             return false;
         }
 
-        private void DirtyCanCallVote(IPlayerSession player)
+        private void DirtyCanCallVote(ICommonSession player)
         {
             _playerCanCallVoteDirty.Add(player);
         }
 
         #region Preset Votes
 
-        private void WirePresetVoteInitiator(VoteOptions options, IPlayerSession? player)
+        private void WirePresetVoteInitiator(VoteOptions options, ICommonSession? player)
         {
             if (player != null)
             {
@@ -432,13 +433,13 @@ namespace Content.Server.Voting.Managers
         private sealed class VoteReg
         {
             public readonly int Id;
-            public readonly Dictionary<IPlayerSession, int> CastVotes = new();
+            public readonly Dictionary<ICommonSession, int> CastVotes = new();
             public readonly VoteEntry[] Entries;
             public readonly string Title;
             public readonly string InitiatorText;
             public readonly TimeSpan StartTime;
             public readonly TimeSpan EndTime;
-            public readonly HashSet<IPlayerSession> VotesDirty = new();
+            public readonly HashSet<ICommonSession> VotesDirty = new();
 
             public bool Cancelled;
             public bool Finished;
@@ -446,10 +447,10 @@ namespace Content.Server.Voting.Managers
 
             public VoteFinishedEventHandler? OnFinished;
             public VoteCancelledEventHandler? OnCancelled;
-            public IPlayerSession? Initiator { get; }
+            public ICommonSession? Initiator { get; }
 
             public VoteReg(int id, VoteEntry[] entries, string title, string initiatorText,
-                IPlayerSession? initiator, TimeSpan start, TimeSpan end)
+                ICommonSession? initiator, TimeSpan start, TimeSpan end)
             {
                 Id = id;
                 Entries = entries;
@@ -517,7 +518,7 @@ namespace Content.Server.Voting.Managers
                 return _mgr.IsValidOption(_reg, optionId);
             }
 
-            public void CastVote(IPlayerSession session, int? optionId)
+            public void CastVote(ICommonSession session, int? optionId)
             {
                 _mgr.CastVote(_reg, session, optionId);
             }
index cb296a7d589a967b4ad8fbfb205df744189ec41d..498c9d049417be534f2d3b2b8c843589ebd216b0 100644 (file)
@@ -6,7 +6,6 @@ using Content.Server.Voting.Managers;
 using Content.Shared.Administration;
 using Content.Shared.Database;
 using Content.Shared.Voting;
-using Robust.Server.Player;
 using Robust.Shared.Console;
 
 namespace Content.Server.Voting
@@ -36,14 +35,14 @@ namespace Content.Server.Voting
 
             var mgr = IoCManager.Resolve<IVoteManager>();
 
-            if (shell.Player != null && !mgr.CanCallVote((IPlayerSession) shell.Player, type))
+            if (shell.Player != null && !mgr.CanCallVote(shell.Player, type))
             {
                 _adminLogger.Add(LogType.Vote, LogImpact.Medium, $"{shell.Player} failed to start {type.ToString()} vote");
                 shell.WriteError(Loc.GetString("cmd-createvote-cannot-call-vote-now"));
                 return;
             }
 
-            mgr.CreateStandardVote((IPlayerSession?) shell.Player, type);
+            mgr.CreateStandardVote(shell.Player, type);
         }
 
         public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
@@ -92,7 +91,7 @@ namespace Content.Server.Voting
                 options.Options.Add((args[i], i));
             }
 
-            options.SetInitiatorOrServer((IPlayerSession?) shell.Player);
+            options.SetInitiatorOrServer(shell.Player);
 
             if (shell.Player != null)
                 _adminLogger.Add(LogType.Vote, LogImpact.Medium, $"{shell.Player} initiated a custom vote: {options.Title} - {string.Join("; ", options.Options.Select(x => x.text))}");
@@ -187,7 +186,7 @@ namespace Content.Server.Voting
                 return;
             }
 
-            vote.CastVote((IPlayerSession) shell.Player!, optionN);
+            vote.CastVote(shell.Player!, optionN);
         }
     }
 
index 6e6d0465edf16a8357e33000ab8f7c16cc319008..5475d10d3297afc2706d65141ff5d820d9e76dd2 100644 (file)
@@ -1,4 +1,4 @@
-using Robust.Server.Player;
+using Robust.Shared.Player;
 
 
 namespace Content.Server.Voting
@@ -16,7 +16,7 @@ namespace Content.Server.Voting
         /// <summary>
         ///     The player that started the vote. Used to keep track of player cooldowns to avoid vote spam.
         /// </summary>
-        public IPlayerSession? InitiatorPlayer { get; set; }
+        public ICommonSession? InitiatorPlayer { get; set; }
 
         /// <summary>
         ///     The shown title of the vote.
@@ -43,13 +43,13 @@ namespace Content.Server.Voting
         ///     Sets <see cref="InitiatorPlayer"/> and <see cref="InitiatorText"/>
         ///     by setting the latter to the player's name.
         /// </summary>
-        public void SetInitiator(IPlayerSession player)
+        public void SetInitiator(ICommonSession player)
         {
             InitiatorPlayer = player;
             InitiatorText = player.Name;
         }
 
-        public void SetInitiatorOrServer(IPlayerSession? player)
+        public void SetInitiatorOrServer(ICommonSession? player)
         {
             if (player != null)
             {
index 1b6b2ebef1cff3af73055547b73695d99279019d..3d9c3e821940fc9b3965a362902f1a083477717c 100644 (file)
@@ -24,11 +24,9 @@ using Content.Shared.StatusEffect;
 using Content.Shared.Tag;
 using Content.Shared.Weapons.Melee;
 using Content.Shared.Weapons.Melee.Events;
-using Robust.Server.Player;
 using Robust.Shared.Audio;
 using Robust.Shared.Map;
 using Robust.Shared.Player;
-using Robust.Shared.Players;
 using Robust.Shared.Random;
 
 namespace Content.Server.Weapons.Melee;
@@ -174,7 +172,7 @@ public sealed class MeleeWeaponSystem : SharedMeleeWeaponSystem
         EntityCoordinates targetCoordinates;
         Angle targetLocalAngle;
 
-        if (session is IPlayerSession pSession)
+        if (session is { } pSession)
         {
             (targetCoordinates, targetLocalAngle) = _lag.GetCoordinatesAngle(target, pSession);
         }
index e75ad0a9efb7e3b8099350b545ee89f1dd88a3f3..b6452efa8a6f03714d72eb6663a051e96ad7176d 100644 (file)
@@ -16,7 +16,7 @@ using Content.Shared.Tools;
 using Content.Shared.Tools.Components;
 using Content.Shared.Wires;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
+using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using SharedToolSystem = Content.Shared.Tools.Systems.SharedToolSystem;
@@ -616,7 +616,7 @@ public sealed class WiresSystem : SharedWiresSystem
             wires.WireSeed), ui: ui);
     }
 
-    public void OpenUserInterface(EntityUid uid, IPlayerSession player)
+    public void OpenUserInterface(EntityUid uid, ICommonSession player)
     {
         if (_uiSystem.TryGetUi(uid, WiresUiKey.Key, out var ui))
             _uiSystem.OpenUi(ui, player);
index 49036fb19d8f2b5a1789eaa2c14f65248c25ddef..9200928d662459b66e09483b73c01cde93ca1564 100644 (file)
@@ -17,7 +17,6 @@ using Content.Shared.Xenoarchaeology.Equipment;
 using Content.Shared.Xenoarchaeology.XenoArtifacts;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
-using Robust.Server.Player;
 using Robust.Shared.Audio;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;
@@ -229,7 +228,7 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem
     /// <param name="args"></param>
     private void OnServerSelectionMessage(EntityUid uid, AnalysisConsoleComponent component, AnalysisConsoleServerSelectionMessage args)
     {
-        _ui.TryOpen(uid, ResearchClientUiKey.Key, (IPlayerSession) args.Session);
+        _ui.TryOpen(uid, ResearchClientUiKey.Key, args.Session);
     }
 
     /// <summary>
index 7e01c81433262b42ec0d5113e0eb78ffa80155fb..22d918d4a33ca28fc2e5b16e8f08d18cda547e65 100644 (file)
@@ -1,4 +1,4 @@
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 
 namespace Content.Shared.Administration.Managers;
 
index 7edf2448aed99b0824d8476136c36d665295636b..1441745b5dac4dc0711d353d6da6281723cfc148 100644 (file)
@@ -11,7 +11,7 @@ using Robust.Shared.Containers;
 using Robust.Shared.Map;
 using Robust.Shared.Network;
 using Robust.Shared.Physics.Systems;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Timing;
 
 namespace Content.Shared.Buckle;
index d0c3be3b311cddd549b2065ba4d66b65fb321f7b..dfa72fcfb7fa5f16839183c386e4edf14ad90978 100644 (file)
@@ -6,7 +6,7 @@ using Content.Shared.Input;
 using Content.Shared.Localizations;
 using Robust.Shared.Input.Binding;
 using Robust.Shared.Map;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 
 namespace Content.Shared.Hands.EntitySystems;
 
index 4a9a43ca2c2b4f9c6b0228fdf9bdc60b61b4820b..7981deaee66e6c03675643158a2723bd6e41f77f 100644 (file)
@@ -34,7 +34,7 @@ using Robust.Shared.Network;
 using Robust.Shared.Physics;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Systems;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Random;
 using Robust.Shared.Serialization;
 using Robust.Shared.Timing;
index 465db6a3d886e2bd4045597983612eb5f5a36e66..b147a2dbbe7e1099d3157b3b71f2a48a130f6868 100644 (file)
@@ -2,7 +2,7 @@
 using Content.Shared.Mind.Components;
 using Robust.Shared.GameStates;
 using Robust.Shared.Network;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 
 namespace Content.Shared.Mind
 {
index 9f5c51ac6e5b6c05f4c6d8ce7251b53cae656375..8e72d9c741f0b73a67fa1471d58301e1bbcb3644 100644 (file)
@@ -13,7 +13,7 @@ using Content.Shared.Objectives.Systems;
 using Content.Shared.Players;
 using Robust.Shared.Map;
 using Robust.Shared.Network;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Utility;
 
 namespace Content.Shared.Mind;
@@ -410,11 +410,11 @@ public abstract class SharedMindSystem : EntitySystem
     }
 
     public bool TryGetMind(
-        PlayerData player,
+        ContentPlayerData contentPlayer,
         out EntityUid mindId,
         [NotNullWhen(true)] out MindComponent? mind)
     {
-        mindId = player.Mind ?? default;
+        mindId = contentPlayer.Mind ?? default;
         return TryComp(mindId, out mind);
     }
 
index 8e1b43f8bd5e9da8eb2a729e79572b0860cbcb2b..89e5636acd7df5a9d70bfec4d0f72634738e2cd6 100644 (file)
@@ -1,5 +1,3 @@
-using Robust.Shared.Players;
-
 namespace Content.Shared.Movement.Events;
 
 /// <summary>
index 27e0080c87eeb762317506f75dae2c7853393759..4b81619fd07214ad9b9bd7ede17503848ae538e1 100644 (file)
@@ -5,7 +5,7 @@ using Content.Shared.Ghost;
 using Content.Shared.Input;
 using Content.Shared.Movement.Components;
 using Robust.Shared.Input.Binding;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Serialization;
 
 namespace Content.Shared.Movement.Systems;
index 425322408efabdf4af458f91a1db1ea3834f41df..1d323a91876a5e1634cda13066077b96ab59a879 100644 (file)
@@ -6,7 +6,7 @@ using Content.Shared.Movement.Components;
 using Content.Shared.Movement.Events;
 using Robust.Shared.Input;
 using Robust.Shared.Input.Binding;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Serialization;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
similarity index 73%
rename from Content.Shared/Players/PlayerData.cs
rename to Content.Shared/Players/ContentPlayerData.cs
index c6274c950bd40f3ba3f3a85f9a5c83c0de909be7..7545eb58fcdbca62eb81f07096a8a0a732c930a6 100644 (file)
@@ -1,16 +1,15 @@
 using Content.Shared.GameTicking;
 using Content.Shared.Mind;
 using Robust.Shared.Network;
-using Robust.Shared.Player;
 
 namespace Content.Shared.Players;
 
 /// <summary>
 ///     Content side for all data that tracks a player session.
-///     Use <see cref="PlaIPlayerDatarver.Player.IPlayerData)"/> to retrieve this from an <see cref="IPlayerData"/>.
+///     Use <see cref="PlaIPlayerDatarver.Player.IPlayerData)"/> to retrieve this from an <see cref="PlayerData"/>.
 ///     <remarks>Not currently used on the client.</remarks>
 /// </summary>
-public sealed class PlayerData
+public sealed class ContentPlayerData
 {
     /// <summary>
     ///     The session ID of the player owning this data.
@@ -38,21 +37,9 @@ public sealed class PlayerData
     /// </summary>
     public bool ExplicitlyDeadminned { get; set; }
 
-    public PlayerData(NetUserId userId, string name)
+    public ContentPlayerData(NetUserId userId, string name)
     {
         UserId = userId;
         Name = name;
     }
-}
-
-
-public static class PlayerDataExt
-{
-    /// <summary>
-    ///     Gets the correctly cast instance of content player data from an engine player data storage.
-    /// </summary>
-    public static PlayerData? ContentData(this IPlayerData data)
-    {
-        return (PlayerData?) data.ContentDataUncast;
-    }
-}
+}
\ No newline at end of file
diff --git a/Content.Shared/Players/PlayerDataExt.cs b/Content.Shared/Players/PlayerDataExt.cs
new file mode 100644 (file)
index 0000000..eba4d83
--- /dev/null
@@ -0,0 +1,30 @@
+using Robust.Shared.Player;
+
+namespace Content.Shared.Players;
+
+public static class PlayerDataExt
+{
+    /// <summary>
+    ///     Gets the correctly cast instance of content player data from an engine player data storage.
+    /// </summary>
+    public static ContentPlayerData? ContentData(this SessionData data)
+    {
+        return (ContentPlayerData?) data.ContentDataUncast;
+    }
+
+    /// <summary>
+    ///     Gets the correctly cast instance of content player data from an engine player data storage.
+    /// </summary>
+    public static ContentPlayerData? ContentData(this ICommonSession session)
+    {
+        return session.Data.ContentData();
+    }
+
+    /// <summary>
+    ///     Gets the mind that is associated with this player.
+    /// </summary>
+    public static EntityUid? GetMind(this ICommonSession session)
+    {
+        return session.Data.ContentData()?.Mind;
+    }
+}
\ No newline at end of file
index 6fc7ad6a409e11bc3a55dcd0f5e2ffdcd863b674..7271c5688abe8f0443d29df69400fbeb62ff5b4e 100644 (file)
@@ -1,4 +1,4 @@
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 
 namespace Content.Shared.Players;
 
@@ -8,5 +8,5 @@ namespace Content.Shared.Players;
 /// </summary>
 public abstract class SharedPlayerSystem : EntitySystem
 {
-    public abstract PlayerData? ContentData(ICommonSession? session);
+    public abstract ContentPlayerData? ContentData(ICommonSession? session);
 }
index 50013a5435007b6ff9eb1e377a783f785baf3074..e4565b90e8bc9a061aa590db61c59e33b6f784a7 100644 (file)
@@ -1,6 +1,5 @@
 using Robust.Shared.Map;
 using Robust.Shared.Player;
-using Robust.Shared.Players;
 using Robust.Shared.Serialization;
 
 namespace Content.Shared.Popups
index 6f19d048b4f67325e63fa30a6626e557aa30b31c..0c139ee9e35010f230a57125c0b9ac40236fa292 100644 (file)
@@ -12,7 +12,7 @@ using Robust.Shared.Map;
 using Robust.Shared.Physics;
 using Robust.Shared.Physics.Events;
 using Robust.Shared.Physics.Systems;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 
 namespace Content.Shared.Pulling
 {
index ac18d04e9c70f0dba7693663bbb4b61fca3dd9d5..af97ea135047513a9b9c58263992e05ccc80a862 100644 (file)
@@ -2,7 +2,7 @@
 using System.Linq;
 using Content.Shared.Players;
 using Content.Shared.Players.PlayTimeTracking;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Utility;
 
index 4b740b8d3c73a2e8edfe56ec017557b60521a902..62af6067d05444c0f5681beaa6bb908e193dc13f 100644 (file)
@@ -23,7 +23,7 @@ using Robust.Shared.Audio;
 using Robust.Shared.Map;
 using Robust.Shared.Physics;
 using Robust.Shared.Physics.Systems;
-using Robust.Shared.Players;
+using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;