prismarine-proxy 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +17 -10
- package/HISTORY.md +4 -0
- package/package.json +3 -3
- package/src/instant_connect_proxy.js +10 -4
|
@@ -13,13 +13,20 @@ jobs:
|
|
|
13
13
|
- name: Set up Node.js
|
|
14
14
|
uses: actions/setup-node@master
|
|
15
15
|
with:
|
|
16
|
-
node-version:
|
|
17
|
-
-
|
|
18
|
-
uses:
|
|
19
|
-
with:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
node-version: 14.0.0
|
|
17
|
+
- id: publish
|
|
18
|
+
uses: JS-DevTools/npm-publish@v1
|
|
19
|
+
with:
|
|
20
|
+
token: ${{ secrets.NPM_AUTH_TOKEN }}
|
|
21
|
+
- name: Create Release
|
|
22
|
+
if: steps.publish.outputs.type != 'none'
|
|
23
|
+
id: create_release
|
|
24
|
+
uses: actions/create-release@v1
|
|
25
|
+
env:
|
|
26
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
27
|
+
with:
|
|
28
|
+
tag_name: ${{ steps.publish.outputs.version }}
|
|
29
|
+
release_name: Release ${{ steps.publish.outputs.version }}
|
|
30
|
+
body: ${{ steps.publish.outputs.version }}
|
|
31
|
+
draft: false
|
|
32
|
+
prerelease: false
|
package/HISTORY.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prismarine-proxy",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Provide features to build proxies using Prismarine modules",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
},
|
|
25
25
|
"homepage": "https://github.com/PrismarineJS/prismarine-proxy#readme",
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"mocha": "^
|
|
27
|
+
"mocha": "^10.0.0",
|
|
28
28
|
"prismarine-proxy": "file:.",
|
|
29
|
-
"standard": "^
|
|
29
|
+
"standard": "^17.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"debug": "^4.3.1",
|
|
@@ -7,11 +7,16 @@ const verMap = {
|
|
|
7
7
|
'1.8.8': '1.8',
|
|
8
8
|
'1.8.9': '1.8'
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
|
|
11
|
+
function getPacket (ver, name, mcData) {
|
|
12
|
+
let packet = packets[ver]?.['from-server']?.[name][0].json
|
|
13
|
+
if (name === 'login') {
|
|
14
|
+
packet = packet ?? mcData.loginPacket
|
|
15
|
+
}
|
|
16
|
+
if (!packet) throw new Error(`Packets for version ${ver} aren't stored. This can be fixed by dumping them adding them to the verMap if similar packets are stored.`)
|
|
13
17
|
return packet
|
|
14
18
|
}
|
|
19
|
+
|
|
15
20
|
class InstantConnectProxy extends EventEmitter {
|
|
16
21
|
constructor (options) {
|
|
17
22
|
super()
|
|
@@ -30,7 +35,7 @@ class InstantConnectProxy extends EventEmitter {
|
|
|
30
35
|
const mcData = mcDataLoader(toClient.version)
|
|
31
36
|
const mcVersion = mcData.version.minecraftVersion
|
|
32
37
|
const ver = verMap[mcVersion] ?? mcVersion
|
|
33
|
-
toClient.write('login', { ...getPacket(ver, 'login'), entityId: toClient.id })
|
|
38
|
+
toClient.write('login', { ...getPacket(ver, 'login', mcData), entityId: toClient.id })
|
|
34
39
|
|
|
35
40
|
const toServer = createClient({
|
|
36
41
|
...this.options.clientOptions,
|
|
@@ -72,6 +77,7 @@ class InstantConnectProxy extends EventEmitter {
|
|
|
72
77
|
this.emit('incoming', data, meta, toClient, toServer)
|
|
73
78
|
}
|
|
74
79
|
})
|
|
80
|
+
|
|
75
81
|
toClient.once('end', () => {
|
|
76
82
|
this.emit('end', toServer.username)
|
|
77
83
|
this.endClient(toClient)
|