From c0f731e19d61a971af5cf26d073ccd25bfc5c91c Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 13 Apr 2005 12:41:46 +0000 Subject: Added Server::AddGLine Added Server::AddKLine Added Server::AddZLine Added Server::AddQLine Added Server::AddELine Added Server::DelGLine Added Server::DelKLine Added Server::DelZLine Added Server::DelQLine Added Server::DelELine Added Server::Duration git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1071 e03df62e-2008-0410-955e-edbf42e46eb7 --- docs/module-doc/classServer.html | 735 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 726 insertions(+), 9 deletions(-) (limited to 'docs/module-doc/classServer.html') diff --git a/docs/module-doc/classServer.html b/docs/module-doc/classServer.html index 2efb4741e..afa949803 100644 --- a/docs/module-doc/classServer.html +++ b/docs/module-doc/classServer.html @@ -120,9 +120,48 @@ Inherits classbase. virtual bool IsUlined (std::string server)  Returns true if the servername you give is ulined.

-virtual chanuserlist GetUsers (chanrec *chan) +virtual chanuserlist GetUsers (chanrec *chan)  Fetches the userlist of a channel.


+virtual bool UserToPseudo (userrec *user, std::string message) + + Remove a user's connection to the irc server, but leave their client in existence in the user hash.


+virtual bool PseudoToUser (userrec *alive, userrec *zombie, std::string message) + + This user takes one user, and switches their file descriptor with another user, so that one user "becomes" the other.


+virtual void AddGLine (long duration, std::string source, std::string reason, std::string hostmask) + + Adds a G-line The G-line is propogated to all of the servers in the mesh and enforced as soon as it is added.


+virtual void AddQLine (long duration, std::string source, std::string reason, std::string nickname) + + Adds a Q-line The Q-line is propogated to all of the servers in the mesh and enforced as soon as it is added.


+virtual void AddZLine (long duration, std::string source, std::string reason, std::string ipaddr) + + Adds a Z-line The Z-line is propogated to all of the servers in the mesh and enforced as soon as it is added.


+virtual void AddKLine (long duration, std::string source, std::string reason, std::string hostmask) + + Adds a K-line The K-line is enforced as soon as it is added.


+virtual void AddELine (long duration, std::string source, std::string reason, std::string hostmask) + + Adds a E-line The E-line is enforced as soon as it is added.


+virtual bool DelGLine (std::string hostmask) + + Deletes a G-Line from all servers on the mesh.


+virtual bool DelQLine (std::string nickname) + + Deletes a Q-Line from all servers on the mesh.


+virtual bool DelZLine (std::string ipaddr) + + Deletes a Z-Line from all servers on the mesh.


+virtual bool DelKLine (std::string hostmask) + + Deletes a local K-Line.


+virtual bool DelELine (std::string hostmask) + + Deletes a local E-Line.


