コード例 #1
0
        public void Init()
        {
            if (Initialized)
            {
                return;
            }

            InvalidateRegions();
            RegisterSubCommands();

            BattleNotoriety.RegisterNotorietyHandler(this, NotorietyHandler);
            BattleNotoriety.RegisterAllowBeneficialHandler(this, AllowBeneficial);
            BattleNotoriety.RegisterAllowHarmfulHandler(this, AllowHarmful);

            EventSink.Shutdown += ServerShutdownHandler;
            EventSink.Logout   += LogoutHandler;
            EventSink.Login    += LoginHandler;

            _CoreTimer = PollTimer.FromSeconds(1.0, OnCoreTick, () => Initialized && !_StateTransition);

            Schedule.OnGlobalTick += OnScheduleTick;

            Teams.Where(team => team != null && !team.Deleted).ForEach(team => team.Init());

            OnInit();

            Initialized = true;

            if (!Validate())
            {
                State = PvPBattleState.Internal;
            }
        }