Skip to content

Commit

Permalink
Fixed plugins that reacted to events crashing on load. Closes #2. Als…
Browse files Browse the repository at this point in the history
…o refactored where the plugins are loaded to make sure this does not happen again.
  • Loading branch information
n42k committed Sep 13, 2019
1 parent 88cb070 commit 4396de0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions brikkit.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ class Brikkit {
if(process.env.DEV === 'TRUE')
this._developmentMode();

this._pluginSystem = new PluginSystem();
this._pluginSystem.loadAllPlugins();

// make an object entry for each type of event
this._callbacks = {};
for(const eventKey of Object.keys(Event)) {
Expand All @@ -35,10 +32,12 @@ class Brikkit {
this._stateMachineJoin = new StateMachineJoin();

this._scraper = new Scraper();
this._pluginSystem = new PluginSystem();

this._brickadia.on('out', line => this._handleBrickadiaLine(line));

this._terminal = new Terminal();

}

/*
Expand Down
3 changes: 2 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ require('dotenv').config({
path: 'brikkit.conf'
});

const Brikkit = new (require('./brikkit.js'))();
const Brikkit = new (require('./brikkit.js'))();
Brikkit.getPluginSystem().loadAllPlugins();

0 comments on commit 4396de0

Please sign in to comment.