Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve custom plugin support #280

Closed
reck1610 opened this issue Feb 4, 2023 · 1 comment
Closed

Improve custom plugin support #280

reck1610 opened this issue Feb 4, 2023 · 1 comment
Labels
core feature request Feature request related to the core SquadJS API

Comments

@reck1610
Copy link
Contributor

reck1610 commented Feb 4, 2023

What is the issue, e.g. map voting, you would like to solve?

In my opinion, custom plugins have 2 problems at the moment.

1. Custom base classes for plugins will always be loaded as a plugin.

This might not cause a problem, but it causes custom plugins to be handled differently from default plugins.
Currently, the default base classes are blacklisted in the plugin loader.

2. Custom plugins have to be placed in a hard-coded location in the repo

This causes git changes and makes updating SquadJS harder.
This also reduces maintainability for both custom and default plugins, if custom plugins are used.

How would you like us to solve this issue?

Problem1: I would like to introduce the file extension .squad.js for plugins. This removes the need for blacklisting other files in the plugin directory.

Problem 2: I would like to make it configurable from where SquadJS is loading the plugins. Furthermore, I would like to allow multiple paths to be configured in order to increase maintainability for both custom and default plugins, if custom plugins are used.
I would like to introduce pluginPaths into the server configuration like this:

{
  "server": {
    "id": 1,
    "host": "xxx.xxx.xxx.xxx",
    "queryPort": 27165,
    "rconPort": 21114,
    "rconPassword": "password",
    "logReaderMode": "tail",
    "logDir": "C:/path/to/squad/log/folder",
    "ftp": {
      "port": 21,
      "user": "FTP Username",
      "password": "FTP Password",
      "useListForSize": false
    },
    "pluginPaths": [
      "squad-server/plugins/",
      "/opt/custom-squadjs-plugins/"
    ]
  }

Both relative and absolute paths should be allowed. Plugins will be loaded in order (starting with index 0), if a plugin already exists it will be replaced. This should be logged accordingly.

Additional Info

I am already working on this.
This relates to #275.

@reck1610 reck1610 added the core feature request Feature request related to the core SquadJS API label Feb 4, 2023
@werewolfboy13
Copy link
Collaborator

Please see attached PR. Closing as we are not able to proceed with this major change but will keep in mind.

@werewolfboy13 werewolfboy13 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core feature request Feature request related to the core SquadJS API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants