use of org.terasology.engine.telemetry.TelemetryEmitter in project Terasology by MovingBlocks.
the class TelemetrySubSystem method setTelemetryDestination.
private void setTelemetryDestination(Context rootContext) {
Config config = rootContext.get(Config.class);
TelemetryConfig telemetryConfig = config.getTelemetryConfig();
String telemetryDestination = telemetryConfig.getTelemetryDestination();
if (telemetryDestination != null) {
try {
URL url = new URL(telemetryDestination);
TelemetryEmitter telemetryEmitter = (TelemetryEmitter) emitter;
telemetryEmitter.changeUrl(url);
} catch (MalformedURLException e) {
logger.error("URL malformed", e);
}
} else {
telemetryConfig.setTelemetryDestination(TelemetryEmitter.getDefaultCollectorURL(DEFAULT_COLLECTOR_PROTOCOL, DEFAULT_COLLECTOR_HOST, DEFAULT_COLLECTOR_PORT).toString());
}
}
use of org.terasology.engine.telemetry.TelemetryEmitter in project Terasology by MovingBlocks.
the class TelemetrySubSystem method shutdown.
@Override
public void shutdown() {
// shutdown emitter
TelemetryEmitter telemetryEmitter = (TelemetryEmitter) emitter;
telemetryEmitter.close();
}
Aggregations