CounterStrikeSharp icon indicating copy to clipboard operation
CounterStrikeSharp copied to clipboard

Whether or not you can get the full list of loaded plugins within a plugin

Open Nianmou opened this issue 1 year ago • 4 comments

Similar to css_plugins list I tried using var cheatsCvar = ConVar.Find("css_plugins list") but it failed

Nianmou avatar Mar 02 '24 05:03 Nianmou

you can access the loaded plugins from the pluginmanager instance

KillStr3aK avatar Mar 03 '24 03:03 KillStr3aK

pluginmanager

I'm new to C# and I see this constructor but I don't know how it should be used and how it should be filled out?PluginManager (IScriptHostConfiguration, ICommandManager, ILogger<PluginManager>, IServiceProvider, IServiceScopeFactory)

Nianmou avatar Mar 03 '24 14:03 Nianmou

We currently don't provide the IPluginContextQueryHandler or IPluginManager implementation to plugins, though this could be added to the DI container and then you can use it to find this information in a future release.

roflmuffin avatar Mar 04 '24 00:03 roflmuffin

We currently don't provide the IPluginContextQueryHandler or IPluginManager implementation to plugins, though this could be added to the DI container and then you can use it to find this information in a future release.

I can work on this however not sure if we should expose

https://github.com/roflmuffin/CounterStrikeSharp/blob/42dd270b7852c7d866a8bdf835524fc0bd27a787/managed/CounterStrikeSharp.API/Core/Plugin/Host/IPluginManager.cs#L7

as it just loads every plugin from the plugins folder

Exposing

https://github.com/roflmuffin/CounterStrikeSharp/blob/42dd270b7852c7d866a8bdf835524fc0bd27a787/managed/CounterStrikeSharp.API/Core/Plugin/Host/IPluginManager.cs#L8

would lead to people load plugins from arbitrary paths.

I believe we should only let

https://github.com/roflmuffin/CounterStrikeSharp/blob/42dd270b7852c7d866a8bdf835524fc0bd27a787/managed/CounterStrikeSharp.API/Core/Plugin/Host/IPluginManager.cs#L9

to be used from IPluginManager but it might require a different interface.

IPluginContextQueryHandler is fine, can be exposed

KillStr3aK avatar Oct 09 '24 12:10 KillStr3aK