sampctl icon indicating copy to clipboard operation
sampctl copied to clipboard

Plugin order is not maintained if remotes are mixed with locals

Open Southclaws opened this issue 6 years ago • 9 comments

[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

Southclaws avatar Jun 03 '18 22:06 Southclaws

Any news related to this issue?

n0dai avatar Jun 11 '18 20:06 n0dai

This also happens with --dev dependencies too.

Southclaws avatar Jul 06 '18 13:07 Southclaws

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.

Southclaws avatar Jul 06 '18 13:07 Southclaws

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

n0dai avatar Aug 01 '18 11:08 n0dai

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

Southclaws avatar Aug 01 '18 11:08 Southclaws

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

Southclaws avatar Aug 12 '18 14:08 Southclaws

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.

Y-Less avatar Aug 12 '18 14:08 Y-Less

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.

Southclaws avatar Aug 12 '18 16:08 Southclaws

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

MtPlayerZ avatar Dec 13 '23 00:12 MtPlayerZ