Skip to content

Commit

Permalink
feat(p2p): publish manticore info
Browse files Browse the repository at this point in the history
  • Loading branch information
DEgITx committed Jun 3, 2023
1 parent 8e7bb74 commit 9d17fd2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/background/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ app.on("ready", async () => {
}
callback.apply(null, arg)
})
}, app.getPath("userData"), app.getVersion(), env.name)
}, app.getPath("userData"), app.getVersion(), env.name, sphinx)

// load page only after init app
spider.initialized.then(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/background/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const start = async () =>
dbPatcher(() => {
spider = new spiderCall((...data) => io.sockets.emit(...data), (message, callback) => {
socketMessages[message] = callback
}, path.resolve(packageJson.serverDataDirectory), packageJson.version, 'production')
}, path.resolve(packageJson.serverDataDirectory), packageJson.version, 'production', sphinx)
}, null, sphinx)
}, path.resolve(packageJson.serverDataDirectory), () => {}))
}
Expand Down
6 changes: 6 additions & 0 deletions src/background/sphinx.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,12 @@ module.exports = async (callback, dataDirectory, onClose, params = {}) => {
{
needConvertation = true;
}

let manticoreVersion;
if (!sphinx.version && (manticoreVersion = /Manticore ([0-9\.]+)/.exec(data))) {
sphinx.version = manticoreVersion[1];
logT('sphinx', 'sphinx version', sphinx.version);
}

if(windowsEncodingFix && data.includes('failed to parse config file'))
{
Expand Down
4 changes: 3 additions & 1 deletion src/background/spider.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const mime = require('mime');
//server.listen(config.httpPort);
//console.log('Listening web server on', config.httpPort, 'port')

module.exports = function (send, recive, dataDirectory, version, env)
module.exports = function (send, recive, dataDirectory, version, env, {version: manticoreVersion})
{
this.initialized = (async () =>
{
Expand Down Expand Up @@ -135,6 +135,8 @@ module.exports = function (send, recive, dataDirectory, version, env)
p2p.info.filesSize = 0;
}

p2p.info.manticoreVersion = manticoreVersion;

if(filesInfo && filesInfo[0])
{
filesInfo = filesInfo[0]
Expand Down

0 comments on commit 9d17fd2

Please sign in to comment.