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

EOS integration #318

Merged

Conversation

fantinodavide
Copy link
Contributor

First EOS implementation. Still requires extensive testing.

@fantinodavide
Copy link
Contributor Author

Every log-parser still emit events with the steamID property, it should be replaced with EOSID. I still haven't done this refactoring, but all the events should have been updated with the proper regex to match the new EOSID, that should already be handled by all the rest of the code that retrieve a player

@werewolfboy13 werewolfboy13 linked an issue Dec 13, 2023 that may be closed by this pull request
@werewolfboy13 werewolfboy13 added the major Major Change label Dec 13, 2023
@Ulibos
Copy link
Contributor

Ulibos commented Dec 13, 2023

Here is a patch that addresses some of the issues in this PR:

--- a/core/rcon.js
+++ b/core/rcon.js
@@ -186,7 +186,7 @@ export default class Rcon extends EventEmitter {
       return this.soh;
     }
     const bufSize = this.stream.readInt32LE(0);
-    if (bufSize > 4154 || bufSize < 10) return this.badPacket();
+    if (bufSize < 10) return this.badPacket();
     else if (bufSize <= this.stream.byteLength - 4 && this.stream.byteLength >= 12) {
       const bufId = this.stream.readInt32LE(4);
       const bufType = this.stream.readInt32LE(8);
@@ -228,7 +228,7 @@ export default class Rcon extends EventEmitter {
       this.emit(`response${this.responseString.id - 2}`, this.responseString.body);
       this.responseString.body = '';
     } else if (!packet.body.includes('^A')) {
-      this.responseString.body = this.responseString.body += packet.body;
+      this.responseString.body = this.responseString.body + packet.body;
       this.responseString.id = packet.id;
     } else this.badPacket();
   }
