New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

minecraft-protocol

Package Overview
Dependencies
Maintainers
3
Versions
176
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minecraft-protocol - npm Package Compare versions

Comparing version 0.11.1 to 0.11.2

5

lib/ping.js
var net = require('net')
, Client = require('./client')
, protocol = require('./protocol')

@@ -37,7 +38,7 @@ module.exports = ping;

client.write(0xfe, {
unused1: 1,
readSuccessfully: 1,
customPayloadId: 250,
magicText: "MC|PingHost",
len: 3 + host.length + 4,
magic: 73,
version: protocol.version,
ip: host,

@@ -44,0 +45,0 @@ port: port,

52

lib/protocol.js

@@ -418,2 +418,8 @@ var assert = require('assert');

],
0x85: [
{ name: "tileEntityId", type: "byte" },
{ name: "x", type: "int" },
{ name: "y", type: "int" },
{ name: "z", type: "int" }
],
0xc8: [

@@ -484,7 +490,7 @@ { name: "statisticId", type: "int" },

0xfe: [
{ name: "unused1", type: "byte" },
{ name: "readSuccessfully", type: "byte" },
{ name: "customPayloadId", type: "ubyte" },
{ name: "magicText", type: "string" },
{ name: "len", type: "short" },
{ name: "magic", type: "byte" },
{ name: "version", type: "byte" },
{ name: "ip", type: "string" },

@@ -730,2 +736,5 @@ { name: "port", type: "int" }

size += sizeOfString(value[i].key) + types['double'][2];
for (var j = 0; j < value[i].elementList.length; j++) {
size += types['long'][2] + types['long'][2] + types['double'][2] + types['byte'][2];
}
}

@@ -741,2 +750,9 @@ return size;

offset = writeDouble(value[i].value, buffer, offset);
offset = writeShort(value[i].elementList.length, buffer, offset);
for (var j = 0; j < value[i].elementList.length; j++) {
offset = writeLong(value[i].elementList[j].uuid_msb, buffer, offset);
offset = writeLong(value[i].elementList[j].uuid_lsb, buffer, offset);
offset = writeDouble(value[i].elementList[j].amount, buffer, offset);
offset = writeByte(value[i].elementList[j].operation, buffer, offset);
}
}

@@ -1058,2 +1074,3 @@ return offset;

var property = {};
var elementListLength;

@@ -1070,2 +1087,33 @@ results = readString(buffer, cursor);

results = readShort(buffer, cursor);
if (! results) return null;
elementListLength = results.value;
cursor += results.size;
property.elementList = [];
for (var j = 0; j < elementListLength ; j++) {
property.elementList[j] = {}
results = readLong(buffer, cursor);
if (! results) return null;
property.elementList[j].uuid_msb = results.value;
cursor += results.size;
results = readLong(buffer, cursor);
if (! results) return null;
property.elementList[j].uuid_lsb = results.value;
cursor += results.size;
results = readDouble(buffer, cursor);
if (! results) return null;
property.elementList[j].amount = results.value;
cursor += results.size;
results = readByte(buffer, cursor);
if (! results) return null;
property.elementList[j].operation = results.value;
cursor += results.size;
}
propertyArray.push(property);

@@ -1072,0 +1120,0 @@ }

{
"name": "minecraft-protocol",
"version": "0.11.1",
"version": "0.11.2",
"description": "Parse and serialize minecraft packets, plus authentication and encryption.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -156,2 +156,22 @@ # minecraft protocol [![NPM version](https://badge.fury.io/js/minecraft-protocol.png)](http://badge.fury.io/js/minecraft-protocol)

#### propertyArray
Included inside *Entity Properties (0x2C)* packets.
```js
[
{ key: 'generic.maxHealth', value: 20, elementList: [] },
{ key: 'generic.movementSpeed', value: 0.25, elementList: [] }
]
```
Where elementList is an array with the following structure:
```js
[
{ uuid_msb: 123, uuid_lsb: 456, amount: 0.5, operation: 1 },
...
]
```
## Testing

@@ -277,2 +297,6 @@

### 0.11.2
* 1.6.2 support fixes: updated 0x2c packets to include `elementList` and added 0x85 *Tile Editor Open* packets
### 0.11.1

@@ -279,0 +303,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc