Append \0\FML\0 to hostname in set_protocol packet if Forge enabled

http://wiki.vg/User:Pokechu22/Forge#Connection_to_a_forge_server
This commit is contained in:
deathcap 2016-01-23 12:00:17 -08:00
parent 609c4466f7
commit 6e50863eaa

View file

@ -90,9 +90,12 @@ function createClient(options) {
return client; return client;
function onConnect() { function onConnect() {
var taggedHost = host;
if (options.forge) taggedHost += '\0FML\0';
client.write('set_protocol', { client.write('set_protocol', {
protocolVersion: version.version, protocolVersion: version.version,
serverHost: host, serverHost: taggedHost,
serverPort: port, serverPort: port,
nextState: 2 nextState: 2
}); });