Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion EXILED/Exiled.Events/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public override void OnEnabled()
Handlers.Player.Verified += Handlers.Internal.Round.OnVerified;
Handlers.Map.ChangedIntoGrenade += Handlers.Internal.ExplodingGrenade.OnChangedIntoGrenade;

RoleAssigner.OnPlayersSpawned += Handlers.Server.OnAllPlayersSpawned;
CharacterClassManager.OnRoundStarted += Handlers.Server.OnRoundStarted;
WaveManager.OnWaveSpawned += Handlers.Server.OnRespawnedTeam;
InventorySystem.InventoryExtensions.OnItemAdded += Handlers.Player.OnItemAdded;
Expand Down Expand Up @@ -112,7 +113,7 @@ public override void OnDisabled()
Handlers.Map.ChangedIntoGrenade -= Handlers.Internal.ExplodingGrenade.OnChangedIntoGrenade;

CharacterClassManager.OnRoundStarted -= Handlers.Server.OnRoundStarted;

RoleAssigner.OnPlayersSpawned -= Handlers.Server.OnAllPlayersSpawned;
InventorySystem.InventoryExtensions.OnItemAdded -= Handlers.Player.OnItemAdded;
InventorySystem.InventoryExtensions.OnItemRemoved -= Handlers.Player.OnItemRemoved;
WaveManager.OnWaveSpawned -= Handlers.Server.OnRespawnedTeam;
Expand Down
12 changes: 11 additions & 1 deletion EXILED/Exiled.Events/Handlers/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public static class Server
/// </summary>
public static Event RoundStarted { get; set; } = new();

/// <summary>
/// Invoked after all players have spawned at the start of a new round.
/// </summary>
public static Event AllPlayersSpawned { get; set; } = new();

/// <summary>
/// Invoked before ending a round.
/// </summary>
Expand Down Expand Up @@ -137,6 +142,11 @@ public static class Server
/// </summary>
public static void OnRoundStarted() => RoundStarted.InvokeSafely();

/// <summary>
/// Called after all players have spawned at the start of a new round.
/// </summary>
public static void OnAllPlayersSpawned() => AllPlayersSpawned.InvokeSafely();

/// <summary>
/// Called before ending a round.
/// </summary>
Expand Down Expand Up @@ -245,4 +255,4 @@ public static class Server
/// <param name="ev">The <see cref="CompletingObjectiveEventArgs"/> instance.</param>
public static void OnCompletingObjective(CompletingObjectiveEventArgs ev) => CompletingObjective.InvokeSafely(ev);
}
}
}