private static void MakeTeams() { var tempList = new List <KolizeumTeam>(); var currentKoliTeam = new KolizeumTeam(); foreach (var client in RegisteredClient.ToArray()) { try { client.Action.KolizeumMessage("Preparation des equipes, merci de patienter ..."); if (!client.Action.IsOccuped) { currentKoliTeam.AddMember(client); if (currentKoliTeam.IsFull) { tempList.Add(currentKoliTeam); currentKoliTeam = new KolizeumTeam(); } } else { client.Action.KolizeumMessage("Vous etes occuper, votre participation au kolizeum a ete annuler !"); UnSubscribeToKolizeum(client); } } catch (Exception e) { client.Action.KolizeumMessage("Votre participation au kolizeum a ete annuler du a une erreur lie a votre personnage"); } } //Get formatted teams for (int i = 0; i <= tempList.Count - 1; i += 2) { try { var redTeam = tempList[i]; var blueTeam = tempList[i + 1]; redTeam.UnsubcribeMembers(); blueTeam.UnsubcribeMembers(); var match = new KolizeumMatch(redTeam, blueTeam); match.Map = RandomMap(); match.InitializeMatch(); } catch (Exception e) { //Utilities.ConsoleStyle.Error("Can't make matchmaking : " + e.ToString()); } } }
private static void MakeTeams() { var tempList = new List<KolizeumTeam>(); var currentKoliTeam = new KolizeumTeam(); foreach (var client in RegisteredClient.ToArray()) { try { client.Action.KolizeumMessage("Preparation des equipes, merci de patienter ..."); if (!client.Action.IsOccuped) { currentKoliTeam.AddMember(client); if (currentKoliTeam.IsFull) { tempList.Add(currentKoliTeam); currentKoliTeam = new KolizeumTeam(); } } else { client.Action.KolizeumMessage("Vous etes occuper, votre participation au kolizeum a ete annuler !"); UnSubscribeToKolizeum(client); } } catch (Exception e) { client.Action.KolizeumMessage("Votre participation au kolizeum a ete annuler du a une erreur lie a votre personnage"); } } //Get formatted teams for (int i = 0; i <= tempList.Count - 1; i += 2) { try { var redTeam = tempList[i]; var blueTeam = tempList[i + 1]; redTeam.UnsubcribeMembers(); blueTeam.UnsubcribeMembers(); var match = new KolizeumMatch(redTeam, blueTeam); match.Map = RandomMap(); match.InitializeMatch(); } catch (Exception e) { //Utilities.ConsoleStyle.Error("Can't make matchmaking : " + e.ToString()); } } }