ball2d 0.2.3 → 0.3.2-next.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/README.md +16 -22
- package/dist/browser.js +7500 -3564
- package/dist/core.wasm +0 -0
- package/dist/licenses/native.json +6 -0
- package/dist/licenses/valibot.txt +9 -0
- package/dist/node.js +33 -33
- package/dist/stadiums/asphalt.ball2dstadium +515 -0
- package/dist/stadiums/{big_hockey.hbs → asphalt_arena.ball2dstadium} +118 -119
- package/dist/stadiums/{big.hbs → big.ball2dstadium} +16 -16
- package/dist/stadiums/{big_easy.hbs → big_easy.ball2dstadium} +16 -16
- package/dist/stadiums/{big_rounded.hbs → big_rounded.ball2dstadium} +20 -20
- package/dist/stadiums/{classic.hbs → classic.ball2dstadium} +16 -16
- package/dist/stadiums/courtyard.ball2dstadium +611 -0
- package/dist/stadiums/{easy.hbs → easy.ball2dstadium} +16 -16
- package/dist/stadiums/{huge.hbs → huge.ball2dstadium} +16 -16
- package/dist/stadiums/meadow.ball2dstadium +611 -0
- package/dist/stadiums/provenance.json +36 -20
- package/dist/stadiums/{rounded.hbs → rounded.ball2dstadium} +20 -20
- package/dist/stadiums/{small.hbs → small.ball2dstadium} +16 -16
- package/dist/stadiums/{hockey.hbs → street_five.ball2dstadium} +82 -83
- package/dist/stadiums/training_green.ball2dstadium +611 -0
- package/dist/types/browser.d.ts +10 -0
- package/dist/types/commentary.d.ts +276 -0
- package/dist/types/config.d.ts +3 -0
- package/dist/types/creation.d.ts +3 -0
- package/dist/types/match-intelligence.d.ts +128 -0
- package/dist/types/match-state.d.ts +8 -2
- package/dist/types/match-xg-runtime.d.ts +37 -0
- package/dist/types/match-xg.d.ts +88 -0
- package/dist/types/node.d.ts +6 -2
- package/dist/types/player.d.ts +2 -0
- package/dist/types/replay.d.ts +1 -1
- package/dist/types/room-geo.d.ts +6 -0
- package/dist/types/room-hooks.d.ts +48 -0
- package/dist/types/room.d.ts +29 -31
- package/package.json +2 -1
package/dist/types/room.d.ts
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
+
import type { MatchXgRuntimeConfig, MatchXgRuntimeStatus } from './match-xg-runtime.js';
|
|
1
2
|
import type { HostPlayer, HostScores, HostDiscProperties } from './player.js';
|
|
2
3
|
import type { DiscPropertyPatch } from './disc.js';
|
|
3
4
|
import type { MatchState } from './match-state.js';
|
|
4
5
|
import type { AnnouncementStyle } from './announcement.js';
|
|
6
|
+
import type { RoomHooks } from './room-hooks.js';
|
|
7
|
+
import type { AtmospherePack, AtmospherePolicy, CommentaryCue, CommentaryGoalGeometry, CommentaryPlayerFact, CommentaryPlayerFactInput, CommentaryPolicy, CommentaryPolicyPatch } from './commentary.js';
|
|
8
|
+
import type { MatchIntelligencePolicy, MatchIntelligencePolicyPatch, MatchIntelligenceRoleAssignment, MatchIntelligenceRoleInput, MatchIntelligenceSnapshot } from './match-intelligence.js';
|
|
5
9
|
/** Public room contract: runtime classes and transport types are deliberately absent. */
|
|
6
|
-
export interface Room {
|
|
10
|
+
export interface Room extends RoomHooks {
|
|
7
11
|
readonly roomId: string;
|
|
8
12
|
readonly roomLink: string;
|
|
9
13
|
readonly roomName: string;
|
|
10
14
|
readonly signal: AbortSignal;
|
|
11
15
|
readonly lastRecording: Blob | null;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
onTeamsLockChange?: (locked: boolean, byPlayer: HostPlayer | null) => void;
|
|
35
|
-
onKickRateLimitSet?: (min: number, rate: number, burst: number, byPlayer: HostPlayer | null) => void;
|
|
36
|
-
onGameTick?: () => void;
|
|
37
|
-
onError?: (message: string) => void;
|
|
16
|
+
/** Host-local opt-in; preparation performs hashes outside the simulation loop. null disables. */
|
|
17
|
+
setMatchXgConfig(config: MatchXgRuntimeConfig | null): Promise<void>;
|
|
18
|
+
getMatchXgStatus(): MatchXgRuntimeStatus;
|
|
19
|
+
setCommentaryPolicy(patch: CommentaryPolicyPatch): Promise<void>;
|
|
20
|
+
getCommentaryPolicy(): CommentaryPolicy;
|
|
21
|
+
setMatchIntelligencePolicy(patch: MatchIntelligencePolicyPatch): Promise<void>;
|
|
22
|
+
getMatchIntelligencePolicy(): MatchIntelligencePolicy;
|
|
23
|
+
/** Replaces all explicit role assignments; [] clears them. Only current field players qualify. */
|
|
24
|
+
setMatchIntelligenceRoles(roles: readonly MatchIntelligenceRoleInput[]): Promise<void>;
|
|
25
|
+
getMatchIntelligenceRoles(): readonly MatchIntelligenceRoleAssignment[];
|
|
26
|
+
/** In-memory observations for this match, never persistent player statistics. */
|
|
27
|
+
getMatchIntelligenceSnapshot(): MatchIntelligenceSnapshot;
|
|
28
|
+
setPlayerCommentaryContext(id: number, facts: readonly CommentaryPlayerFactInput[] | null): Promise<void>;
|
|
29
|
+
getPlayerCommentaryContext(id: number): CommentaryPlayerFact[];
|
|
30
|
+
setCommentaryGeometry(goals: readonly CommentaryGoalGeometry[] | null): Promise<void>;
|
|
31
|
+
getCommentaryGeometry(): readonly CommentaryGoalGeometry[];
|
|
32
|
+
setCommentaryCatalog(cues: readonly CommentaryCue[] | null): Promise<void>;
|
|
33
|
+
getCommentaryCatalog(): readonly CommentaryCue[] | null;
|
|
34
|
+
setAtmospherePolicy(patch: Partial<AtmospherePolicy>): Promise<void>;
|
|
35
|
+
getAtmospherePolicy(): AtmospherePolicy;
|
|
36
|
+
setAtmospherePack(pack: AtmospherePack | null): Promise<void>;
|
|
37
|
+
getAtmospherePack(): AtmospherePack | null;
|
|
38
38
|
getPlayerList(): HostPlayer[];
|
|
39
39
|
getPlayer(id: number): HostPlayer | null;
|
|
40
40
|
setTeamColors(team: number, angle: number, textColor: number, colors: number[]): Promise<void>;
|
|
@@ -49,18 +49,16 @@ export interface Room {
|
|
|
49
49
|
clearBan(id: number): Promise<void>;
|
|
50
50
|
clearBans(): Promise<void>;
|
|
51
51
|
sendChat(text: string, targetId?: number | null): Promise<void>;
|
|
52
|
+
/** Literal text, up to 1,000 characters. RGB color 0x000000–0xffffff;
|
|
53
|
+
* null target broadcasts. Sound 0/1/2 is subject to recipient preferences. */
|
|
52
54
|
sendAnnouncement(text: string, targetId?: number | null, color?: number | null, style?: AnnouncementStyle | null, sound?: number | null): Promise<void>;
|
|
53
55
|
startGame(): Promise<void>;
|
|
54
56
|
stopGame(): Promise<void>;
|
|
55
57
|
pauseGame(paused: boolean): Promise<void>;
|
|
56
58
|
setKickRateLimit(min?: number, rate?: number, burst?: number): Promise<void>;
|
|
57
|
-
/** Enable the wet-grass preset or restore dry ground; requires a stopped match. */
|
|
58
|
-
setSurfaceEnabled(enabled: boolean): Promise<void>;
|
|
59
59
|
setPassword(password: string | null): Promise<void>;
|
|
60
60
|
readonly requireVerification: boolean | null;
|
|
61
61
|
setRequireVerification(required: boolean): Promise<void>;
|
|
62
|
-
/** Migration alias: Ball2D uses Turnstile, not Google's reCAPTCHA. */
|
|
63
|
-
setRequireRecaptcha(required: boolean): Promise<void>;
|
|
64
62
|
setScoreLimit(limit: number): Promise<void>;
|
|
65
63
|
setTimeLimit(minutes: number): Promise<void>;
|
|
66
64
|
setDefaultStadium(name: string): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ball2d",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.3.2-next.0",
|
|
4
4
|
"description": "Ball2D SDK for browser integration and API-key-authorized Node.js room hosting",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"url": "https://github.com/fillbyte/ball2d/issues"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
|
+
"test": "node --test scripts/*.test.mjs",
|
|
35
36
|
"check": "node scripts/check.mjs",
|
|
36
37
|
"check:docs": "node scripts/check-docs.mjs",
|
|
37
38
|
"format:check": "prettier --check .",
|