dbformat.txt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. Database is a regular Lua script that returns a table.
  2. Table has a single named field `timestamp' containing the time_t the
  3. DB was last saved. It's not used in the mod and is only meant for
  4. external use (I don't find filesystem timestamps too reliable).
  5. Next is a simple array (number indices) of entries.
  6. Each entry contains following fields:
  7. [1] = {
  8. -- Names/IPs associated with this entry
  9. names = {
  10. ["foo"] = true,
  11. ["bar"] = true,
  12. ["123.45.67.89"] = true,
  13. },
  14. banned = true, -- Whether this user is banned
  15. -- Other fields do not apply if false
  16. time = 12341234, -- Time of last ban (*1)
  17. expires = 43214321 -- Time at which ban expires (*2)
  18. -- If nil, permanent ban
  19. reason = "asdf", -- Reason for ban
  20. source = "qwerty", -- Source of ban (*2)
  21. record = {
  22. [1] = {
  23. source = "asdf",
  24. reason = "qwerty",
  25. time = 12341234,
  26. expires = 43214321,
  27. },
  28. [1] = {
  29. source = "asdf",
  30. reason = "Unbanned", -- When unbanned
  31. time = 12341234,
  32. },
  33. },
  34. }
  35. Notes:
  36. (*1) All times are expressed in whatever unit `os.time()' uses
  37. (`time_t' on most (all?) systems).
  38. (*2) Mods using the xban API are advised to use the "modname:source"
  39. format for `source' (for example: "anticheat:main").