Add date and time to reports and messages
This commit is contained in:
parent
e3233b651b
commit
006bc109ef
@ -51,6 +51,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
from = name,
|
||||
subject = fields.subject,
|
||||
msg = fields.msg,
|
||||
dtime = contact.date(),
|
||||
}
|
||||
|
||||
-- Insert Data
|
||||
|
5
init.lua
5
init.lua
@ -14,6 +14,11 @@ function contact.log(content, log_type)
|
||||
minetest.log(log_type, "[contact] "..content)
|
||||
end
|
||||
|
||||
-- [function] Get date
|
||||
function contact.date()
|
||||
return os.date("%x %H:%M:%p")
|
||||
end
|
||||
|
||||
-- [function] Load
|
||||
function contact.load()
|
||||
local res = io.open(worldpath.."/mod_contact.txt", "r")
|
||||
|
@ -72,6 +72,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
reason = fields.reason,
|
||||
target = fields.target,
|
||||
info = fields.info,
|
||||
dtime = contact.date(),
|
||||
}
|
||||
|
||||
-- Insert Data
|
||||
@ -80,8 +81,6 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
contact.toggle_report(name, "", false)
|
||||
-- Print to chat
|
||||
minetest.chat_send_player(name, "Report filed!")
|
||||
|
||||
contact.log(dump(contact.reports))
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
Loading…
x
Reference in New Issue
Block a user