-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
606 additions
and
362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using CounterStrikeSharp.API.Core; | ||
using CounterStrikeSharp.API.Core.Attributes.Registration; | ||
using FiveStack.Utilities; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace FiveStack; | ||
|
||
public partial class FiveStackPlugin | ||
{ | ||
[GameEventHandler] | ||
public HookResult OnRoundStart(EventRoundPrestart @event, GameEventInfo info) | ||
{ | ||
MatchManager? matchManager = _matchService.GetCurrentMatch(); | ||
if (matchManager == null) | ||
{ | ||
return HookResult.Continue; | ||
} | ||
|
||
if (!matchManager.IsLive()) | ||
{ | ||
return HookResult.Continue; | ||
} | ||
|
||
int currentPlayers = MatchUtility.Players().Count; | ||
|
||
int expectedPlayers = _matchService.GetCurrentMatch()?.GetExpectedPlayerCount() ?? 10; | ||
|
||
_logger.LogInformation( | ||
"expectedPlayers: {expectedPlayers}, currentPlayers: {currentPlayers}", | ||
expectedPlayers, | ||
currentPlayers | ||
); | ||
if (currentPlayers < expectedPlayers) | ||
{ | ||
matchManager.PauseMatch("Waiting for players to reconnect"); | ||
} | ||
|
||
return HookResult.Continue; | ||
} | ||
} |
Oops, something went wrong.