Content update for NetEntities (#18935)

This commit is contained in:
metalgearsloth
2023-09-11 09:42:41 +10:00
committed by GitHub
parent 389c8d1a2c
commit 5a0fc68be2
526 changed files with 3058 additions and 2215 deletions

View File

@@ -11,6 +11,7 @@ namespace Content.Server.GameTicking.Commands
[AnyCommand]
sealed class JoinGameCommand : IConsoleCommand
{
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
public string Command => "joingame";
@@ -36,9 +37,8 @@ namespace Content.Server.GameTicking.Commands
return;
}
var ticker = EntitySystem.Get<GameTicker>();
var stationSystem = EntitySystem.Get<StationSystem>();
var stationJobs = EntitySystem.Get<StationJobsSystem>();
var ticker = _entManager.System<GameTicker>();
var stationJobs = _entManager.System<StationJobsSystem>();
if (ticker.PlayerGameStatuses.TryGetValue(player.UserId, out var status) && status == PlayerGameStatus.JoinedGame)
{
@@ -61,7 +61,7 @@ namespace Content.Server.GameTicking.Commands
shell.WriteError(Loc.GetString("shell-argument-must-be-number"));
}
var station = new EntityUid(sid);
var station = _entManager.GetEntity(new NetEntity(sid));
var jobPrototype = _prototypeManager.Index<JobPrototype>(id);
if(stationJobs.TryGetJobSlot(station, jobPrototype, out var slots) == false || slots == 0)
{