From 141f434beef51b52d7e7084679d0838718eaa6d2 Mon Sep 17 00:00:00 2001 From: sergelouie6 <49586590+sergelouie6@users.noreply.github.com> Date: Tue, 25 Apr 2023 17:16:12 +0800 Subject: [PATCH 1/5] Rename readme.txt to README.MD --- readme.txt => README.MD | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename readme.txt => README.MD (100%) diff --git a/readme.txt b/README.MD similarity index 100% rename from readme.txt rename to README.MD From 03b84c4700c06122051310095963c2dd005eb44f Mon Sep 17 00:00:00 2001 From: sergelouie6 <49586590+sergelouie6@users.noreply.github.com> Date: Tue, 25 Apr 2023 17:24:09 +0800 Subject: [PATCH 2/5] Update README.MD --- README.MD | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.MD b/README.MD index 7f8fc29..f340aab 100644 --- a/README.MD +++ b/README.MD @@ -1,14 +1,14 @@ -Simple SquadRcon Client by Mattt(or), -Simple SquadRcon Client (with fail over) by Mattt(or), -Simple SquadRcon Client (forSquadJS) by Mattt(or), +## **About** +Simple SquadRcon Client by Mattt(or) +Simple SquadRcon Client (with fail over) by Mattt(or) +Simple SquadRcon Client (forSquadJS) by Mattt(or) Welcome, this is intended specifically for OWI-Squad's flavour of Rcon Server -install node.js -no other dependenices. +#### Prerequisites +* [Node.js](https://nodejs.org/en/) - [Download](https://nodejs.org/en/) -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -Simple SquadRcon Client +## Simple SquadRcon Client Basic Implementation; | line 69: edit port( port ), host( ip ), token( password ). ((for local connections use ip "localhost")). | line 79: set keep alive interval ( 60000 = 1 minute ). From 1133cd0641cb1f1e37854541af243c0c0ef3da02 Mon Sep 17 00:00:00 2001 From: sergelouie6 <49586590+sergelouie6@users.noreply.github.com> Date: Tue, 25 Apr 2023 17:33:50 +0800 Subject: [PATCH 3/5] Update and rename README.MD to README.md --- README.MD | 66 ------------------------------------------------------ README.md | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 66 deletions(-) delete mode 100644 README.MD create mode 100644 README.md diff --git a/README.MD b/README.MD deleted file mode 100644 index f340aab..0000000 --- a/README.MD +++ /dev/null @@ -1,66 +0,0 @@ -## **About** -Simple SquadRcon Client by Mattt(or) -Simple SquadRcon Client (with fail over) by Mattt(or) -Simple SquadRcon Client (forSquadJS) by Mattt(or) - -Welcome, this is intended specifically for OWI-Squad's flavour of Rcon Server - -#### Prerequisites -* [Node.js](https://nodejs.org/en/) - [Download](https://nodejs.org/en/) - -## Simple SquadRcon Client -Basic Implementation; -| line 69: edit port( port ), host( ip ), token( password ). ((for local connections use ip "localhost")). -| line 79: set keep alive interval ( 60000 = 1 minute ). - -to run enter `node rcon.js` into console -Will write 'list query responses' to console text and 'sevrer feed' to console as warning text. -There is ZERO error checking - this is intentional! -!!! LINE 38: UNSAFE value ( >= 4 ) - this allows the buffer to potentially be read outside of a message, this is to make us more likely to find edge case errors. For SAFE operation value must be ( >= 7 ) !!! - -line 12: size and id are not important, this is the hard coded 'made up' packet, no point in converting into it each time it arrives later. -line 15: 2147483647 used as flag when debugging only. -line 19: id defaults to non zero for easier debugging must be a valid positive signed 32bit value, 2 less than range max. -line 21: id + 2 allows for easier debugging plus sets up for way to avoid need to parse later, ie sudo id 33 = "current map" => read from index x to end" -line 47: is special packet? long if statement but efficient. -line 58: long messages re-assembled and sent out from here. - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -Simple SquadRcon Client (with fail over) - -rconWithFailover.js uncomment packetbreaker() to make 'random' bad rackets - -Packet checks are; -is Special packet? -has valid size value? <= rcon spec is max 4096, Squad ignores this, using 8192 is ok for now using too large a value may result in loop as data can never fill to active a decode. -is long enough to be complete? -ends with 'null, null'? -ID is positive 32bit sInt? -Type is either 0,1,2 or 3? - -if out going text is found to contain "", this also counts as a bad packet. - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -Simple SquadRcon Client (forSquadJS) - -rconforSquadJS.js -working draft, intended as straight swap for squadJS/core/rcon.js -Fixes buffer overflow bug etc. -Comment/swap Logger(s) and uncomment squadJsStyle() to run as stand alone test. - -/* A Micro Demo in the style of SquadJS */ -/* -const squadJsStyle = async () => { - const getCurrentMap = async () => { - const response = await rcon.execute("ShowCurrentMap"); - const match = response.match(/^Current level is (?.+), layer is (?.+)/); - return [match.groups.level, match.groups.layer]; - }; - const rcon = new Rcon({ port: "00000", host: "0.0.0.0", password: "password" }); - setTimeout(() => rcon.disconnect(), 10000); - await rcon.connect(); - const layers = await getCurrentMap(); - console.log(layers); -}; -squadJsStyle(); -*/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..cdcf739 --- /dev/null +++ b/README.md @@ -0,0 +1,67 @@ +## **About** +- Simple SquadRcon Client by Mattt(or) +- Simple SquadRcon Client (with fail over) by Mattt(or) +- Simple SquadRcon Client (forSquadJS) by Mattt(or) + +Welcome, this is intended specifically for OWI-Squad's flavour of Rcon Server + +#### Prerequisites +* [Node.js](https://nodejs.org/en/) - [Download](https://nodejs.org/en/) + +## Simple SquadRcon Client +#### Basic Implementation +* line 69: edit port( port ), host( ip ), token( password ). ((for local connections use ip "localhost")). +* line 79: set keep alive interval ( 60000 = 1 minute ). + +#### Installation +1. [Download SimplestSquadRcon](https://github.com/Matttor/SimplestSquadRcon/archive/refs/heads/master.zip) and unzip the download. +2. Open the unzipped folder in your terminal. +3. Start SimplestSquadRcon by running `node rcon.js` in your terminal. + +#### Other Info +* Will write 'list query responses' to console text and 'sevrer feed' to console as warning text. +* There is ZERO error checking - this is intentional! +* !!! LINE 38: UNSAFE value ( >= 4 ) - this allows the buffer to potentially be read outside of a message, this is to make us more likely to find edge case errors. For SAFE operation value must be ( >= 7 ) !!! + +* line 12: size and id are not important, this is the hard coded 'made up' packet, no point in converting into it each time it arrives later. +* line 15: 2147483647 used as flag when debugging only. +* line 19: id defaults to non zero for easier debugging must be a valid positive signed 32bit value, 2 less than range max. +* line 21: id + 2 allows for easier debugging plus sets up for way to avoid need to parse later, ie sudo id 33 = "current map" => read from index x to end" +* line 47: is special packet? long if statement but efficient. +* line 58: long messages re-assembled and sent out from here. + +## Simple SquadRcon Client (with fail over) +rconWithFailover.js uncomment packetbreaker() to make 'random' bad rackets + +Packet checks are; +is Special packet? +has valid size value? <= rcon spec is max 4096, Squad ignores this, using 8192 is ok for now using too large a value may result in loop as data can never fill to active a decode. +is long enough to be complete? +ends with 'null, null'? +ID is positive 32bit sInt? +Type is either 0,1,2 or 3? + +if out going text is found to contain "", this also counts as a bad packet. + +## Simple SquadRcon Client (forSquadJS) +rconforSquadJS.js +working draft, intended as straight swap for squadJS/core/rcon.js +Fixes buffer overflow bug etc. +Comment/swap Logger(s) and uncomment squadJsStyle() to run as stand alone test. + +/* A Micro Demo in the style of SquadJS */ +/* +const squadJsStyle = async () => { + const getCurrentMap = async () => { + const response = await rcon.execute("ShowCurrentMap"); + const match = response.match(/^Current level is (?.+), layer is (?.+)/); + return [match.groups.level, match.groups.layer]; + }; + const rcon = new Rcon({ port: "00000", host: "0.0.0.0", password: "password" }); + setTimeout(() => rcon.disconnect(), 10000); + await rcon.connect(); + const layers = await getCurrentMap(); + console.log(layers); +}; +squadJsStyle(); +*/ From c767778bc303191a2a8f16b6fa9813669c1ae538 Mon Sep 17 00:00:00 2001 From: sergelouie6 <49586590+sergelouie6@users.noreply.github.com> Date: Tue, 25 Apr 2023 17:34:56 +0800 Subject: [PATCH 4/5] Update README.md --- README.md | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index cdcf739..307f4a0 100644 --- a/README.md +++ b/README.md @@ -33,22 +33,22 @@ Welcome, this is intended specifically for OWI-Squad's flavour of Rcon Server ## Simple SquadRcon Client (with fail over) rconWithFailover.js uncomment packetbreaker() to make 'random' bad rackets -Packet checks are; -is Special packet? -has valid size value? <= rcon spec is max 4096, Squad ignores this, using 8192 is ok for now using too large a value may result in loop as data can never fill to active a decode. -is long enough to be complete? -ends with 'null, null'? -ID is positive 32bit sInt? -Type is either 0,1,2 or 3? - -if out going text is found to contain "", this also counts as a bad packet. +* Packet checks are; +* is Special packet? +* has valid size value? <= rcon spec is max 4096, Squad ignores this, using 8192 is ok for now using too large a value may result in loop as data can never fill to active a decode. +* is long enough to be complete? +* ends with 'null, null'? +* ID is positive 32bit sInt? +* Type is either 0,1,2 or 3? +* if out going text is found to contain "", this also counts as a bad packet. ## Simple SquadRcon Client (forSquadJS) -rconforSquadJS.js -working draft, intended as straight swap for squadJS/core/rcon.js -Fixes buffer overflow bug etc. -Comment/swap Logger(s) and uncomment squadJsStyle() to run as stand alone test. +* rconforSquadJS.js +* working draft, intended as straight swap for squadJS/core/rcon.js +* Fixes buffer overflow bug etc. +* Comment/swap Logger(s) and uncomment squadJsStyle() to run as stand alone test. +```javascript /* A Micro Demo in the style of SquadJS */ /* const squadJsStyle = async () => { @@ -65,3 +65,4 @@ const squadJsStyle = async () => { }; squadJsStyle(); */ +``` From e32766932781b0558824bc3e342a6f7c0487e1ce Mon Sep 17 00:00:00 2001 From: sergelouie6 <49586590+sergelouie6@users.noreply.github.com> Date: Tue, 25 Apr 2023 17:37:21 +0800 Subject: [PATCH 5/5] Update README.md --- README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 307f4a0..5c29f2b 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ ## **About** +Welcome, this is intended specifically for OWI-Squad's flavour of Rcon Server - Simple SquadRcon Client by Mattt(or) - Simple SquadRcon Client (with fail over) by Mattt(or) - Simple SquadRcon Client (forSquadJS) by Mattt(or) -Welcome, this is intended specifically for OWI-Squad's flavour of Rcon Server - #### Prerequisites * [Node.js](https://nodejs.org/en/) - [Download](https://nodejs.org/en/) @@ -48,9 +47,8 @@ rconWithFailover.js uncomment packetbreaker() to make 'random' bad rackets * Fixes buffer overflow bug etc. * Comment/swap Logger(s) and uncomment squadJsStyle() to run as stand alone test. -```javascript +```js /* A Micro Demo in the style of SquadJS */ -/* const squadJsStyle = async () => { const getCurrentMap = async () => { const response = await rcon.execute("ShowCurrentMap"); @@ -64,5 +62,4 @@ const squadJsStyle = async () => { console.log(layers); }; squadJsStyle(); -*/ ```