Add tests for packet decode/encode (and fix some bugs found by the tests!)

This commit is contained in:
Casper Warden
2017-12-20 17:07:10 +00:00
parent 231eff9e7f
commit 493b843b4d
316 changed files with 7809 additions and 238 deletions

View File

@@ -29,7 +29,7 @@ export class ScriptDialogMessage implements MessageBase
getSize(): number
{
return (this.Data['FirstName'].length + 1 + this.Data['LastName'].length + 1 + this.Data['ObjectName'].length + 1 + this.Data['Message'].length + 2) + ((this.calculateVarVarSize(this.Buttons, 'ButtonLabel', 1)) * this.Buttons.length) + ((16) * this.OwnerData.length) + 38;
return (this.Data['FirstName'].length + 1 + this.Data['LastName'].length + 1 + this.Data['ObjectName'].length + 1 + this.Data['Message'].length + 2) + this.calculateVarVarSize(this.Buttons, 'ButtonLabel', 1) + ((16) * this.OwnerData.length) + 38;
}
calculateVarVarSize(block: object[], paramName: string, extraPerVar: number): number