コード例 #1
0
        /// <inheritdoc/>
        public void Configure(OsServiceConfiguration configuration)
        {
            if (IsRunning)
            {
                throw GetServerAlreadyRunningException();
            }

            ConfigureInternal(configuration);

            _isConfigured = true;
            if (_serverConfiguration.Subversion == "")
            {
                _logger.Info(
                    @"Configured as version {0}, locale {1}.",
                    _serverConfiguration.Version,
                    _serverConfiguration.LocaleId);
            }
            else
            {
                _logger.Info(
                    @"Configured as version {0}.{1}, locale {2}.",
                    _serverConfiguration.Version,
                    _serverConfiguration.Subversion,
                    _serverConfiguration.LocaleId);
            }
        }
コード例 #2
0
        /// <inheritdoc />
        protected override void OnInitializing(OsServiceConfiguration serviceConfiguration)
        {
            base.OnInitializing(serviceConfiguration);

            Process.Configure(serviceConfiguration);
            Operator.Configure(serviceConfiguration);
        }
コード例 #3
0
        private void ConfigureInternal(OsServiceConfiguration configuration)
        {
            _serverConfiguration = new ServerConfiguration(configuration);

            _ivFactory = CreateRollingIvFactory();
            _acceptor  = CreateSocketAcceptor();
        }
コード例 #4
0
ファイル: WorldServer.cs プロジェクト: shoftee/OpenStory
        protected override void OnInitializing(OsServiceConfiguration serviceConfiguration)
        {
            base.OnInitializing(serviceConfiguration);

            this.worldConfiguration = new WorldConfiguration(serviceConfiguration);

            this.WorldId = this.worldConfiguration.WorldId;
            this.info = this.worldInfoProvider.GetWorldById(this.WorldId);
        }
コード例 #5
0
        /// <inheritdoc />
        public Guid RegisterService(OsServiceConfiguration configuration)
        {
            var token = Guid.NewGuid();

            _configurations.Add(token, configuration);
            _logger.Info("Service registered. Token authorized: {0:N}", token);

            return(token);
        }
コード例 #6
0
        protected override void OnInitializing(OsServiceConfiguration serviceConfiguration)
        {
            base.OnInitializing(serviceConfiguration);

            _worldConfiguration = new WorldConfiguration(serviceConfiguration);

            WorldId = _worldConfiguration.WorldId;
            _info   = _worldInfoProvider.GetWorldById(WorldId);
        }
コード例 #7
0
ファイル: RegistryService.cs プロジェクト: shoftee/OpenStory
        /// <inheritdoc />
        public Guid RegisterService(OsServiceConfiguration configuration)
        {
            var token = Guid.NewGuid();

            this.configurations.Add(token, configuration);
            this.logger.Info("Service registered. Token authorized: {0:N}", token);

            return token;
        }
コード例 #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ServerConfiguration"/> class.
        /// </summary>
        /// <param name="configuration">The object containing the configuration values.</param>
        public ServerConfiguration(OsServiceConfiguration configuration)
        {
            this.Endpoint = configuration.Get<IPEndPoint>("Endpoint", true);

            this.Header = configuration.GetValue<ushort>("Header");
            this.Version = configuration.Get<ushort>("Version", true);
            this.Subversion = configuration.Get<string>("Subversion", true);
            this.LocaleId = configuration.Get<byte>("LocaleId", true);
        }
コード例 #9
0
        /// <inheritdoc />
        public void Initialize(OsServiceConfiguration serviceConfiguration)
        {
            SubscribeForStates(
                _initializeSubscribers,
                _serviceState,
                ServiceState.NotInitialized,
                ServiceState.Initializing);

            if (_serviceState != ServiceState.NotInitialized)
            {
                return;
            }

            HandleStateChange(_serviceState, ServiceState.Initializing);

            var task = GetInitializeTask(serviceConfiguration);

            if (task.Status == TaskStatus.Created)
            {
                task.Start();
            }
        }
コード例 #10
0
 /// <summary>
 /// Executed when the server is being initialized.
 /// </summary>
 protected virtual void OnInitializing(OsServiceConfiguration serviceConfiguration)
 {
 }
