public void EnqueNewPlayers(BasePlayerGroup basePlayerGroup) { var dateTime = DateTime.UtcNow; basePlayerGroup.Players.ToList().ForEach(x => x.EnqueueTime = dateTime); _playerQueue.Enqueue(basePlayerGroup); }
public static BasePlayerGroup MergeBasePlayerGroups(this BasePlayerGroup firstBasePlayerGroup, BasePlayerGroup sencondBasePlayerGroup) { var listOfPlayers = firstBasePlayerGroup.Players.ToList(); listOfPlayers.AddRange(sencondBasePlayerGroup.Players); return(new BasePlayerGroup(listOfPlayers)); }
protected virtual void OnPlayerGroupLobbyMatchHandler(BasePlayerGroup basePlayerGroup) { EventHandler <BasePlayerGroup> handler = PlayerGroupLobbyMatchHandler; if (handler != null) { handler(this, basePlayerGroup); } }
public void RemovePlayers(BasePlayerGroup basePlayerGroup) { if (!_playerGroups.ContainsKey(basePlayerGroup.GroupId)) { return; } BasePlayerGroup tempvar; _playerGroups.TryRemove(basePlayerGroup.GroupId, out tempvar); }
protected void AddPlayerToProcessing(BasePlayerGroup basePlayerGroup) { _playerBuffer.Post(basePlayerGroup); }
protected abstract void ProcessPlayerGroup(BasePlayerGroup basePlayerGroup);
public void AddPlayers(BasePlayerGroup basePlayer) { _playerGroups.TryAdd(basePlayer.GroupId, basePlayer); }
public virtual bool MatchMakingFit(BasePlayerGroup otherPlayerGroup) { return(true); }
protected override void ProcessPlayerGroup(BasePlayerGroup basePlayerGroup) { var processor = SelectLeastBusyProcessor(); processor.EnqueNewPlayers(basePlayerGroup); }
public void NewPlayerGroupConnection(BasePlayerGroup basePlayerGroup) { AddPlayerToProcessing(basePlayerGroup); }