UNPKG

@gwigz/homunculus-core

Version:

A third-party framework for interacting with Linden Lab's virtual world "Second Life"

46 lines (45 loc) 1.3 kB
import type { Client } from "../client"; import { Circuit, type CircuitOptions, type ProxyOptions, Socket } from "../network"; /** * The core handles connecting to a simulator, processing and sending * messages. */ export declare class Core { private readonly client; /** * The UDP connection/socket. */ socket: Socket; /** * Collection of recently, and currently in use Circuit instances. */ circuits: Map<string, Circuit>; /** * The currently in use Circuit instance. */ circuit?: Circuit; /** * The status of this class, a type of Constants.Status, IDLE default. */ status: number; /** * @param client For emitting processed messages back to. */ constructor(client: Client, proxy?: ProxyOptions); /** * Sends message to Circuit over UDP socket. * * @param circuit Circuit to send packets too. * @param packets Packet to send. */ send(circuit: Circuit, packets: Array<[data: Buffer, sequence: number]>): Promise<void>[]; /** * Connects the client to a given circuit code. */ handshake(data: CircuitOptions): Promise<void>; ready(): void; /** * Disconnects the client from the current circuit. */ disconnect(): Promise<void>; }