@hastearcade/snowglobe
Version:
A TypeScript port of CrystalOrb, a high-level Rust game networking library
32 lines • 1.96 kB
TypeScript
import { type Command } from './command';
import { type Config } from './lib';
import { type NetworkResource } from './network_resource';
import * as Timestamp from './timestamp';
import { type Snapshot, type World } from './world';
import { type DisplayState } from './display_state';
import { Analytics } from './analytics';
export declare class Server<$Command extends Command, $Snapshot extends Snapshot, $DisplayState extends DisplayState> {
private readonly world;
private readonly config;
private readonly timekeepingSimulation;
private issuedBuffer;
readonly analytics: Analytics;
private readonly pingTimes;
private commandHistory;
private readonly bufferTime;
constructor(world: World<$Command, $Snapshot, $DisplayState>, config: Config, secondsSinceStartup: number);
filterCommands(): void;
lastCompletedTimestamp(): Timestamp.Timestamp;
simulatingTimestamp(): Timestamp.Timestamp;
estimatedClientSimulatingTimestamp(): Timestamp.Timestamp;
estimatedClientLastCompletedTimestamp(): Timestamp.Timestamp;
applyValidatedCommands(commands: Array<[Timestamp.Timestamped<$Command>, number | undefined]>, net: NetworkResource<$Command>): void;
receiveCommands<$Net extends NetworkResource<$Command>>(commands: Array<[Timestamp.Timestamped<$Command>, number | undefined]>, net: $Net): void;
issueCommand<$Net extends NetworkResource<$Command>>(command: $Command, net: $Net, timestampOverride?: number): void;
bufferedCommands(): IterableIterator<[Timestamp.Timestamp, Timestamp.Timestamped<$Command>[]]>;
getWorld(): World<$Command, $Snapshot, $DisplayState>;
displayState(): Timestamp.Timestamped<$DisplayState> | undefined;
update<$Net extends NetworkResource<$Command>>(deltaSeconds: number, secondsSinceStartup: number, net: $Net): void;
mergeSnapshot(ownerId: string, ownerSnapshot: $Snapshot, nonOwnerSnapshot: $Snapshot): any;
}
//# sourceMappingURL=server.d.ts.map