Removed Old PlayerSession Functions (#5404)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Acruid
2021-11-22 23:11:48 -08:00
committed by GitHub
parent 7910928679
commit 6e54e740c7
26 changed files with 97 additions and 94 deletions

View File

@@ -70,8 +70,7 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components.Mobs
await server.WaitAssertion(() =>
{
var player = serverPlayerManager.GetAllPlayers().Single();
var playerEnt = player.AttachedEntity;
var playerEnt = serverPlayerManager.Sessions.Single().AttachedEntity;
var actionsComponent = playerEnt!.GetComponent<ServerActionsComponent>();
// player should begin with their innate actions granted
@@ -153,8 +152,7 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components.Mobs
// now revoke the action and check that the client sees it as revoked
await server.WaitAssertion(() =>
{
var player = serverPlayerManager.GetAllPlayers().Single();
var playerEnt = player.AttachedEntity;
var playerEnt = serverPlayerManager.Sessions.Single().AttachedEntity;
var actionsComponent = playerEnt!.GetComponent<ServerActionsComponent>();
actionsComponent.Revoke(ActionType.DebugInstant);
});
@@ -246,7 +244,7 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components.Mobs
await server.WaitAssertion(() =>
{
serverPlayerEnt = serverPlayerManager.GetAllPlayers().Single().AttachedEntity;
serverPlayerEnt = serverPlayerManager.Sessions.Single().AttachedEntity;
serverActionsComponent = serverPlayerEnt!.GetComponent<ServerActionsComponent>();
// spawn and give them an item that has actions

View File

@@ -2,12 +2,11 @@ using System.Linq;
using System.Threading.Tasks;
using Content.Client.Alerts;
using Content.Client.Alerts.UI;
using Content.Client.UserInterface;
using Content.Server.Alert;
using Content.Shared.Alert;
using NUnit.Framework;
using Robust.Client.UserInterface;
using IPlayerManager = Robust.Server.Player.IPlayerManager;
using Robust.Server.Player;
namespace Content.IntegrationTests.Tests.GameObjects.Components.Mobs
{
@@ -28,8 +27,7 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components.Mobs
await server.WaitAssertion(() =>
{
var player = serverPlayerManager.GetAllPlayers().Single();
var playerEnt = player.AttachedEntity;
var playerEnt = serverPlayerManager.Sessions.Single().AttachedEntity;
Assert.NotNull(playerEnt);
var alertsComponent = playerEnt.GetComponent<ServerAlertsComponent>();
Assert.NotNull(alertsComponent);
@@ -69,8 +67,7 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components.Mobs
await server.WaitAssertion(() =>
{
var player = serverPlayerManager.GetAllPlayers().Single();
var playerEnt = player.AttachedEntity;
var playerEnt = serverPlayerManager.Sessions.Single().AttachedEntity;
Assert.NotNull(playerEnt);
var alertsComponent = playerEnt.GetComponent<ServerAlertsComponent>();
Assert.NotNull(alertsComponent);