quake2ts 0.0.218 → 0.0.219
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quake2ts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.219",
|
|
4
4
|
"description": "Quake II re-release port to TypeScript with WebGL renderer - A complete game engine with physics, networking, and BSP rendering",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@8.15.7",
|
|
@@ -1032,7 +1032,8 @@ var DedicatedServer = class {
|
|
|
1032
1032
|
}
|
|
1033
1033
|
}
|
|
1034
1034
|
SV_SendClientFrame(client, snapshot) {
|
|
1035
|
-
const
|
|
1035
|
+
const MTU = 1400;
|
|
1036
|
+
const writer = new import_shared4.BinaryWriter(MTU);
|
|
1036
1037
|
writer.writeByte(import_shared4.ServerCommand.frame);
|
|
1037
1038
|
writer.writeLong(this.sv.frame);
|
|
1038
1039
|
writer.writeLong(0);
|
|
@@ -1070,10 +1071,18 @@ var DedicatedServer = class {
|
|
|
1070
1071
|
const entities = snapshot.packetEntities || [];
|
|
1071
1072
|
const currentEntityIds = [];
|
|
1072
1073
|
for (const entity of entities) {
|
|
1074
|
+
if (writer.getOffset() > MTU - 200) {
|
|
1075
|
+
console.warn("Packet MTU limit reached, dropping remaining entities");
|
|
1076
|
+
break;
|
|
1077
|
+
}
|
|
1073
1078
|
currentEntityIds.push(entity.number);
|
|
1074
1079
|
writeDeltaEntity({}, entity, writer, false, true);
|
|
1075
1080
|
}
|
|
1076
1081
|
for (const oldId of client.lastPacketEntities) {
|
|
1082
|
+
if (writer.getOffset() > MTU - 10) {
|
|
1083
|
+
console.warn("Packet MTU limit reached, dropping remaining removals");
|
|
1084
|
+
break;
|
|
1085
|
+
}
|
|
1077
1086
|
if (!currentEntityIds.includes(oldId)) {
|
|
1078
1087
|
writeRemoveEntity(oldId, writer);
|
|
1079
1088
|
}
|
|
@@ -992,7 +992,8 @@ var DedicatedServer = class {
|
|
|
992
992
|
}
|
|
993
993
|
}
|
|
994
994
|
SV_SendClientFrame(client, snapshot) {
|
|
995
|
-
const
|
|
995
|
+
const MTU = 1400;
|
|
996
|
+
const writer = new BinaryWriter2(MTU);
|
|
996
997
|
writer.writeByte(ServerCommand2.frame);
|
|
997
998
|
writer.writeLong(this.sv.frame);
|
|
998
999
|
writer.writeLong(0);
|
|
@@ -1030,10 +1031,18 @@ var DedicatedServer = class {
|
|
|
1030
1031
|
const entities = snapshot.packetEntities || [];
|
|
1031
1032
|
const currentEntityIds = [];
|
|
1032
1033
|
for (const entity of entities) {
|
|
1034
|
+
if (writer.getOffset() > MTU - 200) {
|
|
1035
|
+
console.warn("Packet MTU limit reached, dropping remaining entities");
|
|
1036
|
+
break;
|
|
1037
|
+
}
|
|
1033
1038
|
currentEntityIds.push(entity.number);
|
|
1034
1039
|
writeDeltaEntity({}, entity, writer, false, true);
|
|
1035
1040
|
}
|
|
1036
1041
|
for (const oldId of client.lastPacketEntities) {
|
|
1042
|
+
if (writer.getOffset() > MTU - 10) {
|
|
1043
|
+
console.warn("Packet MTU limit reached, dropping remaining removals");
|
|
1044
|
+
break;
|
|
1045
|
+
}
|
|
1037
1046
|
if (!currentEntityIds.includes(oldId)) {
|
|
1038
1047
|
writeRemoveEntity(oldId, writer);
|
|
1039
1048
|
}
|