+virtual long CalcDuration (std::string duration) + + Calculates a duration This method will take a string containing a formatted duration (e.g.



Detailed Description

Allows server output and query functions This class contains methods which allow a module to query the state of the irc server, and produce output to users and other servers. @@ -131,7 +170,7 @@ All modules should instantiate at least one copy of this class, and use its memb

-Definition at line 376 of file modules.h.


Constructor & Destructor Documentation

+Definition at line 385 of file modules.h.

Constructor & Destructor Documentation

@@ -266,14 +305,75 @@ When the command is typed, the parameters will be placed into the parameters arr

Definition at line 420 of file modules.cpp.

-References createcommand(). +References createcommand().

00421 {
-00422         createcommand(cmd,f,flags,minparams,source);
+00422         createcommand(cmd,f,flags,minparams,source);
 00423 }
 
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Server::AddELine long  duration,
std::string  source,
std::string  reason,
std::string  hostmask
[virtual]
+
+ + + + + +
+   + + +

+Adds a E-line The E-line is enforced as soon as it is added. +

+The duration must be in seconds, however you can use the Server::CalcDuration method to convert durations into the 1w2d3h3m6s format used by /GLINE etc. The source is an arbitary string used to indicate who or what sent the data, usually this is the nickname of a person, or a server name. +

+Definition at line 638 of file modules.cpp. +

+References add_eline(), and duration(). +

+

00639 {
+00640         add_eline(duration, source.c_str(), reason.c_str(), hostmask.c_str());
+00641 }
+

@@ -404,6 +504,290 @@ References DEBUG,
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Server::AddGLine long  duration,
std::string  source,
std::string  reason,
std::string  hostmask
[virtual]
+
+ + + + + +
+   + + +

+Adds a G-line The G-line is propogated to all of the servers in the mesh and enforced as soon as it is added. +

+The duration must be in seconds, however you can use the Server::CalcDuration method to convert durations into the 1w2d3h3m6s format used by /GLINE etc. The source is an arbitary string used to indicate who or what sent the data, usually this is the nickname of a person, or a server name. +

+Definition at line 618 of file modules.cpp. +

+References add_gline(), and duration(). +

+

00619 {
+00620         add_gline(duration, source.c_str(), reason.c_str(), hostmask.c_str());
+00621 }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Server::AddKLine long  duration,
std::string  source,
std::string  reason,
std::string  hostmask
[virtual]
+
+ + + + + +
+   + + +

+Adds a K-line The K-line is enforced as soon as it is added. +

+The duration must be in seconds, however you can use the Server::CalcDuration method to convert durations into the 1w2d3h3m6s format used by /GLINE etc. The source is an arbitary string used to indicate who or what sent the data, usually this is the nickname of a person, or a server name. +

+Definition at line 633 of file modules.cpp. +

+References add_kline(), and duration(). +

+

00634 {
+00635         add_kline(duration, source.c_str(), reason.c_str(), hostmask.c_str());
+00636 }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Server::AddQLine long  duration,
std::string  source,
std::string  reason,
std::string  nickname
[virtual]
+
+ + + + + +
+   + + +

+Adds a Q-line The Q-line is propogated to all of the servers in the mesh and enforced as soon as it is added. +

+The duration must be in seconds, however you can use the Server::CalcDuration method to convert durations into the 1w2d3h3m6s format used by /GLINE etc. The source is an arbitary string used to indicate who or what sent the data, usually this is the nickname of a person, or a server name. +

+Definition at line 623 of file modules.cpp. +

+References add_qline(), and duration(). +

+

00624 {
+00625         add_qline(duration, source.c_str(), reason.c_str(), nickname.c_str());
+00626 }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void Server::AddZLine long  duration,
std::string  source,
std::string  reason,
std::string  ipaddr
[virtual]
+
+ + + + + +
+   + + +

+Adds a Z-line The Z-line is propogated to all of the servers in the mesh and enforced as soon as it is added. +

+The duration must be in seconds, however you can use the Server::CalcDuration method to convert durations into the 1w2d3h3m6s format used by /GLINE etc. The source is an arbitary string used to indicate who or what sent the data, usually this is the nickname of a person, or a server name. +

+Definition at line 628 of file modules.cpp. +

+References add_zline(), and duration(). +

+

00629 {
+00630         add_zline(duration, source.c_str(), reason.c_str(), ipaddr.c_str());
+00631 }
+
+

+ + + + +
+ + + + + + + + + + +
long Server::CalcDuration std::string  duration  )  [virtual]
+
+ + + + + +
+   + + +

+Calculates a duration This method will take a string containing a formatted duration (e.g. +

+"1w2d") and return its value as a total number of seconds. This is the same function used internally by /GLINE etc to set the ban times. +

+Definition at line 668 of file modules.cpp. +

+References duration(). +

+

00669 {
+00670         return duration(delta.c_str());
+00671 }
+

@@ -745,6 +1129,206 @@ Definition at line 573
+

+ + + + +
+ + + + + + + + + + +
bool Server::DelELine std::string  hostmask  )  [virtual]
+
+ + + + + +
+   + + +

+Deletes a local E-Line. +

+ +

+Definition at line 663 of file modules.cpp. +

+References del_eline(). +

+

00664 {
+00665         del_eline(hostmask.c_str());
+00666 }
+
+

+ + + + +
+ + + + + + + + + + +
bool Server::DelGLine std::string  hostmask  )  [virtual]
+
+ + + + + +
+   + + +

+Deletes a G-Line from all servers on the mesh. +

+ +

+Definition at line 643 of file modules.cpp. +

+References del_gline(). +

+

00644 {
+00645         del_gline(hostmask.c_str());
+00646 }
+
+

+ + + + +
+ + + + + + + + + + +
bool Server::DelKLine std::string  hostmask  )  [virtual]
+
+ + + + + +
+   + + +

+Deletes a local K-Line. +

+ +

+Definition at line 658 of file modules.cpp. +

+References del_kline(). +

+

00659 {
+00660         del_kline(hostmask.c_str());
+00661 }
+
+

+ + + + +
+ + + + + + + + + + +
bool Server::DelQLine std::string  nickname  )  [virtual]
+
+ + + + + +
+   + + +

+Deletes a Q-Line from all servers on the mesh. +

+ +

+Definition at line 648 of file modules.cpp. +

+References del_qline(). +

+

00649 {
+00650         del_qline(nickname.c_str());
+00651 }
+
+

+ + + + +
+ + + + + + + + + + +
bool Server::DelZLine std::string  ipaddr  )  [virtual]
+
+ + + + + +
+   + + +

+Deletes a Z-Line from all servers on the mesh. +

