Skip to content

Commit

Permalink
Update queue
Browse files Browse the repository at this point in the history
  • Loading branch information
Morb0 committed Oct 2, 2023
1 parent a550442 commit 2f7b33c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Content.Server/Connection/ConnectionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private async Task NetMgrOnConnecting(NetConnectingArgs e)
}

// Corvax-Queue-Start
var isQueueEnabled = _cfg.GetCVar(CCCVars.QueueEnabled);
var isQueueEnabled = IoCManager.Instance!.TryResolveType<IServerJoinQueueManager>(out var mgr) && mgr.IsEnabled;
if (_plyMgr.PlayerCount >= _cfg.GetCVar(CCVars.SoftMaxPlayers) && !isPrivileged && !isQueueEnabled)
// Corvax-Queue-End
{
Expand Down
10 changes: 0 additions & 10 deletions Content.Shared/Corvax/CCCVars/CCCVars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@ namespace Content.Shared.Corvax.CCCVars;
// ReSharper disable once InconsistentNaming
public sealed class CCCVars
{
/*
* Queue
*/

/// <summary>
/// Controls if the connections queue is enabled. If enabled stop kicking new players after `SoftMaxPlayers` cap and instead add them to queue.
/// </summary>
public static readonly CVarDef<bool>
QueueEnabled = CVarDef.Create("queue.enabled", false, CVar.SERVERONLY);

/**
* TTS (Text-To-Speech)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

public interface IServerJoinQueueManager
{
public bool IsEnabled { get; }
public int PlayerInQueueCount { get; }
public int ActualPlayersCount { get; }
public void Initialize();
public void PostInitialize();
}
4 changes: 4 additions & 0 deletions Resources/Locale/ru-RU/corvax/join-queue/queue-screen.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ queue-quit = Выйти
queue-position = Ваша позиция:
queue-total = Всего в очереди:
queue-priority-join = Приоритетный вход
queue-server-title = Вы можете подключиться к:
queue-server-not-available = Нет доступных серверов
queue-server-online = Онлайн:
queue-server-connect = Подключиться
2 changes: 1 addition & 1 deletion Secrets
Submodule Secrets updated from 3527f4 to 9851c2

0 comments on commit 2f7b33c

Please sign in to comment.