From 93c5c7315a81a379906c0df9862d04d9b9cd5c0a Mon Sep 17 00:00:00 2001 From: deathcap Date: Sun, 24 Jan 2016 11:11:47 -0800 Subject: [PATCH] Add tagHost option, clients can use to append to set_protocol serverHost This is used by Forge clients to tell the server they support FML|HS, otherwise the server will kick with "you must have FML/Forge installed". --- examples/client_forge/client_forge.js | 1 + src/createClient.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/client_forge/client_forge.js b/examples/client_forge/client_forge.js index c079c42..683cb72 100644 --- a/examples/client_forge/client_forge.js +++ b/examples/client_forge/client_forge.js @@ -24,6 +24,7 @@ mc.ping({host, port}, function(err, response) { console.log('Using forgeMods:',forgeMods); var client = mc.createClient({ + tagHost: '\0FML\0', // signifies client supports FML/Forge forge: true, forgeMods: forgeMods, // Client/server mods installed on the client diff --git a/src/createClient.js b/src/createClient.js index 59ff455..5ed48e1 100644 --- a/src/createClient.js +++ b/src/createClient.js @@ -102,7 +102,7 @@ function createClient(options) { function onConnect() { var taggedHost = host; - if (options.forge) taggedHost += '\0FML\0'; + if (options.tagHost) taggedHost += options.tagHost; client.write('set_protocol', { protocolVersion: version.version,