/// <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); } }
/// <inheritdoc /> protected override void OnInitializing(OsServiceConfiguration serviceConfiguration) { base.OnInitializing(serviceConfiguration); Process.Configure(serviceConfiguration); Operator.Configure(serviceConfiguration); }
private void ConfigureInternal(OsServiceConfiguration configuration) { _serverConfiguration = new ServerConfiguration(configuration); _ivFactory = CreateRollingIvFactory(); _acceptor = CreateSocketAcceptor(); }
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); }
/// <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); }
protected override void OnInitializing(OsServiceConfiguration serviceConfiguration) { base.OnInitializing(serviceConfiguration); _worldConfiguration = new WorldConfiguration(serviceConfiguration); WorldId = _worldConfiguration.WorldId; _info = _worldInfoProvider.GetWorldById(WorldId); }
/// <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; }
/// <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); }
/// <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(); } }
/// <summary> /// Executed when the server is being initialized. /// </summary> protected virtual void OnInitializing(OsServiceConfiguration serviceConfiguration) { }
/// <inheritdoc /> public void Initialize(OsServiceConfiguration serviceConfiguration) { OnInitializing(serviceConfiguration); }
/// <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"); }
/// <inheritdoc /> public AuthConfiguration(OsServiceConfiguration configuration) : base(configuration) { }
private Task GetInitializeTask(OsServiceConfiguration serviceConfiguration) { return(SetNewTaskIfNecessary(ref _initializeTask, () => OnInitializing(serviceConfiguration), CompleteInitialization)); }
/// <inheritdoc /> public void Initialize(OsServiceConfiguration serviceConfiguration) { this.OnInitializing(serviceConfiguration); }
/// <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); } }
private void ConfigureInternal(OsServiceConfiguration configuration) { this.serverConfiguration = new ServerConfiguration(configuration); this.ivFactory = this.CreateRollingIvFactory(); this.acceptor = this.CreateSocketAcceptor(); }
/// <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"); }
/// <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"); }
/// <inheritdoc /> public override void Configure(OsServiceConfiguration configuration) { _authConfiguration = new AuthConfiguration(configuration); }
/// <inheritdoc /> public override void Configure(OsServiceConfiguration configuration) { _channelConfiguration = new ChannelConfiguration(configuration); SetUp(); }
/// <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"); }
/// <inheritdoc /> public abstract void Configure(OsServiceConfiguration configuration);