added global item config

This commit is contained in:
2026-10-25 22:31:22 +01:00
parent 6184cdba0a
commit 9178202c57
27 changed files with 637 additions and 88 deletions
+6 -1
View File
@@ -1,6 +1,6 @@
import * as signalR from '@microsoft/signalr';
import { getServerUrl } from '../config/runtimeConfig';
import type { InputAction, JoinResult, Lobby, MatchState } from './types';
import type { InputAction, ItemInfo, JoinResult, Lobby, MatchState } from './types';
export interface HubHandlers {
onLobbyUpdated: (lobby: Lobby) => void;
@@ -64,6 +64,11 @@ export class HubClient {
return this.invoke<void>('StartGame');
}
/** Items with their spawn share and duration from the server config. */
getItems() {
return this.invoke<ItemInfo[]>('GetItems');
}
/** Fire-and-forget input; ordering is preserved by the connection. */
input(action: InputAction) {
if (this.connection.state === signalR.HubConnectionState.Connected) {