+ +

+Definition at line 653 of file modules.cpp. +

+References del_zline(). +

+

00654 {
+00655         del_zline(ipaddr.c_str());
+00656 }
+

@@ -938,7 +1522,7 @@ Definition at line 528
- + @@ -967,7 +1551,7 @@ Definition at line 375 References chanuserlist, clientlist, has_channel(), and isnick().

00376 {
-00377         chanuserlist userl;
+00377         chanuserlist userl;
 00378         userl.clear();
 00379         for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++)
 00380         {
@@ -1319,6 +1903,86 @@ Definition at line 370
 
chanuserlist Server::GetUsers chanuserlist Server::GetUsers chanrec chan
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
bool Server::PseudoToUser userrec alive,
userrec zombie,
std::string  message
[virtual]
+
+ + + + + +
+   + + +

+This user takes one user, and switches their file descriptor with another user, so that one user "becomes" the other. +

+The user in 'alive' is booted off the server with the given message. The user referred to by 'zombie' should have previously been locked with Server::ZombifyUser, otherwise stale sockets and file descriptor leaks can occur. After this call, the pointer to alive will be invalid, and the pointer to zombie will be equivalent in effect to the old pointer to alive. +

+Definition at line 588 of file modules.cpp. +

+References ucrec::channel, userrec::chans, chanrec::created, connection::fd, FD_MAGIC_NUMBER, connection::host, userrec::ident, chanrec::name, userrec::nick, chanrec::setby, chanrec::topic, and chanrec::topicset. +

+

00589 {
+00590         zombie->fd = alive->fd;
+00591         alive->fd = FD_MAGIC_NUMBER;
+00592         Write(zombie->fd,":%s!%s@%s NICK %s",alive->nick,alive->ident,alive->host,zombie->nick);
+00593         kill_link(alive,message.c_str());
+00594         for (int i = 0; i != MAXCHANS; i++)
+00595         {
+00596                 if (zombie->chans[i].channel != NULL)
+00597                 {
+00598                         if (zombie->chans[i].channel->name)
+00599                         {
+00600                                 chanrec* Ptr = zombie->chans[i].channel;
+00601                                 WriteFrom(zombie->fd,zombie,"JOIN %s",Ptr->name);
+00602                                 if (Ptr->topicset)
+00603                                 {
+00604                                         WriteServ(zombie->fd,"332 %s %s :%s", zombie->nick, Ptr->name, Ptr->topic);
+00605                                         WriteServ(zombie->fd,"333 %s %s %s %d", zombie->nick, Ptr->name, Ptr->setby, Ptr->topicset);
+00606                                 }
+00607                                 userlist(zombie,Ptr);
+00608                                 WriteServ(zombie->fd,"366 %s %s :End of /NAMES list.", zombie->nick, Ptr->name);
+00609                                 WriteServ(zombie->fd,"324 %s %s +%s",zombie->nick, Ptr->name,chanmodes(Ptr));
+00610                                 WriteServ(zombie->fd,"329 %s %s %d", zombie->nick, Ptr->name, Ptr->created);
+00611 
+00612                         }
+00613                 }
+00614         }
+00615 
+00616 }
+

@@ -1651,10 +2315,10 @@ The modes will originate from the server where the command was issued, however r

Definition at line 425 of file modules.cpp.

-References server_mode(). +References server_mode().

00426 {
-00427         server_mode(parameters,pcnt,user);
+00427         server_mode(parameters,pcnt,user);
 00428 }
 
@@ -1914,9 +2578,62 @@ Definition at line 488
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
bool Server::UserToPseudo userrec user,
std::string  message
[virtual]
+
+ + + + + +
+   + + +

+Remove a user's connection to the irc server, but leave their client in existence in the user hash. +

+When you call this function, the user's file descriptor will be replaced with the value of FD_MAGIC_NUMBER and their old file descriptor will be closed. This idle client will remain until it is restored with a valid file descriptor, or is removed from IRC by an operator After this call, the pointer to user will be invalid. +

+Definition at line 579 of file modules.cpp. +

+References connection::fd, FD_MAGIC_NUMBER, connection::host, and userrec::ident. +

+

00580 {
+00581         unsigned int old_fd = user->fd;
+00582         user->fd = FD_MAGIC_NUMBER;
+00583         Write(old_fd,"ERROR :Closing link (%s@%s) [%s]",user->ident,user->host,message.c_str());
+00584         close(old_fd);
+00585         shutdown (old_fd,2);
+00586 }
+


The documentation for this class was generated from the following files: -
Generated on Sat Apr 9 14:38:30 2005 for InspIRCd by +
Generated on Wed Apr 13 12:32:29 2005 for InspIRCd by doxygen 1.3.3
-- cgit v1.2.3