Player post-spawn hook and player ghosting controlled by preset (#2734)

* GamePreset: Add a hook to catch all player spawns for modification.

Unless someone makes the entire job system unpluggable, this is what you get...

* GamePreset: Is now in control of voluntary ghosting

* Clean up ghost code to only rely on a player's Mind
This commit is contained in:
20kdc
2020-12-11 01:10:55 +00:00
committed by GitHub
parent adc972f9d3
commit 31b39823ad
5 changed files with 107 additions and 56 deletions

View File

@@ -1,8 +1,10 @@
using System;
using System.Collections.Generic;
using Content.Server.GameTicking;
using Content.Server.Mobs;
using Content.Shared.Roles;
using Robust.Server.Interfaces.Player;
using Robust.Server.Interfaces.Console;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Timing;
@@ -42,6 +44,9 @@ namespace Content.Server.Interfaces.GameTicking
void ToggleReady(IPlayerSession player, bool ready);
void ToggleDisallowLateJoin(bool disallowLateJoin);
/// <summary>proxy to GamePreset (actual handler)</summary>
bool OnGhostAttempt(Mind mind, bool canReturnGlobal);
EntityCoordinates GetLateJoinSpawnPoint();
EntityCoordinates GetJobSpawnPoint(string jobId);
EntityCoordinates GetObserverSpawnPoint();