mirror of
https://github.com/mt-mods/mail.git
synced 2025-07-12 17:32:21 -04:00
storage format docs
This commit is contained in:
parent
894e5df4b1
commit
9b2883030a
3 changed files with 43 additions and 10 deletions
44
storage.lua
44
storage.lua
|
@ -5,7 +5,8 @@ function mail.get_storage_entry(playername)
|
|||
return {
|
||||
contacts = {},
|
||||
inbox = {},
|
||||
outbox = {}
|
||||
outbox = {},
|
||||
lists = {}
|
||||
}
|
||||
else
|
||||
-- deserialize existing entry
|
||||
|
@ -13,6 +14,47 @@ function mail.get_storage_entry(playername)
|
|||
end
|
||||
end
|
||||
|
||||
--[[
|
||||
Mail format (inbox, outbox):
|
||||
{
|
||||
-- sending player name
|
||||
sender = "",
|
||||
-- receiving player name
|
||||
to = "",
|
||||
-- carbon copy (optional)
|
||||
cc = "",
|
||||
-- blind carbon copy (optional)
|
||||
bcc = "",
|
||||
-- mail subject
|
||||
subject = "",
|
||||
-- mail body
|
||||
body = "",
|
||||
-- timestamp (os.time())
|
||||
time = 1234,
|
||||
-- read-flag (true: player has read the mail, inbox only)
|
||||
read = true
|
||||
}
|
||||
|
||||
Contact format:
|
||||
{
|
||||
-- name of the player
|
||||
name = "",
|
||||
-- note
|
||||
note = ""
|
||||
}
|
||||
|
||||
Mail-list format:
|
||||
{
|
||||
-- name of the maillist
|
||||
name = "",
|
||||
-- description
|
||||
description = "",
|
||||
-- player list (delimited by newline)
|
||||
players = ""
|
||||
}
|
||||
|
||||
--]]
|
||||
|
||||
function mail.set_storage_entry(playername, entry)
|
||||
mail.storage:get_string(playername, minetest.write_json(entry))
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue