4 // mlist.cpp - functions for list of plugins (class MPluginList)
9 * This file is part of Metamod.
11 * Metamod is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at
14 * your option) any later version.
16 * Metamod is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with Metamod; if not, write to the Free Software Foundation,
23 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 * In addition, as a special exception, the author gives permission to
26 * link the code of this program with the Half-Life Game Engine ("HL
27 * Engine") and Modified Game Libraries ("MODs") developed by Valve,
28 * L.L.C ("Valve"). You must obey the GNU General Public License in all
29 * respects for all of the code used other than the HL Engine and MODs
30 * from Valve. If you modify this file, you may extend this exception
31 * to your version of the file, but you are not obligated to do so. If
32 * you do not wish to do so, delete this exception statement from your
37 #include <errno.h> // errno, etc
39 #include <extdll.h> // always
41 #include "mlist.h" // me
42 #include "mplugin.h" // class MPlugin
43 #include "plinfo.h" // plid_t, etc
44 #include "commands_meta.h" // cmd_meta_pluginlist, etc
45 #include "metamod.h" // GameDLL, etc
46 #include "types_meta.h" // mBOOL
47 #include "log_meta.h" // META_LOG, etc
48 #include "osdep.h" // win32 snprintf, normalize_pathname,
51 MPluginList::MPluginList(const char *ifile)
52 : size(MAX_PLUGINS), endlist(0)
55 // store filename of ini file
56 STRNCPY(inifile, ifile, sizeof(inifile));
58 memset(plist, 0, sizeof(plist));
59 for(i=0; i< size; i++) {
60 plist[i].index=i+1; // 1-based
65 // Find a plugin based on the plugin handle.
67 // - ME_ARGUMENT invalid pindex
68 // - ME_NOTFOUND couldn't find a matching plugin
69 MPlugin *MPluginList::find(DLHANDLE handle)
74 RETURN_ERRNO(NULL, ME_ARGUMENT);
75 for(i=0; i < endlist; i++) {
76 if(plist[i].status < PL_VALID)
78 if(plist[i].handle == handle)
81 RETURN_ERRNO(NULL, ME_NOTFOUND);
84 // Find a plugin based on the plugin index #.
86 // - ME_ARGUMENT invalid pindex
87 // - ME_NOTFOUND couldn't find a matching plugin
88 MPlugin *MPluginList::find(int pindex) {
91 RETURN_ERRNO(NULL, ME_ARGUMENT);
92 pfound=&plist[pindex-1];
93 if(pfound->status < PL_VALID)
94 RETURN_ERRNO(NULL, ME_NOTFOUND);
99 // Find a plugin with the given plid.
100 // meta_errno values:
101 // - ME_ARGUMENT null plid_t
102 // - ME_NOTFOUND couldn't find a matching plugin
103 MPlugin *MPluginList::find(plid_t id) {
107 RETURN_ERRNO(NULL, ME_ARGUMENT);
108 for(i=0; i < endlist; i++) {
109 if(plist[i].status < PL_VALID)
111 if(plist[i].info == id)
114 RETURN_ERRNO(NULL, ME_NOTFOUND);
117 // Find a plugin with the given pathname.
118 // meta_errno values:
119 // - ME_ARGUMENT null path
120 // - ME_NOTFOUND couldn't find a matching plugin
121 MPlugin *MPluginList::find(const char *findpath) {
125 RETURN_ERRNO(NULL, ME_ARGUMENT);
126 META_DEBUG(8, ("Looking for loaded plugin with dlfnamepath: %s", findpath));
127 for(i=0; i < endlist; i++) {
128 META_DEBUG(9, ("Looking at: plugin %s loadedpath: %s", plist[i].file, plist[i].pathname));
129 if(plist[i].status < PL_VALID)
131 if(strmatch(plist[i].pathname, findpath)) {
132 META_DEBUG(8, ("Found loaded plugin %s", plist[i].file));
136 META_DEBUG(8, ("No loaded plugin found with path: %s", findpath));
137 RETURN_ERRNO(NULL, ME_NOTFOUND);
140 // Find a plugin that uses the given memory location.
141 // meta_errno values:
142 // - ME_ARGUMENT null memptr
143 // - ME_NOTFOUND couldn't find a matching plugin
144 // - errno's from DLFNAME()
145 MPlugin *MPluginList::find_memloc(void *memptr) {
149 RETURN_ERRNO(NULL, ME_ARGUMENT);
150 if(!(dlfile=DLFNAME(memptr))) {
151 META_DEBUG(8, ("DLFNAME failed to find memloc %d", memptr));
152 // meta_errno should be already set in DLFNAME
155 return(find(dlfile));
158 // Find a plugin with non-ambiguous prefix string matching desc, file,
160 // meta_errno values:
161 // - ME_ARGUMENT null prefix
162 // - ME_NOTFOUND couldn't find a matching plugin
163 // - ME_NOTUNIQ found multiple matches; no unique match
164 MPlugin *MPluginList::find_match(const char *prefix) {
166 MPlugin *iplug, *pfound;
170 RETURN_ERRNO(NULL, ME_ARGUMENT);
173 snprintf(buf, sizeof(buf), "mm_%s", prefix);
174 for(i=0; i < endlist; i++) {
176 if(iplug->status < PL_VALID)
178 if(iplug->info && strncasecmp(iplug->info->name, prefix, len) == 0) {
180 RETURN_ERRNO(NULL, ME_NOTUNIQ);
184 else if(strncasecmp(iplug->desc, prefix, len) == 0) {
186 RETURN_ERRNO(NULL, ME_NOTUNIQ);
190 else if(strncasecmp(iplug->file, prefix, len) == 0) {
192 RETURN_ERRNO(NULL, ME_NOTUNIQ);
196 else if(strncasecmp(iplug->file, buf, strlen(buf)) == 0) {
198 RETURN_ERRNO(NULL, ME_NOTUNIQ);
203 && strncasecmp(iplug->info->logtag, prefix, len) == 0)
206 RETURN_ERRNO(NULL, ME_NOTUNIQ);
214 RETURN_ERRNO(NULL, ME_NOTFOUND);
218 // Find a plugin with same file, logtag, desc or significant
219 // prefix of file. Uses the platform_match() method of MPlugin.
220 // meta_errno values:
221 // - ME_ARGUMENT null prefix
222 // - ME_NOTFOUND couldn't find a matching plugin
223 MPlugin *MPluginList::find_match(MPlugin *pmatch) {
225 MPlugin *iplug, *pfound;
227 RETURN_ERRNO(NULL, ME_ARGUMENT);
229 for(i=0; i < endlist; i++) {
231 if(pmatch->platform_match(iplug)) {
240 RETURN_ERRNO(NULL, ME_NOTFOUND);
243 MPlugin * MPluginList::plugin_addload(plid_t plid, const char *fname, PLUG_LOADTIME now)
246 MPlugin *pl_found, *pl_added, *pl_loader;
248 if ( !(pl_loader=find(plid)) )
250 META_DEBUG(1, ("Couldn't find plugin that gave this loading request!"));
251 RETURN_ERRNO(NULL, ME_BADREQ);
254 memset(&pl_temp, 0, sizeof(pl_temp));
256 if (!pl_temp.plugin_parseline(fname, pl_loader->index))
258 RETURN_ERRNO(NULL, ME_NOTFOUND);
261 if (pl_temp.resolve() != mTRUE)
263 META_DEBUG(1, ("Couldn't resolve given path into a file: %s", pl_temp.file));
264 RETURN_ERRNO(NULL, ME_NOTFOUND);
267 if ( (pl_found=find(pl_temp.pathname)) )
269 META_DEBUG(1, ("Plugin '%s' already in current list; file=%s desc='%s'",
270 pl_temp.file, pl_found->file, pl_found->desc));
271 RETURN_ERRNO(NULL, ME_ALREADY);
274 if (!(pl_added=add(&pl_temp)))
276 META_DEBUG(1, ("Couldn't add plugin '%s' to list; see log", pl_temp.desc));
280 pl_added->action = PA_LOAD;
281 if (!pl_added->load(now))
283 if (meta_errno==ME_NOTALLOWED || meta_errno==ME_DELAYED)
285 META_DEBUG(1, ("Plugin '%s' couldn't attach; only allowed %s",
286 pl_added->desc, pl_added->str_loadable(SL_ALLOWED)));
288 } else if (pl_added->status == PL_OPENED) {
289 META_DEBUG(1, ("Opened plugin '%s', but failed to attach; see log", pl_added->desc));
291 META_DEBUG(1, ("Couldn't load plugin '%s'; see log", pl_added->desc));
296 META_DEBUG(1, ("Loaded plugin '%s' successfully", pl_added->desc));
297 meta_errno = ME_NOERROR;
302 // Add a plugin to the list.
303 // meta_errno values:
304 // - ME_MAXREACHED reached max plugins
305 MPlugin *MPluginList::add(MPlugin *padd) {
310 // - a slot in the list that's not being used
311 // - the end of the list
312 for(i=0; i < endlist && plist[i].status != PL_EMPTY; i++);
314 // couldn't find a slot to use
316 META_ERROR("Couldn't add plugin '%s' to list; reached max plugins (%d)",
318 RETURN_ERRNO(NULL, ME_MAXREACHED);
321 // if we found the end of the list, advance end marker
326 // copy filename into this free slot
327 STRNCPY(iplug->filename, padd->filename, sizeof(iplug->filename));
328 // Copy file offset ptr.
329 // Can't just copy ptr, as it points to offset in padd, which will go
330 // away; need to point to corresponding offset in iplug.
331 iplug->file = iplug->filename + (padd->file - padd->filename);
333 STRNCPY(iplug->desc, padd->desc, sizeof(iplug->desc));
335 STRNCPY(iplug->pathname, padd->pathname, sizeof(iplug->pathname));
337 iplug->source=padd->source;
339 iplug->status=padd->status;
341 iplug->source_plugin_index = padd->source_plugin_index;
347 // Read plugins.ini at server startup.
348 // meta_errno values:
349 // - ME_NOFILE ini file missing or empty
350 mBOOL MPluginList::ini_startup() {
352 char line[MAX_STRBUF_LEN];
356 if(!valid_gamedir_file(inifile)) {
357 META_ERROR("ini: Metamod plugins file empty or missing: %s", inifile);
358 RETURN_ERRNO(mFALSE, ME_NOFILE);
360 full_gamedir_path(inifile, inifile);
362 fp=fopen(inifile, "r");
364 META_ERROR("ini: Unable to open plugins file '%s': %s", inifile,
366 RETURN_ERRNO(mFALSE, ME_NOFILE);
369 META_LOG("ini: Begin reading plugins list: %s", inifile);
371 !feof(fp) && fgets(line, sizeof(line), fp) && n < size;
374 // Remove line terminations.
376 if((cp=strrchr(line, '\r')))
378 if((cp=strrchr(line, '\n')))
380 // Parse directly into next entry in array
381 if(!plist[n].ini_parseline(line)) {
382 if(meta_errno==ME_FORMAT)
383 META_ERROR("ini: Skipping malformed line %d of %s", ln,
387 // Check for a duplicate - an existing entry with this pathname.
388 if(find(plist[n].pathname)) {
389 // Should we check platform specific level here?
390 META_INFO("ini: Skipping duplicate plugin, line %d of %s: %s",
391 ln, inifile, plist[n].pathname);
394 // Check for a matching platform with different platform specifics
396 if(NULL != (pmatch=find_match(&plist[n]))) {
397 if(pmatch->pfspecific >= plist[n].pfspecific) {
398 META_DEBUG(1, ("ini: Skipping plugin, line %d of %s: plugin with higher platform specific level already exists. (%d >= %d)",
399 ln, inifile, pmatch->pfspecific, plist[n].pfspecific));
402 META_DEBUG(1, ("ini: Plugin in line %d overrides existing plugin with lower platform specific level %d, ours %d",
403 ln, pmatch->pfspecific, plist[n].pfspecific));
404 int _index = pmatch->index;
405 memset(pmatch, 0, sizeof(MPlugin));
406 pmatch->index = _index;
408 plist[n].action=PA_LOAD;
409 META_LOG("ini: Read plugin config for: %s", plist[n].desc);
411 endlist=n; // mark end of list
413 META_LOG("ini: Finished reading plugins list: %s; Found %d plugins to load",
418 META_ERROR("ini: Warning; no plugins found to load?");
423 // Re-read plugins.ini looking for added/deleted/changed plugins.
424 // meta_errno values:
425 // - ME_NOFILE ini file missing or empty
426 mBOOL MPluginList::ini_refresh() {
428 char line[MAX_STRBUF_LEN];
431 MPlugin *pl_found, *pl_added;
433 fp=fopen(inifile, "r");
435 META_ERROR("ini: Unable to open plugins file '%s': %s", inifile,
437 RETURN_ERRNO(mFALSE, ME_NOFILE);
440 META_LOG("ini: Begin re-reading plugins list: %s", inifile);
442 !feof(fp) && fgets(line, sizeof(line), fp) && n < size;
445 // Remove line terminations.
447 if((cp=strrchr(line, '\r')))
449 if((cp=strrchr(line, '\n')))
451 // Parse into a temp plugin
452 memset(&pl_temp, 0, sizeof(pl_temp));
453 if(!pl_temp.ini_parseline(line)) {
454 if(meta_errno==ME_FORMAT)
455 META_ERROR("ini: Skipping malformed line %d of %s",
459 // Try to find plugin with this pathname in the current list of
461 if(!(pl_found=find(pl_temp.pathname))) {
462 // Check for a matching platform with higher platform specifics
464 if(NULL != (pl_found=find_match(&pl_temp))) {
465 if(pl_found->pfspecific >= pl_temp.pfspecific) {
466 META_DEBUG(1, ("ini: Skipping plugin, line %d of %s: plugin with higher platform specific level already exists. (%d >= %d)",
467 ln, inifile, pl_found->pfspecific, pl_temp.pfspecific));
470 if(PA_LOAD == pl_found->action) {
471 META_DEBUG(1, ("ini: Plugin in line %d overrides loading of plugin with lower platform specific level %d, ours %d",
472 ln, pl_found->pfspecific, pl_temp.pfspecific));
473 int _index = pl_found->index;
474 memset(pl_found, 0, sizeof(MPlugin));
475 pl_found->index = _index;
478 META_DEBUG(1, ("ini: Plugin in line %d should override existing plugin with lower platform specific level %d, ours %d. Unable to comply.",
479 ln, pl_found->pfspecific, pl_temp.pfspecific));
483 // new plugin; add to list
484 if((pl_added=add(&pl_temp))) {
485 // try to load this plugin at the next opportunity
486 pl_added->action=PA_LOAD;
489 // error details logged in add()
493 // This plugin is already in the current list of plugins.
494 // Pathname already matches. Recopy desc, if specified in
496 if(pl_temp.desc[0] != '<')
497 STRNCPY(pl_found->desc, pl_temp.desc, sizeof(pl_found->desc));
499 // Check the file to see if it looks like it's been modified
500 // since we last loaded it.
501 if(!pl_found->newer_file()) {
502 if(meta_errno==ME_NOFILE) {
503 META_ERROR("ini: Skipping plugin, couldn't stat file '%s': %s",
504 pl_found->pathname, strerror(errno));
508 // File hasn't been updated.
509 // Keep plugin (don't let refresh() unload it).
510 pl_found->action=PA_KEEP;
513 // Newer file on disk.
514 else if(pl_found->status >= PL_OPENED) {
515 META_DEBUG(2, ("ini: Plugin '%s' has newer file on disk", pl_found->desc));
516 pl_found->action=PA_RELOAD;
519 META_ERROR("ini: Plugin '%s' has newer file, but unexpected status (%s)",
520 pl_found->desc, pl_found->str_status());
522 if(NULL != pl_found) {
523 META_LOG("ini: Read plugin config for: %s", pl_found->desc);
526 META_LOG("ini: Read plugin config for: %s", pl_temp.desc);
530 META_LOG("ini: Finished reading plugins list: %s; Found %d plugins", inifile, n);
534 META_ERROR("ini: Warning; no plugins found to load?");
539 // Load a plugin from a console command.
540 // meta_errno values:
541 // - errno's from cmd_parseline()
542 // - errno's from resolve()
543 // - ME_ALREADY this plugin already loaded
544 // - errno's from add()
545 // - errno's from load()
546 mBOOL MPluginList::cmd_addload(const char *args) {
548 MPlugin *pl_found, *pl_added;
550 // XXX move back to comands_meta ?
552 // parse into a temp plugin
553 memset(&pl_temp, 0, sizeof(pl_temp));
554 if(pl_temp.cmd_parseline(args) != mTRUE) {
555 META_CONS("Couldn't parse 'meta load' arguments: %s", args);
556 // meta_errno should be already set in cmd_parseline()
560 // resolve given path into a file; accepts various "shortcut"
562 if(pl_temp.resolve() != mTRUE) {
563 // Couldn't find a matching file on disk
564 META_CONS("Couldn't resolve given path into a file: %s",
566 // meta_errno should be already set in resolve()
570 // Try to find plugin with this pathname in the current list of
572 if((pl_found=find(pl_temp.pathname))) {
574 META_CONS("Plugin '%s' already in current list; file=%s desc='%s'",
575 pl_temp.file, pl_found->file, pl_found->desc);
576 RETURN_ERRNO(mFALSE, ME_ALREADY);
578 // new plugin; add to list
579 if(!(pl_added=add(&pl_temp))) {
580 META_CONS("Couldn't add plugin '%s' to list; see log", pl_temp.desc);
581 // meta_errno should be already set in add()
585 // try to load new plugin
586 pl_added->action=PA_LOAD;
587 if(!pl_added->load(PT_ANYTIME)) {
589 if(meta_errno==ME_DELAYED)
590 META_CONS("Loaded plugin '%s', but will wait to become active, %s",
591 pl_added->desc, pl_added->str_loadable(SL_ALLOWED));
592 else if(meta_errno==ME_NOTALLOWED) {
593 META_CONS("Plugin '%s' couldn't attach; only allowed %s",
594 pl_added->desc, pl_added->str_loadable(SL_ALLOWED));
597 else if(pl_added->status == PL_OPENED)
598 META_CONS("Opened plugin '%s', but failed to attach; see log", pl_added->desc);
600 META_CONS("Couldn't load plugin '%s'; see log", pl_added->desc);
602 // meta_errno should be already set in load()
605 META_CONS("Loaded plugin '%s' successfully", pl_added->desc);
610 // Load plugins at startup.
611 // meta_errno values:
612 // - errno's from ini_startup()
613 mBOOL MPluginList::load() {
616 if (!ini_startup()) {
617 META_ERROR("Problem loading plugins.ini: %s", inifile);
618 // meta_errno should be already set in ini_startup()
622 META_LOG("dll: Loading plugins...");
623 for(i=0, n=0; i < endlist; i++) {
624 if(plist[i].status < PL_VALID)
626 if(plist[i].load(PT_STARTUP) == mTRUE)
629 // all plugins should be loadable at startup...
630 META_ERROR("dll: Failed to load plugin '%s'", plist[i].file);
632 META_LOG("dll: Finished loading %d plugins", n);
636 // Update list of loaded plugins from ini file, and load any new/changed plugins.
637 // meta_errno values:
638 // - errno's from ini_refresh()
639 mBOOL MPluginList::refresh(PLUG_LOADTIME now) {
640 int i, ndone=0, nkept=0, nloaded=0, nunloaded=0, nreloaded=0, ndelayed=0;
643 if (!ini_refresh()) {
644 META_ERROR("dll: Problem reloading plugins.ini: %s", inifile);
645 // meta_errno should be already set in ini_refresh()
649 META_LOG("dll: Updating plugins...");
650 for(i=0; i < endlist; i++) {
652 if(iplug->status < PL_VALID)
654 switch(iplug->action) {
656 META_DEBUG(1, ("Keeping plugin '%s'", iplug->desc));
657 iplug->action=PA_NONE;
661 META_DEBUG(1, ("Loading plugin '%s'", iplug->desc));
664 else if(meta_errno==ME_DELAYED)
668 META_DEBUG(1, ("Reloading plugin '%s'", iplug->desc));
669 if(iplug->reload(now, PNL_FILE_NEWER))
671 else if(meta_errno==ME_DELAYED)
675 // If previously loaded from ini, but apparently removed from new ini.
676 if(iplug->source==PS_INI && iplug->status >= PL_RUNNING) {
677 META_DEBUG(1, ("Unloading plugin '%s'", iplug->desc));
678 iplug->action=PA_UNLOAD;
679 if(iplug->unload(now, PNL_INI_DELETED, PNL_INI_DELETED))
681 else if(meta_errno==ME_DELAYED)
686 // Previously requested attach, but was delayed?
687 META_DEBUG(1, ("Retrying attach plugin '%s'", iplug->desc));
688 if(iplug->retry(now, PNL_DELAYED))
690 else if(meta_errno==ME_DELAYED)
694 // Previously requested unload, but was delayed?
695 META_DEBUG(1, ("Retrying unload plugin '%s'", iplug->desc));
696 if(iplug->retry(now, PNL_DELAYED))
698 else if(meta_errno==ME_DELAYED)
702 META_ERROR("dll: Unexpected action for plugin '%s': '%s'", iplug->desc, iplug->str_action());
705 META_ERROR("dll: Unrecognized action for plugin '%s': '%s'", iplug->desc, iplug->str_action());
710 META_LOG("dll: Finished updating %d plugins; kept %d, loaded %d, unloaded %d, reloaded %d, delayed %d",
711 ndone, nkept, nloaded, nunloaded, nreloaded, ndelayed);
715 // Re-enable any plugins currently paused.
716 // meta_errno values:
718 void MPluginList::unpause_all(void) {
721 for(i=0; i < endlist; i++) {
723 if(iplug->status==PL_PAUSED)
728 // Retry any pending actions on plugins, for instance load/unload delayed
729 // until changelevel.
730 // meta_errno values:
732 void MPluginList::retry_all(PLUG_LOADTIME now) {
735 for(i=0; i < endlist; i++) {
737 if(iplug->action != PA_NONE)
738 iplug->retry(now, PNL_DELAYED);
742 // List plugins and information about them in a formatted table.
743 // meta_errno values:
745 void MPluginList::show(int source_index) {
748 char desc[15+1], file[16+1], vers[7+1]; // plus 1 for term null
750 if (source_index <= 0)
751 META_CONS("Currently loaded plugins:");
753 META_CONS("Child plugins:");
755 META_CONS(" %*s %-*s %-4s %-4s %-*s v%-*s %-3s %-5s %-5s",
756 WIDTH_MAX_PLUGINS, "",
757 sizeof(desc)-1, "description",
759 sizeof(file)-1, "file", sizeof(vers)-1, "ers",
760 "src", "load ", "unlod");
761 for(i=0; i < endlist; i++) {
763 if(pl->status < PL_VALID)
765 if ((source_index > 0) && (pl->source_plugin_index != source_index))
767 STRNCPY(desc, pl->desc, sizeof(desc));
768 STRNCPY(file, pl->file, sizeof(file));
769 if(pl->info && pl->info->version) STRNCPY(vers, pl->info->version, sizeof(vers));
770 else STRNCPY(vers, " -", sizeof(vers));
771 META_CONS(" [%*d] %-*s %-4s %-4s %-*s v%-*s %-3s %-5s %-5s",
772 WIDTH_MAX_PLUGINS, pl->index,
773 sizeof(desc)-1, desc,
774 pl->str_status(ST_SHOW), pl->str_action(SA_SHOW),
775 sizeof(file)-1, file, sizeof(vers)-1, vers,
776 pl->str_source(SO_SHOW),
777 pl->str_loadable(SL_SHOW), pl->str_unloadable(SL_SHOW));
778 if(pl->status == PL_RUNNING)
782 META_CONS("%d plugins, %d running", n, r);
785 // List plugins and information to Player/client entity. Differs from the
786 // "meta list" console command in that:
787 // - Shows only "running" plugins, skipping any failed or paused plugins.
788 // - Limited info about each plugin, mostly the "public" info (name, author,
790 // meta_errno values:
792 void MPluginList::show_client(edict_t *pEntity) {
795 META_CLIENT(pEntity, "Currently running plugins:");
796 for(i=0; i < endlist; i++) {
798 if(pl->status != PL_RUNNING)
801 META_CLIENT(pEntity, " [%3d] %s, v%s, %s, by %s, see %s",
803 pl->info->name ? pl->info->name : "<unknown>",
804 pl->info->version ? pl->info->version : "<?>",
805 pl->info->date ? pl->info->date : "<../../..>",
806 pl->info->author ? pl->info->author : "<unknown>",
807 pl->info->url ? pl->info->url : "<unknown>");
809 META_CLIENT(pEntity, "%d plugins", n);
812 mBOOL MPluginList::found_child_plugins(int source_index)
816 if (source_index <= 0)
819 for (i=0; i<endlist; i++)
821 if (plist[i].status < PL_VALID)
823 if (plist[i].source_plugin_index == source_index)
830 void MPluginList::clear_source_plugin_index(int source_index)
834 if (source_index <= 0)
837 for (i=0; i<endlist; i++)
839 if (plist[i].status < PL_VALID)
841 if (plist[i].source_plugin_index == source_index)
842 plist[i].source_plugin_index = -1;