Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SkeldjsClient

Represents a programmable Among Us client.

See SkeldjsClientEvents for events to listen to.

Hierarchy

Index

Properties

Static FixedUpdateInterval

FixedUpdateInterval: number = ...

How often a FixedUpdate should be called.

authClient

authClient: AuthClient

Auth client responsible for getting an authentication token from the connected-to server.

clientId

clientId: number

The client ID of the client.

code

code: number

The code of the room.

config

config: ClientConfig

The options for the client.

connected

connected: boolean

Whether or not the client is currently connected to a server.

counter

counter: number

The current start counter for the room.

decoder

decoder: PacketDecoder<any>

endGameIntents

endGameIntents: EndGameIntent<any>[]

Every end game intent that should happen in a queue to be or not to be canceled.

The first item of each element being the name of the end game intent and the second being metadata passed with it.

See RoomEndGameIntentEvent to cancel an end game intent, or see Hostable.registerEndGameIntent to register your own.

See RoomGameEndEvent to listen for a game actually ending.

gameData

gameData: undefined | GameData<SkeldjsClient>

An instance of the game data in the room. Contains information about players such as their name, colour, hat etc.

It is possible for more than one game data to be spawned, however this property is set and cleared for simplicity.

See Hostable.objectList if you're looking to find all game data objects that have been spawned.

gameState

gameState: GameState

The state that the game is currently in.

hostId

hostId: number

The ID of the host of the room.

httpMatchmakerClient

httpMatchmakerClient: HttpMatchmakerClient

Http matchmaker client responsible for retrieving information about games on the server to connect to.

identified

identified: boolean

Whether or not the client is identified with the connected server.

Optional ip

ip: string

The IP of the server that the client is currently connected to.

lobbyBehaviour

lobbyBehaviour: undefined | LobbyBehaviour<SkeldjsClient>

An instance of the lobby behaviour in the room. Spawned when the room is currently in the lobby waiting for a game to start.

It is possible for more than one lobby behaviour to be spawned, however this property is set and cleared for simplicity.

See Hostable.objectList if you're looking to find all lobby behaviour objects that have been spawned.

meetingHud

meetingHud: undefined | MeetingHud<SkeldjsClient>

An instance of the meeting hud in the room. Spawned when a meeting is started.

It is possible for more than one meeting hud to be spawned, however this property is set and cleared for simplicity.

See Hostable.objectList if you're looking to find all meeting hud objects that have been spawned.

messageStream

messageStream: BaseGameDataMessage[]

The current message stream to be sent to the server on fixed update.

netobjects

netobjects: Map<number, Networkable<any, NetworkableEvents<Hostable<any>>, SkeldjsClient>>

The networkable components in the room.

Optional nextExpectedNonce

nextExpectedNonce: number

The next nonce that the client is expecting to receive from the server.

objectList

objectList: Networkable<any, NetworkableEvents<Hostable<any>>, Hostable<any>>[]

A list of all objects in the room.

packetsReceived

packetsReceived: number[]

An array of 8 of the most recent packets received from the server.

packetsSent

packetsSent: SentPacket[]

An array of 8 of the most recent packet sent by the client.

players

players: Map<number, PlayerData<SkeldjsClient>>

The players in the room.

Optional port

port: number

The port of the server that the client is currently connected to.

privacy

privacy: PrivacyType

The privacy state of the room.

registeredPrefabs

registeredPrefabs: Map<number, NetworkableConstructor<any>[]>

A map of spawn type -> objects used in the protocol. Useful to register custom INO (inner net objects) such as replicating behaviour from a client mod, see Hostable.registerPrefab.

registeredRoles

registeredRoles: Map<number, typeof BaseRole>

All roles that can be assigned to players. See Hostable.registerRole.

sent_disconnect

sent_disconnect: boolean

Whether or not the client has sent a disconnect packet.

settings

settings: GameSettings

The settings of the room.

shipStatus

shipStatus: undefined | InnerShipStatus<SkeldjsClient>

An instance of the ship status in the room. Spawned when a game is started and represents the current map.

It is possible for more than one ship status to be spawned, however this property is set and cleared for simplicity.

See Hostable.objectList if you're looking to find all ship status objects that have been spawned.

Optional socket

socket: DtlsSocket | Socket

The datagram socket for the client.

unorderedMessageMap

