DebugSleep: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Server client function}} This function is used to set the freeze time for the client/server. This means that all synchronization, frame updating and script's execu...") |
Fernando187 (talk | contribs) (Remove obsolete Requirements section) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server client function}} | {{Server client function}} | ||
[[debugSleep]] freezes the client/server for the specified time. This means that all synchronization, rendering and script execution will stop except HTTP processing invoked by [[fetchRemote]]. This function only works, if development mode is enabled by [[setDevelopmentMode]] and can be utilised to build a debugger that communicates via HTTP requests with the editor/IDE. | |||
{{Warning|Only use this function if you know what you are doing!|true}} | |||
==Syntax== | ==Syntax== | ||
Line 13: | Line 15: | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if the development mode is enabled and arguments are correct, ''false'' otherwise. | Returns ''true'' if the development mode is enabled and arguments are correct, ''false'' otherwise. | ||
==Example== | ==Example== | ||
Line 23: | Line 22: | ||
addCommandHandler ( "zzz", | addCommandHandler ( "zzz", | ||
function ( command, sleep ) | function ( command, sleep ) | ||
debugSleep ( | if ( sleep ) then | ||
local ms = tonumber ( sleep ) | |||
if ( ms ) then | |||
debugSleep ( ms ) | |||
end | |||
end | |||
end | end | ||
) | ) |
Latest revision as of 17:14, 7 November 2024
debugSleep freezes the client/server for the specified time. This means that all synchronization, rendering and script execution will stop except HTTP processing invoked by fetchRemote. This function only works, if development mode is enabled by setDevelopmentMode and can be utilised to build a debugger that communicates via HTTP requests with the editor/IDE.
Syntax
bool debugSleep ( int sleep )
Required Arguments
- sleep : An integer value in milliseconds.
Returns
Returns true if the development mode is enabled and arguments are correct, false otherwise.
Example
Example 1: This example would add the command to set the client's freeze time.
Click to collapse [-]
ClientaddCommandHandler ( "zzz", function ( command, sleep ) if ( sleep ) then local ms = tonumber ( sleep ) if ( ms ) then debugSleep ( ms ) end end end )
See Also
- createTrayNotification
- downloadFile
- getDevelopmentMode
- getKeyboardLayout
- getLocalization
- isShowCollisionsEnabled
- isShowSoundEnabled
- isTransferBoxAlwaysVisible
- isTransferBoxVisible
- isTrayNotificationEnabled
- setClipboard
- setDevelopmentMode
- setTransferBoxVisible
- setWindowFlashing
- showCol
- showSound
- Shared
- 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