forked from PrismarineJS/node-minecraft-protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit af31ece Author: Romain Beaumont <[email protected]> Date: Tue Aug 16 01:00:53 2022 +0200 Release 1.36.0 commit 79afd27 Author: IceTank <[email protected]> Date: Tue Aug 16 00:57:47 2022 +0200 Fix unhandled promise rejection on ms auth (PrismarineJS#1022) commit d7c5053 Author: extremeheat <[email protected]> Date: Mon Aug 15 18:57:26 2022 -0400 1.19.0 support (PrismarineJS#1027) * Bump mcdata for 1.19 * 1.19 in version.js * 1.19.0 in ci yml * Update ci.yml * Update version.js * Update package.json * No fail fast * Update mcdata * Update package.json * Update ci.yml * [1.19] fix tests and library session code (PrismarineJS#1020) * make tests work, add todo's * clean up, varlong test, additional todo * removed log statements, fix for older versions * Update mcdata * Update ci.yml * Update ci.yml * remove excessive version comments near supportFeature checks Co-authored-by: Romain Beaumont <[email protected]> * chat signing implementation * Update ci.yml * move some boilerplate to pauth * update tests * update chat example * bump pauth, update doc * modify test nextMessage func * lint * update default version * add server player verifyMessage * update doc Co-authored-by: Romain Beaumont <[email protected]> Co-authored-by: Rob9315 <[email protected]> commit 60379eb Author: Jordan Jones <[email protected]> Date: Fri Jul 29 09:41:43 2022 -0700 Provide interface for using not at all supported alternative accounts. (PrismarineJS#1026) * Handle auth potentially being an function * "Simple" example of how in theroy it would work * Add package.json * Fix lint * add type declarations * Remove mcleaks example * Add doc changes * adjust warning * Fix lint from rebase manual edit. commit e079e9b Author: Jordan Jones <[email protected]> Date: Fri Jul 29 09:03:20 2022 -0700 Use offline mode as default authentication, fallback to offline mode if invalid option. (PrismarineJS#998) * Default n-m-p to use offline unless specified. * Remove expression * actually make offline default * Revert examples * Revert all example changes * Add deprecation warning that mojang servers are no longer accepting mojang auth tokens. commit e4c797d Author: Romain Beaumont <[email protected]> Date: Fri Jul 22 22:20:55 2022 +0200 Release 1.35.1 (PrismarineJS#1024) * Update HISTORY.md * Update package.json commit 92fd00d Author: Rob9315 <[email protected]> Date: Thu Jul 21 22:56:34 2022 +0200 add type values to packetTest (PrismarineJS#1023) * add varlong value to packetTest * add command_node type value in packetTest commit 446d1d9 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Jul 19 22:47:52 2022 +0200 Bump readable-stream from 3.6.0 to 4.1.0 (PrismarineJS#1014) Bumps [readable-stream](https://github.com/nodejs/readable-stream) from 3.6.0 to 4.1.0. - [Release notes](https://github.com/nodejs/readable-stream/releases) - [Commits](nodejs/readable-stream@v3.6.0...v4.1.0) --- updated-dependencies: - dependency-name: readable-stream dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 50de598 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Jul 19 22:47:36 2022 +0200 Bump @types/node from 17.0.45 to 18.0.6 (PrismarineJS#1017) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.45 to 18.0.6. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 6cc3cfc Author: Rob9315 <[email protected]> Date: Tue Jul 19 22:47:18 2022 +0200 add custom minecraft type `varlong` which aliases to varint (PrismarineJS#1018) * add custom minecraft type varlong which aliases to varint for now or forever * semicolon (standard-js)
- Loading branch information
Showing
27 changed files
with
650 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,29 @@ | ||
## FAQ | ||
# FAQ | ||
|
||
This Frequently Asked Question document is meant to help people for the most common things. | ||
|
||
### How to hide errors ? | ||
## How to hide errors ? | ||
|
||
Use `hideErrors: true` in createClient options | ||
You may also choose to add these listeners : | ||
|
||
```js | ||
client.on('error', () => {}) | ||
client.on('end', () => {}) | ||
``` | ||
|
||
### How can I make a proxy with this ? | ||
## How can I make a proxy with this ? | ||
|
||
* Check out our WIP proxy lib <https://github.com/PrismarineJS/prismarine-proxy> | ||
* See this example <https://github.com/PrismarineJS/node-minecraft-protocol/tree/master/examples/proxy> | ||
* Read this issue <https://github.com/PrismarineJS/node-minecraft-protocol/issues/712> | ||
* check out <https://github.com/Heath123/pakkit> | ||
* Check out this app <https://github.com/wvffle/minecraft-packet-debugger> | ||
|
||
## Can you support alternative auth methods? | ||
|
||
Supporting alternative authentcation methods has been a long standing issue with Prismarine for awhile. We do add support for using your own custom authentication method by providing a function to the `options.auth` property. In order to keep the legitimacy of the project, and to prevent bad attention from Mojang, we will not be supporting any custom authentication methods in the official repositories. | ||
|
||
It is up to the end user to support and maintain the authentication protocol if this is used as support in many of the official channels will be limited. | ||
|
||
* Check out our WIP proxy lib https://github.com/PrismarineJS/prismarine-proxy | ||
* See this example https://github.com/PrismarineJS/node-minecraft-protocol/tree/master/examples/proxy | ||
* Read this issue https://github.com/PrismarineJS/node-minecraft-protocol/issues/712 | ||
* check out https://github.com/Heath123/pakkit | ||
* Check out this app https://github.com/wvffle/minecraft-packet-debugger | ||
If you still wish to proceed, please make sure to throughly read and attempt to understand all implementations of the authentcation you wish to implement. Using an non-official authentication server can make you vulnerable to all different kinds of attacks which are not limited to insecure and/or malicious code! We will not be held responsible for anything you mess up. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,7 +78,7 @@ var client = mc.createClient({ | |
port: 25565, // optional | ||
username: "[email protected]", | ||
password: "12345678", | ||
auth: 'mojang' // optional; by default uses mojang, if using a microsoft account, set to 'microsoft' | ||
auth: 'microsoft' // optional; by default uses offline mode, if using a microsoft account, set to 'microsoft' | ||
}); | ||
client.on('chat', function(packet) { | ||
// Listen for chat messages and echo them back. | ||
|
@@ -92,7 +92,7 @@ client.on('chat', function(packet) { | |
}); | ||
``` | ||
|
||
If the server is in offline mode, you may leave out the `password` option. | ||
If the server is in offline mode, you may leave out the `password` option and switch auth to `offline`. | ||
You can also leave out `password` when using a Microsoft account. If provided, password based auth will be attempted first which may fail. *Note:* if using a Microsoft account, your account age must be >= 18 years old. | ||
|
||
### Client example joining a Realm | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
'use strict' | ||
|
||
const mc = require('minecraft-protocol') | ||
|
||
const [, , host, port, username, password] = process.argv | ||
if (!username || !password) { | ||
console.log('Usage : node client_custom_auth.js <host> <port> <username/email> [<password>]') | ||
process.exit(1) | ||
} | ||
|
||
const client = mc.createClient({ | ||
host, | ||
port: parseInt(port), | ||
username: username, | ||
password: password, | ||
sessionServer: '', // URL to your session server proxy that changes the expected result of mojang's seession server to mcleaks expected. | ||
// For more information: https://github.com/PrismarineJS/node-yggdrasil/blob/master/src/Server.js#L19 | ||
auth: async (client, options) => { | ||
// handle custom authentication your way. | ||
|
||
// client.username = options.username | ||
// options.accessToken = | ||
return options.connect(client) | ||
} | ||
}) | ||
|
||
client.on('connect', function () { | ||
console.info('connected') | ||
}) | ||
client.on('disconnect', function (packet) { | ||
console.log('disconnected: ' + packet.reason) | ||
}) | ||
client.on('chat', function (packet) { | ||
const jsonMsg = JSON.parse(packet.message) | ||
if (jsonMsg.translate === 'chat.type.announcement' || jsonMsg.translate === 'chat.type.text') { | ||
const username = jsonMsg.with[0].text | ||
const msg = jsonMsg.with[1] | ||
if (username === client.username) return | ||
client.write('chat', { message: msg }) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "node-minecraft-protocol-example-client-custom-auth", | ||
"version": "0.0.0", | ||
"description": "A node-minecraft-protocol example", | ||
"main": "client_custom_auth.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.