コード例 #1
0
        private static void CMInvoke()
        {
            PvPBattle.Bind();
            BattleNotoriety.Enable();

            var scenarios = new List <PvPScenario>();

            foreach (var type in BattleTypes.Where(t => t != null))
            {
                VitaNexCore.TryCatch(
                    () =>
                {
                    var battle = type.CreateInstanceSafe <PvPBattle>();

                    if (battle == null)
                    {
                        throw new Exception("PvPBattle Type could not be constructed, requires a constructor with 0 arguments.");
                    }

                    PvPScenario scenario = battle;
                    scenarios.Add(scenario);
                    battle.Delete();

                    CMOptions.ToConsole("Created scenario ({0}) '{1}'", scenario.TypeOf.Name, scenario.Name);
                },
                    CMOptions.ToConsole);
            }

            Scenarios = scenarios.ToArray();
            scenarios.Clear();

            foreach (var battle in Battles.Values.Where(b => b != null && !b.Deleted).ToArray())
            {
                VitaNexCore.TryCatch(
                    battle.Init,
                    ex =>
                {
                    VitaNexCore.TryCatch(battle.Delete);

                    CMOptions.ToConsole("Failed to initialize battle #{0} '{1}'", battle.Serial, battle.Name);
                    CMOptions.ToConsole(ex);
                });
            }

            foreach (var profile in Profiles.Values.Where(p => p != null && !p.Deleted).ToArray())
            {
                VitaNexCore.TryCatch(
                    profile.Init,
                    ex =>
                {
                    VitaNexCore.TryCatch(profile.Delete);

                    CMOptions.ToConsole("Failed to initialize profile #{0} '{1}'", profile.Owner.Serial.Value, profile.Owner.RawName);
                    CMOptions.ToConsole(ex);
                });
            }
        }
コード例 #2
0
 private static void CMEnabled()
 {
     SeasonSchedule.OnGlobalTick += ChangeSeason;
     BattleNotoriety.Enable();
 }
コード例 #3
0
 private static void CMEnabled()
 {
     PvPBattle.Bind();
     BattleNotoriety.Enable();
 }
コード例 #4
0
ファイル: AutoPvP_Init.cs プロジェクト: AllanNisbet/runuo
 private static void CMEnabled()
 {
     BattleNotoriety.Enable();
 }