quake2ts 0.0.565 → 0.0.567
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 +1 -1
- package/packages/engine/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/engine/dist/types/render/webgpu/context.d.ts +27 -0
- package/packages/engine/dist/types/render/webgpu/context.d.ts.map +1 -0
- package/packages/test-utils/dist/index.cjs +301 -178
- package/packages/test-utils/dist/index.cjs.map +1 -1
- package/packages/test-utils/dist/index.d.cts +87 -41
- package/packages/test-utils/dist/index.d.ts +87 -41
- package/packages/test-utils/dist/index.js +294 -178
- package/packages/test-utils/dist/index.js.map +1 -1
|
@@ -659,6 +659,52 @@ async function simulateHandshake(client, server) {
|
|
|
659
659
|
return true;
|
|
660
660
|
}
|
|
661
661
|
|
|
662
|
+
// src/server/mocks/commands.ts
|
|
663
|
+
import { vi as vi5 } from "vitest";
|
|
664
|
+
function createMockServerConsole(overrides) {
|
|
665
|
+
const outputBuffer = [];
|
|
666
|
+
const commandBuffer = [];
|
|
667
|
+
return {
|
|
668
|
+
exec: vi5.fn((cmd) => {
|
|
669
|
+
commandBuffer.push(cmd);
|
|
670
|
+
return `Executed: ${cmd}`;
|
|
671
|
+
}),
|
|
672
|
+
print: vi5.fn((text) => {
|
|
673
|
+
outputBuffer.push(text);
|
|
674
|
+
}),
|
|
675
|
+
broadcast: vi5.fn((text) => {
|
|
676
|
+
outputBuffer.push(`Broadcast: ${text}`);
|
|
677
|
+
}),
|
|
678
|
+
commandBuffer,
|
|
679
|
+
outputBuffer,
|
|
680
|
+
...overrides
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
function createMockRConClient(password = "") {
|
|
684
|
+
return {
|
|
685
|
+
connected: false,
|
|
686
|
+
lastCommand: "",
|
|
687
|
+
lastResponse: "",
|
|
688
|
+
connect: vi5.fn(async (address, port, pwd) => {
|
|
689
|
+
return pwd === password;
|
|
690
|
+
}),
|
|
691
|
+
sendCommand: vi5.fn(async (cmd) => {
|
|
692
|
+
return `RCON Response for: ${cmd}`;
|
|
693
|
+
}),
|
|
694
|
+
disconnect: vi5.fn()
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
function simulateServerCommand(server, command) {
|
|
698
|
+
if (server.executeBuffer) {
|
|
699
|
+
server.executeBuffer(command);
|
|
700
|
+
return "Executed";
|
|
701
|
+
}
|
|
702
|
+
if (server.exec) {
|
|
703
|
+
return server.exec(command);
|
|
704
|
+
}
|
|
705
|
+
return "Unknown command handler";
|
|
706
|
+
}
|
|
707
|
+
|
|
662
708
|
// src/server/helpers/multiplayer.ts
|
|
663
709
|
import { ClientState as ClientState3 } from "@quake2ts/server";
|
|
664
710
|
function createMultiplayerTestScenario(numPlayers = 2) {
|
|
@@ -1287,193 +1333,67 @@ function createMockImage(width, height, src) {
|
|
|
1287
1333
|
return img;
|
|
1288
1334
|
}
|
|
1289
1335
|
|
|
1290
|
-
// src/
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
}
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
|
-
// src/setup/storage.ts
|
|
1297
|
-
import "fake-indexeddb/auto";
|
|
1298
|
-
function createMockLocalStorage(initialData = {}) {
|
|
1299
|
-
const storage = new Map(Object.entries(initialData));
|
|
1336
|
+
// src/engine/mocks/webgpu.ts
|
|
1337
|
+
import { vi as vi6 } from "vitest";
|
|
1338
|
+
function createMockGPUAdapter() {
|
|
1300
1339
|
return {
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
clear: () => storage.clear(),
|
|
1305
|
-
key: (index) => Array.from(storage.keys())[index] || null,
|
|
1306
|
-
get length() {
|
|
1307
|
-
return storage.size;
|
|
1308
|
-
}
|
|
1340
|
+
requestDevice: vi6.fn().mockResolvedValue(createMockGPUDevice()),
|
|
1341
|
+
features: /* @__PURE__ */ new Set(),
|
|
1342
|
+
limits: {}
|
|
1309
1343
|
};
|
|
1310
1344
|
}
|
|
1311
|
-
function
|
|
1312
|
-
return
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1345
|
+
function createMockGPUDevice() {
|
|
1346
|
+
return {
|
|
1347
|
+
features: /* @__PURE__ */ new Set(),
|
|
1348
|
+
limits: {},
|
|
1349
|
+
queue: {
|
|
1350
|
+
submit: vi6.fn(),
|
|
1351
|
+
writeBuffer: vi6.fn(),
|
|
1352
|
+
writeTexture: vi6.fn(),
|
|
1353
|
+
copyExternalImageToTexture: vi6.fn()
|
|
1354
|
+
},
|
|
1355
|
+
createCommandEncoder: vi6.fn().mockReturnValue({
|
|
1356
|
+
beginRenderPass: vi6.fn().mockReturnValue({
|
|
1357
|
+
setPipeline: vi6.fn(),
|
|
1358
|
+
draw: vi6.fn(),
|
|
1359
|
+
end: vi6.fn()
|
|
1360
|
+
}),
|
|
1361
|
+
finish: vi6.fn()
|
|
1362
|
+
}),
|
|
1363
|
+
createRenderPipeline: vi6.fn(),
|
|
1364
|
+
createShaderModule: vi6.fn(),
|
|
1365
|
+
createBindGroup: vi6.fn(),
|
|
1366
|
+
createBindGroupLayout: vi6.fn(),
|
|
1367
|
+
createBuffer: vi6.fn(),
|
|
1368
|
+
createTexture: vi6.fn(),
|
|
1369
|
+
createSampler: vi6.fn()
|
|
1370
|
+
};
|
|
1319
1371
|
}
|
|
1320
|
-
function
|
|
1321
|
-
if (storageType === "indexed") {
|
|
1322
|
-
const dbName = `test-db-${Math.random().toString(36).substring(7)}`;
|
|
1323
|
-
const storeName = "test-store";
|
|
1324
|
-
const storage2 = createMockIndexedDB();
|
|
1325
|
-
return {
|
|
1326
|
-
storage: storage2,
|
|
1327
|
-
populate: async (data) => {
|
|
1328
|
-
return new Promise((resolve, reject) => {
|
|
1329
|
-
const req = storage2.open(dbName, 1);
|
|
1330
|
-
req.onupgradeneeded = (e) => {
|
|
1331
|
-
const db = e.target.result;
|
|
1332
|
-
db.createObjectStore(storeName);
|
|
1333
|
-
};
|
|
1334
|
-
req.onsuccess = (e) => {
|
|
1335
|
-
const db = e.target.result;
|
|
1336
|
-
const tx = db.transaction(storeName, "readwrite");
|
|
1337
|
-
const store = tx.objectStore(storeName);
|
|
1338
|
-
Object.entries(data).forEach(([k, v]) => store.put(v, k));
|
|
1339
|
-
tx.oncomplete = () => {
|
|
1340
|
-
db.close();
|
|
1341
|
-
resolve();
|
|
1342
|
-
};
|
|
1343
|
-
tx.onerror = () => reject(tx.error);
|
|
1344
|
-
};
|
|
1345
|
-
req.onerror = () => reject(req.error);
|
|
1346
|
-
});
|
|
1347
|
-
},
|
|
1348
|
-
verify: async (key, value) => {
|
|
1349
|
-
return new Promise((resolve, reject) => {
|
|
1350
|
-
const req = storage2.open(dbName, 1);
|
|
1351
|
-
req.onsuccess = (e) => {
|
|
1352
|
-
const db = e.target.result;
|
|
1353
|
-
if (!db.objectStoreNames.contains(storeName)) {
|
|
1354
|
-
db.close();
|
|
1355
|
-
resolve(false);
|
|
1356
|
-
return;
|
|
1357
|
-
}
|
|
1358
|
-
const tx = db.transaction(storeName, "readonly");
|
|
1359
|
-
const store = tx.objectStore(storeName);
|
|
1360
|
-
const getReq = store.get(key);
|
|
1361
|
-
getReq.onsuccess = () => {
|
|
1362
|
-
const result = getReq.result === value;
|
|
1363
|
-
db.close();
|
|
1364
|
-
resolve(result);
|
|
1365
|
-
};
|
|
1366
|
-
getReq.onerror = () => {
|
|
1367
|
-
db.close();
|
|
1368
|
-
resolve(false);
|
|
1369
|
-
};
|
|
1370
|
-
};
|
|
1371
|
-
req.onerror = () => reject(req.error);
|
|
1372
|
-
});
|
|
1373
|
-
}
|
|
1374
|
-
};
|
|
1375
|
-
}
|
|
1376
|
-
const storage = storageType === "local" ? createMockLocalStorage() : createMockSessionStorage();
|
|
1372
|
+
function createMockGPUCanvasContext() {
|
|
1377
1373
|
return {
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
},
|
|
1382
|
-
verify(key, value) {
|
|
1383
|
-
return storage.getItem(key) === value;
|
|
1384
|
-
}
|
|
1374
|
+
configure: vi6.fn(),
|
|
1375
|
+
unconfigure: vi6.fn(),
|
|
1376
|
+
getCurrentTexture: vi6.fn()
|
|
1385
1377
|
};
|
|
1386
1378
|
}
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
connect: () => {
|
|
1393
|
-
},
|
|
1394
|
-
gain: { value: 1, setValueAtTime: () => {
|
|
1395
|
-
} }
|
|
1396
|
-
}),
|
|
1397
|
-
createOscillator: () => ({
|
|
1398
|
-
connect: () => {
|
|
1399
|
-
},
|
|
1400
|
-
start: () => {
|
|
1401
|
-
},
|
|
1402
|
-
stop: () => {
|
|
1403
|
-
},
|
|
1404
|
-
frequency: { value: 440 }
|
|
1405
|
-
}),
|
|
1406
|
-
createBufferSource: () => ({
|
|
1407
|
-
connect: () => {
|
|
1408
|
-
},
|
|
1409
|
-
start: () => {
|
|
1410
|
-
},
|
|
1411
|
-
stop: () => {
|
|
1412
|
-
},
|
|
1413
|
-
buffer: null,
|
|
1414
|
-
playbackRate: { value: 1 },
|
|
1415
|
-
loop: false
|
|
1416
|
-
}),
|
|
1417
|
-
destination: {},
|
|
1418
|
-
currentTime: 0,
|
|
1419
|
-
state: "running",
|
|
1420
|
-
resume: async () => {
|
|
1421
|
-
},
|
|
1422
|
-
suspend: async () => {
|
|
1423
|
-
},
|
|
1424
|
-
close: async () => {
|
|
1425
|
-
},
|
|
1426
|
-
decodeAudioData: async (buffer) => ({
|
|
1427
|
-
duration: 1,
|
|
1428
|
-
length: 44100,
|
|
1429
|
-
sampleRate: 44100,
|
|
1430
|
-
numberOfChannels: 2,
|
|
1431
|
-
getChannelData: () => new Float32Array(44100)
|
|
1432
|
-
}),
|
|
1433
|
-
createBuffer: (channels, length, sampleRate) => ({
|
|
1434
|
-
duration: length / sampleRate,
|
|
1435
|
-
length,
|
|
1436
|
-
sampleRate,
|
|
1437
|
-
numberOfChannels: channels,
|
|
1438
|
-
getChannelData: () => new Float32Array(length)
|
|
1439
|
-
}),
|
|
1440
|
-
// Helper to track events if needed
|
|
1441
|
-
_events: []
|
|
1379
|
+
function setupWebGPUMocks() {
|
|
1380
|
+
const mockAdapter = createMockGPUAdapter();
|
|
1381
|
+
const mockGpu = {
|
|
1382
|
+
requestAdapter: vi6.fn().mockResolvedValue(mockAdapter),
|
|
1383
|
+
getPreferredCanvasFormat: vi6.fn().mockReturnValue("bgra8unorm")
|
|
1442
1384
|
};
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
if (typeof value === "function") {
|
|
1448
|
-
return (...args) => {
|
|
1449
|
-
target._events.push({ type: String(prop), args });
|
|
1450
|
-
return Reflect.apply(value, target, args);
|
|
1451
|
-
};
|
|
1452
|
-
}
|
|
1453
|
-
return value;
|
|
1454
|
-
}
|
|
1385
|
+
Object.defineProperty(global.navigator, "gpu", {
|
|
1386
|
+
value: mockGpu,
|
|
1387
|
+
writable: true,
|
|
1388
|
+
configurable: true
|
|
1455
1389
|
});
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
};
|
|
1464
|
-
global.window.AudioContext = global.AudioContext;
|
|
1465
|
-
global.window.webkitAudioContext = global.AudioContext;
|
|
1466
|
-
}
|
|
1467
|
-
}
|
|
1468
|
-
function teardownMockAudioContext() {
|
|
1469
|
-
if (global.AudioContext && global.AudioContext.toString().includes("class")) {
|
|
1470
|
-
delete global.AudioContext;
|
|
1471
|
-
delete global.window.AudioContext;
|
|
1472
|
-
delete global.window.webkitAudioContext;
|
|
1473
|
-
}
|
|
1474
|
-
}
|
|
1475
|
-
function captureAudioEvents(context) {
|
|
1476
|
-
return context._events || [];
|
|
1390
|
+
global.GPUTextureUsage = {
|
|
1391
|
+
COPY_SRC: 1,
|
|
1392
|
+
COPY_DST: 2,
|
|
1393
|
+
TEXTURE_BINDING: 4,
|
|
1394
|
+
STORAGE_BINDING: 8,
|
|
1395
|
+
RENDER_ATTACHMENT: 16
|
|
1396
|
+
};
|
|
1477
1397
|
}
|
|
1478
1398
|
|
|
1479
1399
|
// src/setup/timing.ts
|
|
@@ -1660,6 +1580,195 @@ function simulateFramesWithMock(mock, count, frameTimeMs = 16.6, callback) {
|
|
|
1660
1580
|
}
|
|
1661
1581
|
}
|
|
1662
1582
|
|
|
1583
|
+
// src/setup/node.ts
|
|
1584
|
+
function setupNodeEnvironment(options = {}) {
|
|
1585
|
+
if (options.polyfillFetch && typeof global.fetch === "undefined") {
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
// src/setup/storage.ts
|
|
1590
|
+
import "fake-indexeddb/auto";
|
|
1591
|
+
function createMockLocalStorage(initialData = {}) {
|
|
1592
|
+
const storage = new Map(Object.entries(initialData));
|
|
1593
|
+
return {
|
|
1594
|
+
getItem: (key) => storage.get(key) || null,
|
|
1595
|
+
setItem: (key, value) => storage.set(key, value),
|
|
1596
|
+
removeItem: (key) => storage.delete(key),
|
|
1597
|
+
clear: () => storage.clear(),
|
|
1598
|
+
key: (index) => Array.from(storage.keys())[index] || null,
|
|
1599
|
+
get length() {
|
|
1600
|
+
return storage.size;
|
|
1601
|
+
}
|
|
1602
|
+
};
|
|
1603
|
+
}
|
|
1604
|
+
function createMockSessionStorage(initialData = {}) {
|
|
1605
|
+
return createMockLocalStorage(initialData);
|
|
1606
|
+
}
|
|
1607
|
+
function createMockIndexedDB() {
|
|
1608
|
+
if (typeof indexedDB === "undefined") {
|
|
1609
|
+
throw new Error("IndexedDB mock not found. Ensure fake-indexeddb is loaded.");
|
|
1610
|
+
}
|
|
1611
|
+
return indexedDB;
|
|
1612
|
+
}
|
|
1613
|
+
function createStorageTestScenario(storageType = "local") {
|
|
1614
|
+
if (storageType === "indexed") {
|
|
1615
|
+
const dbName = `test-db-${Math.random().toString(36).substring(7)}`;
|
|
1616
|
+
const storeName = "test-store";
|
|
1617
|
+
const storage2 = createMockIndexedDB();
|
|
1618
|
+
return {
|
|
1619
|
+
storage: storage2,
|
|
1620
|
+
populate: async (data) => {
|
|
1621
|
+
return new Promise((resolve, reject) => {
|
|
1622
|
+
const req = storage2.open(dbName, 1);
|
|
1623
|
+
req.onupgradeneeded = (e) => {
|
|
1624
|
+
const db = e.target.result;
|
|
1625
|
+
db.createObjectStore(storeName);
|
|
1626
|
+
};
|
|
1627
|
+
req.onsuccess = (e) => {
|
|
1628
|
+
const db = e.target.result;
|
|
1629
|
+
const tx = db.transaction(storeName, "readwrite");
|
|
1630
|
+
const store = tx.objectStore(storeName);
|
|
1631
|
+
Object.entries(data).forEach(([k, v]) => store.put(v, k));
|
|
1632
|
+
tx.oncomplete = () => {
|
|
1633
|
+
db.close();
|
|
1634
|
+
resolve();
|
|
1635
|
+
};
|
|
1636
|
+
tx.onerror = () => reject(tx.error);
|
|
1637
|
+
};
|
|
1638
|
+
req.onerror = () => reject(req.error);
|
|
1639
|
+
});
|
|
1640
|
+
},
|
|
1641
|
+
verify: async (key, value) => {
|
|
1642
|
+
return new Promise((resolve, reject) => {
|
|
1643
|
+
const req = storage2.open(dbName, 1);
|
|
1644
|
+
req.onsuccess = (e) => {
|
|
1645
|
+
const db = e.target.result;
|
|
1646
|
+
if (!db.objectStoreNames.contains(storeName)) {
|
|
1647
|
+
db.close();
|
|
1648
|
+
resolve(false);
|
|
1649
|
+
return;
|
|
1650
|
+
}
|
|
1651
|
+
const tx = db.transaction(storeName, "readonly");
|
|
1652
|
+
const store = tx.objectStore(storeName);
|
|
1653
|
+
const getReq = store.get(key);
|
|
1654
|
+
getReq.onsuccess = () => {
|
|
1655
|
+
const result = getReq.result === value;
|
|
1656
|
+
db.close();
|
|
1657
|
+
resolve(result);
|
|
1658
|
+
};
|
|
1659
|
+
getReq.onerror = () => {
|
|
1660
|
+
db.close();
|
|
1661
|
+
resolve(false);
|
|
1662
|
+
};
|
|
1663
|
+
};
|
|
1664
|
+
req.onerror = () => reject(req.error);
|
|
1665
|
+
});
|
|
1666
|
+
}
|
|
1667
|
+
};
|
|
1668
|
+
}
|
|
1669
|
+
const storage = storageType === "local" ? createMockLocalStorage() : createMockSessionStorage();
|
|
1670
|
+
return {
|
|
1671
|
+
storage,
|
|
1672
|
+
populate(data) {
|
|
1673
|
+
Object.entries(data).forEach(([k, v]) => storage.setItem(k, v));
|
|
1674
|
+
},
|
|
1675
|
+
verify(key, value) {
|
|
1676
|
+
return storage.getItem(key) === value;
|
|
1677
|
+
}
|
|
1678
|
+
};
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
// src/setup/audio.ts
|
|
1682
|
+
function createMockAudioContext() {
|
|
1683
|
+
const context = {
|
|
1684
|
+
createGain: () => ({
|
|
1685
|
+
connect: () => {
|
|
1686
|
+
},
|
|
1687
|
+
gain: { value: 1, setValueAtTime: () => {
|
|
1688
|
+
} }
|
|
1689
|
+
}),
|
|
1690
|
+
createOscillator: () => ({
|
|
1691
|
+
connect: () => {
|
|
1692
|
+
},
|
|
1693
|
+
start: () => {
|
|
1694
|
+
},
|
|
1695
|
+
stop: () => {
|
|
1696
|
+
},
|
|
1697
|
+
frequency: { value: 440 }
|
|
1698
|
+
}),
|
|
1699
|
+
createBufferSource: () => ({
|
|
1700
|
+
connect: () => {
|
|
1701
|
+
},
|
|
1702
|
+
start: () => {
|
|
1703
|
+
},
|
|
1704
|
+
stop: () => {
|
|
1705
|
+
},
|
|
1706
|
+
buffer: null,
|
|
1707
|
+
playbackRate: { value: 1 },
|
|
1708
|
+
loop: false
|
|
1709
|
+
}),
|
|
1710
|
+
destination: {},
|
|
1711
|
+
currentTime: 0,
|
|
1712
|
+
state: "running",
|
|
1713
|
+
resume: async () => {
|
|
1714
|
+
},
|
|
1715
|
+
suspend: async () => {
|
|
1716
|
+
},
|
|
1717
|
+
close: async () => {
|
|
1718
|
+
},
|
|
1719
|
+
decodeAudioData: async (buffer) => ({
|
|
1720
|
+
duration: 1,
|
|
1721
|
+
length: 44100,
|
|
1722
|
+
sampleRate: 44100,
|
|
1723
|
+
numberOfChannels: 2,
|
|
1724
|
+
getChannelData: () => new Float32Array(44100)
|
|
1725
|
+
}),
|
|
1726
|
+
createBuffer: (channels, length, sampleRate) => ({
|
|
1727
|
+
duration: length / sampleRate,
|
|
1728
|
+
length,
|
|
1729
|
+
sampleRate,
|
|
1730
|
+
numberOfChannels: channels,
|
|
1731
|
+
getChannelData: () => new Float32Array(length)
|
|
1732
|
+
}),
|
|
1733
|
+
// Helper to track events if needed
|
|
1734
|
+
_events: []
|
|
1735
|
+
};
|
|
1736
|
+
return new Proxy(context, {
|
|
1737
|
+
get(target, prop, receiver) {
|
|
1738
|
+
if (prop === "_events") return target._events;
|
|
1739
|
+
const value = Reflect.get(target, prop, receiver);
|
|
1740
|
+
if (typeof value === "function") {
|
|
1741
|
+
return (...args) => {
|
|
1742
|
+
target._events.push({ type: String(prop), args });
|
|
1743
|
+
return Reflect.apply(value, target, args);
|
|
1744
|
+
};
|
|
1745
|
+
}
|
|
1746
|
+
return value;
|
|
1747
|
+
}
|
|
1748
|
+
});
|
|
1749
|
+
}
|
|
1750
|
+
function setupMockAudioContext() {
|
|
1751
|
+
if (typeof global.AudioContext === "undefined" && typeof global.window !== "undefined") {
|
|
1752
|
+
global.AudioContext = class {
|
|
1753
|
+
constructor() {
|
|
1754
|
+
return createMockAudioContext();
|
|
1755
|
+
}
|
|
1756
|
+
};
|
|
1757
|
+
global.window.AudioContext = global.AudioContext;
|
|
1758
|
+
global.window.webkitAudioContext = global.AudioContext;
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
function teardownMockAudioContext() {
|
|
1762
|
+
if (global.AudioContext && global.AudioContext.toString().includes("class")) {
|
|
1763
|
+
delete global.AudioContext;
|
|
1764
|
+
delete global.window.AudioContext;
|
|
1765
|
+
delete global.window.webkitAudioContext;
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
function captureAudioEvents(context) {
|
|
1769
|
+
return context._events || [];
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1663
1772
|
// src/e2e/playwright.ts
|
|
1664
1773
|
import { chromium } from "playwright";
|
|
1665
1774
|
import { createServer } from "http";
|
|
@@ -1898,6 +2007,9 @@ export {
|
|
|
1898
2007
|
createMockCanvasContext2D,
|
|
1899
2008
|
createMockConnection,
|
|
1900
2009
|
createMockEngine,
|
|
2010
|
+
createMockGPUAdapter,
|
|
2011
|
+
createMockGPUCanvasContext,
|
|
2012
|
+
createMockGPUDevice,
|
|
1901
2013
|
createMockGame,
|
|
1902
2014
|
createMockGameState,
|
|
1903
2015
|
createMockHandshake,
|
|
@@ -1908,8 +2020,10 @@ export {
|
|
|
1908
2020
|
createMockNetworkAddress,
|
|
1909
2021
|
createMockPerformance,
|
|
1910
2022
|
createMockRAF,
|
|
2023
|
+
createMockRConClient,
|
|
1911
2024
|
createMockServer,
|
|
1912
2025
|
createMockServerClient,
|
|
2026
|
+
createMockServerConsole,
|
|
1913
2027
|
createMockServerState,
|
|
1914
2028
|
createMockServerStatic,
|
|
1915
2029
|
createMockSessionStorage,
|
|
@@ -1939,6 +2053,7 @@ export {
|
|
|
1939
2053
|
setupBrowserEnvironment,
|
|
1940
2054
|
setupMockAudioContext,
|
|
1941
2055
|
setupNodeEnvironment,
|
|
2056
|
+
setupWebGPUMocks,
|
|
1942
2057
|
simulateFrames,
|
|
1943
2058
|
simulateFramesWithMock,
|
|
1944
2059
|
simulateHandshake,
|
|
@@ -1946,6 +2061,7 @@ export {
|
|
|
1946
2061
|
simulatePlayerInput,
|
|
1947
2062
|
simulatePlayerJoin,
|
|
1948
2063
|
simulatePlayerLeave,
|
|
2064
|
+
simulateServerCommand,
|
|
1949
2065
|
simulateServerTick,
|
|
1950
2066
|
simulateSnapshotDelivery,
|
|
1951
2067
|
stairTrace,
|