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 ​
Name | Type |
---|---|
player | alt.Player |
newValue | any |
oldValue | any |
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 ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
document | Account |
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 ​
Name | Type |
---|---|
T | Account |
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An 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 ​
Name | Type |
---|---|
T | {} |
ReturnType | any |
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
fieldName | string | 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 ​
Name | Type |
---|---|
T | {} |
Parameters ​
Name | Type |
---|---|
fieldName | string | number | symbol |
callback | KeyChangeCallback |
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 ​
Name | Type |
---|---|
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 ​
Name | Type |
---|---|
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 ​
Name | Type |
---|---|
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 ​
Name | Type |
---|---|
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 ​
Name | Type |
---|---|
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 ​
Name | Type |
---|---|
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 ​
Name | Type |
---|---|
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 ​
Name | Type |
---|---|
T | {} |
Keys | string | number | symbol |
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
fieldName | Keys | |
value | any |
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 ​
Name | Type |
---|---|
T | {} |
Keys | Partial <any > |
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
fields | Keys |
Returns ​
any
Defined in ​
server/document/accountData.ts:187
unbind ​
Usage
Athena.document.accountData.unbind(id
): any
Unbind stored player character cache data.
Parameters ​
Name | Type |
---|---|
id | number |
Returns ​
any