mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-28 13:45:37 -04:00
Update var to const/let in forgeHandshake
This commit is contained in:
parent
9e9a5cb3d8
commit
14740447dd
@ -1,8 +1,8 @@
|
|||||||
var ProtoDef = require('protodef').ProtoDef;
|
const ProtoDef = require('protodef').ProtoDef;
|
||||||
var assert = require('assert');
|
const assert = require('assert');
|
||||||
var debug = require('../debug');
|
const debug = require('../debug');
|
||||||
|
|
||||||
var proto = new ProtoDef();
|
const proto = new ProtoDef();
|
||||||
// copied from ../../dist/transforms/serializer.js TODO: refactor
|
// copied from ../../dist/transforms/serializer.js TODO: refactor
|
||||||
proto.addType("string", ["pstring", {
|
proto.addType("string", ["pstring", {
|
||||||
countType: "varint"
|
countType: "varint"
|
||||||
@ -154,7 +154,7 @@ proto.addType('FML|HS',
|
|||||||
);
|
);
|
||||||
|
|
||||||
function writeAck(client, phase) {
|
function writeAck(client, phase) {
|
||||||
var ackData = proto.createPacketBuffer('FML|HS', {
|
const ackData = proto.createPacketBuffer('FML|HS', {
|
||||||
discriminator: 'HandshakeAck', // HandshakeAck,
|
discriminator: 'HandshakeAck', // HandshakeAck,
|
||||||
phase: phase
|
phase: phase
|
||||||
});
|
});
|
||||||
@ -164,7 +164,7 @@ function writeAck(client, phase) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var FMLHandshakeClientState = {
|
const FMLHandshakeClientState = {
|
||||||
START: 1,
|
START: 1,
|
||||||
WAITINGSERVERDATA: 2,
|
WAITINGSERVERDATA: 2,
|
||||||
WAITINGSERVERCOMPLETE: 3,
|
WAITINGSERVERCOMPLETE: 3,
|
||||||
@ -174,10 +174,10 @@ var FMLHandshakeClientState = {
|
|||||||
|
|
||||||
function fmlHandshakeStep(client, data, options)
|
function fmlHandshakeStep(client, data, options)
|
||||||
{
|
{
|
||||||
var parsed = proto.parsePacketBuffer('FML|HS', data);
|
const parsed = proto.parsePacketBuffer('FML|HS', data);
|
||||||
debug('FML|HS',parsed);
|
debug('FML|HS',parsed);
|
||||||
|
|
||||||
var fmlHandshakeState = client.fmlHandshakeState || FMLHandshakeClientState.START;
|
const fmlHandshakeState = client.fmlHandshakeState || FMLHandshakeClientState.START;
|
||||||
|
|
||||||
switch(fmlHandshakeState) {
|
switch(fmlHandshakeState) {
|
||||||
case FMLHandshakeClientState.START:
|
case FMLHandshakeClientState.START:
|
||||||
@ -192,7 +192,7 @@ function fmlHandshakeStep(client, data, options)
|
|||||||
data: new Buffer(['FML|HS', 'FML', 'FML|MP', 'FML', 'FORGE'].join('\0'))
|
data: new Buffer(['FML|HS', 'FML', 'FML|MP', 'FML', 'FORGE'].join('\0'))
|
||||||
});
|
});
|
||||||
|
|
||||||
var clientHello = proto.createPacketBuffer('FML|HS', {
|
const clientHello = proto.createPacketBuffer('FML|HS', {
|
||||||
discriminator: 'ClientHello',
|
discriminator: 'ClientHello',
|
||||||
fmlProtocolVersion: parsed.data.fmlProtocolVersion
|
fmlProtocolVersion: parsed.data.fmlProtocolVersion
|
||||||
});
|
});
|
||||||
@ -203,7 +203,7 @@ function fmlHandshakeStep(client, data, options)
|
|||||||
});
|
});
|
||||||
|
|
||||||
debug('Sending client modlist');
|
debug('Sending client modlist');
|
||||||
var modList = proto.createPacketBuffer('FML|HS', {
|
const modList = proto.createPacketBuffer('FML|HS', {
|
||||||
discriminator: 'ModList',
|
discriminator: 'ModList',
|
||||||
mods: options.forgeMods || []
|
mods: options.forgeMods || []
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user