@genex-ai/multiplayer 0.17.1 → 0.17.8
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/PROTOCOL.md +761 -9
- package/README.md +285 -1
- package/WORLD-GLTF.md +109 -0
- package/WORLD-SCENE.md +135 -0
- package/dist/authority/fast-udp.d.ts +15 -0
- package/dist/authority/fast-udp.js +14 -0
- package/dist/authority/fast-webtransport.d.ts +67 -0
- package/dist/authority/fast-webtransport.js +21 -0
- package/dist/authority/index.d.ts +2671 -0
- package/dist/authority/index.js +958 -0
- package/dist/authority/module.d.ts +2 -0
- package/dist/authority/module.js +12 -0
- package/dist/bridge-authority.d.ts +101 -0
- package/dist/bridge-authority.global.js +15 -0
- package/dist/bridge-authority.js +291 -0
- package/dist/bridge-core-Dhc73GC8.d.ts +27 -0
- package/dist/bridge.d.ts +26 -20
- package/dist/bridge.global.js +7 -7
- package/dist/bridge.js +17 -48
- package/dist/chunk-2NGXXQDS.js +1916 -0
- package/dist/chunk-4R7C2TLH.js +68 -0
- package/dist/{chunk-C52XFIB6.js → chunk-CSQEEANB.js} +217 -4
- package/dist/chunk-FPWP22Y7.js +143 -0
- package/dist/chunk-NFMGIKFZ.js +2627 -0
- package/dist/chunk-OD6NRSX2.js +29 -0
- package/dist/{chunk-3ZUPU3GT.js → chunk-QY3QQNDJ.js} +13 -122
- package/dist/chunk-QZOCUQJT.js +6900 -0
- package/dist/chunk-TSYEWPVO.js +44 -0
- package/dist/chunk-TVTVIMIH.js +675 -0
- package/dist/chunk-YWQ3ALYY.js +69 -0
- package/dist/fast-client--A88q0kk.d.ts +546 -0
- package/dist/index.d.ts +3 -5
- package/dist/index.js +3 -2
- package/dist/join-CGoInvUM.d.ts +6 -0
- package/dist/level-build-CbRqrYJq.d.ts +140 -0
- package/dist/module-CSpXrzFc.d.ts +1187 -0
- package/dist/physics-predict-C7ZB1gDG.d.ts +1223 -0
- package/dist/protocol.d.ts +222 -2
- package/dist/protocol.js +47 -1
- package/dist/shot-world-D22tqOUT.d.ts +485 -0
- package/dist/world-fit/index.d.ts +549 -0
- package/dist/world-fit/index.js +4763 -0
- package/dist/world-fit/three.d.ts +77 -0
- package/dist/world-fit/three.js +140 -0
- package/package.json +46 -4
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/** Why a level was refused. A refusal says this code and names what to change. */
|
|
2
|
+
declare const LevelRefusalCode: {
|
|
3
|
+
/** Not a glb or a glTF, or not a file that can be read. */
|
|
4
|
+
readonly NotGltf: "not_gltf";
|
|
5
|
+
/** A glb's chunks do not add up. */
|
|
6
|
+
readonly BadContainer: "bad_container";
|
|
7
|
+
/** glTF 1 or a version this reader does not take. */
|
|
8
|
+
readonly BadVersion: "bad_version";
|
|
9
|
+
/** An index that names nothing: a scene, a node, a mesh, an accessor, a buffer. */
|
|
10
|
+
readonly BadReference: "bad_reference";
|
|
11
|
+
/** An accessor or a view that does not fit what it reads or is not what it must be. */
|
|
12
|
+
readonly BadAccessor: "bad_accessor";
|
|
13
|
+
/** A triangle's index past its vertices. */
|
|
14
|
+
readonly BadIndex: "bad_index";
|
|
15
|
+
/** A transform or a field of the wrong shape. */
|
|
16
|
+
readonly BadValue: "bad_value";
|
|
17
|
+
/** NaN, an infinity, or a coordinate past the format's range. */
|
|
18
|
+
readonly NotFinite: "not_finite";
|
|
19
|
+
/** A cycle, or a node with two parents. */
|
|
20
|
+
readonly NodeCycle: "node_cycle";
|
|
21
|
+
/** Past a stated limit (LEVEL_LIMITS). */
|
|
22
|
+
readonly TooLarge: "too_large";
|
|
23
|
+
/** Draco or meshopt on something that collides. */
|
|
24
|
+
readonly Compressed: "compressed";
|
|
25
|
+
/** A required extension this reader cannot honour. */
|
|
26
|
+
readonly UnknownExtension: "unknown_extension";
|
|
27
|
+
/** A buffer URI that leaves the input's folder, names the network, or is not a plain file. */
|
|
28
|
+
readonly UriRefused: "uri_refused";
|
|
29
|
+
/** A skinned mesh that collides. */
|
|
30
|
+
readonly Skinned: "skinned";
|
|
31
|
+
/** A mesh posed by morph targets that collides. */
|
|
32
|
+
readonly Morphed: "morphed";
|
|
33
|
+
/** A kind of three.js object the helper cannot read. */
|
|
34
|
+
readonly Unsupported: "unsupported";
|
|
35
|
+
/** A mesh with no triangle left of any area. */
|
|
36
|
+
readonly Degenerate: "degenerate";
|
|
37
|
+
/** More triangles on one edge than any surface has. */
|
|
38
|
+
readonly NonManifold: "non_manifold";
|
|
39
|
+
/** No spawn: a fit starts from where a hull can stand. */
|
|
40
|
+
readonly NoSpawn: "no_spawn";
|
|
41
|
+
/** Nothing collides. */
|
|
42
|
+
readonly NoSurface: "no_surface";
|
|
43
|
+
/** A mark that is not one. */
|
|
44
|
+
readonly BadMark: "bad_mark";
|
|
45
|
+
};
|
|
46
|
+
type LevelRefusalCode = (typeof LevelRefusalCode)[keyof typeof LevelRefusalCode];
|
|
47
|
+
/** A level refused by name: `code` says why, the message names the node or field and what to do. */
|
|
48
|
+
declare class LevelRefusal extends Error {
|
|
49
|
+
readonly code: LevelRefusalCode;
|
|
50
|
+
constructor(code: LevelRefusalCode, message: string);
|
|
51
|
+
}
|
|
52
|
+
/** What this path takes. Each is refused before anything is decoded or allocated for it. */
|
|
53
|
+
declare const LEVEL_LIMITS: {
|
|
54
|
+
/** One glb, or one external buffer, and all buffers together. */
|
|
55
|
+
readonly maxFileBytes: number;
|
|
56
|
+
/** Triangles in the level, instances counted. A fit reads a scene of this size; art past it needs a proxy. */
|
|
57
|
+
readonly maxTriangles: 8000000;
|
|
58
|
+
/** Vertices one accessor may read. */
|
|
59
|
+
readonly maxVertices: 24000000;
|
|
60
|
+
readonly maxNodes: 1000000;
|
|
61
|
+
readonly maxDepth: 1024;
|
|
62
|
+
/** Points a `hull` holds, as the scene format says. */
|
|
63
|
+
readonly maxHullPoints: 4096;
|
|
64
|
+
/** No surface puts more triangles on one edge: past this it is junk, or an attack on what reads it. */
|
|
65
|
+
readonly maxTrianglesOnEdge: 64;
|
|
66
|
+
};
|
|
67
|
+
/** What a surface answers, as a creator marks it. `both` is the default; `none` is only drawn. */
|
|
68
|
+
declare const LevelCollide: {
|
|
69
|
+
readonly Both: "both";
|
|
70
|
+
readonly Move: "move";
|
|
71
|
+
readonly Shot: "shot";
|
|
72
|
+
readonly None: "none";
|
|
73
|
+
};
|
|
74
|
+
type LevelCollide = (typeof LevelCollide)[keyof typeof LevelCollide];
|
|
75
|
+
/** How a mesh becomes surfaces. Unmarked, a closed axis-aligned cube becomes an exact box and the rest stays triangles. */
|
|
76
|
+
declare const LevelShape: {
|
|
77
|
+
readonly Mesh: "mesh";
|
|
78
|
+
readonly Box: "box";
|
|
79
|
+
readonly Hull: "hull";
|
|
80
|
+
};
|
|
81
|
+
type LevelShape = (typeof LevelShape)[keyof typeof LevelShape];
|
|
82
|
+
/** A node's own mark, from its name and its `extras.genex` (`userData.genex` in three.js). */
|
|
83
|
+
interface LevelMark {
|
|
84
|
+
readonly collide?: LevelCollide;
|
|
85
|
+
readonly shape?: LevelShape;
|
|
86
|
+
readonly movable?: boolean;
|
|
87
|
+
readonly prop?: boolean;
|
|
88
|
+
readonly spawn?: boolean;
|
|
89
|
+
readonly tags?: readonly string[];
|
|
90
|
+
}
|
|
91
|
+
/** A node's own mark: what its name spells, then its `extras.genex`, which wins. Refuses a mark that is not one. */
|
|
92
|
+
declare function levelMarkOf(name: string, genex: unknown, where?: string, allowSettings?: boolean): LevelMark;
|
|
93
|
+
interface LevelHull {
|
|
94
|
+
readonly radius: number;
|
|
95
|
+
readonly height: number;
|
|
96
|
+
readonly crouchHeight: number;
|
|
97
|
+
readonly step: number;
|
|
98
|
+
readonly jump: number;
|
|
99
|
+
readonly leap: number;
|
|
100
|
+
}
|
|
101
|
+
/** The scene as JSON holds it, base64 for the big arrays: `parseWorldScene` takes exactly this. */
|
|
102
|
+
interface RawWorldScene {
|
|
103
|
+
readonly format: 'genex-world-scene';
|
|
104
|
+
readonly version: 1;
|
|
105
|
+
readonly unitsPerMeter: number;
|
|
106
|
+
readonly source: Readonly<Record<string, string>>;
|
|
107
|
+
readonly hull?: LevelHull;
|
|
108
|
+
readonly actors: readonly RawActor[];
|
|
109
|
+
readonly spawns: readonly {
|
|
110
|
+
readonly at: readonly number[];
|
|
111
|
+
readonly name?: string;
|
|
112
|
+
readonly tags?: readonly string[];
|
|
113
|
+
}[];
|
|
114
|
+
}
|
|
115
|
+
interface RawActor {
|
|
116
|
+
readonly name: string;
|
|
117
|
+
readonly tags?: readonly string[];
|
|
118
|
+
readonly surfaces: readonly RawSurface[];
|
|
119
|
+
}
|
|
120
|
+
type RawSurface = {
|
|
121
|
+
readonly kind: string;
|
|
122
|
+
} & Readonly<Record<string, unknown>>;
|
|
123
|
+
interface LevelStats {
|
|
124
|
+
readonly actors: number;
|
|
125
|
+
readonly boxes: number;
|
|
126
|
+
readonly hulls: number;
|
|
127
|
+
readonly meshes: number;
|
|
128
|
+
readonly triangles: number;
|
|
129
|
+
readonly spawns: number;
|
|
130
|
+
}
|
|
131
|
+
interface LevelScene {
|
|
132
|
+
readonly scene: RawWorldScene;
|
|
133
|
+
/** What was kept or dropped that a creator may want to look at. Never in the scene's bytes. */
|
|
134
|
+
readonly notes: readonly string[];
|
|
135
|
+
readonly stats: LevelStats;
|
|
136
|
+
/** The scene's bytes, as text: one file, the same on every OS. */
|
|
137
|
+
readonly json: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export { type LevelScene as L, type RawWorldScene as R, type LevelHull as a, LEVEL_LIMITS as b, LevelCollide as c, type LevelMark as d, LevelRefusal as e, LevelRefusalCode as f, LevelShape as g, levelMarkOf as l };
|