Esempio n. 1
0
        public ServerNetworkService(ILogger logger,
                                    IEngineService engineService,
                                    IServerSettingsService settingsService,
                                    IModuleService moduleService,
                                    IPathService pathService,
                                    IDataService dataService)
        {
            _logger               = logger;
            _engineService        = engineService;
            _settingsService      = settingsService;
            _moduleService        = moduleService;
            _pathService          = pathService;
            _dataService          = dataService;
            _usernameToConnection = new Dictionary <string, NetConnection>();
            _connectionToUsername = new Dictionary <NetConnection, string>();

            _boundPacketActions = new Dictionary <string, Tuple <Type, Action <string, PacketBase> > >();
        }
Esempio n. 2
0
 public ServerGameService(
     EntityWorld world,
     IServerSettingsService settingsService,
     IScriptService scriptService,
     IDataService dataService,
     IAppService appService,
     IServerNetworkService networkService,
     IScreenService screenService,
     IObjectMapper objectMapper,
     ISystemLoader systemLoader)
 {
     _world = world;
     _settingsService = settingsService;
     _scriptService = scriptService;
     _dataService = dataService;
     _appService = appService;
     _networkService = networkService;
     _screenService = screenService;
     _objectMapper = objectMapper;
     _systemLoader = systemLoader;
 }
Esempio n. 3
0
        protected override void Initialize()
        {
            ServerIOCConfig.Initialize(this);

            // Any data from the GUI thread needed for the logic thread
            // needs to be copied here.
            _settingsService = ServerIOCConfig.Resolve <IServerSettingsService>();
            _settingsService.CopySettings(_initialSettings);

            _moduleService = ServerIOCConfig.Resolve <IModuleService>();
            _moduleService.OpenModule(_moduleName);

            _gameService = ServerGameFactory.GetServerGameService();
            _gameService.Initialize(_graphics);

            _networkService = ServerIOCConfig.Resolve <IServerNetworkService>();
            _networkService.OnPlayerConnected    += PlayerConnected;
            _networkService.OnPlayerDisconnected += PlayerDisconnected;


            base.Initialize();
        }
Esempio n. 4
0
 public ServerScreen(EntityWorld world,
                     IEntityFactory entityFactory,
                     IServerNetworkService networkService,
                     IModuleService moduleService,
                     IModuleDataService moduleDataService,
                     IScriptService scriptService,
                     IDataService dataService,
                     IPathService pathService,
                     ILogger logger,
                     IServerSettingsService settingsService)
 {
     _world             = world;
     _entityFactory     = entityFactory;
     _networkService    = networkService;
     _moduleService     = moduleService;
     _moduleDataService = moduleDataService;
     _scriptService     = scriptService;
     _dataService       = dataService;
     _pathService       = pathService;
     _logger            = logger;
     _settingsService   = settingsService;
 }