mirror of
https://github.com/demostf/demo.js
synced 2026-06-04 00:54:14 +02:00
fix encoding string sendprops
This commit is contained in:
parent
9cc38d6b2d
commit
8fe977ff9f
4 changed files with 261 additions and 13 deletions
|
|
@ -68,9 +68,11 @@ export class SendPropEncoder {
|
|||
}
|
||||
|
||||
public static writeString(value: string, stream: BitStream) {
|
||||
// +1 for null
|
||||
stream.writeBits(value.length + 1, 9);
|
||||
stream.writeASCIIString(value);
|
||||
stream.writeBits(value.length, 9);
|
||||
if (value) {
|
||||
// specify the length to exclude the null terminator
|
||||
stream.writeASCIIString(value, value.length);
|
||||
}
|
||||
}
|
||||
|
||||
public static writeVector(value: Vector, propDefinition: SendPropDefinition, stream: BitStream) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue