InspIRCd
3.0
|
#include <xline.h>
Public Member Functions | |
XLine (time_t s_time, unsigned long d, const std::string &src, const std::string &re, const std::string &t) | |
virtual | ~XLine () |
virtual void | SetCreateTime (time_t created) |
virtual bool | Matches (User *u)=0 |
virtual bool | Matches (const std::string &str)=0 |
virtual void | Apply (User *u) |
virtual void | Unset () |
virtual void | DisplayExpiry () |
virtual const std::string & | Displayable ()=0 |
virtual void | OnAdd () |
virtual bool | IsBurstable () |
![]() | |
virtual CullResult | cull () |
Public Attributes | |
time_t | set_time |
unsigned long | duration |
std::string | source |
std::string | reason |
time_t | expiry |
const std::string | type |
bool | from_config |
Protected Member Functions | |
void | DefaultApply (User *u, const std::string &line, bool bancache) |
XLine is the base class for ban lines such as G-lines and K-lines. Modules may derive from this, and their xlines will automatically be handled as expected by any protocol modules (e.g. m_spanningtree will propagate them using AddLine). The process of translating a type+pattern to a known line type is done by means of an XLineFactory object (see below).
|
inline |
Create an XLine.
s_time | The set time |
d | The duration of the xline |
src | The sender of the xline |
re | The reason of the xline |
t | The line type, should be set by the derived class constructor |
|
inlinevirtual |
Destructor
|
virtual |
|
protected |
Default 'apply' action. Quits the user.
u | User to apply the line against |
line | The line typed, used for display purposes in the quit message |
bancache | If true, the user will be added to the bancache if they match. Else not. |
|
pure virtual |
Returns the displayable form of the pattern for this xline, e.g. '*@foo' or 'baz'. This must always return the full pattern in a form which can be used to construct an entire derived xline, even if it is stored differently internally (e.g. GLine stores the ident and host parts separately but will still return [email protected] for its Displayable() method).
|
virtual |
|
pure virtual |
Returns true whether or not the given string is covered by this line.
str | The string to match against. The details of what must be in this string and the mechanics of the match are defined by the derived class. |
|
pure virtual |
|
inlinevirtual |
Called when the xline has just been added.
Reimplemented in ELine.
|
inlinevirtual |
Change creation time of an xline. Updates expiry to be after the creation time.
|
inlinevirtual |
Called when the line is unset either via expiry or via explicit removal.
Reimplemented in ELine.
unsigned long XLine::duration |
The duration of the ban, or 0 if permanent
time_t XLine::expiry |
Expiry time. Does not contain useful data if the duration is 0.
std::string XLine::reason |
Reason for the ban
time_t XLine::set_time |
The time the line was added.
std::string XLine::source |
Source of the ban. This can be a servername or an oper nickname
const std::string XLine::type |
"Q", "K", etc. Set only by derived classes constructor to the type of line this is.