Update few more modules

This commit is contained in:
2026-03-25 23:19:03 +01:00
parent f27f6df525
commit 04b10efbfc
16 changed files with 568 additions and 233 deletions
+2 -2
View File
@@ -2,9 +2,9 @@ import {
BinaryWriter, BinaryReader, writeInt16, readInt16, createBinaryReader, readUint16, readLength,
readUint32, readUint8, readObject, readUint8Array
} from 'ag-sockets/dist/browser';
import { decodeString } from 'ag-sockets/dist/utf8';
import { DecodedUpdate, DecodedRegionUpdate, TileUpdate, UpdateFlags } from '../interfaces';
import { tileWidth, tileHeight, MAX_VELOCITY } from '../constants';
import { decodeStringFromUint8Array } from '../binaryUtils';
export function writeVelocity(writer: BinaryWriter, value: number) {
if (value >= MAX_VELOCITY || value <= -MAX_VELOCITY) {
@@ -140,7 +140,7 @@ export function readOneUpdate(reader: BinaryReader): DecodedUpdate | undefined {
}
if ((flags & UpdateFlags.Name) !== 0) {
update.name = decodeString(readUint8Array(reader)) || undefined;
update.name = decodeStringFromUint8Array(readUint8Array(reader)) || undefined;
update.filterName = (flags & UpdateFlags.NameBad) !== 0;
}