create-smore-game 1.0.0 → 1.2.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/package.json +1 -1
- package/templates.js +11 -11
package/package.json
CHANGED
package/templates.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// pnpm-workspace.yaml is no longer generated.
|
|
4
4
|
// npm workspaces are configured in root package.json instead.
|
|
5
5
|
|
|
6
|
-
const SDK_VERSION = '^1.
|
|
6
|
+
const SDK_VERSION = '^1.3.0';
|
|
7
7
|
|
|
8
8
|
export function rootPackageJson(name) {
|
|
9
9
|
return JSON.stringify(
|
|
@@ -219,8 +219,8 @@ export function App() {
|
|
|
219
219
|
// onControllerReconnect: (playerIndex: number, info: ControllerInfo) => void — called when a disconnected player reconnects
|
|
220
220
|
// onCharacterUpdated: (playerIndex: number, appearance: CharacterAppearance | null) => void — called when a player updates their character appearance
|
|
221
221
|
// onRateLimited: (event: string) => void — called when client is rate-limited by server
|
|
222
|
-
//
|
|
223
|
-
//
|
|
222
|
+
// onReady: () => void — called when all participants are ready. Use for countdown/game start.
|
|
223
|
+
// To control autoReady, use: import { configure } from '@smoregg/sdk'; configure({ autoReady: false });
|
|
224
224
|
onError: (error) => {
|
|
225
225
|
console.error('SDK Error:', error.message);
|
|
226
226
|
// Show user-friendly error UI
|
|
@@ -409,8 +409,8 @@ export function App() {
|
|
|
409
409
|
// onControllerReconnect: (playerIndex: number, info: ControllerInfo) => void — called when a disconnected player reconnects
|
|
410
410
|
// onCharacterUpdated: (playerIndex: number, appearance: CharacterAppearance | null) => void — called when a player updates their character appearance
|
|
411
411
|
// onRateLimited: (event: string) => void — called when client is rate-limited by server
|
|
412
|
-
//
|
|
413
|
-
//
|
|
412
|
+
// onReady: () => void — called when all participants are ready. Use for countdown/game start.
|
|
413
|
+
// To control autoReady, use: import { configure } from '@smoregg/sdk'; configure({ autoReady: false });
|
|
414
414
|
onError: (error) => {
|
|
415
415
|
console.error('SDK Error:', error.message);
|
|
416
416
|
// Show user-friendly error UI
|
|
@@ -584,8 +584,8 @@ async function init() {
|
|
|
584
584
|
// onControllerReconnect: (playerIndex, info) => { console.log('Player reconnected:', playerIndex); },
|
|
585
585
|
// onCharacterUpdated: (playerIndex, appearance) => { console.log('Character updated:', playerIndex); },
|
|
586
586
|
// onRateLimited: (event: string) => { console.warn('Rate limited:', event); },
|
|
587
|
-
//
|
|
588
|
-
//
|
|
587
|
+
// onReady: () => void — called when all participants are ready. Use for countdown/game start.
|
|
588
|
+
// To control autoReady, use: import { configure } from '@smoregg/sdk'; configure({ autoReady: false });
|
|
589
589
|
onError: (error) => {
|
|
590
590
|
console.error('SDK Error:', error.message);
|
|
591
591
|
// Show user-friendly error UI
|
|
@@ -756,8 +756,8 @@ export function App() {
|
|
|
756
756
|
// onControllerJoin: (playerIndex: number, info: ControllerInfo) => void — called when any player joins
|
|
757
757
|
// onControllerLeave: (playerIndex: number) => void — called when any player leaves
|
|
758
758
|
// onError: (error: SmoreError) => void — called on SDK errors
|
|
759
|
-
//
|
|
760
|
-
// autoReady:
|
|
759
|
+
// onReady: () => void — called when all participants are ready
|
|
760
|
+
// To control autoReady, use: import { configure } from '@smoregg/sdk'; configure({ autoReady: false });
|
|
761
761
|
});
|
|
762
762
|
if (!mounted) {
|
|
763
763
|
controller.destroy();
|
|
@@ -915,8 +915,8 @@ async function init() {
|
|
|
915
915
|
// onControllerJoin: (playerIndex, info) => { console.log('Player joined:', playerIndex); },
|
|
916
916
|
// onControllerLeave: (playerIndex) => { console.log('Player left:', playerIndex); },
|
|
917
917
|
// onError: (error) => { console.error('SDK Error:', error.message); },
|
|
918
|
-
//
|
|
919
|
-
// autoReady:
|
|
918
|
+
// onReady: () => void — called when all participants are ready
|
|
919
|
+
// To control autoReady, use: import { configure } from '@smoregg/sdk'; configure({ autoReady: false });
|
|
920
920
|
});
|
|
921
921
|
|
|
922
922
|
playerInfoEl.textContent = \`Player \${controller.myIndex}\`;
|