Open Mendanbar opened 9 years ago
This has been an issue in at least the JAVA incarnation of open-dis, and maybe others. The variable datum is handled as if it is a fixed datum with length 8, which ends up ignoring any data beyond the first 8 characters.
in dis.VariableDatum, the code reads as follows:
this.variableData = new Array(0, 0, 0, 0, 0, 0, 0, 0); dis.VariableDatum.prototype.initFromBinaryDIS = function(inputStream) { this.variableDatumID = inputStream.readInt(); this.variableDatumLength = inputStream.readInt(); for(var idx = 0; idx < 8; idx++) { this.variableData[ idx ] = inputStream.readByte(); } };
I believe it should be like this (at least this works for my project anyway, which makes heavy use of variable datums):
this.variableData = new Array(); dis.VariableDatum.prototype.initFromBinaryDIS = function(inputStream) { this.variableDatumID = inputStream.readInt(); this.variableDatumLength = inputStream.readInt(); for (var idx = 0; idx < (this.variableDatumLength / 8); idx++) { this.variableData.push(inputStream.readByte()); } };
Thanks, I should be getting to this soon. I think the Java version has patches applied to it post-generation to fix the issue.
This has been an issue in at least the JAVA incarnation of open-dis, and maybe others. The variable datum is handled as if it is a fixed datum with length 8, which ends up ignoring any data beyond the first 8 characters.
in dis.VariableDatum, the code reads as follows:
I believe it should be like this (at least this works for my project anyway, which makes heavy use of variable datums):