diff --git a/protocol/protocol.json b/protocol/protocol.json index d9ddc79..add3f1c 100644 --- a/protocol/protocol.json +++ b/protocol/protocol.json @@ -32,7 +32,7 @@ "fields": [ { "name": "response", - "type": "ustring" + "type": "string" } ] }, @@ -231,7 +231,7 @@ "fields": [ { "name": "message", - "type": "ustring" + "type": "string" }, { "name": "position", @@ -1741,7 +1741,7 @@ }, { "name": "value", - "type": "ustring" + "type": "string" }, { "name": "isSigned", @@ -1751,7 +1751,7 @@ "name": "signature", "type": "condition", "typeArgs": { - "type": "ustring", + "type": "string", "field": "isSigned", "values": [ true diff --git a/src/datatypes/utils.js b/src/datatypes/utils.js index 26438b2..4604e26 100644 --- a/src/datatypes/utils.js +++ b/src/datatypes/utils.js @@ -1,14 +1,11 @@ var assert = require('assert'); -var STRING_MAX_LENGTH = 240; -var SRV_STRING_MAX_LENGTH = 32767; var getField = require("../utils").getField; module.exports = { 'varint': [readVarInt, writeVarInt, sizeOfVarInt], 'bool': [readBool, writeBool, 1], 'string': [readString, writeString, sizeOfString], - 'ustring': [readString, writeString, sizeOfUString], // TODO : remove ustring 'buffer': [readBuffer, writeBuffer, sizeOfBuffer] }; @@ -81,7 +78,6 @@ function writeString(value, buffer, offset) { function sizeOfString(value) { var length = Buffer.byteLength(value, 'utf8'); - assert.ok(length < STRING_MAX_LENGTH, "string greater than max length"); return sizeOfVarInt(length) + length; } @@ -116,10 +112,3 @@ function writeBuffer(value, buffer, offset) { function sizeOfBuffer(value) { return value.length; } - - -function sizeOfUString(value) { - var length = Buffer.byteLength(value, 'utf8'); - assert.ok(length < SRV_STRING_MAX_LENGTH, "string greater than max length"); - return sizeOfVarInt(length) + length; -} diff --git a/test/test.js b/test/test.js index c65172c..4b9fbf2 100644 --- a/test/test.js +++ b/test/test.js @@ -59,7 +59,6 @@ var values = { 'byte': -10, 'ubyte': 8, 'string': "hi hi this is my client string", - 'ustring': "hi hi this is my server string", 'buffer': new Buffer(8), 'array': function(typeArgs) { if(typeof values[typeArgs.type] === "undefined") {