@@ -241,7 +241,7 @@ export default class Rcon extends EventEmitter {
       }`
     );
     this.stream = Buffer.alloc(0);
-    this.responseString = '';
+    this.responseString.body = '';
     return null;
   }
   onClose() {

There were 2 typos and a hard limit on a max packet size. I did some test rcon dumps and the biggest packet I got was 13670 bytes long. Since squad has no respect towards the standard, I'd suggest removing the upper limit entirely.

@fantinodavide
Copy link
Contributor Author

@Ulibos
I wouldn't like to remove the check on maximum buffer size, but I'm curious about the other parts of the code.
I've placed a comment on the original PR (#291 (comment)) to address part of the issues, it would be better to move the discussion there since there are other important changes

@werewolfboy13
Copy link
Collaborator

Conflict fixed

@vohk
Copy link
Contributor

vohk commented Jan 1, 2024

On the current (2 days ago) PR, seeing a new error in the console:

(node:15) UnhandledPromiseRejectionWarning: Error
at Query.run (/home/container/node_modules/sequelize/lib/dialects/mysql/query.js:52:25)
at /home/container/node_modules/sequelize/lib/sequelize.js:315:28
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MySQLQueryInterface.upsert (/home/container/node_modules/sequelize/lib/dialects/mysql/query-interface.js:43:12)
at async DBLog_Player.upsert (/home/container/node_modules/sequelize/lib/model.js:1533:20)
at async DBLog.onPlayerWounded (file:///home/container/squad-server/plugins/db-log.js:535:7)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:15) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 23)

No crashing or functionality impaired that I've yet noticed. If there is any information I can add or provide, let me know.

@romanvoloboev
Copy link

looks like something not working?..
image

@fantinodavide
Copy link
Contributor Author

@romanvoloboev make sure you don't have multiple tools connecting to rcon from the same IP (including loopback), because it would cause both the tools to alternate the connection

@romanvoloboev
Copy link

@romanvoloboev make sure you don't have multiple tools connecting to rcon from the same IP (including loopback), because it would cause both the tools to alternate the connection

yep, I have rcon web admin panel..

@romanvoloboev
Copy link

@romanvoloboev make sure you don't have multiple tools connecting to rcon from the same IP (including loopback), because it would cause both the tools to alternate the connection

but it's strange, because my setup didn't change and everything was working before..

@sergelouie6
Copy link
Contributor

@romanvoloboev make sure you don't have multiple tools connecting to rcon from the same IP (including loopback), because it would cause both the tools to alternate the connection

but it's strange, because my setup didn't change and everything was working before..

When was "before"? Were you using the version of rcon.js with passthrough support?

@romanvoloboev
Copy link

@romanvoloboev make sure you don't have multiple tools connecting to rcon from the same IP (including loopback), because it would cause both the tools to alternate the connection

but it's strange, because my setup didn't change and everything was working before..

When was "before"? Were you using the version of rcon.js with passthrough support?

Maybe few days ago it was working..
I'm using code from this branch, and no any other "rcon.js with passthrough support".
Also I'm using on same host squadjs and server installed with LinuxGsm.. maybe it somehow conflicts, idk..

@fantinodavide
Copy link
Contributor Author

@romanvoloboev try to stop the other tool and check if the error persists

@romanvoloboev
Copy link

romanvoloboev commented Jan 3, 2024

@romanvoloboev try to stop the other tool and check if the error persists

I can't stop "other tool", because there is no other tool except LinuxGSM which starts server.
For better understanding, I have next setup:

  • dedicated server where I run squadserver via LinuxGSM + squadJS
  • VPS on different IP with admin panel connected to squadserver (but I turned it off, and nothing changed, so it's doesn't matter in this case, forget about it)

So I rebooted dedicated server, started game server via LinuxGSM, started SquadJS, connected to server and got this:
image

Start params (screenshot from LinuxGSM tool)
image

Another thing that I should mention that I'm building and runing squadJs via docker-compose
But I believe it's also not the problem, since before everything was working good.
image

So I don't know what to do.. please try to reproduce by yourself by installing server via LinuxGSM and connect to it SQJS from the same host with 1 static IP.

@fantinodavide
Copy link
Contributor Author

@romanvoloboev try to stop the other tool and check if the error persists

I can't stop "other tool", because there is no other tool except LinuxGSM which starts server. For better understanding, I have next setup:

  • dedicated server where I run squadserver via LinuxGSM + squadJS
  • VPS on different IP with admin panel connected to squadserver (but I turned it off, and nothing changed, so it's doesn't matter in this case, forget about it)

So I rebooted dedicated server, started game server via LinuxGSM, started SquadJS, connected to server and got this: image

Start params (screenshot from LinuxGSM tool) image

Another thing that I should mention that I'm building and runing squadJs via docker-compose But I believe it's also not the problem, since before everything was working good. image

So I don't know what to do.. please try to reproduce by yourself by installing server via LinuxGSM and connect to it SQJS from the same host with 1 static IP.

@romanvoloboev try to stop the other tool (rcon web admin panel) connecting to the RCON to avoid conflict.
Also, this conversation should be moved on discord as it's not related to the developement of this PR

@romanvoloboev
Copy link

romanvoloboev commented Jan 3, 2024 via email

@romanvoloboev
Copy link

@fantinodavide my issue has been fixed by accepting in firewall input udp traffic to 21114 port

@fantinodavide
Copy link
Contributor Author

@fantinodavide my issue has been fixed by accepting in firewall input udp traffic to 21114 port

very good!

@fantinodavide
Copy link
Contributor Author

@werewolfboy13 I think it's ready to be merged

@werewolfboy13 werewolfboy13 added core bug Bug related to the core SquadJS API core feature request Feature request related to the core SquadJS API labels Jan 5, 2024
@werewolfboy13 werewolfboy13 merged commit dffc8b6 into Team-Silver-Sphere:master Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core bug Bug related to the core SquadJS API core feature request Feature request related to the core SquadJS API major Major Change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EOS Integration for tracking
8 participants