interface IGameServer { connectionInfo: unknown; banPlayer(options: BanDTO): Promise<void>; executeConsoleCommand(rawCommand: string): Promise<CommandOutput>; getEventEmitter(): TakaroEmitter; getMapInfo(): Promise<MapInfoDTO>; getMapTile(x: number, y: number, z: number): Promise<Buffer>; getPlayer(player: IPlayerReferenceDTO): Promise<null | IGamePlayer>; getPlayerInventory(player: IPlayerReferenceDTO): Promise<IItemDTO[]>; getPlayerLocation(player: IPlayerReferenceDTO): Promise<null | IPosition>; getPlayers(): Promise<IGamePlayer[]>; giveItem( player: IPlayerReferenceDTO, item: string, amount: number, quality?: string, ): Promise<void>; kickPlayer(player: IPlayerReferenceDTO, reason: string): Promise<void>; listBans(): Promise<BanDTO[]>; listItems(): Promise<IItemDTO[]>; sendMessage(message: string, opts: IMessageOptsDTO): Promise<void>; shutdown(): Promise<void>; teleportPlayer( player: IPlayerReferenceDTO, x: number, y: number, z: number, ): Promise<void>; testReachability(): Promise<TestReachabilityOutputDTO>; unbanPlayer(player: IPlayerReferenceDTO): Promise<void>;} Properties
connectionInfo
connectionInfo: unknown
Methods
banPlayer
- banPlayer(options: BanDTO): Promise<void>
Returns Promise<void>
executeConsoleCommand
- executeConsoleCommand(rawCommand: string): Promise<CommandOutput>
getMapTile
- getMapTile(x: number, y: number, z: number): Promise<Buffer>
Parameters
- x: number
- y: number
- z: number
Returns Promise<Buffer>
giveItem
- giveItem(
player: IPlayerReferenceDTO,
item: string,
amount: number,
quality?: string,
): Promise<void> Returns Promise<void>
sendMessage
- sendMessage(message: string, opts: IMessageOptsDTO): Promise<void>
Returns Promise<void>
shutdown
- shutdown(): Promise<void>
Returns Promise<void>
teleportPlayer
- teleportPlayer(
player: IPlayerReferenceDTO,
x: number,
y: number,
z: number,
): Promise<void> Returns Promise<void>
Try and connect to the gameserver If anything goes wrong, this function will report a detailed reason