Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Config

The general configuration

Hierarchy

  • Config

Index

Properties

Optional cache

The cache handler to replace redis.

db

Database Config

Optional redis

redis: IORedis.RedisOptions

Redis config

server

server: ServerConfig

Server config

Optional worldGenerator

worldGenerator: (world: World, width?: number, height?: number) => Promise<WorldData>

A custom funtion to replace world generation.

param

The world object.

param

The width of the world.

param

The height of the world.

Type declaration

    • Parameters

      • world: World
      • Optional width: number
      • Optional height: number

      Returns Promise<WorldData>

Optional worldSerializationCall

worldSerializationCall: (pos: number, packet: Buffer, tiles: WorldTile[]) => void

A custom function to replace for world serialization. This gets called after the buffer size is determinded. The "packet" argument is a reference to the buffer to use. Take note that this is not called in a loop, this is only called once.

param

The starting position for writing to buffers, use this to keep track on the current position when writing to the buffer.

param

The world packet to modify

param

The tiles in the world

Type declaration

    • (pos: number, packet: Buffer, tiles: WorldTile[]): void
    • Parameters

      • pos: number
      • packet: Buffer
      • tiles: WorldTile[]

      Returns void

Optional worldTilesSize

worldTilesSize: (tiles: WorldTile[]) => number

A custom function to calculate the size of the world packet to allocate, excluding the necessary data of a world. (Basically just for tiles)

param

The tiles in the world

Type declaration

Generated using TypeDoc