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 forgeHandshake = require('../../dist/client/forgeHandshake'); // TODO: what's with 'dist' here?
|
||||
|
||||
if(process.argv.length < 4 || process.argv.length > 6) {
|
||||
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);
|
||||
|
||||
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,
|
||||
port: port,
|
||||
username: username,
|
||||
password: password
|
||||
});
|
||||
forgeHandshake(client, {forgeMods});
|
||||
|
||||
client.on('connect', function() {
|
||||
console.info('connected');
|
||||
|
@ -264,6 +264,8 @@ function fmlHandshakeStep(client, data, 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) {
|
||||
// TODO: channel registration tracking in NMP, https://github.com/PrismarineJS/node-minecraft-protocol/pull/328
|
||||
if (packet.channel === 'FML|HS') {
|
||||
|
@ -8,6 +8,7 @@ var caseCorrect = require('./client/caseCorrect');
|
||||
var setProtocol = require('./client/setProtocol');
|
||||
var play = require('./client/play');
|
||||
var tcp_dns = require('./client/tcp_dns');
|
||||
var forgeHandshake = require('./client/forgeHandshake');
|
||||
|
||||
module.exports=createClient;
|
||||
|
||||
@ -24,6 +25,7 @@ function createClient(options) {
|
||||
var client = new Client(false, options.majorVersion);
|
||||
|
||||
tcp_dns(client, options);
|
||||
if (options.forgeMods) forgeHandshake(client, options);
|
||||
setProtocol(client, options);
|
||||
keepalive(client, options);
|
||||
encrypt(client, options);
|
||||
|
Loading…
x
Reference in New Issue
Block a user