コード例 #11
0
 /// <inheritdoc />
 public void Initialize(OsServiceConfiguration serviceConfiguration)
 {
     OnInitializing(serviceConfiguration);
 }
コード例 #12
0
ファイル: GameServerBase.cs プロジェクト: shoftee/OpenStory
 /// <summary>
 /// Executed when the server is being initialized.
 /// </summary>
 protected virtual void OnInitializing(OsServiceConfiguration serviceConfiguration)
 {
 }
コード例 #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WorldConfiguration"/> class.
 /// </summary>
 /// <param name="configuration"><inheritdoc /></param>
 public WorldConfiguration(OsServiceConfiguration configuration)
 {
     WorldId = configuration.Get <int>("World");
 }
コード例 #14
0
 /// <inheritdoc />
 public AuthConfiguration(OsServiceConfiguration configuration)
     : base(configuration)
 {
 }
コード例 #15
0
 private Task GetInitializeTask(OsServiceConfiguration serviceConfiguration)
 {
     return(SetNewTaskIfNecessary(ref _initializeTask, () => OnInitializing(serviceConfiguration), CompleteInitialization));
 }
コード例 #16
0
ファイル: GameServerBase.cs プロジェクト: shoftee/OpenStory
 /// <inheritdoc />
 public void Initialize(OsServiceConfiguration serviceConfiguration)
 {
     this.OnInitializing(serviceConfiguration);
 }
コード例 #17
0
ファイル: ServerProcess.cs プロジェクト: shoftee/OpenStory
        /// <inheritdoc/>
        public void Configure(OsServiceConfiguration configuration)
        {
            if (this.IsRunning)
            {
                throw GetServerAlreadyRunningException();
            }

            this.ConfigureInternal(configuration);

            this.isConfigured = true;
            if (this.serverConfiguration.Subversion == "")
            {
                this.logger.Info(
                    @"Configured as version {0}, locale {1}.",
                    this.serverConfiguration.Version,
                    this.serverConfiguration.LocaleId);
            }
            else
            {
                this.logger.Info(
                    @"Configured as version {0}.{1}, locale {2}.",
                    this.serverConfiguration.Version,
                    this.serverConfiguration.Subversion,
                    this.serverConfiguration.LocaleId);
            }
        }
コード例 #18
0
ファイル: ServerProcess.cs プロジェクト: shoftee/OpenStory
        private void ConfigureInternal(OsServiceConfiguration configuration)
        {
            this.serverConfiguration = new ServerConfiguration(configuration);

            this.ivFactory = this.CreateRollingIvFactory();
            this.acceptor = this.CreateSocketAcceptor();
        }
コード例 #19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WorldConfiguration"/> class.
 /// </summary>
 /// <param name="configuration"><inheritdoc /></param>
 public WorldConfiguration(OsServiceConfiguration configuration)
 {
     this.WorldId = configuration.Get<int>("World");
 }
コード例 #20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChannelConfiguration"/> class.
 /// </summary>
 /// <param name="configuration"><inheritdoc /></param>
 public ChannelConfiguration(OsServiceConfiguration configuration)
     : base(configuration)
 {
     ChannelId = configuration.Get <int>("Channel");
 }
コード例 #21
0
 /// <inheritdoc />
 public override void Configure(OsServiceConfiguration configuration)
 {
     _authConfiguration = new AuthConfiguration(configuration);
 }
コード例 #22
0
 /// <inheritdoc />
 public override void Configure(OsServiceConfiguration configuration)
 {
     _channelConfiguration = new ChannelConfiguration(configuration);
     SetUp();
 }
コード例 #23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChannelConfiguration"/> class.
 /// </summary>
 /// <param name="configuration"><inheritdoc /></param>
 public ChannelConfiguration(OsServiceConfiguration configuration)
     : base(configuration)
 {
     this.ChannelId = configuration.Get<int>("Channel");
 }
コード例 #24
0
 /// <inheritdoc />
 public AuthConfiguration(OsServiceConfiguration configuration)
     : base(configuration)
 {
 }
コード例 #25
0
 /// <inheritdoc />
 public abstract void Configure(OsServiceConfiguration configuration);