public ModuleManagerImpl(Config config, List<Class<?>> classesOnClasspathsToAddToEngine) { this(config.getNetwork().getMasterServer(), classesOnClasspathsToAddToEngine); }
public NetworkSystemImpl(Time time, Context context) { this.time = time; this.config = context.get(Config.class).getNetwork(); this.hibernationSettings = Optional.ofNullable(context.get(HibernationManager.class)); }
@Override public boolean step() { try { Config config = context.get(Config.class); int port = config.getNetwork().getServerPort(); context.get(NetworkSystem.class).host(port, dedicated); } catch (HostingFailedException e) { context.get(NUIManager.class).pushScreen(MessagePopup.ASSET_URI, MessagePopup.class).setMessage("Failed to Host", e.getMessage() + " - Reverting to single player"); } return true; }
@Override public void preInitialise(Context rootContext) { config = new Config(rootContext); config.load(); FlexibleConfigManager flexibleConfigManager = new FlexibleConfigManagerImpl(); rootContext.put(FlexibleConfigManager.class, flexibleConfigManager); // TODO: Update rendering config description FlexibleConfig renderingFlexibleConfig = new FlexibleConfigImpl("Rendering Config"); flexibleConfigManager.addConfig(new SimpleUri("engine:rendering"), renderingFlexibleConfig); flexibleConfigManager.loadAllConfigs(); // Add settings to RenderingFC String serverPortProperty = System.getProperty(SERVER_PORT_PROPERTY); if (serverPortProperty != null) { try { config.getNetwork().setServerPort(Integer.parseInt(serverPortProperty)); } catch (NumberFormatException e) { logger.error("Failed to set server port to invalid value: {}", serverPortProperty); } } if (Iterables.isEmpty(config.getDefaultModSelection().listModules())) { config.getDefaultModSelection().addModule(TerasologyConstants.CORE_GAMEPLAY_MODULE); } checkServerIdentity(); // TODO: Move to display subsystem logger.info("Video Settings: {}", config.renderConfigAsJson(config.getRendering())); rootContext.put(Config.class, config); //add facades rootContext.put(InputDeviceConfiguration.class, new InputDeviceConfigurationImpl(config)); rootContext.put(BindsConfiguration.class, new BindsConfigurationImpl(config)); }
config.getNetwork().addServerInfo(item); visibleList.setSelection(item); }); ServerInfo info = visibleList.getSelection(); if (info != null) { config.getNetwork().removeServerInfo(info); extInfo.remove(info); visibleList.setSelection(null);
downloader = new ServerListDownloader(config.getNetwork().getMasterServer()); customServerList.setList(config.getNetwork().getServerInfos()); configureServerList(customServerList);