Skip to content
On this page

Athena.document.accountData

Type Aliases

KeyChangeCallback

Ƭ KeyChangeCallback: (player: alt.Player, newValue: any, oldValue: any) => void

Type declaration

Usage

Athena.document.accountData.(player, newValue, oldValue): void

Parameters
NameType
playeralt.Player
newValueany
oldValueany
Returns

void

Defined in

server/document/accountData.ts:10

Functions

bind

Usage

Athena.document.accountData.bind(player, document): any

Binds a player identifier to a Account document. This document is cleared on disconnected automatically. This should be the first thing you do after having a user authenticate.

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
documentAccount

Returns

any

Defined in

server/document/accountData.ts:47


get

Usage

Athena.document.accountData.get<T>(player): T | undefined

Return current player data and their associated account object.

Type parameters

NameType
TAccount

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity

Returns

T | undefined

Defined in

server/document/accountData.ts:91


getField

Usage

Athena.document.accountData.getField<T, ReturnType>(player, fieldName): ReturnType | undefined

Get the current value of a specific field inside of the player data object. Can be extended to obtain any value easily.

Type parameters

NameType
T{}
ReturnTypeany

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
fieldNamestring | number | symbol

Returns

ReturnType | undefined

Defined in

server/document/accountData.ts:110


onChange

Usage

Athena.document.accountData.onChange<T>(fieldName, callback): any

Listen for individual player document changes.

Type parameters

NameType
T{}

Parameters

NameType
fieldNamestring | number | symbol
callbackKeyChangeCallback

Returns

any

Defined in

server/document/accountData.ts:238


override

Usage

Athena.document.accountData.override(functionName, callback): any

Used to override any account data document functionality

Parameters

NameType
functionName"bind"
callback(player: Player, document: Account) => any

Returns

any

Defined in

server/document/accountData.ts:264

Usage

Athena.document.accountData.override(functionName, callback): any

Used to override any account data document functionality

Parameters

NameType
functionName"unbind"
callback(id: number) => any

Returns

any

Defined in

server/document/accountData.ts:265

Usage

Athena.document.accountData.override(functionName, callback): any

Used to override any account data document functionality

Parameters

NameType
functionName"get"
callback<T>(player: Player) => T | undefined

Returns

any

Defined in

server/document/accountData.ts:266

Usage

Athena.document.accountData.override(functionName, callback): any

Used to override any account data document functionality

Parameters

NameType
functionName"getField"
callback<T, ReturnType>(player: Player, fieldName: string | number | symbol) => ReturnType | undefined

Returns

any

Defined in

server/document/accountData.ts:267

Usage

Athena.document.accountData.override(functionName, callback): any

Used to override any account data document functionality

Parameters

NameType
functionName"set"
callback<T, Keys>(player: Player, fieldName: Keys, value: any) => any

Returns

any

Defined in

server/document/accountData.ts:268

Usage

Athena.document.accountData.override(functionName, callback): any

Used to override any account data document functionality

Parameters

NameType
functionName"setBulk"
callback<T, Keys>(player: Player, fields: Keys) => any

Returns

any

Defined in

server/document/accountData.ts:269

Usage

Athena.document.accountData.override(functionName, callback): any

Used to override any account data document functionality

Parameters

NameType
functionName"onChange"
callback<T>(fieldName: string | number | symbol, callback: KeyChangeCallback) => any

Returns

any

Defined in

server/document/accountData.ts:270


set

Usage

Athena.document.accountData.set<T, Keys>(player, fieldName, value): any

Sets a player document value, and saves it automatically to the selected account database. Automatically calls all callbacks associated with the field name.

Type parameters

NameType
T{}
Keysstring | number | symbol

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
fieldNameKeys
valueany

Returns

any

Defined in

server/document/accountData.ts:135


setBulk

Usage

Athena.document.accountData.setBulk<T, Keys>(player, fields): any

Sets player document values, and saves it automatically to the selected Account's database. Automatically calls all callbacks associated with the field name.

Type parameters

NameType
T{}
KeysPartial<any>

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
fieldsKeys

Returns

any

Defined in

server/document/accountData.ts:187


unbind

Usage

Athena.document.accountData.unbind(id): any

Unbind stored player character cache data.

Parameters

NameType
idnumber

Returns

any

Defined in

server/document/accountData.ts:76

Created by Stuyk | Est. 2020