quake2ts 0.0.515 → 0.0.517
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/client/dist/browser/index.global.js +10 -10
- package/packages/client/dist/browser/index.global.js.map +1 -1
- package/packages/client/dist/cjs/index.cjs +34 -12
- package/packages/client/dist/cjs/index.cjs.map +1 -1
- package/packages/client/dist/esm/index.js +34 -12
- package/packages/client/dist/esm/index.js.map +1 -1
- package/packages/client/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/engine/dist/browser/index.global.js +9 -9
- package/packages/engine/dist/browser/index.global.js.map +1 -1
- package/packages/engine/dist/cjs/index.cjs +60 -27
- package/packages/engine/dist/cjs/index.cjs.map +1 -1
- package/packages/engine/dist/esm/index.js +60 -27
- package/packages/engine/dist/esm/index.js.map +1 -1
- package/packages/engine/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/engine/dist/types/assets/crossReference.d.ts +53 -0
- package/packages/engine/dist/types/assets/crossReference.d.ts.map +1 -0
- package/packages/engine/dist/types/assets/manager.d.ts.map +1 -1
- package/packages/engine/dist/types/demo/analysis.d.ts +11 -7
- package/packages/engine/dist/types/demo/analysis.d.ts.map +1 -1
- package/packages/engine/dist/types/demo/analyzer.d.ts.map +1 -1
- package/packages/engine/dist/types/demo/playback.d.ts +4 -0
- package/packages/engine/dist/types/demo/playback.d.ts.map +1 -1
- package/packages/engine/dist/types/render/gpuProfiler.d.ts +22 -7
- package/packages/engine/dist/types/render/gpuProfiler.d.ts.map +1 -1
- package/packages/engine/dist/types/render/renderer.d.ts.map +1 -1
- package/packages/game/dist/tsconfig.tsbuildinfo +1 -1
|
@@ -4422,7 +4422,8 @@ var AssetManager = class {
|
|
|
4422
4422
|
}
|
|
4423
4423
|
async loadTexture(path) {
|
|
4424
4424
|
if (this.resourceTracker) {
|
|
4425
|
-
this.
|
|
4425
|
+
const stats = this.vfs.stat(path);
|
|
4426
|
+
this.resourceTracker.recordLoad("texture" /* Texture */, path, stats?.size, stats?.sourcePak);
|
|
4426
4427
|
}
|
|
4427
4428
|
const cached = this.textures.get(path);
|
|
4428
4429
|
if (cached) return cached;
|
|
@@ -4443,7 +4444,8 @@ var AssetManager = class {
|
|
|
4443
4444
|
}
|
|
4444
4445
|
async loadSound(path) {
|
|
4445
4446
|
if (this.resourceTracker) {
|
|
4446
|
-
this.
|
|
4447
|
+
const stats = this.vfs.stat(path);
|
|
4448
|
+
this.resourceTracker.recordLoad("sound" /* Sound */, path, stats?.size, stats?.sourcePak);
|
|
4447
4449
|
}
|
|
4448
4450
|
const audio = await this.audio.load(path);
|
|
4449
4451
|
const key = this.makeKey("sound", path);
|
|
@@ -4453,7 +4455,8 @@ var AssetManager = class {
|
|
|
4453
4455
|
}
|
|
4454
4456
|
async loadMd2Model(path, textureDependencies = []) {
|
|
4455
4457
|
if (this.resourceTracker) {
|
|
4456
|
-
this.
|
|
4458
|
+
const stats = this.vfs.stat(path);
|
|
4459
|
+
this.resourceTracker.recordLoad("model" /* Model */, path, stats?.size, stats?.sourcePak);
|
|
4457
4460
|
}
|
|
4458
4461
|
const modelKey = this.makeKey("model", path);
|
|
4459
4462
|
const dependencyKeys = textureDependencies.map((dep) => this.makeKey("texture", dep));
|
|
@@ -4468,13 +4471,15 @@ var AssetManager = class {
|
|
|
4468
4471
|
}
|
|
4469
4472
|
getMd2Model(path) {
|
|
4470
4473
|
if (this.resourceTracker) {
|
|
4471
|
-
this.
|
|
4474
|
+
const stats = this.vfs.stat(path);
|
|
4475
|
+
this.resourceTracker.recordLoad("model" /* Model */, path, stats?.size, stats?.sourcePak);
|
|
4472
4476
|
}
|
|
4473
4477
|
return this.md2.get(path);
|
|
4474
4478
|
}
|
|
4475
4479
|
async loadMd3Model(path, textureDependencies = []) {
|
|
4476
4480
|
if (this.resourceTracker) {
|
|
4477
|
-
this.
|
|
4481
|
+
const stats = this.vfs.stat(path);
|
|
4482
|
+
this.resourceTracker.recordLoad("model" /* Model */, path, stats?.size, stats?.sourcePak);
|
|
4478
4483
|
}
|
|
4479
4484
|
const modelKey = this.makeKey("model", path);
|
|
4480
4485
|
const dependencyKeys = textureDependencies.map((dep) => this.makeKey("texture", dep));
|
|
@@ -4489,13 +4494,15 @@ var AssetManager = class {
|
|
|
4489
4494
|
}
|
|
4490
4495
|
getMd3Model(path) {
|
|
4491
4496
|
if (this.resourceTracker) {
|
|
4492
|
-
this.
|
|
4497
|
+
const stats = this.vfs.stat(path);
|
|
4498
|
+
this.resourceTracker.recordLoad("model" /* Model */, path, stats?.size, stats?.sourcePak);
|
|
4493
4499
|
}
|
|
4494
4500
|
return this.md3.get(path);
|
|
4495
4501
|
}
|
|
4496
4502
|
async loadSprite(path) {
|
|
4497
4503
|
if (this.resourceTracker) {
|
|
4498
|
-
this.
|
|
4504
|
+
const stats = this.vfs.stat(path);
|
|
4505
|
+
this.resourceTracker.recordLoad("sprite" /* Sprite */, path, stats?.size, stats?.sourcePak);
|
|
4499
4506
|
}
|
|
4500
4507
|
const spriteKey = this.makeKey("sprite", path);
|
|
4501
4508
|
this.dependencyTracker.register(spriteKey);
|
|
@@ -4505,7 +4512,8 @@ var AssetManager = class {
|
|
|
4505
4512
|
}
|
|
4506
4513
|
async loadMap(path) {
|
|
4507
4514
|
if (this.resourceTracker) {
|
|
4508
|
-
this.
|
|
4515
|
+
const stats = this.vfs.stat(path);
|
|
4516
|
+
this.resourceTracker.recordLoad("map" /* Map */, path, stats?.size, stats?.sourcePak);
|
|
4509
4517
|
}
|
|
4510
4518
|
const mapKey = this.makeKey("map", path);
|
|
4511
4519
|
if (this.maps.has(path)) {
|
|
@@ -13295,13 +13303,16 @@ var NetworkMessageParser = class _NetworkMessageParser {
|
|
|
13295
13303
|
|
|
13296
13304
|
// src/demo/analysis.ts
|
|
13297
13305
|
var DemoEventType = /* @__PURE__ */ ((DemoEventType2) => {
|
|
13298
|
-
DemoEventType2[
|
|
13299
|
-
DemoEventType2[
|
|
13300
|
-
DemoEventType2[
|
|
13301
|
-
DemoEventType2[
|
|
13302
|
-
DemoEventType2[
|
|
13303
|
-
DemoEventType2[
|
|
13304
|
-
DemoEventType2[
|
|
13306
|
+
DemoEventType2["WeaponFire"] = "weapon_fire";
|
|
13307
|
+
DemoEventType2["DamageDealt"] = "damage_dealt";
|
|
13308
|
+
DemoEventType2["DamageReceived"] = "damage_received";
|
|
13309
|
+
DemoEventType2["Pickup"] = "pickup";
|
|
13310
|
+
DemoEventType2["Death"] = "death";
|
|
13311
|
+
DemoEventType2["Kill"] = "kill";
|
|
13312
|
+
DemoEventType2["Spawn"] = "spawn";
|
|
13313
|
+
DemoEventType2["PlayerInfo"] = "player_info";
|
|
13314
|
+
DemoEventType2["Chat"] = "chat";
|
|
13315
|
+
DemoEventType2["Objective"] = "objective";
|
|
13305
13316
|
return DemoEventType2;
|
|
13306
13317
|
})(DemoEventType || {});
|
|
13307
13318
|
|
|
@@ -13366,7 +13377,7 @@ var DemoAnalyzer = class {
|
|
|
13366
13377
|
currentFrameEntities.add(ent.number);
|
|
13367
13378
|
if (!this.activeEntities.has(ent.number)) {
|
|
13368
13379
|
this.recordEvent({
|
|
13369
|
-
type:
|
|
13380
|
+
type: "spawn" /* Spawn */,
|
|
13370
13381
|
frame: currentFrameIndex,
|
|
13371
13382
|
time: currentTime,
|
|
13372
13383
|
entityId: ent.number,
|
|
@@ -13381,25 +13392,41 @@ var DemoAnalyzer = class {
|
|
|
13381
13392
|
}
|
|
13382
13393
|
},
|
|
13383
13394
|
onPrint: (level, msg) => {
|
|
13384
|
-
|
|
13395
|
+
const text = msg.replace(/\n/g, " ").trim();
|
|
13396
|
+
if (text.includes("died") || text.includes("killed") || text.includes("suicide")) {
|
|
13385
13397
|
this.summary.totalDeaths++;
|
|
13386
13398
|
this.recordEvent({
|
|
13387
|
-
type:
|
|
13399
|
+
type: "death" /* Death */,
|
|
13388
13400
|
frame: currentFrameIndex,
|
|
13389
13401
|
time: currentTime,
|
|
13390
|
-
description:
|
|
13402
|
+
description: text
|
|
13391
13403
|
});
|
|
13392
|
-
}
|
|
13393
|
-
if (msg.startsWith("You got the ")) {
|
|
13404
|
+
} else if (text.startsWith("You got the ")) {
|
|
13394
13405
|
this.recordEvent({
|
|
13395
|
-
type:
|
|
13406
|
+
type: "pickup" /* Pickup */,
|
|
13396
13407
|
frame: currentFrameIndex,
|
|
13397
13408
|
time: currentTime,
|
|
13398
|
-
description:
|
|
13409
|
+
description: text
|
|
13399
13410
|
});
|
|
13411
|
+
} else {
|
|
13412
|
+
if (level === 3 || level === 2) {
|
|
13413
|
+
this.recordEvent({
|
|
13414
|
+
type: "chat" /* Chat */,
|
|
13415
|
+
frame: currentFrameIndex,
|
|
13416
|
+
time: currentTime,
|
|
13417
|
+
description: text,
|
|
13418
|
+
data: { level }
|
|
13419
|
+
});
|
|
13420
|
+
}
|
|
13400
13421
|
}
|
|
13401
13422
|
},
|
|
13402
|
-
onCenterPrint: () => {
|
|
13423
|
+
onCenterPrint: (msg) => {
|
|
13424
|
+
this.recordEvent({
|
|
13425
|
+
type: "objective" /* Objective */,
|
|
13426
|
+
frame: currentFrameIndex,
|
|
13427
|
+
time: currentTime,
|
|
13428
|
+
description: msg.trim()
|
|
13429
|
+
});
|
|
13403
13430
|
},
|
|
13404
13431
|
onStuffText: () => {
|
|
13405
13432
|
},
|
|
@@ -13430,7 +13457,7 @@ var DemoAnalyzer = class {
|
|
|
13430
13457
|
onDamage: (indicators) => {
|
|
13431
13458
|
for (const ind of indicators) {
|
|
13432
13459
|
this.recordEvent({
|
|
13433
|
-
type:
|
|
13460
|
+
type: "damage_received" /* DamageReceived */,
|
|
13434
13461
|
frame: currentFrameIndex,
|
|
13435
13462
|
time: currentTime,
|
|
13436
13463
|
value: ind.damage,
|
|
@@ -13476,7 +13503,7 @@ var DemoAnalyzer = class {
|
|
|
13476
13503
|
}
|
|
13477
13504
|
handleWeaponFire(ent, weapon, frame, time) {
|
|
13478
13505
|
this.recordEvent({
|
|
13479
|
-
type:
|
|
13506
|
+
type: "weapon_fire" /* WeaponFire */,
|
|
13480
13507
|
frame,
|
|
13481
13508
|
time,
|
|
13482
13509
|
entityId: ent,
|
|
@@ -14016,10 +14043,16 @@ var DemoPlaybackController = class {
|
|
|
14016
14043
|
return trajectory;
|
|
14017
14044
|
}
|
|
14018
14045
|
// 3.2.3 Event Log Extraction & 3.3 Metadata
|
|
14019
|
-
|
|
14046
|
+
/**
|
|
14047
|
+
* Extract notable events from demo for timeline markers
|
|
14048
|
+
*/
|
|
14049
|
+
getEvents() {
|
|
14020
14050
|
this.ensureAnalysis();
|
|
14021
14051
|
return this.cachedEvents || [];
|
|
14022
14052
|
}
|
|
14053
|
+
getDemoEvents() {
|
|
14054
|
+
return this.getEvents();
|
|
14055
|
+
}
|
|
14023
14056
|
filterEvents(type, entityId) {
|
|
14024
14057
|
const events = this.getDemoEvents();
|
|
14025
14058
|
return events.filter((e) => {
|