fivem-ts

a library to speed up the development of Fivem scripts and frameworks


Project maintained by Purpose-Dev Hosted on GitHub Pages — Theme by mattgraham

fivem-ts - Documentation v0.7.5Docs


fivem-ts - Documentation v0.7.5 / Server / BucketCollection

Class: BucketCollection

Represents a collection of population-aware routing buckets.

In the context of a FiveM server, routing buckets are used to segregate entities and players into different logical spaces that can operate independently. These buckets allow you to control entity routing, player visibility, and interaction within the game world, with the added capability of managing population awareness.

Constructors

new BucketCollection()

new BucketCollection(): BucketCollection

Creates a new instance of the BucketCollection class.

Returns

BucketCollection

Defined in

server/models/BucketCollection.ts:17

Accessors

BucketCount

get BucketCount(): number

Gets the count of buckets in the collection.

Returns

number

The number of buckets in the collection.

Defined in

server/models/BucketCollection.ts:33


Buckets

get Buckets(): Map<number, Bucket>

Gets the map of buckets.

Returns

Map<number, Bucket>

A map where the key is the bucket ID and the value is the bucket.

Defined in

server/models/BucketCollection.ts:24

Methods

addBucket()

addBucket(bucket): void

Adds a new bucket to the collection.

Parameters

bucket: Bucket

The bucket to add to the collection.

Returns

void

Defined in

server/models/BucketCollection.ts:78


clear()

clear(): void

Removes all buckets from the collection.

Returns

void

Defined in

server/models/BucketCollection.ts:98


createBucket()

createBucket(name, id, population?, entityLockdownMode?): void

Create a new bucket and add it to the collection.

Parameters

name: string

The name of the bucket.

id: number

The unique identifier for the bucket.

population?: boolean

(Optional) A flag to enable or disable population within the bucket. Defaults to false.

entityLockdownMode?: BucketLockdownMode

(Optional) The mode controlling entity access within the bucket. Defaults to BucketLockdownMode.Relaxed.

Returns

void

Defined in

server/models/BucketCollection.ts:64


getAllBuckets()

getAllBuckets(): Bucket[]

Retrieves all buckets in the collection.

Returns

Bucket[]

An array of all buckets in the collection.

Defined in

server/models/BucketCollection.ts:42


getBucket()

getBucket(bucketId): Bucket

Retrieves a bucket from the collection.

Parameters

bucketId: number

The unique identifier of the bucket to retrieve.

Returns

Bucket

The bucket with the specified identifier, or undefined if no such bucket exists.

Defined in

server/models/BucketCollection.ts:52


getEmptyBuckets()

getEmptyBuckets(): Bucket[]

Retrieves a list of buckets that are currently empty.

Returns

Bucket[]

An array of buckets that are currently empty.

Defined in

server/models/BucketCollection.ts:116


getPopulatedBuckets()

getPopulatedBuckets(): Bucket[]

Retrieves a list of buckets that are currently populated.

Returns

Bucket[]

An array of buckets that are currently populated.

Defined in

server/models/BucketCollection.ts:107


removeBucket()

removeBucket(bucketId): void

Removes a bucket from the collection.

Parameters

bucketId: number

The unique identifier of the bucket to remove.

Returns

void

Defined in

server/models/BucketCollection.ts:89