@quake2ts/shared 0.0.754 → 0.0.757
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.global.js +1 -1
- package/dist/browser/index.global.js.map +1 -1
- package/dist/cjs/index.cjs +7 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +7 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/net/netchan.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/net/netchan.ts +11 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -5440,12 +5440,18 @@ var _NetChan = class _NetChan {
|
|
|
5440
5440
|
* Returns the payload data (reliable + unreliable) to be processed, or null if discarded
|
|
5441
5441
|
*/
|
|
5442
5442
|
process(packet) {
|
|
5443
|
-
if (packet.length <
|
|
5443
|
+
if (packet.length < 4) {
|
|
5444
5444
|
return null;
|
|
5445
5445
|
}
|
|
5446
5446
|
this.lastReceived = Date.now();
|
|
5447
5447
|
const view = new DataView(packet.buffer, packet.byteOffset, packet.byteLength);
|
|
5448
5448
|
const sequence = view.getUint32(0, true);
|
|
5449
|
+
if (sequence === 4294967295) {
|
|
5450
|
+
return packet.subarray(4);
|
|
5451
|
+
}
|
|
5452
|
+
if (packet.length < _NetChan.PACKET_HEADER) {
|
|
5453
|
+
return null;
|
|
5454
|
+
}
|
|
5449
5455
|
const ack = view.getUint32(4, true);
|
|
5450
5456
|
const qport = view.getUint16(8, true);
|
|
5451
5457
|
if (this.qport !== qport) {
|