mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-29 14:13:45 -04:00
Set tagHost in src/client/forgeHandshake.js
This commit is contained in:
parent
069a79ba3e
commit
70f1883a0c
@ -1,5 +1,4 @@
|
|||||||
var mc = require('minecraft-protocol');
|
var mc = require('minecraft-protocol');
|
||||||
var forgeHandshake = require('../../dist/client/forgeHandshake'); // TODO: what's with 'dist' here?
|
|
||||||
|
|
||||||
if(process.argv.length < 4 || process.argv.length > 6) {
|
if(process.argv.length < 4 || process.argv.length > 6) {
|
||||||
console.log("Usage : node echo.js <host> <port> [<name>] [<password>]");
|
console.log("Usage : node echo.js <host> <port> [<name>] [<password>]");
|
||||||
@ -25,13 +24,12 @@ mc.ping({host, port}, function(err, response) {
|
|||||||
console.log('Using forgeMods:',forgeMods);
|
console.log('Using forgeMods:',forgeMods);
|
||||||
|
|
||||||
var client = mc.createClient({
|
var client = mc.createClient({
|
||||||
tagHost: '\0FML\0', // passed to src/client/setProtocol.js, signifies client supports FML/Forge TODO: refactor into src/client/forgeHandshake.js, let it set it, but earliest enough(pause)
|
forgeMods: forgeMods,
|
||||||
host: host,
|
host: host,
|
||||||
port: port,
|
port: port,
|
||||||
username: username,
|
username: username,
|
||||||
password: password
|
password: password
|
||||||
});
|
});
|
||||||
forgeHandshake(client, {forgeMods});
|
|
||||||
|
|
||||||
client.on('connect', function() {
|
client.on('connect', function() {
|
||||||
console.info('connected');
|
console.info('connected');
|
||||||
|
@ -264,6 +264,8 @@ function fmlHandshakeStep(client, data, options)
|
|||||||
}
|
}
|
||||||
|
|
||||||
module.exports = function(client, options) {
|
module.exports = function(client, options) {
|
||||||
|
options.tagHost = '\0FML\0'; // passed to src/client/setProtocol.js, signifies client supports FML/Forge
|
||||||
|
|
||||||
client.on('custom_payload', function(packet) {
|
client.on('custom_payload', function(packet) {
|
||||||
// TODO: channel registration tracking in NMP, https://github.com/PrismarineJS/node-minecraft-protocol/pull/328
|
// TODO: channel registration tracking in NMP, https://github.com/PrismarineJS/node-minecraft-protocol/pull/328
|
||||||
if (packet.channel === 'FML|HS') {
|
if (packet.channel === 'FML|HS') {
|
||||||
|
@ -8,6 +8,7 @@ var caseCorrect = require('./client/caseCorrect');
|
|||||||
var setProtocol = require('./client/setProtocol');
|
var setProtocol = require('./client/setProtocol');
|
||||||
var play = require('./client/play');
|
var play = require('./client/play');
|
||||||
var tcp_dns = require('./client/tcp_dns');
|
var tcp_dns = require('./client/tcp_dns');
|
||||||
|
var forgeHandshake = require('./client/forgeHandshake');
|
||||||
|
|
||||||
module.exports=createClient;
|
module.exports=createClient;
|
||||||
|
|
||||||
@ -24,6 +25,7 @@ function createClient(options) {
|
|||||||
var client = new Client(false, options.majorVersion);
|
var client = new Client(false, options.majorVersion);
|
||||||
|
|
||||||
tcp_dns(client, options);
|
tcp_dns(client, options);
|
||||||
|
if (options.forgeMods) forgeHandshake(client, options);
|
||||||
setProtocol(client, options);
|
setProtocol(client, options);
|
||||||
keepalive(client, options);
|
keepalive(client, options);
|
||||||
encrypt(client, options);
|
encrypt(client, options);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user