quake2ts 0.0.516 → 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
|
@@ -4637,7 +4637,8 @@ var AssetManager = class {
|
|
|
4637
4637
|
}
|
|
4638
4638
|
async loadTexture(path) {
|
|
4639
4639
|
if (this.resourceTracker) {
|
|
4640
|
-
this.
|
|
4640
|
+
const stats = this.vfs.stat(path);
|
|
4641
|
+
this.resourceTracker.recordLoad("texture" /* Texture */, path, stats?.size, stats?.sourcePak);
|
|
4641
4642
|
}
|
|
4642
4643
|
const cached = this.textures.get(path);
|
|
4643
4644
|
if (cached) return cached;
|
|
@@ -4658,7 +4659,8 @@ var AssetManager = class {
|
|
|
4658
4659
|
}
|
|
4659
4660
|
async loadSound(path) {
|
|
4660
4661
|
if (this.resourceTracker) {
|
|
4661
|
-
this.
|
|
4662
|
+
const stats = this.vfs.stat(path);
|
|
4663
|
+
this.resourceTracker.recordLoad("sound" /* Sound */, path, stats?.size, stats?.sourcePak);
|
|
4662
4664
|
}
|
|
4663
4665
|
const audio = await this.audio.load(path);
|
|
4664
4666
|
const key = this.makeKey("sound", path);
|
|
@@ -4668,7 +4670,8 @@ var AssetManager = class {
|
|
|
4668
4670
|
}
|
|
4669
4671
|
async loadMd2Model(path, textureDependencies = []) {
|
|
4670
4672
|
if (this.resourceTracker) {
|
|
4671
|
-
this.
|
|
4673
|
+
const stats = this.vfs.stat(path);
|
|
4674
|
+
this.resourceTracker.recordLoad("model" /* Model */, path, stats?.size, stats?.sourcePak);
|
|
4672
4675
|
}
|
|
4673
4676
|
const modelKey = this.makeKey("model", path);
|
|
4674
4677
|
const dependencyKeys = textureDependencies.map((dep) => this.makeKey("texture", dep));
|
|
@@ -4683,13 +4686,15 @@ var AssetManager = class {
|
|
|
4683
4686
|
}
|
|
4684
4687
|
getMd2Model(path) {
|
|
4685
4688
|
if (this.resourceTracker) {
|
|
4686
|
-
this.
|
|
4689
|
+
const stats = this.vfs.stat(path);
|
|
4690
|
+
this.resourceTracker.recordLoad("model" /* Model */, path, stats?.size, stats?.sourcePak);
|
|
4687
4691
|
}
|
|
4688
4692
|
return this.md2.get(path);
|
|
4689
4693
|
}
|
|
4690
4694
|
async loadMd3Model(path, textureDependencies = []) {
|
|
4691
4695
|
if (this.resourceTracker) {
|
|
4692
|
-
this.
|
|
4696
|
+
const stats = this.vfs.stat(path);
|
|
4697
|
+
this.resourceTracker.recordLoad("model" /* Model */, path, stats?.size, stats?.sourcePak);
|
|
4693
4698
|
}
|
|
4694
4699
|
const modelKey = this.makeKey("model", path);
|
|
4695
4700
|
const dependencyKeys = textureDependencies.map((dep) => this.makeKey("texture", dep));
|
|
@@ -4704,13 +4709,15 @@ var AssetManager = class {
|
|
|
4704
4709
|
}
|
|
4705
4710
|
getMd3Model(path) {
|
|
4706
4711
|
if (this.resourceTracker) {
|
|
4707
|
-
this.
|
|
4712
|
+
const stats = this.vfs.stat(path);
|
|
4713
|
+
this.resourceTracker.recordLoad("model" /* Model */, path, stats?.size, stats?.sourcePak);
|
|
4708
4714
|
}
|
|
4709
4715
|
return this.md3.get(path);
|
|
4710
4716
|
}
|
|
4711
4717
|
async loadSprite(path) {
|
|
4712
4718
|
if (this.resourceTracker) {
|
|
4713
|
-
this.
|
|
4719
|
+
const stats = this.vfs.stat(path);
|
|
4720
|
+
this.resourceTracker.recordLoad("sprite" /* Sprite */, path, stats?.size, stats?.sourcePak);
|
|
4714
4721
|
}
|
|
4715
4722
|
const spriteKey = this.makeKey("sprite", path);
|
|
4716
4723
|
this.dependencyTracker.register(spriteKey);
|
|
@@ -4720,7 +4727,8 @@ var AssetManager = class {
|
|
|
4720
4727
|
}
|
|
4721
4728
|
async loadMap(path) {
|
|
4722
4729
|
if (this.resourceTracker) {
|
|
4723
|
-
this.
|
|
4730
|
+
const stats = this.vfs.stat(path);
|
|
4731
|
+
this.resourceTracker.recordLoad("map" /* Map */, path, stats?.size, stats?.sourcePak);
|
|
4724
4732
|
}
|
|
4725
4733
|
const mapKey = this.makeKey("map", path);
|
|
4726
4734
|
if (this.maps.has(path)) {
|
|
@@ -13510,13 +13518,16 @@ var NetworkMessageParser = class _NetworkMessageParser {
|
|
|
13510
13518
|
|
|
13511
13519
|
// src/demo/analysis.ts
|
|
13512
13520
|
var DemoEventType = /* @__PURE__ */ ((DemoEventType2) => {
|
|
13513
|
-
DemoEventType2[
|
|
13514
|
-
DemoEventType2[
|
|
13515
|
-
DemoEventType2[
|
|
13516
|
-
DemoEventType2[
|
|
13517
|
-
DemoEventType2[
|
|
13518
|
-
DemoEventType2[
|
|
13519
|
-
DemoEventType2[
|
|
13521
|
+
DemoEventType2["WeaponFire"] = "weapon_fire";
|
|
13522
|
+
DemoEventType2["DamageDealt"] = "damage_dealt";
|
|
13523
|
+
DemoEventType2["DamageReceived"] = "damage_received";
|
|
13524
|
+
DemoEventType2["Pickup"] = "pickup";
|
|
13525
|
+
DemoEventType2["Death"] = "death";
|
|
13526
|
+
DemoEventType2["Kill"] = "kill";
|
|
13527
|
+
DemoEventType2["Spawn"] = "spawn";
|
|
13528
|
+
DemoEventType2["PlayerInfo"] = "player_info";
|
|
13529
|
+
DemoEventType2["Chat"] = "chat";
|
|
13530
|
+
DemoEventType2["Objective"] = "objective";
|
|
13520
13531
|
return DemoEventType2;
|
|
13521
13532
|
})(DemoEventType || {});
|
|
13522
13533
|
|
|
@@ -13581,7 +13592,7 @@ var DemoAnalyzer = class {
|
|
|
13581
13592
|
currentFrameEntities.add(ent.number);
|
|
13582
13593
|
if (!this.activeEntities.has(ent.number)) {
|
|
13583
13594
|
this.recordEvent({
|
|
13584
|
-
type:
|
|
13595
|
+
type: "spawn" /* Spawn */,
|
|
13585
13596
|
frame: currentFrameIndex,
|
|
13586
13597
|
time: currentTime,
|
|
13587
13598
|
entityId: ent.number,
|
|
@@ -13596,25 +13607,41 @@ var DemoAnalyzer = class {
|
|
|
13596
13607
|
}
|
|
13597
13608
|
},
|
|
13598
13609
|
onPrint: (level, msg) => {
|
|
13599
|
-
|
|
13610
|
+
const text = msg.replace(/\n/g, " ").trim();
|
|
13611
|
+
if (text.includes("died") || text.includes("killed") || text.includes("suicide")) {
|
|
13600
13612
|
this.summary.totalDeaths++;
|
|
13601
13613
|
this.recordEvent({
|
|
13602
|
-
type:
|
|
13614
|
+
type: "death" /* Death */,
|
|
13603
13615
|
frame: currentFrameIndex,
|
|
13604
13616
|
time: currentTime,
|
|
13605
|
-
description:
|
|
13617
|
+
description: text
|
|
13606
13618
|
});
|
|
13607
|
-
}
|
|
13608
|
-
if (msg.startsWith("You got the ")) {
|
|
13619
|
+
} else if (text.startsWith("You got the ")) {
|
|
13609
13620
|
this.recordEvent({
|
|
13610
|
-
type:
|
|
13621
|
+
type: "pickup" /* Pickup */,
|
|
13611
13622
|
frame: currentFrameIndex,
|
|
13612
13623
|
time: currentTime,
|
|
13613
|
-
description:
|
|
13624
|
+
description: text
|
|
13614
13625
|
});
|
|
13626
|
+
} else {
|
|
13627
|
+
if (level === 3 || level === 2) {
|
|
13628
|
+
this.recordEvent({
|
|
13629
|
+
type: "chat" /* Chat */,
|
|
13630
|
+
frame: currentFrameIndex,
|
|
13631
|
+
time: currentTime,
|
|
13632
|
+
description: text,
|
|
13633
|
+
data: { level }
|
|
13634
|
+
});
|
|
13635
|
+
}
|
|
13615
13636
|
}
|
|
13616
13637
|
},
|
|
13617
|
-
onCenterPrint: () => {
|
|
13638
|
+
onCenterPrint: (msg) => {
|
|
13639
|
+
this.recordEvent({
|
|
13640
|
+
type: "objective" /* Objective */,
|
|
13641
|
+
frame: currentFrameIndex,
|
|
13642
|
+
time: currentTime,
|
|
13643
|
+
description: msg.trim()
|
|
13644
|
+
});
|
|
13618
13645
|
},
|
|
13619
13646
|
onStuffText: () => {
|
|
13620
13647
|
},
|
|
@@ -13645,7 +13672,7 @@ var DemoAnalyzer = class {
|
|
|
13645
13672
|
onDamage: (indicators) => {
|
|
13646
13673
|
for (const ind of indicators) {
|
|
13647
13674
|
this.recordEvent({
|
|
13648
|
-
type:
|
|
13675
|
+
type: "damage_received" /* DamageReceived */,
|
|
13649
13676
|
frame: currentFrameIndex,
|
|
13650
13677
|
time: currentTime,
|
|
13651
13678
|
value: ind.damage,
|
|
@@ -13691,7 +13718,7 @@ var DemoAnalyzer = class {
|
|
|
13691
13718
|
}
|
|
13692
13719
|
handleWeaponFire(ent, weapon, frame, time) {
|
|
13693
13720
|
this.recordEvent({
|
|
13694
|
-
type:
|
|
13721
|
+
type: "weapon_fire" /* WeaponFire */,
|
|
13695
13722
|
frame,
|
|
13696
13723
|
time,
|
|
13697
13724
|
entityId: ent,
|
|
@@ -14231,10 +14258,16 @@ var DemoPlaybackController = class {
|
|
|
14231
14258
|
return trajectory;
|
|
14232
14259
|
}
|
|
14233
14260
|
// 3.2.3 Event Log Extraction & 3.3 Metadata
|
|
14234
|
-
|
|
14261
|
+
/**
|
|
14262
|
+
* Extract notable events from demo for timeline markers
|
|
14263
|
+
*/
|
|
14264
|
+
getEvents() {
|
|
14235
14265
|
this.ensureAnalysis();
|
|
14236
14266
|
return this.cachedEvents || [];
|
|
14237
14267
|
}
|
|
14268
|
+
getDemoEvents() {
|
|
14269
|
+
return this.getEvents();
|
|
14270
|
+
}
|
|
14238
14271
|
filterEvents(type, entityId) {
|
|
14239
14272
|
const events = this.getDemoEvents();
|
|
14240
14273
|
return events.filter((e) => {
|