|
|||
|
|||
|
#include <xline.h>
Inheritance diagram for XLine:


Public Member Functions | |
| XLine (InspIRCd *Instance, time_t s_time, long d, const char *src, const char *re, const std::string &t) | |
| Create an XLine. | |
| virtual | ~XLine () |
| Destructor. | |
| virtual void | SetCreateTime (time_t created) |
| Change creation time of an xline. | |
| virtual bool | Matches (User *u)=0 |
| Returns true whether or not the given user is covered by this line. | |
| virtual bool | Matches (const std::string &str)=0 |
| Returns true whether or not the given string is covered by this line. | |
| virtual void | Apply (User *u) |
| Apply a line against a user. | |
| virtual void | Unset () |
| Called when the line is unset either via expiry or via explicit removal. | |
| virtual void | DisplayExpiry ()=0 |
| Called when the expiry message is to be displayed for the line. | |
| virtual const char * | Displayable ()=0 |
| Returns the displayable form of the pattern for this xline, e.g. | |
| virtual void | OnAdd () |
| Called when the xline has just been added. | |
| virtual bool | IsBurstable () |
Public Attributes | |
| time_t | set_time |
| The time the line was added. | |
| long | duration |
| The duration of the ban, or 0 if permenant. | |
| char * | source |
| Source of the ban. | |
| char * | reason |
| Reason for the ban. | |
| time_t | expiry |
| Expiry time. | |
| const std::string | type |
| "Q", "K", etc. | |
Protected Member Functions | |
| void | DefaultApply (User *u, const std::string &line, bool bancache) |
| Default 'apply' action. | |
Protected Attributes | |
| InspIRCd * | ServerInstance |
| Creator. | |
Modules may derive from this, and their xlines will automatically be handled as expected by any protocol modules (e.g. m_spanningtree will propogate 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).
Definition at line 28 of file xline.h.
|
||||||||||||||||||||||||||||
|
Create an XLine.
|
|
|
Destructor.
|
|
|
Apply a line against a user. The mechanics of what occurs when the line is applied are specific to the derived class.
Reimplemented in RLine, Shun, KLine, GLine, ZLine, and QLine. Definition at line 432 of file xline.cpp. Referenced by UserManager::AddUser(), XLineManager::ApplyLines(), User::CheckLines(), ModuleShun::OnUserConnect(), ModuleRLine::OnUserConnect(), and ModuleRLine::OnUserPostNick(). |
|
||||||||||||||||
|
Default 'apply' action. Quits the user.
Definition at line 441 of file xline.cpp. References BanCacheManager::AddHit(), InspIRCd::BanCache, InspIRCd::Config, DEBUG, duration, User::GetIPString(), ServerConfig::HideBans, LogManager::Log(), InspIRCd::Logs, MAXBUF, ServerConfig::MoronBanner, User::nick, UserManager::QuitUser(), reason, ServerInstance, type, InspIRCd::Users, and User::WriteServ(). Referenced by ZLine::Apply(), GLine::Apply(), KLine::Apply(), and RLine::Apply(). |
|
|
Returns the displayable form of the pattern for this xline, e.g. '*' 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 seperately but will still return ident for its Displayable() method) Implemented in CBan, RLine, Shun, SVSHold, KLine, GLine, ELine, ZLine, and QLine. Referenced by XLineManager::AddLine(), ModuleSpanningTree::OnAddLine(), ModuleSpanningTree::OnDelLine(), and ModuleXLineDB::WriteDatabase(). |
|
|
Called when the expiry message is to be displayed for the line. Usually a line in the form 'expiring Xline blah, set by...' see the DisplayExpiry methods of GLine, ELine etc. Implemented in CBan, RLine, Shun, SVSHold, KLine, GLine, ELine, ZLine, and QLine. |
|
|
Reimplemented in KLine. Definition at line 436 of file xline.cpp. Referenced by ModuleSpanningTree::OnAddLine(). |
|
|
Returns true whether or not the given string is covered by this line.
Implemented in CBan, RLine, Shun, SVSHold, KLine, GLine, ELine, ZLine, and QLine. |
|
|
Returns true whether or not the given user is covered by this line.
Implemented in CBan, RLine, Shun, SVSHold, KLine, GLine, ELine, ZLine, and QLine. Definition at line 52 of file xline.cpp. Referenced by XLineManager::ApplyLines(), and XLineManager::CheckELines(). |
|
|
Called when the xline has just been added.
Reimplemented in ELine. |
|
|
Change creation time of an xline. Updates expiry to be after the creation time Definition at line 70 of file xline.h. Referenced by TreeSocket::AddLine(), and ModuleXLineDB::ReadDatabase(). |
|
|
Called when the line is unset either via expiry or via explicit removal.
Reimplemented in ELine. |
|
|
The duration of the ban, or 0 if permenant.
Definition at line 127 of file xline.h. Referenced by TreeSocket::AddLine(), DefaultApply(), SVSHold::DisplayExpiry(), Shun::DisplayExpiry(), RLine::DisplayExpiry(), CBan::DisplayExpiry(), ModuleSpanningTree::OnAddLine(), and ModuleXLineDB::WriteDatabase(). |
|
|
Expiry time. Does not contain useful data if the duration is 0. Definition at line 139 of file xline.h. Referenced by TreeSocket::AddLine(). |
|
|
Reason for the ban.
Definition at line 135 of file xline.h. Referenced by DefaultApply(), ModuleSpanningTree::OnAddLine(), ModuleCBan::OnUserPreJoin(), ModuleSVSHold::OnUserPreNick(), and ModuleXLineDB::WriteDatabase(). |
|
|
Creator.
Definition at line 33 of file xline.h. Referenced by DefaultApply(), GLine::DisplayExpiry(), KLine::DisplayExpiry(), ZLine::DisplayExpiry(), QLine::DisplayExpiry(), ELine::DisplayExpiry(), SVSHold::DisplayExpiry(), Shun::DisplayExpiry(), RLine::DisplayExpiry(), CBan::DisplayExpiry(), ELine::OnAdd(), RLine::RLine(), and ELine::Unset(). |
|
|
The time the line was added.
Definition at line 123 of file xline.h. Referenced by ModuleSpanningTree::OnAddLine(), and ModuleXLineDB::WriteDatabase(). |
|
|
Source of the ban. This can be a servername or an oper nickname Definition at line 131 of file xline.h. Referenced by SVSHold::DisplayExpiry(), Shun::DisplayExpiry(), RLine::DisplayExpiry(), and CBan::DisplayExpiry(). |
|
|
"Q", "K", etc. Set only by derived classes constructor to the type of line this is. Definition at line 144 of file xline.h. Referenced by XLineManager::AddLine(), DefaultApply(), ModuleSpanningTree::OnAddLine(), ModuleSpanningTree::OnDelLine(), and ModuleXLineDB::WriteDatabase(). |