Beispiel #1
0
 public LobbyQueue(GameType gameType, LobbyGameConfig gameConfig)
 {
     GameType  = gameType;
     SubTypes  = gameConfig.SubTypes;
     Players   = new List <LobbyServerConnection>();
     QueueInfo = new LobbyMatchmakingQueueInfo()
     {
         QueuedPlayers    = 0,
         AverageWaitTime  = TimeSpan.FromSeconds(500),
         GameConfig       = gameConfig,
         PlayersPerMinute = 1,
         QueueStatus      = Framework.Constants.Enums.QueueStatus.Idle,
         ShowQueueSize    = true
     };
     MatchId = 0;
 }
Beispiel #2
0
        public void AddPlayer(LobbyServerConnection client)
        {
            //Log.Print(LogType.Lobby, $"Player {client.PlayerInfo.GetHandle()} joined {GameType.ToString()} Queue");

            Players.Add(client);
            QueueInfo.QueuedPlayers++;

            LobbyMatchmakingQueueInfo info = QueueInfo.Clone();

            info.QueueStatus = Framework.Constants.Enums.QueueStatus.Success;


            MatchmakingQueueAssignmentNotification assignmentNotification = new MatchmakingQueueAssignmentNotification()
            {
                Reason = "",
                MatchmakingQueueInfo = info
            };

            _ = client.SendMessage(assignmentNotification);

            Update();
        }
Beispiel #3
0
 public void SetQueueInfo(LobbyMatchmakingQueueInfo queueInfo)
 {
     QueueInfo = queueInfo;
 }