public PlayerEntry(User user, List <MatchMakerSetup.Queue> queueTypes, PartyManager.Party party) { Party = party; QueueTypes = queueTypes; LobbyUser = user; float recentWinChance = RatingSystems.GetRatingSystem(RatingCategory.MatchMaking).GetAverageRecentWinChance(user.AccountID); double bonusElo = -400 * Math.Log(1 / recentWinChance - 1) / Math.Log(10); bonusElo = Math.Min(300, Math.Max(-300, bonusElo)); MinConsideredElo = (int)Math.Round(LobbyUser.EffectiveMmElo + DynamicConfig.Instance.MmEloBonusMultiplier * bonusElo); //Trace.TraceInformation($"Player {user.AccountID} with recent win chance {recentWinChance} receives {DynamicConfig.Instance.MmEloBonusMultiplier} * {bonusElo} bonusElo => {MinConsideredElo} Effective Elo"); }
private bool VerifyPartySizeFits(PartyManager.Party party) { if (party.UserNames.Count + Players.Count > Size) { return(false); } if (QueueType.Mode != AutohostMode.GameChickens) { var existingPartySizes = Players.Where(x => x.Party != null) .GroupBy(x => x.Party) .Select(x => x.Key.UserNames.Count) .OrderByDescending(x => x) .ToList(); var maxTeamSize = Size / 2; var t1 = 0; var t2 = 0; foreach (var psize in existingPartySizes) { if (t1 + psize <= maxTeamSize) { t1 += psize; } else if (t2 + psize <= maxTeamSize) { t2 += psize; } } if ((party.UserNames.Count + t1 > maxTeamSize) && (party.UserNames.Count + t2 > maxTeamSize)) { return(false); // cannot fit new party to still balance } } return(true); }
public PlayerEntry(User user, List <MatchMakerSetup.Queue> queueTypes, PartyManager.Party party) { Party = party; QueueTypes = queueTypes; LobbyUser = user; }
private int GetPartyMinElo(PartyManager.Party party, List <PlayerEntry> players) { return((int)Math.Round(players.Where(x => x.Party == party).Select(GetPlayerMinElo).Average())); }
public PlayerEntry(User user, List<MatchMakerSetup.Queue> queueTypes, PartyManager.Party party) { Party = party; QueueTypes = queueTypes; LobbyUser = user; }