Southclaws / sampctl

The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer.
GNU General Public License v3.0
240 stars 34 forks source link

Plugin order is not maintained if remotes are mixed with locals #173

Open Southclaws opened 6 years ago

Southclaws commented 6 years ago

[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

n0dai commented 6 years ago

Any news related to this issue?

Southclaws commented 6 years ago

This also happens with --dev dependencies too.

Southclaws commented 6 years ago

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.

n0dai commented 5 years ago

That's a great idea. Are you able to implement it in the next releases?

Southclaws commented 5 years ago

Possibly, there are other things on the roadmap and this isn't a priority right now.

Southclaws commented 5 years ago

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).

Y-Less commented 5 years ago

Could I suggest:

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.

Southclaws commented 5 years ago

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.

MtPlayerZ commented 6 months ago

Any news of this issue? I'm having trouble with this too :/