openkore icon indicating copy to clipboard operation
openkore copied to clipboard

Changes to plugin loading functions

Open Henrybk opened this issue 9 years ago • 6 comments

New functions: getPluginsFiles getCondition unloadByRegexp unloadPlugins loadByRegexp loadPlugins reloadByRegexp reloadAll reloadPlugins

Also changed Commands.pm accordingly

Henrybk avatar Dec 24 '16 23:12 Henrybk

@Henrybk Can you explain why these changes were made and how they should be tested? :+1:

itsrachelfish avatar Jan 13 '17 06:01 itsrachelfish

I made these changes based on the files loading functions, they can be tested by just loading, unloading and reloading some plugins, I tested it and found no errors.

Henrybk avatar Jan 13 '17 14:01 Henrybk

Alright, hold the phone on this one. @Henrybk It looks like there's a bug in your code which prevents plugins from being loaded manually. Using the current code in the master branch, I can force load a plugin even if it's not enabled in sys.txt.

This is the current behavior:

plugin
-------------------------- Currently loaded plugins ---------------------------
#   Name                 Description
0   macro                allows usage of macros
1   profiles             Profiles Selector
2   breakTime            Automatically disconnect and reconnect at certain time
-------------------------------------------------------------------------------
plugin load plugins/buffplease.pl
Loading plugin plugins/buffplease.pl...
plugin
-------------------------- Currently loaded plugins ---------------------------
#   Name                 Description
0   macro                allows usage of macros
1   profiles             Profiles Selector
2   breakTime            Automatically disconnect and reconnect at certain time
3   Buff Please?         Buff people when they ask
-------------------------------------------------------------------------------

As you can see, the 3 plugins defined in sys.txt are loaded by default and I can load other plugins manually.

However, when I try to do the same thing using your branch, this happens:

plugin load plugins/buffplease.pl
Selectively loading plugins...
plugin
-------------------------- Currently loaded plugins ---------------------------
#   Name                 Description
0   macro                allows usage of macros
1   profiles             Profiles Selector
2   breakTime            Automatically disconnect and reconnect at certain time
-------------------------------------------------------------------------------

itsrachelfish avatar Jan 19 '17 09:01 itsrachelfish

@Henrybk will you have time to address @itsrachelfish concerns?

kaliwanagan avatar Jul 11 '17 10:07 kaliwanagan

Yeah, next week I'll be on vacation and will take a look at it.

Henrybk avatar Jul 11 '17 10:07 Henrybk

@Henrybk do you have free time to fix the error reported?

Nipodemos avatar Sep 23 '18 11:09 Nipodemos

@Henrybk do you have free time to fix the error reported?

I fixed it:

start.exe --no-connect

plugin
-------------------------- Currently loaded plugins ---------------------------
#   Name                 Description
0   macro                allows usage of macros
-------------------------------------------------------------------------------
plugin load event
Loading plugin plugins/eventMacro/eventMacro.pl...
plugin
-------------------------- Currently loaded plugins ---------------------------
#   Name                 Description
0   macro                allows usage of macros
1   eventMacro           allows usage of eventMacros
-------------------------------------------------------------------------------

ya4ept avatar Aug 21 '22 16:08 ya4ept

Updated documentation: https://openkore.com/wiki/plugin

ya4ept avatar Aug 21 '22 17:08 ya4ept

Automatic load - ok: image

Manual load - ok: image

Manual reload - ok: image

Manual unload - ok: image

Manual reload all - ok: image

Manual unload all - ok: image

manual load all - ok: image

alisonrag avatar Aug 21 '22 17:08 alisonrag