added global item config
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user