public ShardServer(IWhisperComposerFactory <ShardRequest> composerFactory, IRandomSource randomSource, IWhisperDatasource wauth, IWhisperDatasource wshard, World world, Game.World.Shard shard, ShardConfig configuration) : base(composerFactory) { AppConfig = configuration; SecureRandom = randomSource; AuthDB = wauth; ShardDB = wshard; World = world; Shard = shard; }
public static void Main(string[] args) { using (IWindsorContainer container = new WindsorContainer()) { XmlConfigurator.Configure(new FileInfo(args.Length < 2 ? LogConfigurationFile : args[1])); ShardConfig config = new ShardConfig(); config.Initialize(new ConfigurationFileConfigurationProvider <ShardConfig>() { ConfigurationFile = args.Length < 1 ? ConfigurationFile : args[0], ConfigurationSection = ConfigurationSection }); container.Register(Component.For <ShardConsole>()); container.Register(Component.For <ShardConfig>().Instance(config)); container.Register(Component.For <IRandomSource>().ImplementedBy <SecureRandom>()); container.Register(Component.For <IWhisperComposerFactory <ShardRequest> >().ImplementedBy <ShardComposerFactory>()); container.Register(Component.For <IWhisperRequestFactory <ShardRequest, ShardClientOpcode> >().ImplementedBy <ShardRequestFactory>()); container.Register(Component.For <ShardServer>() .DependsOn(Dependency.OnValue("wauth", new Datasource(config.AuthDatabaseAddress, config.AuthDatabasePort, config.AuthDatabaseName, config.AuthDatabaseUser, config.AuthDatabasePassword))) .DependsOn(Dependency.OnValue("wshard", new Datasource(config.ShardDatabaseAddress, config.ShardDatabasePort, config.ShardDatabaseName, config.ShardDatabaseUser, config.ShardDatabasePassword))) ); container.Register(Component.For <World>() .DependsOn(Dependency.OnValue("wworld", new Datasource(config.WorldDatabaseAddress, config.WorldDatabasePort, config.WorldDatabaseName, config.WorldDatabaseUser, config.WorldDatabasePassword))) ); container.Register(Component.For <Game.World.Shard>()); ServerConfig serverConfig = new ServerConfig(); serverConfig.Ip = config.ShardDaemonBindAddress; serverConfig.Port = config.ShardDaemonBindPort; serverConfig.MaxRequestLength = 2048; serverConfig.Mode = SocketMode.Tcp; serverConfig.IdleSessionTimeOut = 62; ShardConsole console = container.Resolve <ShardConsole>(); console.Server.Setup(serverConfig); console.Server.Start(); console.Run(); console.Server.Stop(); } }
public ShardPinger(IWhisperDatasource wauth, ShardConfig config) { this.config = config; authDatasource = wauth; }
public ShardUpdater(ShardServer server, ShardConfig config) { this.server = server; this.config = config; }