-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.lua
46 lines (25 loc) · 888 Bytes
/
functions.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
function isArray(a_Table)
local i = 0
for _, t in pairs(a_Table) do
i = i + 1
if (not rawget(a_Table, i)) then
return false
end
end
return true
end
function GetUUIDFromPlayerName(a_PlayerName)
if (cRoot:Get():GetServer():ShouldAuthenticate()) then
return cMojangAPI:GetUUIDFromPlayerName(a_PlayerName, true)
else
return cClientHandle:GenerateOfflineUUID(a_PlayerName)
end
end
-- TODO: format time properly
function SendChangesAt(a_Player, a_BlockX, a_BlockY, a_BlockZ)
local Changes, NumChanges = g_Storage:GetChangesInPos(a_Player:GetWorld(), a_BlockX, a_BlockY, a_BlockZ)
a_Player:SendMessage("There are " .. NumChanges .. " changes:")
for Idx, ChangeInfo in ipairs(Changes) do
a_Player:SendMessage(string.format(" Cause: %q Action: %s Time: %s seconds ago", ChangeInfo.cause, ChangeInfo.action, os.time() - ChangeInfo.time))
end
end