Merge pull request #612 from Ylianst/revert-610-plugin

Revert "Expand PluginHandler to Support Periodic Updates"
This commit is contained in:
Ylian Saint-Hilaire 2019-10-28 09:20:24 -07:00 committed by GitHub
commit 011651b349
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 7 deletions

View File

@ -2573,7 +2573,7 @@ function createMeshCore(agent) {
if ((meshCoreObj.av == null) || (JSON.stringify(meshCoreObj.av) != JSON.stringify(av))) { meshCoreObj.av = av; mesh.SendCommand(meshCoreObj); }
}
mesh.SendCommand({ action: "plugin", plugin: "__all", hook: "sendPeriodicServerUpdate"});
// TODO: add plugin hook here
}

View File

@ -2517,7 +2517,7 @@ function createMeshCore(agent) {
if ((meshCoreObj.av == null) || (JSON.stringify(meshCoreObj.av) != JSON.stringify(av))) { meshCoreObj.av = av; mesh.SendCommand(meshCoreObj); }
}
mesh.SendCommand({ action: "plugin", plugin: "__all", hook: "sendPeriodicServerUpdate"});
// TODO: add plugin hook here
}

View File

@ -1278,11 +1278,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
if (typeof command.plugin != 'string') break;
try {
var pluginHandler = require('./pluginHandler.js').pluginHandler(parent.parent);
if (command.plugin == '__all') {
pluginHandler.callHook(command.hook, command, obj, parent);
} else {
pluginHandler.plugins[command.plugin].serveraction(command, obj, parent);
}
} catch (e) {
console.log('Error loading plugin handler (' + e + ')');
}