mirror of
https://github.com/PrismarineJS/node-minecraft-protocol.git
synced 2025-05-21 02:30:24 -04:00
add ushort writer
This commit is contained in:
parent
a95fe18a4d
commit
8a6d4bc725
1 changed files with 10 additions and 0 deletions
|
@ -450,6 +450,7 @@ var packets = {
|
||||||
var writers = {
|
var writers = {
|
||||||
'int': IntWriter,
|
'int': IntWriter,
|
||||||
'short': ShortWriter,
|
'short': ShortWriter,
|
||||||
|
'ushort': UShortWriter,
|
||||||
'byte': ByteWriter,
|
'byte': ByteWriter,
|
||||||
'ubyte': UByteWriter,
|
'ubyte': UByteWriter,
|
||||||
'string': StringWriter,
|
'string': StringWriter,
|
||||||
|
@ -963,6 +964,15 @@ ShortWriter.prototype.write = function(buffer, offset) {
|
||||||
buffer.writeInt16BE(this.value, offset);
|
buffer.writeInt16BE(this.value, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function UShortWriter(value) {
|
||||||
|
this.value = value;
|
||||||
|
this.size = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
UShortWriter.prototype.write = function(buffer, offset) {
|
||||||
|
buffer.writeUInt16BE(this.value, offset);
|
||||||
|
}
|
||||||
|
|
||||||
function IntWriter(value) {
|
function IntWriter(value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.size = 4;
|
this.size = 4;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue