Lockmanager Lua Functions
-
nil ResetRuntime()
Resets the runtime timeout back to 0
-
nil Log(string text)
Logs text to serilog as information into a property/field named LuaLogMessage
-
Table Http.Request(string url, bool isPost, string content, table headers, opt int timeout)
Performs a http request (runtime timeout is paused during it) returning nil on timeout or a table containing StatusCode, Content, Headers
-
string Http.UrlEncode(string text)
Url encodes text
-
string Http.UrlDecode(string text)
Url decodes text
-
bool Events.Add(string EventName, string actionName, Function)
Adds an event to an existing EventName with a name
-
bool Events.Remove(string EventName, string actionName)
Removes an event from an EventName
-
array Events.All()
Returns an array of all actions, each entry is a table with EventName, ActionName, and Function
-
nil Events.Create(string EventName)
Create a new event does nothing if the event already exists
-
nil Events.Fire(string EventName, any)
Fires all actions assigned to an event with any as its parameter
-
array Events.EventTypes()
Get an object containing events as keys and actions in an array of strings
-
string Schedule.Add(ms, function, parameter)
Schedules a function for execution in ms time passing parameter to it, returns a guid for its id
-
array Schedule.All()
Returns an array containing objects with Id, Time, Function, Parameter
-
bool Schedule.Remove(id)
Removes a scheduled execution by its id
-
nil SetPlainResult(int httpcode, string result)
Sets plain text to be return for the http request (if any)
-
nil SetJsonResult(int httpcode, string result)
Sets a json string to be eturn for the http request
-
nil SetHttpResult(int httpcode, string result)
Sets a html string to be eturn for the http request
-
array of lockobjects Locks.All()
Returns dictionary where key is the group and the value an array of locks. Lock objects: Id, IsLocked, Name, Group, Touch, Session (Id, User, SessionTime, ApplicationSessionId)
-
array of connections Locks.Connections()
Returns an array of all connections each object contains Id, ApplicationSessionId, IsAuthorized, IsConnected, Name, UserName, Address, SinceLastMessage
-
bool Locks.Disconnect(id)
Disconnects a connection based on its Id
-
lockobject Locks.Get(group, id)
Gets an array that contains all locks by an id, Lock objects: Id, IsLocked, Name, Group, Touch, Session (Id, User, SessionTime, ApplicationSessionId)
-
bool Locks.Unlock(group, id)
Forcefully unlocks a lock on a group
-
bool Locks.Lock(id, name, group, connectionid)
Forcefully locks on a connection if given. Locks locked this way can only be unlocked with the unlock function or if a connectionid was given if that application disconnects.
-
array Locks.Groups()
Get all existing groups
-
array Locks.GroupLocks(group)
Get all locks from a group, Lock objects: Id, IsLocked, Name, Group, Touch, Session (Id, User, SessionTime, ApplicationSessionId)
-
lockobject Locks.Touch(group, id)
Updates the touch timer on a lock and returns the lock if exists
-
lockobject Locks.Rename(group, id, name)
Renames a lock and returns the lock if exists