Ref: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Server client function}} This function will create a reference to the given argument. ==Syntax== <syntaxhighlight lang="lua"> int ref( mixed objectToReference...") |
No edit summary |
||
Line 13: | Line 13: | ||
===Returns=== | ===Returns=== | ||
Returns an ''int'' if the reference were successfully created. Returns ''false'' if the parameter were invalid. | Returns an ''int'' if the reference were successfully created. Returns ''false'' if the parameter were invalid. | ||
==Remarks== | |||
This function was originally created to prevent garbage-collection of specific Lua objects/elements which should persist even though no script would reference them. The storage of those references can be obtained by a call to the debug.getregistry function. Since at the moment MTA does not make use of advanced garbage-collector semantics, this function serves little purpose other than leak memory! | |||
==See Also== | ==See Also== | ||
{{Utility functions}} | {{Utility functions}} |
Latest revision as of 16:57, 20 October 2021
This function will create a reference to the given argument.
Syntax
int ref( mixed objectToReference )
Required Arguments
- objectToReference : The Lua element, which you want to reference
Returns
Returns an int if the reference were successfully created. Returns false if the parameter were invalid.
Remarks
This function was originally created to prevent garbage-collection of specific Lua objects/elements which should persist even though no script would reference them. The storage of those references can be obtained by a call to the debug.getregistry function. Since at the moment MTA does not make use of advanced garbage-collector semantics, this function serves little purpose other than leak memory!
See Also
- addDebugHook
- base64Decode
- base64Encode
- debugSleep
- decodeString
- encodeString
- fromJSON
- generateKeyPair
- getColorFromString
- getDevelopmentMode
- getDistanceBetweenPoints2D
- getDistanceBetweenPoints3D
- getEasingValue
- getNetworkStats
- getNetworkUsageData
- getPerformanceStats
- getRealTime
- getTickCount
- getTimerDetails
- getTimers
- getFPSLimit
- getUserdataType
- getVersion
- gettok
- isTransferBoxVisible
- setTransferBoxVisible
- hash
- inspect
- interpolateBetween
- iprint
- isOOPEnabled
- isTimer
- killTimer
- md5
- passwordHash
- passwordVerify
- pregFind
- pregMatch
- pregReplace
- removeDebugHook
- resetTimer
- setDevelopmentMode
- setFPSLimit
- setTimer
- ref
- deref
- sha256
- split
- teaDecode
- teaEncode
- toJSON
- tocolor
- getProcessMemoryStats
- utfChar
- utfCode
- utfLen
- utfSeek
- utfSub
- bitAnd
- bitNot
- bitOr
- bitXor
- bitTest
- bitLRotate
- bitRRotate
- bitLShift
- bitRShift
- bitArShift
- bitExtract
- bitReplace