Exemplo n.º 1
0
        public void EnqueNewPlayers(BasePlayerGroup basePlayerGroup)
        {
            var dateTime = DateTime.UtcNow;

            basePlayerGroup.Players.ToList().ForEach(x => x.EnqueueTime = dateTime);
            _playerQueue.Enqueue(basePlayerGroup);
        }
Exemplo n.º 2
0
        public static BasePlayerGroup MergeBasePlayerGroups(this BasePlayerGroup firstBasePlayerGroup,
                                                            BasePlayerGroup sencondBasePlayerGroup)
        {
            var listOfPlayers = firstBasePlayerGroup.Players.ToList();

            listOfPlayers.AddRange(sencondBasePlayerGroup.Players);
            return(new BasePlayerGroup(listOfPlayers));
        }
Exemplo n.º 3
0
        protected virtual void OnPlayerGroupLobbyMatchHandler(BasePlayerGroup basePlayerGroup)
        {
            EventHandler <BasePlayerGroup> handler = PlayerGroupLobbyMatchHandler;

            if (handler != null)
            {
                handler(this, basePlayerGroup);
            }
        }
Exemplo n.º 4
0
        public void RemovePlayers(BasePlayerGroup basePlayerGroup)
        {
            if (!_playerGroups.ContainsKey(basePlayerGroup.GroupId))
            {
                return;
            }
            BasePlayerGroup tempvar;

            _playerGroups.TryRemove(basePlayerGroup.GroupId, out tempvar);
        }
Exemplo n.º 5
0
 protected void AddPlayerToProcessing(BasePlayerGroup basePlayerGroup)
 {
     _playerBuffer.Post(basePlayerGroup);
 }
Exemplo n.º 6
0
 protected abstract void ProcessPlayerGroup(BasePlayerGroup basePlayerGroup);
Exemplo n.º 7
0
 public void AddPlayers(BasePlayerGroup basePlayer)
 {
     _playerGroups.TryAdd(basePlayer.GroupId, basePlayer);
 }
Exemplo n.º 8
0
 public virtual bool MatchMakingFit(BasePlayerGroup otherPlayerGroup)
 {
     return(true);
 }
Exemplo n.º 9
0
        protected override void ProcessPlayerGroup(BasePlayerGroup basePlayerGroup)
        {
            var processor = SelectLeastBusyProcessor();

            processor.EnqueNewPlayers(basePlayerGroup);
        }
Exemplo n.º 10
0
 public void NewPlayerGroupConnection(BasePlayerGroup basePlayerGroup)
 {
     AddPlayerToProcessing(basePlayerGroup);
 }