mirror of
https://github.com/PrismarineJS/node-minecraft-protocol.git
synced 2024-12-12 08:51:06 -05:00
Send client HandshakeAck with WAITINGSERVERDATA
This commit is contained in:
parent
790ba538d9
commit
06f8a5fe28
1 changed files with 25 additions and 0 deletions
|
@ -134,6 +134,21 @@ proto.addType('FML|HS',
|
|||
// TODO: mods array: modname string, modversion string
|
||||
],
|
||||
},
|
||||
|
||||
// HandshakeAck
|
||||
{
|
||||
"name": "phase",
|
||||
"type": [
|
||||
"switch",
|
||||
{
|
||||
"compareTo": "discriminator",
|
||||
"fields": {
|
||||
"-1": "byte"
|
||||
},
|
||||
"default": "void"
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
]
|
||||
);
|
||||
|
@ -186,6 +201,16 @@ client.on('custom_payload', function(packet) {
|
|||
});
|
||||
} else if (parsed.data.discriminator === 2) { // ModList
|
||||
console.log('Server ModList:',parsed.data.mods);
|
||||
// TODO: client/server check if mods compatible
|
||||
|
||||
var ackWaitingServerData = proto.createPacketBuffer('FML|HS', {
|
||||
discriminator: -1, // HandshakeAck,
|
||||
phase: 2 // WAITINGSERVERDATA
|
||||
});
|
||||
client.write('custom_payload', {
|
||||
channel: 'FML|HS',
|
||||
data: ackWaitingServerData
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue