Beispiel #1
0
        protected void Startup()
        {
            SetupListeners();
            Jail.ReleasePlayer += Jail_ReleasePlayer;
            Jail.Setup(State);

            GameState = new GamePlayZone(State);
            GameState.PlayerPreAdd += GameState_PlayerPreAdd;
        }
Beispiel #2
0
        // World Contents

        public Server(ServerConfig cfg)
        {
            NetworkMessage.IsOnServer = true;

            if (cfg.LogFile == string.Empty)
            {
                cfg.LogFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "default_log.txt");
            }

            Logger.SetLogFilePath(cfg.LogFile);
            Logger.LogLevel = cfg.LogLevel;

            Logger.Log0("Server startup");

            ConfigData = cfg;

            State.Init(ConfigData);

            State.Players.ServerHost = this;

            SetTeamSelector(null);

            SetupAPI();
            SetupConfig();
            SetupBZDB();
            SetupWorld();
            UpdatePublicListServer();

            SecurityArea = new RestrictedAccessZone(ConfigData);
            SecurityArea.PromotePlayer += SecurityArea_PromotePlayer;
            SecurityArea.Set(State);

            StagingArea = new StagingZone(ConfigData);
            StagingArea.PromotePlayer += this.StagingArea_PromotePlayer;
            StagingArea.Set(State);

            GameZone = new GamePlayZone(this);
            GameZone.UpdatePublicListServer += new EventHandler((s, e) => UpdatePublicListServer());
            GameZone.Set(State);

            RegisterProcessorEvents();
        }