From 86f6923b7270cf10dc49051abb0df5e314b151e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20P=C3=A9rez-Cerezo?= Date: Fri, 16 Feb 2018 14:24:27 +0100 Subject: Added reason to unban, documented API changes --- doc/API.md | 37 +++++++++++++++++++++++++++++++++++-- doc/dbformat.txt | 2 ++ 2 files changed, 37 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/API.md b/doc/API.md index bee7c42..2353cb4 100644 --- a/doc/API.md +++ b/doc/API.md @@ -16,14 +16,47 @@ Ban a player and all of his/her alternative names and IPs. ### unban_player -`xban.unban_player(player_or_ip, source)` +`xban.unban_player(player_or_ip, source, reason)` + +Unban a player and all of his/her alternative names and IPs. A reason +may be given for this unbanning, so other moderators can follow your +thoughts. -Unban a player and all of his/her alternative names and IPs. #### Arguments: * `player_or_ip` - Player to search for and unban. * `source` - Source of the ban. See note 2 below. +* `reason` - Reason for unbanning. + +### add_record: + +`xban.add_record(player, record)` + +Adds a record to the player's criminal record. + +#### Arguments: + +* `player` - Name of a player +* `record` - a xban record (see below) + +### Player record format: + + + local record = { + source = "admin", + time = os.time(), + expires = nil, + reason = "bad behaviour", + type = "ban", + } + +* `source` - who issued the record +* `time` - time at which the record was issued +* `expires` - time at which the record expires, `nil` for never +* `reason` - reason for record +* `type` - type of record. + ### Notes diff --git a/doc/dbformat.txt b/doc/dbformat.txt index 71b25a5..a16737d 100644 --- a/doc/dbformat.txt +++ b/doc/dbformat.txt @@ -29,11 +29,13 @@ Each entry contains following fields: reason = "qwerty", time = 12341234, expires = 43214321, + type = "ban" }, [1] = { source = "asdf", reason = "Unbanned", -- When unbanned time = 12341234, + type = "unban" }, }, } -- cgit v1.2.3