mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-09 20:10:18 +01:00
46 lines
1.2 KiB
Plaintext
46 lines
1.2 KiB
Plaintext
|
|
Database is a regular Lua script that returns a table.
|
|
|
|
Table has a single named field `timestamp' containing the time_t the
|
|
DB was last saved. It's not used in the mod and is only meant for
|
|
external use (I don't find filesystem timestamps too reliable).
|
|
|
|
Next is a simple array (number indices) of entries.
|
|
|
|
Each entry contains following fields:
|
|
|
|
[1] = {
|
|
-- Names/IPs associated with this entry
|
|
names = {
|
|
["foo"] = true,
|
|
["bar"] = true,
|
|
["123.45.67.89"] = true,
|
|
},
|
|
banned = true, -- Whether this user is banned
|
|
-- Other fields do not apply if false
|
|
time = 12341234, -- Time of last ban (*1)
|
|
expires = 43214321 -- Time at which ban expires (*2)
|
|
-- If nil, permanent ban
|
|
reason = "asdf", -- Reason for ban
|
|
source = "qwerty", -- Source of ban (*2)
|
|
record = {
|
|
[1] = {
|
|
source = "asdf",
|
|
reason = "qwerty",
|
|
time = 12341234,
|
|
expires = 43214321,
|
|
},
|
|
[1] = {
|
|
source = "asdf",
|
|
reason = "Unbanned", -- When unbanned
|
|
time = 12341234,
|
|
},
|
|
},
|
|
}
|
|
|
|
Notes:
|
|
(*1) All times are expressed in whatever unit `os.time()' uses
|
|
(`time_t' on most (all?) systems).
|
|
(*2) Mods using the xban API are advised to use the "modname:source"
|
|
format for `source' (for example: "anticheat:main").
|