ball2d 0.2.3 → 0.3.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 +14 -22
- package/dist/browser.js +2839 -2238
- 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 +6 -0
- package/dist/types/config.d.ts +3 -0
- package/dist/types/match-state.d.ts +8 -2
- package/dist/types/node.d.ts +2 -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.d.ts +6 -4
- package/package.json +2 -1
package/dist/types/room.d.ts
CHANGED
|
@@ -26,7 +26,11 @@ export interface Room {
|
|
|
26
26
|
onPlayerLeave?: (p: HostPlayer) => void;
|
|
27
27
|
onPlayerKicked?: (p: HostPlayer, reason: string, ban: boolean, byPlayer: HostPlayer | null) => void;
|
|
28
28
|
onPlayerActivity?: (p: HostPlayer) => void;
|
|
29
|
+
/** Runs only when a peer changes its accepted key state; prevInput is the previous authoritative bitmask. */
|
|
30
|
+
onPlayerInput?: (p: HostPlayer, prevInput: number) => void;
|
|
29
31
|
onPlayerChat?: (p: HostPlayer, text: string) => boolean | void;
|
|
32
|
+
/** Host-visible direct chat; return false to suppress delivery to both participants. */
|
|
33
|
+
onPlayerDirectChat?: (p: HostPlayer, recipient: HostPlayer, text: string) => boolean | void;
|
|
30
34
|
onPlayerBallKick?: (p: HostPlayer) => void;
|
|
31
35
|
onTeamGoal?: (team: 1 | 2) => void;
|
|
32
36
|
onPositionsReset?: () => void;
|
|
@@ -49,18 +53,16 @@ export interface Room {
|
|
|
49
53
|
clearBan(id: number): Promise<void>;
|
|
50
54
|
clearBans(): Promise<void>;
|
|
51
55
|
sendChat(text: string, targetId?: number | null): Promise<void>;
|
|
56
|
+
/** Literal text, up to 1,000 characters. RGB color 0x000000–0xffffff;
|
|
57
|
+
* null target broadcasts. Sound 0/1/2 is subject to recipient preferences. */
|
|
52
58
|
sendAnnouncement(text: string, targetId?: number | null, color?: number | null, style?: AnnouncementStyle | null, sound?: number | null): Promise<void>;
|
|
53
59
|
startGame(): Promise<void>;
|
|
54
60
|
stopGame(): Promise<void>;
|
|
55
61
|
pauseGame(paused: boolean): Promise<void>;
|
|
56
62
|
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
63
|
setPassword(password: string | null): Promise<void>;
|
|
60
64
|
readonly requireVerification: boolean | null;
|
|
61
65
|
setRequireVerification(required: boolean): Promise<void>;
|
|
62
|
-
/** Migration alias: Ball2D uses Turnstile, not Google's reCAPTCHA. */
|
|
63
|
-
setRequireRecaptcha(required: boolean): Promise<void>;
|
|
64
66
|
setScoreLimit(limit: number): Promise<void>;
|
|
65
67
|
setTimeLimit(minutes: number): Promise<void>;
|
|
66
68
|
setDefaultStadium(name: string): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ball2d",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.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 .",
|