Team-Silver-Sphere / SquadJS

Squad Server Script Framework
Boost Software License 1.0
163 stars 123 forks source link

JS file check breaks application #338

Closed CodeRedDev closed 8 months ago

CodeRedDev commented 8 months ago

The introduced JS file check from #319 breaks the application. Non of the plugins will be inserted into the server plugins list and will not be mounted at all.

werewolfboy13 commented 8 months ago

@CodeRedDev I will need server/bot logs, the QA pass that was ran passed inspection.

rwsender commented 8 months ago

I went commit by commit updating my SquadJS to the latest and can confirm this change caused the FTP file trail of logs not to work crashing squadJS

    at FTPContext._onControlSocketData (D:\projects\ripsquadjs\node_modules\basic-ftp\dist\FtpContext.js:282:39)
    at Socket.<anonymous> (D:\projects\ripsquadjs\node_modules\basic-ftp\dist\FtpContext.js:123:44)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:293:11)
    at Readable.push (node:internal/streams/readable:234:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
Emitted 'error' event on FTPTail instance at:
    at FTPTail.fetchLoop (file:///D:/projects/ripsquadjs/node_modules/ftp-tail/index.js:117:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 550
}

Removing this change fixes the issue

CodeRedDev commented 8 months ago

@werewolfboy13 when commenting the JS files section the application will have objects in server.plugins and will mount them.

From my understanding of the code non of the plugin's plugin properties in the config.json end with .js. Maybe there is a typo?

werewolfboy13 commented 8 months ago

If this is still breaking let me know, but if this is an FTP issue it shouldn't be causing this issue.

CodeRedDev commented 8 months ago

If this is still breaking let me know, but if this is an FTP issue it shouldn't be causing this issue.

I don't think rwsender's error has anything to do with this. It's a complete other component. Thanks for the quick fix :)

CodeRedDev commented 8 months ago

Nevermind just took another look at the changes.

https://github.com/Team-Silver-Sphere/SquadJS/blob/5be2d21183481e632d9ee2179a4d98f133b8523e/squad-server/factory.js#L85

This must be removed otherwise the error stated at the beginning of the issue won't be fixed.

werewolfboy13 commented 8 months ago

IF this is occuring I want to see if the console logs I will not be approving a PR if you cant state/show why its not working.

werewolfboy13 commented 8 months ago

image

If its fixed as such will it work?

CodeRedDev commented 8 months ago

image

If its fixed as such will it work?

No, the check shouldn't be in this place as I've mentioned in https://github.com/Team-Silver-Sphere/SquadJS/pull/341#issuecomment-1879875772

watchful-eyes commented 8 months ago

image If its fixed as such will it work?

No, the check shouldn't be in this place as I've mentioned in #341 (comment)

I agree, the PR about checking the file's type is in wrong place. pluginConfig.plugin is the plugin property of the plugin's config which its name. Also what's been done already done in squad-server/plugins/index.js