EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Quests (https://www.eqemulator.org/forums/forumdisplay.php?f=624)
-   -   plugin success / failure (https://www.eqemulator.org/forums/showthread.php?t=12201)

smogo 02-28-2004 10:17 AM

plugin success / failure
 
I'm having difficulties with plugins.
Zone seems to load them from the plugins/*.pl sometimes, sometimes not.
Also, loading chokes one some script errors, not on others.

Anyone post information about status, thanks in advance.

samandhi 02-28-2004 01:41 PM

Quote:

Zone seems to load them from the plugins/*.pl sometimes, sometimes not.
Is it random which ones do and which ones dont? Or is it constant which ones dont?

smogo 02-28-2004 01:51 PM

it's still hard to say. Pretty random anyway.

./plugin.pl always gets loaded fine.

./plugin/*.pl, well, sometimes all succed, sometimes a group, but generally at least one ot two always get loaded. Still i can't guess the rule.

I suspect there is an error in one script (at least something the embparser does not like), and after that, it loads no more. It might be the readdir function used to parse directory that makes it random, that retrieves filenames one at a time. Duno if it's sorted on name, modification time, creation time, ...

smogo 02-29-2004 10:15 AM

got it !

the file loading uses cache, to check if a package (read 'npc quest') was already loaded. It does the same for plugin files. So, it doesn't load the file if it is older than the previously loaded plugin file.

Correcting this in the embperl.cpp file :
Code:

@@ -93,7 +94,7 @@
                        "my($package, $filename) = @_;"
                        "$filename=~s/\'//g;"
                        "my $mtime = -M $filename;"
-                      "if(defined $Cache{$package}{mtime}&&$Cache{$package}{mtime} <= $mtime){ return; }"
+                      "if(defined $Cache{$package}{mtime}&&$Cache{$package}{mtime} <= $mtime && !($package eq 'plugin')){ return; }"
                        "else {"
                                "local *FH;open FH, $filename or die \"open '$filename' $!\";"
                                "local($/) = undef;my $sub = <FH>;close FH;"


samandhi 03-01-2004 01:30 AM

AAAHHH, good eye... :)


All times are GMT -4. The time now is 09:56 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.