+ Added lua hot reload functionality
This commit is contained in:
+4
-2
@@ -86,7 +86,8 @@ public class Main extends ListenerAdapter
|
||||
RPManager.instance.addLine(channel, user, input);
|
||||
|
||||
// Run any pre-emptive upkeep we need to
|
||||
Superintendent.perCommandUpkeepPre();
|
||||
if(!Superintendent.perCommandUpkeepPre(pluginManager))
|
||||
return;
|
||||
|
||||
// Attempt to spin up a command. If the command doesn't exist.
|
||||
// Run plugins right before invoking the commands but after all other setup.
|
||||
@@ -111,6 +112,7 @@ public class Main extends ListenerAdapter
|
||||
}
|
||||
|
||||
// Run any upkeep in post we need to
|
||||
Superintendent.perCommandUpkeepPost(kittyCore, databaseManager);
|
||||
if(!Superintendent.perCommandUpkeepPost(kittyCore, databaseManager))
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import core.Config;
|
||||
import core.DatabaseManager;
|
||||
import core.RPManager;
|
||||
import core.Stats;
|
||||
import core.lua.PluginManager;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyCore;
|
||||
import dataStructures.KittyGuild;
|
||||
@@ -71,11 +72,13 @@ public class Superintendent
|
||||
|
||||
// Only called once per command. Good for lazily updating.
|
||||
// Happens just before the command / plugin runs.
|
||||
public static boolean perCommandUpkeepPre()
|
||||
public static boolean perCommandUpkeepPre(PluginManager pluginManager)
|
||||
{
|
||||
// Upkeep the config file monitoring
|
||||
Config.instance.upkeep();
|
||||
pluginManager.update();
|
||||
|
||||
// Return if we succeeded or not. At this time, we always succeed.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user