Skip to content

Commit

Permalink
Fix wsmc protocol state check in raw handler, now an object
Browse files Browse the repository at this point in the history
  • Loading branch information
deathcap committed Jan 13, 2016
1 parent ed274b0 commit d7f2305
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wsmc.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,16 @@ wss.on('connection', function(new_websocket_connection) {
});


mc.on('raw', function(buffer, state) {
mc.on('raw', function(buffer, packet_state) {
var state = packet_state.state;
if (PACKET_DEBUG) {
console.log('mc received '+buffer.length+' bytes');
hex(buffer);
}

if (state !== 'play' && state !== 'login') {
console.log('Skipping state '+state+' packet: ',buffer);
console.log(state);
return;
}

Expand Down

0 comments on commit d7f2305

Please sign in to comment.