sampctl
sampctl copied to clipboard
Plugin order is not maintained if remotes are mixed with locals
[10:26 PM] spacemud: hey @Southclaws when including a custom plugin in the runtimes.plugins field i've noticed it puts them at the start of the plugins string in the generated server.cfg
Any news related to this issue?
This also happens with --dev dependencies too.
The only way I can think of doing it is by prefixing the dependency string with a number or something to indicate order of precedence:
{
"dependencies": [
"1:something",
"0:somethingElse"
]
}
Which would be loaded as somethingElse
then something
.
{
"dependencies": [
"IllidanS4/PawnPlus:v0.7"
],
"devDependencies": [
"0 Zeex/samp-plugin-crashdetect:v4.19"
],
"runtime": {
"plugins": [
"1 localplugin"
]
}
}
Here's another example that forces crashdetect to load first, localplugin to load second and everything else to be undefined, but guaranteed to load after localplugin.
That's a great idea. Are you able to implement it in the next releases?
Possibly, there are other things on the roadmap and this isn't a priority right now.
I've done a quick fix for this by reversing the order that plugins are joined. Dependencies will come first followed by anything from runtime.plugins
("custom" or "local" plugins).
Could I suggest:
- dependencies,
- runtime.plugins
- devDependencies
Things like "nativechecker" (and maybe "crashdetect") always need to come last, but shouldn't be used on a live server anyway, so should only be dev dependencies.
Yeah that would make the most sense. That will take a bit more time to actually do though because of how it currently works - dependencies and devDependencies are grouped and then sent to a completely different part of the program before being merged with runtime.plugins, I'll have to have a think about that.
Hopefully for now, the quick fix will be sufficient and I'll keep this issue open as it's not properly resolved yet.
Any news of this issue? I'm having trouble with this too :/