diff --git a/core/src/main/groovy/com/muwire/core/Core.groovy b/core/src/main/groovy/com/muwire/core/Core.groovy index a079c4a8..386c317b 100644 --- a/core/src/main/groovy/com/muwire/core/Core.groovy +++ b/core/src/main/groovy/com/muwire/core/Core.groovy @@ -279,10 +279,13 @@ public class Core { log.info("initializing cache client") cacheClient = new CacheClient(eventBus,hostCache, connectionManager, i2pSession, props, 10000) + if (!props.plugin) { log.info("initializing update client") - updateClient = new UpdateClient(eventBus, i2pSession, myVersion, props, fileManager, me, spk) - eventBus.register(FileDownloadedEvent.class, updateClient) - eventBus.register(UIResultBatchEvent.class, updateClient) + updateClient = new UpdateClient(eventBus, i2pSession, myVersion, props, fileManager, me, spk) + eventBus.register(FileDownloadedEvent.class, updateClient) + eventBus.register(UIResultBatchEvent.class, updateClient) + } else + log.info("running as plugin, not initializing update client") log.info("initializing connector") I2PConnector i2pConnector = new I2PConnector(socketManager) diff --git a/core/src/main/groovy/com/muwire/core/MuWireSettings.groovy b/core/src/main/groovy/com/muwire/core/MuWireSettings.groovy index 71d1f7c6..b820ce1e 100644 --- a/core/src/main/groovy/com/muwire/core/MuWireSettings.groovy +++ b/core/src/main/groovy/com/muwire/core/MuWireSettings.groovy @@ -41,6 +41,7 @@ class MuWireSettings { int meshExpiration int speedSmoothSeconds boolean embeddedRouter + boolean plugin int inBw, outBw Set watchedKeywords Set watchedRegexes @@ -76,6 +77,7 @@ class MuWireSettings { hostRejectInterval = Integer.valueOf(props.getProperty("hostRejectInterval", "1")) meshExpiration = Integer.valueOf(props.getProperty("meshExpiration","60")) embeddedRouter = Boolean.valueOf(props.getProperty("embeddedRouter","false")) + plugin = Boolean.valueOf(props.getProperty("plugin","false")) inBw = Integer.valueOf(props.getProperty("inBw","256")) outBw = Integer.valueOf(props.getProperty("outBw","128")) searchComments = Boolean.valueOf(props.getProperty("searchComments","true")) @@ -130,6 +132,7 @@ class MuWireSettings { props.setProperty("hostRejectInterval", String.valueOf(hostRejectInterval)) props.setProperty("meshExpiration", String.valueOf(meshExpiration)) props.setProperty("embeddedRouter", String.valueOf(embeddedRouter)) + props.setProperty("plugin", String.valueOf(plugin)) props.setProperty("inBw", String.valueOf(inBw)) props.setProperty("outBw", String.valueOf(outBw)) props.setProperty("searchComments", String.valueOf(searchComments)) diff --git a/webui/src/main/java/com/muwire/webui/MuWireClient.java b/webui/src/main/java/com/muwire/webui/MuWireClient.java index 1427f4d5..52f9c082 100644 --- a/webui/src/main/java/com/muwire/webui/MuWireClient.java +++ b/webui/src/main/java/com/muwire/webui/MuWireClient.java @@ -110,6 +110,7 @@ public class MuWireClient { settings.setNickname(nickname); settings.setDownloadLocation(downloadLocation); settings.setIncompleteLocation(incompleteLocation); + settings.setPlugin(true); PrintWriter pw = new PrintWriter(mwProps, "UTF-8"); settings.write(pw);