public void CopyNewMapValuesTo(
     MultiplayerOptions.MultiplayerOptionsContainer other)
 {
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.Map, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.Map));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.GameType, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.GameType));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.ClanMatchType, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.ClanMatchType));
 }
 public void CopyNewRoundValuesTo(
     MultiplayerOptions.MultiplayerOptionsContainer other)
 {
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.NumberOfBotsPerFormation, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.NumberOfBotsPerFormation));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.CultureTeam1, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.CultureTeam1));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.CultureTeam2, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.CultureTeam2));
 }
 public void CopyImmediateEffectValuesTo(
     MultiplayerOptions.MultiplayerOptionsContainer other)
 {
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.AllowPollsToKickPlayers, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.AllowPollsToKickPlayers));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.AllowPollsToBanPlayers, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.AllowPollsToBanPlayers));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.AllowPollsToChangeMaps, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.AllowPollsToChangeMaps));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.AllowIndividualBanners, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.AllowIndividualBanners));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.UseRealisticBlocking, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.UseRealisticBlocking));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.MaxNumberOfPlayers, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.MaxNumberOfPlayers));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.MinNumberOfPlayersForMatchStart, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.MinNumberOfPlayersForMatchStart));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.WarmupTimeLimit, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.WarmupTimeLimit));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.MapTimeLimit, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.MapTimeLimit));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.RoundTotal, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.RoundTotal));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.RoundTimeLimit, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.RoundTimeLimit));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.RoundPreparationTimeLimit, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.RoundPreparationTimeLimit));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.RespawnPeriodTeam1, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.RespawnPeriodTeam1));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.RespawnPeriodTeam2, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.RespawnPeriodTeam2));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.GoldGainChangePercentageTeam1, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.GoldGainChangePercentageTeam1));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.GoldGainChangePercentageTeam2, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.GoldGainChangePercentageTeam2));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.MinScoreToWinMatch, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.MinScoreToWinMatch));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.PollAcceptThreshold, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.PollAcceptThreshold));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.SpectatorCamera, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.SpectatorCamera));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.NumberOfBotsTeam1, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.NumberOfBotsTeam1));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.NumberOfBotsTeam2, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.NumberOfBotsTeam2));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.FriendlyFireDamageMeleeSelfPercent, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.FriendlyFireDamageMeleeSelfPercent));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.FriendlyFireDamageMeleeFriendPercent, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.FriendlyFireDamageMeleeFriendPercent));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.FriendlyFireDamageRangedSelfPercent, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.FriendlyFireDamageRangedSelfPercent));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.FriendlyFireDamageRangedFriendPercent, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.FriendlyFireDamageRangedFriendPercent));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.AutoTeamBalanceThreshold, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.AutoTeamBalanceThreshold));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.WelcomeMessage, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.WelcomeMessage));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.GamePassword, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.GamePassword));
     other.CopyOptionFromOther(MultiplayerOptions.OptionType.AdminPassword, this.GetOptionFromOptionType(MultiplayerOptions.OptionType.AdminPassword));
 }
 public void CopyAllValuesTo(
     MultiplayerOptions.MultiplayerOptionsContainer other)
 {
     this.CopyImmediateEffectValuesTo(other);
     this.CopyNewRoundValuesTo(other);
     this.CopyNewMapValuesTo(other);
 }
        public MultiplayerOptions()
        {
            this._current = new MultiplayerOptions.MultiplayerOptionsContainer();
            this._next    = new MultiplayerOptions.MultiplayerOptionsContainer();
            this._ui      = new MultiplayerOptions.MultiplayerOptionsContainer();
            MultiplayerOptions.MultiplayerOptionsContainer container = this.GetContainer();
            for (MultiplayerOptions.OptionType optionType = MultiplayerOptions.OptionType.ServerName; optionType < MultiplayerOptions.OptionType.NumOfSlots; ++optionType)
            {
                container.CreateOption(optionType);
            }
            List <MultiplayerGameTypeInfo> multiplayerGameTypes = Module.CurrentModule.GetMultiplayerGameTypes();

            if (multiplayerGameTypes.Count > 0)
            {
                MultiplayerGameTypeInfo multiplayerGameTypeInfo = multiplayerGameTypes[0];
                container.UpdateOptionValue(MultiplayerOptions.OptionType.GameType, multiplayerGameTypeInfo.GameType);
                container.UpdateOptionValue(MultiplayerOptions.OptionType.ClanMatchType, multiplayerGameTypes.First <MultiplayerGameTypeInfo>((Func <MultiplayerGameTypeInfo, bool>)(info => info.GameType == "Skirmish")).GameType);
                container.UpdateOptionValue(MultiplayerOptions.OptionType.Map, multiplayerGameTypeInfo.Scenes.First <string>());
            }
            container.UpdateOptionValue(MultiplayerOptions.OptionType.CultureTeam1, MBObjectManager.Instance.GetObjectTypeList <BasicCultureObject>()[0].StringId);
            container.UpdateOptionValue(MultiplayerOptions.OptionType.CultureTeam2, MBObjectManager.Instance.GetObjectTypeList <BasicCultureObject>()[2].StringId);
            container.UpdateOptionValue(MultiplayerOptions.OptionType.MaxNumberOfPlayers, 120);
            container.UpdateOptionValue(MultiplayerOptions.OptionType.MinNumberOfPlayersForMatchStart, 1);
            container.UpdateOptionValue(MultiplayerOptions.OptionType.WarmupTimeLimit, 5);
            container.UpdateOptionValue(MultiplayerOptions.OptionType.MapTimeLimit, 30);
            container.UpdateOptionValue(MultiplayerOptions.OptionType.RoundTimeLimit, 120);
            container.UpdateOptionValue(MultiplayerOptions.OptionType.RoundPreparationTimeLimit, 10);
            container.UpdateOptionValue(MultiplayerOptions.OptionType.RoundTotal, 20);
            container.UpdateOptionValue(MultiplayerOptions.OptionType.RespawnPeriodTeam1, 3);
            container.UpdateOptionValue(MultiplayerOptions.OptionType.RespawnPeriodTeam2, 3);
            container.UpdateOptionValue(MultiplayerOptions.OptionType.MinScoreToWinMatch, 120000);
            container.UpdateOptionValue(MultiplayerOptions.OptionType.AutoTeamBalanceThreshold, 0);
            this._current.CopyAllValuesTo(this._next);
            this._current.CopyAllValuesTo(this._ui);
        }
 private void UpdateMbMultiplayerData()
 {
     MultiplayerOptions.MultiplayerOptionsContainer container = this.GetContainer();
     container.GetOptionFromOptionType(MultiplayerOptions.OptionType.ServerName).GetValue(out MBMultiplayerData.ServerName);
     if (this.CurrentOptionsCategory == MultiplayerOptions.OptionsCategory.Default)
     {
         container.GetOptionFromOptionType(MultiplayerOptions.OptionType.GameType).GetValue(out MBMultiplayerData.GameType);
     }
     else if (this.CurrentOptionsCategory == MultiplayerOptions.OptionsCategory.ClanMatch)
     {
         container.GetOptionFromOptionType(MultiplayerOptions.OptionType.ClanMatchType).GetValue(out MBMultiplayerData.GameType);
     }
     container.GetOptionFromOptionType(MultiplayerOptions.OptionType.Map).GetValue(out MBMultiplayerData.Map);
     container.GetOptionFromOptionType(MultiplayerOptions.OptionType.MaxNumberOfPlayers).GetValue(out MBMultiplayerData.PlayerCountLimit);
 }