DebugSleep: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
Fernando187 (talk | contribs) (Remove obsolete Requirements section) |
||
(One intermediate revision by one other user not shown) | |||
Line 15: | 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 25: | 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