kacky-gbx-parser 1.0.0
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/Classes/Game/CGameCtnBlock.d.ts +16 -0
- package/dist/Classes/Game/CGameCtnBlock.d.ts.map +1 -0
- package/dist/Classes/Game/CGameCtnBlockSkin.d.ts +28 -0
- package/dist/Classes/Game/CGameCtnBlockSkin.d.ts.map +1 -0
- package/dist/Classes/Game/CGameCtnChallenge.d.ts +329 -0
- package/dist/Classes/Game/CGameCtnChallenge.d.ts.map +1 -0
- package/dist/Classes/Game/CGameCtnChallengeParameters.d.ts +72 -0
- package/dist/Classes/Game/CGameCtnChallengeParameters.d.ts.map +1 -0
- package/dist/Classes/Game/CGameCtnCollectorList.d.ts +16 -0
- package/dist/Classes/Game/CGameCtnCollectorList.d.ts.map +1 -0
- package/dist/Classes/Game/CGameCtnGhost.d.ts +170 -0
- package/dist/Classes/Game/CGameCtnGhost.d.ts.map +1 -0
- package/dist/Classes/Game/CGameCtnMediaBlock.d.ts +7 -0
- package/dist/Classes/Game/CGameCtnMediaBlock.d.ts.map +1 -0
- package/dist/Classes/Game/CGameCtnMediaBlockTriangles.d.ts +7 -0
- package/dist/Classes/Game/CGameCtnMediaBlockTriangles.d.ts.map +1 -0
- package/dist/Classes/Game/CGameCtnMediaClip.d.ts +13 -0
- package/dist/Classes/Game/CGameCtnMediaClip.d.ts.map +1 -0
- package/dist/Classes/Game/CGameCtnMediaTrack.d.ts +11 -0
- package/dist/Classes/Game/CGameCtnMediaTrack.d.ts.map +1 -0
- package/dist/Classes/Game/CGameCtnReplayRecord.d.ts +127 -0
- package/dist/Classes/Game/CGameCtnReplayRecord.d.ts.map +1 -0
- package/dist/Classes/Game/CGameGhost.d.ts +71 -0
- package/dist/Classes/Game/CGameGhost.d.ts.map +1 -0
- package/dist/Classes/Game/CGameWaypointSpecialProperty.d.ts +11 -0
- package/dist/Classes/Game/CGameWaypointSpecialProperty.d.ts.map +1 -0
- package/dist/Classes/Game/index.d.ts +15 -0
- package/dist/Classes/Game/index.d.ts.map +1 -0
- package/dist/Classes/Node.d.ts +9 -0
- package/dist/Classes/Node.d.ts.map +1 -0
- package/dist/Classes/Plug/CPlugEntRecordData.d.ts +15 -0
- package/dist/Classes/Plug/CPlugEntRecordData.d.ts.map +1 -0
- package/dist/Classes/Plug/index.d.ts +3 -0
- package/dist/Classes/Plug/index.d.ts.map +1 -0
- package/dist/Classes/Utilities/GameVersion.d.ts +30 -0
- package/dist/Classes/Utilities/GameVersion.d.ts.map +1 -0
- package/dist/Data/ClassWrap.d.ts +4 -0
- package/dist/Data/ClassWrap.d.ts.map +1 -0
- package/dist/Data/CollectionIDs.d.ts +5 -0
- package/dist/Data/CollectionIDs.d.ts.map +1 -0
- package/dist/Data/NodeTypes.d.ts +6 -0
- package/dist/Data/NodeTypes.d.ts.map +1 -0
- package/dist/Functions/Utils.d.ts +35 -0
- package/dist/Functions/Utils.d.ts.map +1 -0
- package/dist/GBX.d.ts +16 -0
- package/dist/GBX.d.ts.map +1 -0
- package/dist/GBXReader.d.ts +32 -0
- package/dist/GBXReader.d.ts.map +1 -0
- package/dist/Handlers/DataStream.d.ts +153 -0
- package/dist/Handlers/DataStream.d.ts.map +1 -0
- package/dist/Handlers/Hex.d.ts +12 -0
- package/dist/Handlers/Hex.d.ts.map +1 -0
- package/dist/Handlers/LZOHandler.d.ts +15 -0
- package/dist/Handlers/LZOHandler.d.ts.map +1 -0
- package/dist/Handlers/Logger.d.ts +42 -0
- package/dist/Handlers/Logger.d.ts.map +1 -0
- package/dist/Handlers/Merger.d.ts +27 -0
- package/dist/Handlers/Merger.d.ts.map +1 -0
- package/dist/Handlers/ZLibHandler.d.ts +15 -0
- package/dist/Handlers/ZLibHandler.d.ts.map +1 -0
- package/dist/Handlers/index.d.ts +8 -0
- package/dist/Handlers/index.d.ts.map +1 -0
- package/dist/gbx.js +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/dist/types.d.ts +93 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CGameCtnMediaBlockTriangles.d.ts","sourceRoot":"","sources":["../../../src/Classes/Game/CGameCtnMediaBlockTriangles.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,2BAA2B;IAC5C,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,UAoClC;CACL"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import CGameCtnMediaTrack from './CGameCtnMediaTrack';
|
|
2
|
+
/**
|
|
3
|
+
* @chunk 0x03079000
|
|
4
|
+
*/
|
|
5
|
+
export default class CGameCtnMediaClip {
|
|
6
|
+
tracks?: CGameCtnMediaTrack[];
|
|
7
|
+
name?: string;
|
|
8
|
+
stopWhenLeave?: boolean;
|
|
9
|
+
stopWhenRespawn?: boolean;
|
|
10
|
+
localPlayerClipEntIndex?: number;
|
|
11
|
+
protected 0x0307900d: ({ r }: Chunk) => void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=CGameCtnMediaClip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CGameCtnMediaClip.d.ts","sourceRoot":"","sources":["../../../src/Classes/Game/CGameCtnMediaClip.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAiB;IAC9B,MAAM,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAExC,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,UAkBlC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @chunk 0x03078000
|
|
3
|
+
*/
|
|
4
|
+
export default class CGameCtnMediaTrack {
|
|
5
|
+
name?: string;
|
|
6
|
+
blocks?: any[];
|
|
7
|
+
keepPlaying?: boolean;
|
|
8
|
+
protected 0x03078001: ({ r }: Chunk) => void;
|
|
9
|
+
protected 0x03078004: ({ r }: Chunk) => void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=CGameCtnMediaTrack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CGameCtnMediaTrack.d.ts","sourceRoot":"","sources":["../../../src/Classes/Game/CGameCtnMediaTrack.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAkB;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IAE7B,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,UAalC;IAEF,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,UAGlC;CACH"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import GameVersion from '../Utilities/GameVersion';
|
|
2
|
+
import GBX from '../../GBX';
|
|
3
|
+
import CGameCtnChallenge from './CGameCtnChallenge';
|
|
4
|
+
import CGameCtnGhost from './CGameCtnGhost';
|
|
5
|
+
import CPlugEntRecordData from '../Plug/CPlugEntRecordData';
|
|
6
|
+
/**
|
|
7
|
+
* A replay.
|
|
8
|
+
* @chunk 0x03093000 / 0x2407e000
|
|
9
|
+
*/
|
|
10
|
+
export default class CGameCtnReplayRecord extends GameVersion {
|
|
11
|
+
authorExtraInfo?: string;
|
|
12
|
+
authorLogin?: string;
|
|
13
|
+
authorNickname?: string;
|
|
14
|
+
authorVersion?: number;
|
|
15
|
+
authorZone?: string;
|
|
16
|
+
challengeData?: GBX<CGameCtnChallenge>;
|
|
17
|
+
controlEntries?: {
|
|
18
|
+
name: any;
|
|
19
|
+
time: number;
|
|
20
|
+
value: number;
|
|
21
|
+
analog: boolean;
|
|
22
|
+
}[];
|
|
23
|
+
controlNames?: string[];
|
|
24
|
+
eventsDuration?: number;
|
|
25
|
+
extras?: {
|
|
26
|
+
extra1: number;
|
|
27
|
+
extra2: number;
|
|
28
|
+
}[];
|
|
29
|
+
game?: string;
|
|
30
|
+
ghosts?: CGameCtnGhost[];
|
|
31
|
+
mapInfo?: IMeta;
|
|
32
|
+
playerLogin?: string;
|
|
33
|
+
playerNickname?: string;
|
|
34
|
+
playgroundScript?: string;
|
|
35
|
+
recordData?: CPlugEntRecordData;
|
|
36
|
+
time?: number;
|
|
37
|
+
titleId?: string;
|
|
38
|
+
xml?: string;
|
|
39
|
+
/**
|
|
40
|
+
* (Header) Basic information
|
|
41
|
+
*/
|
|
42
|
+
protected 0x03093000: ({ r }: Chunk, f: ChunkFunctions) => void;
|
|
43
|
+
/**
|
|
44
|
+
* (Header) XML data
|
|
45
|
+
*/
|
|
46
|
+
protected 0x03093001: ({ r }: Chunk) => void;
|
|
47
|
+
/**
|
|
48
|
+
* (Header) Author information
|
|
49
|
+
* (Body) Track data
|
|
50
|
+
*/
|
|
51
|
+
protected 0x03093002: ({ r, isHeaderChunk }: Chunk, f: ChunkFunctions) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Validation TM1.0
|
|
54
|
+
*/
|
|
55
|
+
/**
|
|
56
|
+
* Ghost data
|
|
57
|
+
*/
|
|
58
|
+
protected 0x03093004: ({ r }: Chunk, f: ChunkFunctions) => void;
|
|
59
|
+
/**
|
|
60
|
+
* Unknown
|
|
61
|
+
*/
|
|
62
|
+
protected 0x03093005: ({ r }: Chunk, f: ChunkFunctions) => void;
|
|
63
|
+
/**
|
|
64
|
+
* (Skippable) Unknown
|
|
65
|
+
*/
|
|
66
|
+
protected 0x03093007: ({ r }: Chunk, f: ChunkFunctions) => void;
|
|
67
|
+
/**
|
|
68
|
+
* (Skippable) Game
|
|
69
|
+
*/
|
|
70
|
+
protected 0x03093008: ({ r }: Chunk, f: ChunkFunctions) => void;
|
|
71
|
+
/**
|
|
72
|
+
* MediaTracker Clip
|
|
73
|
+
*/
|
|
74
|
+
protected 0x0309300c: ({ r, fullChunkId }: Chunk) => void;
|
|
75
|
+
/**
|
|
76
|
+
* Validation
|
|
77
|
+
*/
|
|
78
|
+
protected 0x0309300d: ({ r }: Chunk, f: ChunkFunctions) => void;
|
|
79
|
+
/**
|
|
80
|
+
* Events
|
|
81
|
+
*/
|
|
82
|
+
protected 0x0309300e: ({ r, fullChunkId }: Chunk) => void;
|
|
83
|
+
/**
|
|
84
|
+
* (Skippable) Game and unknown data
|
|
85
|
+
*/
|
|
86
|
+
protected 0x0309300f: ({ r }: Chunk, f: ChunkFunctions) => void;
|
|
87
|
+
/**
|
|
88
|
+
* Simple events display
|
|
89
|
+
*/
|
|
90
|
+
protected 0x03093010: ({ r, fullChunkId }: Chunk) => void;
|
|
91
|
+
/**
|
|
92
|
+
* Ghost data
|
|
93
|
+
*/
|
|
94
|
+
protected 0x03093014: ({ r }: Chunk, f: ChunkFunctions) => void;
|
|
95
|
+
/**
|
|
96
|
+
* MediaTracker Clip
|
|
97
|
+
*/
|
|
98
|
+
protected 0x03093015: ({ r, fullChunkId }: Chunk) => void;
|
|
99
|
+
/**
|
|
100
|
+
* (Skippable) Author information
|
|
101
|
+
*/
|
|
102
|
+
protected 0x03093018: ({ r }: Chunk) => void;
|
|
103
|
+
/**
|
|
104
|
+
* (Skippable) Scenery vortex key
|
|
105
|
+
*/
|
|
106
|
+
/**
|
|
107
|
+
* (Skippable) Player of interest
|
|
108
|
+
*/
|
|
109
|
+
protected 0x0309301b: ({ r }: Chunk, f: ChunkFunctions) => void;
|
|
110
|
+
/**
|
|
111
|
+
* (Skippable) Playground script (Campaign solo)
|
|
112
|
+
*/
|
|
113
|
+
protected 0x0309301c: ({ r }: Chunk, f: ChunkFunctions) => void;
|
|
114
|
+
/**
|
|
115
|
+
* (Skippable) Unknown
|
|
116
|
+
*/
|
|
117
|
+
protected 0x03093021: ({ r }: Chunk, f: ChunkFunctions) => void;
|
|
118
|
+
/**
|
|
119
|
+
* (Skippable) Record data
|
|
120
|
+
*/
|
|
121
|
+
protected 0x03093024: ({ r }: Chunk, f: ChunkFunctions) => void;
|
|
122
|
+
/**
|
|
123
|
+
* (Skippable) Unknown
|
|
124
|
+
*/
|
|
125
|
+
protected 0x03093025: ({ r }: Chunk, f: ChunkFunctions) => void;
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=CGameCtnReplayRecord.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CGameCtnReplayRecord.d.ts","sourceRoot":"","sources":["../../../src/Classes/Game/CGameCtnReplayRecord.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,GAAG,MAAM,WAAW,CAAC;AAC5B,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,kBAAkB,MAAM,4BAA4B,CAAC;AAE5D;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,WAAW;IACrD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACvC,cAAc,CAAC,EAAE;QAAE,IAAI,EAAE,GAAG,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IAC/E,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,EAAE,GAAG,cAAc,UAkBrD;IAEF;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,UAElC;IAEF;;;OAGG;IACH,SAAS,CAAC,UAAU,GAAI,sBAAsB,KAAK,EAAE,GAAG,cAAc,UAgBpE;IAEF;;OAEG;IAGH;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,EAAE,GAAG,cAAc,UAQrD;IAEF;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,EAAE,GAAG,cAAc,UAErD;IAEF;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,EAAE,GAAG,cAAc,UAErD;IAEF;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,EAAE,GAAG,cAAc,UAGrD;IAEF;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,oBAAoB,KAAK,UAE/C;IAEF;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,EAAE,GAAG,cAAc,UAuBrD;IAEF;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,oBAAoB,KAAK,UAE/C;IAEF;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,EAAE,GAAG,cAAc,UAOrD;IAEF;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,oBAAoB,KAAK,UAE/C;IAEF;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,EAAE,GAAG,cAAc,UAgBrD;IAEF;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,oBAAoB,KAAK,UAE/C;IAEF;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,UAOlC;IAEF;;OAEG;IAGH;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,EAAE,GAAG,cAAc,UAOrD;IAEF;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,EAAE,GAAG,cAAc,UAIrD;IAEF;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,EAAE,GAAG,cAAc,UAGrD;IAEF;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,EAAE,GAAG,cAAc,UAKrD;IAEF;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,EAAE,GAAG,cAAc,UAIrD;CACF"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import GameVersion from '../Utilities/GameVersion';
|
|
2
|
+
/**
|
|
3
|
+
* A single sample record from ghost motion data.
|
|
4
|
+
*/
|
|
5
|
+
export interface GhostSampleRecord {
|
|
6
|
+
/** Car position in 3D world space */
|
|
7
|
+
position: Vector3;
|
|
8
|
+
/** Car rotation angle (raw value) */
|
|
9
|
+
angle: number;
|
|
10
|
+
/** Heading axis value */
|
|
11
|
+
axisHeading: number;
|
|
12
|
+
/** Pitch axis value */
|
|
13
|
+
axisPitch: number;
|
|
14
|
+
/** Speed value (logarithmic scale, use displaySpeed for 0-1000 range) */
|
|
15
|
+
speed: number;
|
|
16
|
+
/** Velocity heading */
|
|
17
|
+
velHeading: number;
|
|
18
|
+
/** Velocity pitch */
|
|
19
|
+
velPitch: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Ghost data.
|
|
23
|
+
* @chunk 0x0303F000
|
|
24
|
+
*/
|
|
25
|
+
export default class CGameGhost extends GameVersion {
|
|
26
|
+
isReplaying?: boolean;
|
|
27
|
+
/** Raw compressed sample data */
|
|
28
|
+
sampleData?: number[];
|
|
29
|
+
/** Expected uncompressed size */
|
|
30
|
+
sampleDataUncompressedSize?: number;
|
|
31
|
+
/** Decompressed and parsed sample records */
|
|
32
|
+
sampleRecords?: GhostSampleRecord[];
|
|
33
|
+
/** Sample offsets for seeking */
|
|
34
|
+
sampleOffsets?: number[];
|
|
35
|
+
/** Sample timestamps */
|
|
36
|
+
sampleTimes?: number[];
|
|
37
|
+
/** Whether samples are at fixed time intervals */
|
|
38
|
+
isFixedTimeStep?: boolean;
|
|
39
|
+
/** Time period between samples (if fixed time step) */
|
|
40
|
+
samplePeriod?: number;
|
|
41
|
+
/** Sample data version */
|
|
42
|
+
sampleVersion?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Decompresses and parses the sample data into structured records.
|
|
45
|
+
* Call this after parsing if you need access to individual sample records.
|
|
46
|
+
* Requires the pako package to be installed.
|
|
47
|
+
*/
|
|
48
|
+
decompressSampleData(): Promise<GhostSampleRecord[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Converts a raw speed value to display speed (0-1000 range).
|
|
51
|
+
* The raw speed is stored in a logarithmic scale.
|
|
52
|
+
*/
|
|
53
|
+
static speedToDisplaySpeed(rawSpeed: number): number;
|
|
54
|
+
/**
|
|
55
|
+
* Old sample data
|
|
56
|
+
*/
|
|
57
|
+
protected 0x0303f003: ({ r }: Chunk) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Unknown
|
|
60
|
+
*/
|
|
61
|
+
protected 0x0303f004: ({ r }: Chunk, f: ChunkFunctions) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Sample data (compressed with zlib)
|
|
64
|
+
*/
|
|
65
|
+
protected 0x0303f005: ({ r }: Chunk) => void;
|
|
66
|
+
/**
|
|
67
|
+
* Is replaying and sample data
|
|
68
|
+
*/
|
|
69
|
+
protected 0x0303f006: (chunk: Chunk) => void;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=CGameGhost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CGameGhost.d.ts","sourceRoot":"","sources":["../../../src/Classes/Game/CGameGhost.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAGnD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,qCAAqC;IACrC,QAAQ,EAAE,OAAO,CAAC;IAClB,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IAC7B,iCAAiC;IAC1B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,iCAAiC;IAC1B,0BAA0B,CAAC,EAAE,MAAM,CAAC;IAC3C,6CAA6C;IACtC,aAAa,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC3C,iCAAiC;IAC1B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,wBAAwB;IACjB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,kDAAkD;IAC3C,eAAe,CAAC,EAAE,OAAO,CAAC;IACjC,uDAAuD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IAC7B,0BAA0B;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IAE9B;;;;OAIG;IACU,oBAAoB,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;IA8CjE;;;OAGG;WACW,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAM3D;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,UAUlC;IAEF;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,EAAE,GAAG,cAAc,UAErD;IAEF;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,UAKlC;IAEF;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,UAMlC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Node from '../Node';
|
|
2
|
+
/**
|
|
3
|
+
* Chunk 0x2e009000
|
|
4
|
+
*/
|
|
5
|
+
export default class CGameWaypointSpecialProperty extends Node {
|
|
6
|
+
order?: number;
|
|
7
|
+
spawn?: number;
|
|
8
|
+
tag?: string;
|
|
9
|
+
protected 0x2e009000: ({ r }: Chunk, f: ChunkFunctions) => void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=CGameWaypointSpecialProperty.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CGameWaypointSpecialProperty.d.ts","sourceRoot":"","sources":["../../../src/Classes/Game/CGameWaypointSpecialProperty.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,4BAA6B,SAAQ,IAAI;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IAEpB,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,EAAE,GAAG,cAAc,UAUrD;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import CGameCtnBlock from './CGameCtnBlock';
|
|
2
|
+
import CGameCtnBlockSkin from './CGameCtnBlockSkin';
|
|
3
|
+
import CGameCtnChallenge from './CGameCtnChallenge';
|
|
4
|
+
import CGameCtnChallengeParameters from './CGameCtnChallengeParameters';
|
|
5
|
+
import CGameCtnCollectorList from './CGameCtnCollectorList';
|
|
6
|
+
import CGameCtnGhost from './CGameCtnGhost';
|
|
7
|
+
import CGameCtnMediaClip from './CGameCtnMediaClip';
|
|
8
|
+
import CGameCtnMediaBlock from './CGameCtnMediaBlock';
|
|
9
|
+
import CGameCtnMediaBlockTriangles from './CGameCtnMediaBlockTriangles';
|
|
10
|
+
import CGameCtnMediaTrack from './CGameCtnMediaTrack';
|
|
11
|
+
import CGameCtnReplayRecord from './CGameCtnReplayRecord';
|
|
12
|
+
import CGameGhost from './CGameGhost';
|
|
13
|
+
import CGameWaypointSpecialProperty from './CGameWaypointSpecialProperty';
|
|
14
|
+
export { CGameCtnBlock, CGameCtnBlockSkin, CGameCtnChallenge, CGameCtnChallengeParameters, CGameCtnCollectorList, CGameCtnGhost, CGameCtnMediaClip, CGameCtnMediaTrack, CGameCtnMediaBlock, CGameCtnMediaBlockTriangles, CGameCtnReplayRecord, CGameGhost, CGameWaypointSpecialProperty, };
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Classes/Game/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,2BAA2B,MAAM,+BAA+B,CAAC;AACxE,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,2BAA2B,MAAM,+BAA+B,CAAC;AACxE,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAE1E,OAAO,EACN,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,2BAA2B,EAC3B,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EACf,kBAAkB,EAClB,2BAA2B,EAC9B,oBAAoB,EACpB,UAAU,EACV,4BAA4B,GAC5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Node.d.ts","sourceRoot":"","sources":["../../src/Classes/Node.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,IAAI;IACjB,MAAM,EAAE;QACd,CAAC,GAAG,EAAE,MAAM,GAAG;YACd,QAAQ,EAAE,GAAG,EAAE,CAAC;YAChB,OAAO,EAAE,GAAG,CAAC;SACb,GAAG,IAAI,CAAC;KACT,CAAM;CACP"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Node from '../Node';
|
|
2
|
+
/**
|
|
3
|
+
* Data of an entity in a timeline.
|
|
4
|
+
* @chunk 0x0911f000
|
|
5
|
+
*/
|
|
6
|
+
export default class CPlugEntRecordData extends Node {
|
|
7
|
+
compressedData?: number[];
|
|
8
|
+
compressedSize?: number;
|
|
9
|
+
uncompressedSize?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Data of the entity
|
|
12
|
+
*/
|
|
13
|
+
protected 0x0911f000: ({ r }: Chunk, f: ChunkFunctions) => void;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=CPlugEntRecordData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CPlugEntRecordData.d.ts","sourceRoot":"","sources":["../../../src/Classes/Plug/CPlugEntRecordData.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,IAAI;IAC5C,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAEjC;;OAEG;IACH,SAAS,CAAC,UAAU,GAAI,OAAO,KAAK,EAAE,GAAG,cAAc,UAQrD;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Classes/Plug/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import Node from '../Node';
|
|
2
|
+
/**
|
|
3
|
+
* Class to determine the game version of a node.
|
|
4
|
+
*
|
|
5
|
+
* Rewritten from the [GameVersion class of GBXToolAPI](https://github.com/bigbang1112-cz/gbx-tool-api/blob/ab15dab71310d6458745d9615b8bfcd52567c7aa/Src/GbxToolAPI/GameVersion.cs), originally made by BigBang1112.
|
|
6
|
+
*/
|
|
7
|
+
export default class GameVersion extends Node {
|
|
8
|
+
private getObjectKeysAsNumbers;
|
|
9
|
+
/**
|
|
10
|
+
* Checks if node is TM2020. Supports maps, ghosts, and replays.
|
|
11
|
+
* @returns true or false.
|
|
12
|
+
*/
|
|
13
|
+
isTM2020(): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Checks if node is ManiaPlanet (includes TM2020). Supports maps, ghosts, and replays.
|
|
16
|
+
* @returns true or false.
|
|
17
|
+
*/
|
|
18
|
+
isManiaPlanet(): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Checks if node is Trackmania Turbo. Supports maps, ghosts, and replays.
|
|
21
|
+
* @returns true or false.
|
|
22
|
+
*/
|
|
23
|
+
isTurbo(): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Checks if node is Trackmania Nations Forever. Supports maps, ghosts, and replays.
|
|
26
|
+
* @returns true or false.
|
|
27
|
+
*/
|
|
28
|
+
isTMF(): boolean;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=GameVersion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GameVersion.d.ts","sourceRoot":"","sources":["../../../src/Classes/Utilities/GameVersion.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,IAAI;IAC5C,OAAO,CAAC,sBAAsB;IAI9B;;;OAGG;IACI,QAAQ,IAAI,OAAO;IAU1B;;;OAGG;IACI,aAAa,IAAI,OAAO;IAU/B;;;OAGG;IACI,OAAO,IAAI,OAAO;IAgBzB;;;OAGG;IACI,KAAK,IAAI,OAAO;CAevB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClassWrap.d.ts","sourceRoot":"","sources":["../../src/Data/ClassWrap.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,EAAE;IAAE,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAAA;CAe1D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollectionIDs.d.ts","sourceRoot":"","sources":["../../src/Data/CollectionIDs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,eA+C3B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as Game from '../Classes/Game';
|
|
2
|
+
import * as Plug from '../Classes/Plug';
|
|
3
|
+
type ChunkType = (typeof Game)[keyof typeof Game] | (typeof Plug)[keyof typeof Plug];
|
|
4
|
+
export default function getNodeType(classId: number): ChunkType;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=NodeTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodeTypes.d.ts","sourceRoot":"","sources":["../../src/Data/NodeTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAExC,KAAK,SAAS,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,OAAO,IAAI,CAAC,CAAC;AAErF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAiB9D"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CGameCtnChallenge, CGameCtnGhost } from '../Classes/Game';
|
|
2
|
+
export declare namespace Utils {
|
|
3
|
+
/**
|
|
4
|
+
* Gets amount of checkpoints of a map.
|
|
5
|
+
* @todo Add support for checkpoints as items.
|
|
6
|
+
* @param gbx GBX of a CGameCtnChallenge.
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
function getCheckpointCount(gbx: CGameCtnChallenge | CGameCtnGhost): number | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Gets amount of respawns of a ghost.
|
|
12
|
+
* @param ghost GBX of a CGameCtnGhost.
|
|
13
|
+
* @returns the amount of respawns.
|
|
14
|
+
*/
|
|
15
|
+
function getRespawnsCount(ghost: CGameCtnGhost): number | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Gets the splits of each checkpoint of a ghost.
|
|
18
|
+
* @param ghost GBX of a CGameCtnGhost.
|
|
19
|
+
* @returns the splits of each checkpoint.
|
|
20
|
+
*/
|
|
21
|
+
function getCheckpointTimes(ghost: CGameCtnGhost): number[] | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the amount of respawns per checkpoint of a ghost.
|
|
24
|
+
* @param ghost GBX of a CGameCtnGhost.
|
|
25
|
+
* @returns the amount of respawns per checkpoint.
|
|
26
|
+
*/
|
|
27
|
+
function getRespawnsByCheckpoint(ghost: CGameCtnGhost): number[] | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Gets the sector times of a ghost.
|
|
30
|
+
* @param ghost GBX of a CGameCtnGhost.
|
|
31
|
+
* @returns the sector times.
|
|
32
|
+
*/
|
|
33
|
+
function getSectorTimes(ghost: CGameCtnGhost): number[] | undefined;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=Utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../src/Functions/Utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGnE,yBAAiB,KAAK,CAAC;IACtB;;;;;OAKG;IACH,SAAgB,kBAAkB,CAAC,GAAG,EAAE,iBAAiB,GAAG,aAAa,GAAG,MAAM,GAAG,SAAS,CAsC7F;IAQD;;;;OAIG;IACH,SAAgB,gBAAgB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,CAEzE;IAED;;;;OAIG;IACH,SAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE,GAAG,SAAS,CAE7E;IAED;;;;OAIG;IACH,SAAgB,uBAAuB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE,GAAG,SAAS,CAqBlF;IAED;;;;OAIG;IACH,SAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE,GAAG,SAAS,CASzE;CACD"}
|
package/dist/GBX.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default class GBX<NodeType> {
|
|
2
|
+
private stream;
|
|
3
|
+
classId?: number;
|
|
4
|
+
wrappedClassId?: number;
|
|
5
|
+
private bodyCompression;
|
|
6
|
+
constructor(stream: Buffer | number[], loglevel?: number);
|
|
7
|
+
/**
|
|
8
|
+
* Parses the headers of the GBX file.
|
|
9
|
+
*/
|
|
10
|
+
parseHeaders(): Promise<NodeType>;
|
|
11
|
+
/**
|
|
12
|
+
* Parses the GBX file entirely.
|
|
13
|
+
*/
|
|
14
|
+
parse(): Promise<NodeType>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=GBX.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GBX.d.ts","sourceRoot":"","sources":["../src/GBX.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,OAAO,GAAG,CAAC,QAAQ;IAChC,OAAO,CAAC,MAAM,CAAc;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IAC/B,OAAO,CAAC,eAAe,CAAwB;gBAEnC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,QAAQ,GAAE,MAAU;IAQ3D;;OAEG;IACU,YAAY,IAAI,OAAO,CAAC,QAAQ,CAAC;IAqE9C;;OAEG;IACU,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC;CA8BvC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DataStream } from './Handlers';
|
|
2
|
+
interface GBXReaderOptions {
|
|
3
|
+
classId: number;
|
|
4
|
+
stream?: DataStream;
|
|
5
|
+
headerChunks?: IHeaderChunks[];
|
|
6
|
+
}
|
|
7
|
+
export declare class GBXReader<NodeType> {
|
|
8
|
+
options: GBXReaderOptions;
|
|
9
|
+
private current?;
|
|
10
|
+
private fullChunkId;
|
|
11
|
+
private versions;
|
|
12
|
+
private unknowns;
|
|
13
|
+
constructor(options: GBXReaderOptions);
|
|
14
|
+
protected readVersion(version: number): number;
|
|
15
|
+
protected readUnknown<T>(unknown: T): T;
|
|
16
|
+
/**
|
|
17
|
+
* Reads a node.
|
|
18
|
+
*/
|
|
19
|
+
readNode(): NodeType;
|
|
20
|
+
/**
|
|
21
|
+
* Check if the chunk is supported and process it.
|
|
22
|
+
* @param fullChunkId The full chunk ID.
|
|
23
|
+
* @returns A boolean indicating if the chunk is supported.
|
|
24
|
+
*/
|
|
25
|
+
readChunk(fullChunkId: number, isHeaderChunk?: boolean, length?: number): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Reads a header chunk.
|
|
28
|
+
*/
|
|
29
|
+
readHeaderChunk(classId: number): NodeType;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=GBXReader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GBXReader.d.ts","sourceRoot":"","sources":["../src/GBXReader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAuB,MAAM,YAAY,CAAC;AAI7D,UAAU,gBAAgB;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,YAAY,CAAC,EAAE,aAAa,EAAE,CAAC;CAC/B;AAED,qBAAa,SAAS,CAAC,QAAQ;IAOX,OAAO,EAAE,gBAAgB;IAN5C,OAAO,CAAC,OAAO,CAAC,CAAM;IAEtB,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,QAAQ,CAAiC;IACjD,OAAO,CAAC,QAAQ,CAAgC;gBAE7B,OAAO,EAAE,gBAAgB;IAI5C,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAM9C,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC;IAQvC;;OAEG;IACI,QAAQ,IAAI,QAAQ;IA6C3B;;;;OAIG;IACI,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,UAAQ,EAAE,MAAM,GAAE,MAAU,GAAG,OAAO;IA+CzF;;OAEG;IACI,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ;CA4BjD"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handle data streams.
|
|
3
|
+
*/
|
|
4
|
+
export default class DataStream {
|
|
5
|
+
private stream;
|
|
6
|
+
private position;
|
|
7
|
+
constructor(stream: Buffer | Array<number>);
|
|
8
|
+
/**
|
|
9
|
+
* Returns the number of bytes available to read from the current position.
|
|
10
|
+
*/
|
|
11
|
+
get bytesAvailable(): number;
|
|
12
|
+
/**
|
|
13
|
+
* Creates an array with a callback function applied to each index.
|
|
14
|
+
* @param length length of the array.
|
|
15
|
+
* @param callback arrow function with index as argument.
|
|
16
|
+
* @returns an array with the function applied to each index.
|
|
17
|
+
*/
|
|
18
|
+
createArray<T>(length: number, callback: (index: number) => T): T[];
|
|
19
|
+
/**
|
|
20
|
+
* Reads a single byte at the current pointer position without advancing the pointer.
|
|
21
|
+
* @returns a number between 0 to 255.
|
|
22
|
+
*/
|
|
23
|
+
peekByte(offset?: number): number;
|
|
24
|
+
/**
|
|
25
|
+
* Reads a single byte at the current pointer position.
|
|
26
|
+
* @returns a number between 0 to 255.
|
|
27
|
+
*/
|
|
28
|
+
readByte(): number;
|
|
29
|
+
/**
|
|
30
|
+
* Reads multiple bytes at the current pointer position without advancing the pointer.
|
|
31
|
+
* @param count Amount of bytes to read.
|
|
32
|
+
* @returns an array of numbers between 0 to 255.
|
|
33
|
+
*/
|
|
34
|
+
peekBytes(count: number): number[];
|
|
35
|
+
/**
|
|
36
|
+
* Reads multiple bytes at the current pointer position.
|
|
37
|
+
* @param count Amount of bytes to read.
|
|
38
|
+
* @returns an array of numbers between 0 to 255.
|
|
39
|
+
*/
|
|
40
|
+
readBytes(count: number): number[];
|
|
41
|
+
/**
|
|
42
|
+
* Reads a byte array as a number.
|
|
43
|
+
* @param bytes Array of bytes.
|
|
44
|
+
* @returns a number (signed if the array is >= 4 long, unsigned otherwise).
|
|
45
|
+
*/
|
|
46
|
+
private bytesToNumber;
|
|
47
|
+
/**
|
|
48
|
+
* Reads multiple bytes at the current pointer position
|
|
49
|
+
* without advancing the pointer and returns them as an unsigned number.
|
|
50
|
+
* @returns a positive number.
|
|
51
|
+
*/
|
|
52
|
+
peekNumbers(count: number): number;
|
|
53
|
+
/**
|
|
54
|
+
* Reads multiple bytes at the current pointer position
|
|
55
|
+
* and returns them as an unsigned number.
|
|
56
|
+
* @returns a positive number.
|
|
57
|
+
*/
|
|
58
|
+
readNumbers(count: number): number;
|
|
59
|
+
/**
|
|
60
|
+
* Reads a 32-bit float, consisting of 4 bytes based on IEEE-754.
|
|
61
|
+
* @returns a floating point number.
|
|
62
|
+
*/
|
|
63
|
+
readFloat(): number;
|
|
64
|
+
/**
|
|
65
|
+
* Peeks an unsigned 16-bit integer.
|
|
66
|
+
* @returns unsigned 16-bit integer.
|
|
67
|
+
*/
|
|
68
|
+
peekUInt16(): number;
|
|
69
|
+
/**
|
|
70
|
+
* Reads an unsigned 16-bit integer.
|
|
71
|
+
* @returns unsigned 16-bit integer.
|
|
72
|
+
*/
|
|
73
|
+
readUInt16(): number;
|
|
74
|
+
/**
|
|
75
|
+
* Peeks an unsigned 32-bit integer.
|
|
76
|
+
* @returns unsigned 32-bit integer.
|
|
77
|
+
*/
|
|
78
|
+
peekUInt32(): number;
|
|
79
|
+
/**
|
|
80
|
+
* Reads an unsigned 32-bit integer.
|
|
81
|
+
* @returns unsigned 32-bit integer.
|
|
82
|
+
*/
|
|
83
|
+
readUInt32(): number;
|
|
84
|
+
/**
|
|
85
|
+
* Reads a boolean, consisting of 4 bytes.
|
|
86
|
+
* @returns true or false.
|
|
87
|
+
*/
|
|
88
|
+
readBoolean(): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Reads a string of a given length.
|
|
91
|
+
* @param count length of the string.
|
|
92
|
+
* @returns a string.
|
|
93
|
+
*/
|
|
94
|
+
readString(count?: number): string;
|
|
95
|
+
/**
|
|
96
|
+
* Reads a single character
|
|
97
|
+
* @returns a 1-long string.
|
|
98
|
+
*/
|
|
99
|
+
readChar(): string;
|
|
100
|
+
/**
|
|
101
|
+
* Reads two consecutive 32-bit integers.
|
|
102
|
+
* @returns an array of two numbers.
|
|
103
|
+
*/
|
|
104
|
+
readInt2(): Int2;
|
|
105
|
+
/**
|
|
106
|
+
* Reads three consecutive 32-bit integers.
|
|
107
|
+
* @returns an array of three numbers.
|
|
108
|
+
*/
|
|
109
|
+
readInt3(): Int3;
|
|
110
|
+
/**
|
|
111
|
+
* Reads a vector of size 2 as floats.
|
|
112
|
+
* @returns an array of two floats.
|
|
113
|
+
*/
|
|
114
|
+
readVector2(): Vector2;
|
|
115
|
+
/**
|
|
116
|
+
* Reads a vector of size 3 as floats.
|
|
117
|
+
* @returns an array of three floats.
|
|
118
|
+
*/
|
|
119
|
+
readVector3(): Vector3;
|
|
120
|
+
/**
|
|
121
|
+
* Reads three consecutive bytes.
|
|
122
|
+
* @returns an array of three bytes.
|
|
123
|
+
*/
|
|
124
|
+
readByte3(): Byte3;
|
|
125
|
+
/**
|
|
126
|
+
* Reads three consecutive lookback strings.
|
|
127
|
+
* @returns object of id, collection and author.
|
|
128
|
+
*/
|
|
129
|
+
readMeta(): IMeta;
|
|
130
|
+
/**
|
|
131
|
+
* Reads a file reference.
|
|
132
|
+
* @returns a string consisting of a file path.
|
|
133
|
+
*/
|
|
134
|
+
readFileReference(): string;
|
|
135
|
+
private nodeList;
|
|
136
|
+
/**
|
|
137
|
+
* Reads a node reference.
|
|
138
|
+
*/
|
|
139
|
+
readNodeReference<NodeType>(): NodeType | undefined;
|
|
140
|
+
private lookbackVersion?;
|
|
141
|
+
private lookbackStrings;
|
|
142
|
+
/**
|
|
143
|
+
* Reads a lookback string.
|
|
144
|
+
* @returns a string.
|
|
145
|
+
*/
|
|
146
|
+
readLookbackString(): string;
|
|
147
|
+
/**
|
|
148
|
+
* Skips to the next chunk within the same class ID. Very unsafe, as it does not take lookback strings into account, because of its naive skip method.
|
|
149
|
+
* @todo Add support for skipping nested chunks.
|
|
150
|
+
*/
|
|
151
|
+
forceChunkSkip(fullChunkId: number): void;
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=DataStream.d.ts.map
|