unorderedMessageMap: Map<number, ReliablePacket>

A map from nonce->message that were received from the server with an unexpected nonce (out of order).

username

username: string

The username of the client.

version

version: VersionInfo

The version of the client.

voteBanSystem

voteBanSystem: undefined | VoteBanSystem<SkeldjsClient>

An instance of the voting ban system in the room. Used as a utility object for handling kick and ban votes.

It is possible for more than one vote ban system to be spawned, however this property is set and cleared for simplicity.

See Hostable.objectList if you're looking to find all vote ban system objects that have been spawned.

Methods

FixedUpdate

  • FixedUpdate(): Promise<void>

_connect

  • _connect(host: string, port: number | PortOptions): Promise<void>

_createGame

  • _createGame(settings: GameSettings, doJoin: boolean): Promise<number>

_joinGame

  • _joinGame(code: RoomID, doSpawn: boolean): Promise<number>

broadcast

  • broadcast(gamedata: BaseGameDataMessage[], payloads?: BaseRootMessage[], include?: (number | PlayerData<Hostable<any>>)[], exclude?: (number | PlayerData<Hostable<any>>)[], reliable?: boolean): Promise<void>
  • Broadcast a message to a specific player or to all players in the game.

    Parameters

    • gamedata: BaseGameDataMessage[]

      The gamedata messages to broadcast

    • payloads: BaseRootMessage[] = []

      Any payloads to send to the server (won't go to any recipients in particular)

    • Optional include: (number | PlayerData<Hostable<any>>)[]

      Which players to include in the broadcast

    • Optional exclude: (number | PlayerData<Hostable<any>>)[]

      Which players to exclude from the broadcast

    • reliable: boolean = true

      Whether or not this message is reliable and should be acknowledged by the server

    Returns Promise<void>

canManageObject

  • canManageObject(object: Networkable<any, NetworkableEvents<Hostable<any>>, Hostable<any>>): boolean
  • Whether or not this client/room is able to manage an object, i.e. perform host actions on it.

    Parameters

    • object: Networkable<any, NetworkableEvents<Hostable<any>>, Hostable<any>>

      The object to manage.

    Returns boolean

    Whether or not the object can be managed by this client/room.

checkPlayersRemaining

  • checkPlayersRemaining(): void

connect

  • connect(host: string, port?: number | PortOptions): Promise<void>
  • Connect to a region or IP. Optionally identify with {@link SkeldsClient.username} (can be done later with the SkeldjsClient.identify method).

    example
    // Connect to an official Among Us region.
    await connect("https://matchmaker.among.us", "weakeyes", 443);
    
    // Connect to a locally hosted private server.
    await connect("127.0.0.1", "weakeyes", 3423432);
    

    Parameters

    • host: string

      The hostname to connect to.

    • Optional port: number | PortOptions

      The port to connect to.

    Returns Promise<void>

createFakePlayer

  • Create a fake player in the room that doesn't need a client to be connected to own it.

    To dispose of the player, use player.despawn().

    Parameters

    • isNew: boolean = true

      Whether or not the player should be seen jumping off of the seat in the lobby.

    Returns PlayerData<SkeldjsClient>

    The fake player created.

createGame

  • createGame(hostSettings?: Partial<{ anonymousVotes: boolean; commonTasks: number; confirmEjects: boolean; crewmateVision: number; discussionTime: number; emergencyCooldown: number; impostorVision: number; isDefaults: boolean; keywords: GameKeyword; killCooldown: number; killDistance: KillDistance; longTasks: number; map: GameMap; maxPlayers: number; numEmergencies: number; numImpostors: number; playerSpeed: number; roleSettings: Partial<{ roleChances: Partial<{ 0?: Partial<{ maxPlayers: number; chance: number; }> | undefined; 1?: Partial<{ maxPlayers: number; chance: number; }> | undefined; 2?: Partial<{ maxPlayers: number; chance: number; }> | undefined; 3?: Partial<...> | undefined; 4?: Partial<...> | undefined; 5?: Partial<...> | undefined; }>; ...>; shortTasks: number; taskbarUpdates: TaskBarUpdate; version: number; visualTasks: boolean; votingTime: number }>, doJoin?: boolean): Promise<number>
  • Create a game with given settings.

    example
    // Create a game on The Skeld with an English chat with 2 impostors.
    await client.createGame({
      map: GameMap.TheSkeld,
      keywords: GameKeyword.English,
      numImpostors: 2
    });
    

    Parameters

    • hostSettings: Partial<{ anonymousVotes: boolean; commonTasks: number; confirmEjects: boolean; crewmateVision: number; discussionTime: number; emergencyCooldown: number; impostorVision: number; isDefaults: boolean; keywords: GameKeyword; killCooldown: number; killDistance: KillDistance; longTasks: number; map: GameMap; maxPlayers: number; numEmergencies: number; numImpostors: number; playerSpeed: number; roleSettings: Partial<{ roleChances: Partial<{ 0?: Partial<{ maxPlayers: number; chance: number; }> | undefined; 1?: Partial<{ maxPlayers: number; chance: number; }> | undefined; 2?: Partial<{ maxPlayers: number; chance: number; }> | undefined; 3?: Partial<...> | undefined; 4?: Partial<...> | undefined; 5?: Partial<...> | undefined; }>; ...>; shortTasks: number; taskbarUpdates: TaskBarUpdate; version: number; visualTasks: boolean; votingTime: number }> = {}

      The settings to create the game with.

    • doJoin: boolean = true

      Whether or not to join the game after created.

    Returns Promise<number>

    The game code of the room.

despawnComponent

  • despawnComponent(component: Networkable<any, NetworkableEvents<Hostable<any>>, SkeldjsClient>): void

destroy

  • destroy(): void

disconnect

emit

  • emit<Event>(event: Event): Promise<Event>

emitSerial

  • emitSerial<Event>(event: Event): Promise<Event>

emitSync

  • emitSync<Event>(event: Event): Event

endGame

  • endGame(reason: GameOverReason): Promise<void>

findGames

  • findGames(maps?: number | GameMap[], impostors?: number, keyword?: GameKeyword, quickChat?: QuickChatMode): Promise<GameListing[]>
  • Search for public games.

    example
    // Search for games and join a random one.
    const client = new SkeldjsClient("2021.4.25");
    
    await client.connect("EU", "weakeyes");
    
    const games = await client.findGames();
    const game = games[Math.floor(Math.random() * games.length)];
    
    const code = await game.join();
    

    Parameters

    • maps: number | GameMap[] = 0x7

      The maps of games to look for. If a number, it will be a bitfield of the maps, else, it will be an array of the maps.

    • impostors: number = 0

      The number of impostors to look for. 0 for any amount.

    • keyword: GameKeyword = ...

      The language of the game to look for, use GameKeyword.All for any.

    • quickChat: QuickChatMode = ...

    Returns Promise<GameListing[]>

    An array of game listings.

findPlayersWithName

  • findPlayersWithName(displayName: string): PlayerData<SkeldjsClient>[]

getAvailablePlayerID

  • getAvailablePlayerID(): number

getExistingObjectSpawn

getLastNonce

  • getLastNonce(): number

getListeners

  • getListeners<Event>(event: string): Listener<Event>[]

getNextNetId

  • getNextNetId(): number

getNextNonce

  • getNextNonce(): number

getPlayerByNetId

  • getPlayerByNetId(netId: number): undefined | PlayerData<SkeldjsClient>
  • Get a player by one of their components' netIds.

    example
    const player = room.getPlayerByNetId(34);
    

    Parameters

    • netId: number

      The net ID of the component of the player to search.

    Returns undefined | PlayerData<SkeldjsClient>

    The player that was found, or null if they do not exist.

getPlayerByPlayerId

  • getPlayerByPlayerId(playerId: number): undefined | PlayerData<SkeldjsClient>

getPlayerControlByPlayerId

handleEnd

  • handleEnd(reason: GameOverReason): Promise<void>

handleInboundMessage

  • handleInboundMessage(message: Buffer): Promise<void>

handleJoin

  • handleJoin(joinInfo: PlayerJoinData): any

handleLeave

  • handleLeave(resolvable: PlayerDataResolvable): Promise<null | PlayerData<SkeldjsClient>>

handleOutboundMessage

  • handleOutboundMessage(message: Buffer): Promise<void>

handleReady

  • handleReady(player: PlayerDataResolvable): Promise<void>

handleStart

  • handleStart(): Promise<void>

identify

  • identify(username: string, authToken: number): Promise<void>
  • Identify with the connected server. (Can be done before in the SkeldjsClient.connect method)

    example
    await client.identify("weakeyes");
    

    Parameters

    • username: string

      The username to identify with.

    • authToken: number

    Returns Promise<void>

joinGame

  • joinGame(code: RoomID, doSpawn?: boolean): Promise<number>
  • Join a room given the 4 or 6 digit code.

    example
    await client.joinGame("ABCDEF");
    

    Parameters

    • code: RoomID

      The code of the room to join.

    • doSpawn: boolean = true

      Whether or not to spawn the player. If false, the client will be unaware of any existing objects in the game until SkeldjsClient.spawnSelf is called.

    Returns Promise<number>

    The code of the room joined.

murderIsValid

  • murderIsValid(murderer: PlayerData<Hostable<any>>, victim: PlayerData<Hostable<any>>): boolean

off

  • off<EventName>(event: EventName, listener: Listener<SkeldjsClientEvents[EventName]>): void
  • off<K>(event: string, listener: Listener<K>): void
  • Type parameters

    • EventName: "component.spawn" | "component.despawn" | "player.checkcolor" | "player.checkmurder" | "player.checkname" | "player.checkprotect" | "player.completetask" | "player.die" | "player.usemovingplatform" | "player.murder" | "player.protect" | "player.removeprotection" | "player.reportbody" | "player.revertshapeshift" | "player.chat" | "player.quickchat" | "player.setcolor" | "player.sethat" | "player.setname" | "player.setnameplate" | "player.setpet" | "player.setrole" | "player.setskin" | "player.setstartcounter" | "player.setvisor" | "player.shapeshift" | "player.startmeeting" | "player.syncsettings" | "player.entervent" | "player.exitvent" | "player.climbladder" | "player.move" | "player.snapto" | "player.ready" | "player.join" | "player.leave" | "player.sethost" | "player.scenechange" | "player.spawn" | "gamedata.addplayer" | "gamedata.removeplayer" | "gamedata.settasks" | "meeting.castvote" | "meeting.clearvote" | "meeting.votingcomplete" | "meeting.close" | "doors.open" | "doors.close" | "system.sabotage" | "system.repair" | "decon.doors.close" | "decon.doors.open" | "decon.enter" | "decon.exit" | "hqhud.consoles.reset" | "hqhud.consoles.open" | "hqhud.consoles.close" | "hqhud.consoles.complete" | "heli.consoles.open" | "heli.consoles.reset" | "heli.consoles.close" | "heli.consoles.complete" | "o2.consoles.clear" | "o2.consoles.complete" | "medscan.joinqueue" | "medscan.leavequeue" | "movingplatform.updateplayer" | "reactor.consoles.add" | "reactor.consoles.remove" | "reactor.consoles.reset" | "security.cameras.join" | "security.cameras.leave" | "electrical.switchflip" | "room.assignroles" | "room.endgameintent" | "room.fixedupdate" | "room.gameend" | "room.gamestart" | "room.setprivacy" | "client.connect" | "client.disconnect" | "client.identify" | "client.join"

    Parameters

    Returns void

  • Type parameters

    Parameters

    • event: string
    • listener: Listener<K>

    Returns void

on

  • on<EventName>(event: EventName, listener: Listener<SkeldjsClientEvents[EventName]>): () => void
  • on<K>(event: string, listener: Listener<K>): () => void
  • Type parameters

    • EventName: "component.spawn" | "component.despawn" | "player.checkcolor" | "player.checkmurder" | "player.checkname" | "player.checkprotect" | "player.completetask" | "player.die" | "player.usemovingplatform" | "player.murder" | "player.protect" | "player.removeprotection" | "player.reportbody" | "player.revertshapeshift" | "player.chat" | "player.quickchat" | "player.setcolor" | "player.sethat" | "player.setname" | "player.setnameplate" | "player.setpet" | "player.setrole" | "player.setskin" | "player.setstartcounter" | "player.setvisor" | "player.shapeshift" | "player.startmeeting" | "player.syncsettings" | "player.entervent" | "player.exitvent" | "player.climbladder" | "player.move" | "player.snapto" | "player.ready" | "player.join" | "player.leave" | "player.sethost" | "player.scenechange" | "player.spawn" | "gamedata.addplayer" | "gamedata.removeplayer" | "gamedata.settasks" | "meeting.castvote" | "meeting.clearvote" | "meeting.votingcomplete" | "meeting.close" | "doors.open" | "doors.close" | "system.sabotage" | "system.repair" | "decon.doors.close" | "decon.doors.open" | "decon.enter" | "decon.exit" | "hqhud.consoles.reset" | "hqhud.consoles.open" | "hqhud.consoles.close" | "hqhud.consoles.complete" | "heli.consoles.open" | "heli.consoles.reset" | "heli.consoles.close" | "heli.consoles.complete" | "o2.consoles.clear" | "o2.consoles.complete" | "medscan.joinqueue" | "medscan.leavequeue" | "movingplatform.updateplayer" | "reactor.consoles.add" | "reactor.consoles.remove" | "reactor.consoles.reset" | "security.cameras.join" | "security.cameras.leave" | "electrical.switchflip" | "room.assignroles" | "room.endgameintent" | "room.fixedupdate" | "room.gameend" | "room.gamestart" | "room.setprivacy" | "client.connect" | "client.disconnect" | "client.identify" | "client.join"

    Parameters

    Returns () => void

      • (): void
      • Returns void

  • Type parameters

    Parameters

    • event: string
    • listener: Listener<K>

    Returns () => void

      • (): void
      • Returns void

once

  • once<EventName>(event: EventName, listener: Listener<SkeldjsClientEvents[EventName]>): () => void
  • once<K>(event: string, listener: Listener<K>): () => void
  • Type parameters

    • EventName: "component.spawn" | "component.despawn" | "player.checkcolor" | "player.checkmurder" | "player.checkname" | "player.checkprotect" | "player.completetask" | "player.die" | "player.usemovingplatform" | "player.murder" | "player.protect" | "player.removeprotection" | "player.reportbody" | "player.revertshapeshift" | "player.chat" | "player.quickchat" | "player.setcolor" | "player.sethat" | "player.setname" | "player.setnameplate" | "player.setpet" | "player.setrole" | "player.setskin" | "player.setstartcounter" | "player.setvisor" | "player.shapeshift" | "player.startmeeting" | "player.syncsettings" | "player.entervent" | "player.exitvent" | "player.climbladder" | "player.move" | "player.snapto" | "player.ready" | "player.join" | "player.leave" | "player.sethost" | "player.scenechange" | "player.spawn" | "gamedata.addplayer" | "gamedata.removeplayer" | "gamedata.settasks" | "meeting.castvote" | "meeting.clearvote" | "meeting.votingcomplete" | "meeting.close" | "doors.open" | "doors.close" | "system.sabotage" | "system.repair" | "decon.doors.close" | "decon.doors.open" | "decon.enter" | "decon.exit" | "hqhud.consoles.reset" | "hqhud.consoles.open" | "hqhud.consoles.close" | "hqhud.consoles.complete" | "heli.consoles.open" | "heli.consoles.reset" | "heli.consoles.close" | "heli.consoles.complete" | "o2.consoles.clear" | "o2.consoles.complete" | "medscan.joinqueue" | "medscan.leavequeue" | "movingplatform.updateplayer" | "reactor.consoles.add" | "reactor.consoles.remove" | "reactor.consoles.reset" | "security.cameras.join" | "security.cameras.leave" | "electrical.switchflip" | "room.assignroles" | "room.endgameintent" | "room.fixedupdate" | "room.gameend" | "room.gamestart" | "room.setprivacy" | "client.connect" | "client.disconnect" | "client.identify" | "client.join"

    Parameters

    Returns () => void

      • (): void
      • Returns void

  • Type parameters

    Parameters

    • event: string
    • listener: Listener<K>

    Returns () => void

      • (): void
      • Returns void

pingInterval

registerEndGameIntent

registerPrefab

  • registerPrefab(spawnType: number, components: NetworkableConstructor<Networkable<any, NetworkableEvents<Hostable<any>>, Hostable<any>>>[]): void
  • Register a custom INO spawn object by its spawn type. Can also override built-in objects.

    Parameters

    • spawnType: number

      The spawn type of the component as an integer.

    • components: NetworkableConstructor<Networkable<any, NetworkableEvents<Hostable<any>>, Hostable<any>>>[]

      The components in the object. The first component should be the main object which will inherit the rest of the components.

    Returns void

registerRole

  • registerRole(roleCtr: typeof BaseRole): void

removeAllListeners

  • removeAllListeners(): void

removeListeners

  • removeListeners(event: string): void

resolvePlayer

  • resolvePlayer(player: PlayerDataResolvable): undefined | PlayerData<SkeldjsClient>
  • Resolve a player by some identifier.

    example
    // Resolve a player by their client id.
    const player = room.resolvePlayer(11013);
    

    Parameters

    • player: PlayerDataResolvable

      The identifier to resolve to a player.

    Returns undefined | PlayerData<SkeldjsClient>

    The resolved player.

resolvePlayerClientID

  • resolvePlayerClientID(player: PlayerDataResolvable): undefined | number

resolvePlayerId

send

setCode

  • setCode(code: RoomID): void

setHost

  • setHost(host: PlayerDataResolvable): Promise<void>
  • Set the host of the room. If the current client is the host, it will conduct required host changes. e.g. Spawning objects if they are not already spawned.

    Parameters

    • host: PlayerDataResolvable

      The new host of the room.

    Returns Promise<void>

setPrivacy

  • setPrivacy(privacy: PrivacyType): Promise<void>
  • Change the the privacy of the room.

    example
    room.setAlterGameTag(AlterGameTag.ChangePrivacy, 1); // 0 for private, 1 for public.
    

    Parameters

    • privacy: PrivacyType

    Returns Promise<void>

setSettings

  • setSettings(settings: Partial<AllGameSettings>): void
  • Change the settings of the room. If the host, it will broadcast these changes.

    example
    room.syncSettings({
      crewmateVision: 0.5,
      votingTime: 120
    });
    

    Parameters

    • settings: Partial<AllGameSettings>

      The settings to set to (Can be partial).

    Returns void

spawnComponent

  • spawnComponent(component: Networkable<any, NetworkableEvents<Hostable<any>>, SkeldjsClient>): void

spawnNecessaryObjects

  • spawnNecessaryObjects(): void

spawnPrefabOfType

  • spawnPrefabOfType(spawnType: number, ownerId: undefined | number | PlayerData<Hostable<any>>, flags?: number, componentData?: any[], doBroadcast?: boolean, doAwake?: boolean): undefined | Networkable<any, any, SkeldjsClient>
  • Spawn a prefab of an object.

    example
    room.spawnPrefab(SpawnType.Player, client.myPlayer);
    

    Parameters

    • spawnType: number

      The type of object to spawn.

    • ownerId: undefined | number | PlayerData<Hostable<any>>
    • Optional flags: number
    • Optional componentData: any[]
    • doBroadcast: boolean = true
    • doAwake: boolean = true

    Returns undefined | Networkable<any, any, SkeldjsClient>

    The object that was spawned.

spawnSelf

  • spawnSelf(): Promise<void>
  • Spawn your own player if doSpawn = false was used in the SkeldjsClient.joinGame method.

    example
    // Spawn your player 5 seconds after joining a game without spawning.
    await client.joinGame("ABCDEF", false);
    
    setTimeout(() => {
      await client.spawnSelf();
    }, 5000)
    

    Returns Promise<void>

startGame

  • startGame(): Promise<void>

wait

  • Type parameters

    • EventName: "component.spawn" | "component.despawn" | "player.checkcolor" | "player.checkmurder" | "player.checkname" | "player.checkprotect" | "player.completetask" | "player.die" | "player.usemovingplatform" | "player.murder" | "player.protect" | "player.removeprotection" | "player.reportbody" | "player.revertshapeshift" | "player.chat" | "player.quickchat" | "player.setcolor" | "player.sethat" | "player.setname" | "player.setnameplate" | "player.setpet" | "player.setrole" | "player.setskin" | "player.setstartcounter" | "player.setvisor" | "player.shapeshift" | "player.startmeeting" | "player.syncsettings" | "player.entervent" | "player.exitvent" | "player.climbladder" | "player.move" | "player.snapto" | "player.ready" | "player.join" | "player.leave" | "player.sethost" | "player.scenechange" | "player.spawn" | "gamedata.addplayer" | "gamedata.removeplayer" | "gamedata.settasks" | "meeting.castvote" | "meeting.clearvote" | "meeting.votingcomplete" | "meeting.close" | "doors.open" | "doors.close" | "system.sabotage" | "system.repair" | "decon.doors.close" | "decon.doors.open" | "decon.enter" | "decon.exit" | "hqhud.consoles.reset" | "hqhud.consoles.open" | "hqhud.consoles.close" | "hqhud.consoles.complete" | "heli.consoles.open" | "heli.consoles.reset" | "heli.consoles.close" | "heli.consoles.complete" | "o2.consoles.clear" | "o2.consoles.complete" | "medscan.joinqueue" | "medscan.leavequeue" | "movingplatform.updateplayer" | "reactor.consoles.add" | "reactor.consoles.remove" | "reactor.consoles.reset" | "security.cameras.join" | "security.cameras.leave" | "electrical.switchflip" | "room.assignroles" | "room.endgameintent" | "room.fixedupdate" | "room.gameend" | "room.gamestart" | "room.setprivacy" | "client.connect" | "client.disconnect" | "client.identify" | "client.join"

    Parameters

    • event: EventName

    Returns Promise<SkeldjsClientEvents[EventName]>

  • Parameters

    • event: string

    Returns Promise<BasicEvent>

waitf

  • waitf<EventName>(event: EventName, filter: (ev: SkeldjsClientEvents[EventName]) => boolean | Promise<boolean>): Promise<SkeldjsClientEvents[EventName]>
  • waitf<K>(event: string, filter: (ev: K) => boolean | Promise<boolean>): Promise<BasicEvent>
  • Type parameters

    • EventName: "component.spawn" | "component.despawn" | "player.checkcolor" | "player.checkmurder" | "player.checkname" | "player.checkprotect" | "player.completetask" | "player.die" | "player.usemovingplatform" | "player.murder" | "player.protect" | "player.removeprotection" | "player.reportbody" | "player.revertshapeshift" | "player.chat" | "player.quickchat" | "player.setcolor" | "player.sethat" | "player.setname" | "player.setnameplate" | "player.setpet" | "player.setrole" | "player.setskin" | "player.setstartcounter" | "player.setvisor" | "player.shapeshift" | "player.startmeeting" | "player.syncsettings" | "player.entervent" | "player.exitvent" | "player.climbladder" | "player.move" | "player.snapto" | "player.ready" | "player.join" | "player.leave" | "player.sethost" | "player.scenechange" | "player.spawn" | "gamedata.addplayer" | "gamedata.removeplayer" | "gamedata.settasks" | "meeting.castvote" | "meeting.clearvote" | "meeting.votingcomplete" | "meeting.close" | "doors.open" | "doors.close" | "system.sabotage" | "system.repair" | "decon.doors.close" | "decon.doors.open" | "decon.enter" | "decon.exit" | "hqhud.consoles.reset" | "hqhud.consoles.open" | "hqhud.consoles.close" | "hqhud.consoles.complete" | "heli.consoles.open" | "heli.consoles.reset" | "heli.consoles.close" | "heli.consoles.complete" | "o2.consoles.clear" | "o2.consoles.complete" | "medscan.joinqueue" | "medscan.leavequeue" | "movingplatform.updateplayer" | "reactor.consoles.add" | "reactor.consoles.remove" | "reactor.consoles.reset" | "security.cameras.join" | "security.cameras.leave" | "electrical.switchflip" | "room.assignroles" | "room.endgameintent" | "room.fixedupdate" | "room.gameend" | "room.gamestart" | "room.setprivacy" | "client.connect" | "client.disconnect" | "client.identify" | "client.join"

    Parameters

    Returns Promise<SkeldjsClientEvents[EventName]>

  • Type parameters

    Parameters

    • event: string
    • filter: (ev: K) => boolean | Promise<boolean>
        • (ev: K): boolean | Promise<boolean>
        • Parameters

          • ev: K

          Returns boolean | Promise<boolean>

    Returns Promise<BasicEvent>

Constructors

constructor

  • new SkeldjsClient(version: string | number | VersionInfo, username: string, options?: Partial<ClientConfig>): SkeldjsClient

Accessors

destroyed

  • get destroyed(): boolean

host

  • get host(): undefined | PlayerData<this>

hostIsMe

  • get hostIsMe(): boolean

myPlayer

  • get myPlayer(): undefined | PlayerData<this>

Generated using TypeDoc