From 66f0cd6469d2643858c2fcd14726d362696bd68d Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 24 May 2005 02:34:33 +0000 Subject: New methods, new docs git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1484 e03df62e-2008-0410-955e-edbf42e46eb7 --- docs/module-doc/classuserrec.html | 707 ++++++++++++++++++++++---------------- 1 file changed, 402 insertions(+), 305 deletions(-) (limited to 'docs/module-doc/classuserrec.html') diff --git a/docs/module-doc/classuserrec.html b/docs/module-doc/classuserrec.html index c9aec653f..257dd3b50 100644 --- a/docs/module-doc/classuserrec.html +++ b/docs/module-doc/classuserrec.html @@ -18,8 +18,8 @@ Inheritance diagram for userrec:

| HasPermission (char *command) | |
| Returns true or false for if a user can execute a privilaged oper command. | |
| bool | AddBuffer (std::string a) |
| int | ReadData (void *buffer, size_t size) |
| This method adds data to the buffer of the user. | |
| bool | BufferIsReady () |
| Calls read() to read some data for this user using their fd. | |
| bool | AddBuffer (std::string a) |
| This method returns true if the buffer contains at least one carriage return character (e.g. | |
| void | ClearBuffer () |
| This method adds data to the buffer of the user. | |
| bool | BufferIsReady () |
| This function clears the entire buffer by setting it to an empty string. | |
| std::string | GetBuffer () |
| This method returns true if the buffer contains at least one carriage return character (e.g. | |
| void | ClearBuffer () |
| This method returns the first available string at the tail end of the buffer and advances the tail end of the buffer past the string. | |
| void | SetWriteError (std::string error) |
| This function clears the entire buffer by setting it to an empty string. | |
| std::string | GetBuffer () |
| Sets the write error for a connection. | |
| std::string | GetWriteError () |
| This method returns the first available string at the tail end of the buffer and advances the tail end of the buffer past the string. | |
| void | SetWriteError (std::string error) |
| Returns the write error which last occured on this connection or an empty string if none occured. | |
| void | AddWriteBuf (std::string data) |
| Sets the write error for a connection. | |
| std::string | GetWriteError () |
| Adds to the user's write buffer. | |
| void | FlushWriteBuf () |
| Returns the write error which last occured on this connection or an empty string if none occured. | |
| void | AddWriteBuf (std::string data) |
| Flushes as much of the user's buffer to the file descriptor as possible. | |
| InvitedList * | GetInviteList () |
| Adds to the user's write buffer. | |
| void | FlushWriteBuf () |
| Returns the list of channels this user has been invited to but has not yet joined. | |
| Flushes as much of the user's buffer to the file descriptor as possible. | |
| InvitedList * | GetInviteList () |
| Returns the list of channels this user has been invited to but has not yet joined. | |
| void | CloseSocket () |
| Shuts down and closes the user's socket. | |
Public Attributes | |
| char | nick [NICKMAX] |
|
@@ -279,38 +285,38 @@ This method adds data to the buffer of the user.
The buffer can grow to any size within limits of the available memory, managed by the size of a std::string, however if any individual line in the buffer grows over 600 bytes in length (which is 88 chars over the RFC-specified limit per line) then the method will return false and the text will not be inserted. -Definition at line 175 of file users.cpp. - -References recvq, recvqmax, and SetWriteError(). - - 00176 {
-00177 std::string b = "";
-00178 for (int i = 0; i < a.length(); i++)
-00179 if ((a[i] != '\r') && (a[i] != '\0') && (a[i] != 7))
-00180 b = b + a[i];
-00181 std::stringstream stream(recvq);
-00182 stream << b;
-00183 recvq = stream.str();
-00184 int i = 0;
-00185 // count the size of the first line in the buffer.
-00186 while (i < recvq.length())
-00187 {
-00188 if (recvq[i++] == '\n')
-00189 break;
-00190 }
-00191 if (recvq.length() > this->recvqmax)
-00192 {
-00193 this->SetWriteError("RecvQ exceeded");
-00194 WriteOpers("*** User %s RecvQ of %d exceeds connect class maximum of %d",this->nick,recvq.length(),this->recvqmax);
-00195 }
-00196 // return false if we've had more than 600 characters WITHOUT
-00197 // a carriage return (this is BAD, drop the socket)
-00198 return (i < 600);
-00199 }
+Definition at line 190 of file users.cpp.
+ |
|
@@ -389,20 +395,20 @@ This method returns true if the buffer contains at least one carriage return cha
one complete line may be read) -Definition at line 201 of file users.cpp. +Definition at line 216 of file users.cpp. References recvq. - |
|
@@ -431,19 +437,57 @@ This function clears the entire buffer by setting it to an empty string.
-Definition at line 209 of file users.cpp. +Definition at line 224 of file users.cpp. References recvq. -Referenced by Server::PseudoToUser(), and Server::UserToPseudo(). +Referenced by Server::PseudoToUser(), and Server::UserToPseudo(). - |
+
+
|
+
| + + | +
+
+ +Shuts down and closes the user's socket. + + + +Definition at line 62 of file users.cpp. + + 00063 {
+00064 shutdown(this->fd,2);
+00065 close(this->fd);
+00066 }
+ |
+
|
@@ -472,34 +516,34 @@ Flushes as much of the user's buffer to the file descriptor as possible.
This function may not always flush the entire buffer, rather instead as much of it as it possibly can. If the send() call fails to send the entire buffer, the buffer position is advanced forwards and the rest of the data sent at the next call to this method. -Definition at line 247 of file users.cpp. - -References connection::bytes_out, connection::cmds_out, sendq, and SetWriteError(). - - 00248 {
-00249 if (sendq.length())
-00250 {
-00251 char* tb = (char*)this->sendq.c_str();
-00252 int n_sent = write(this->fd,tb,this->sendq.length());
-00253 if (n_sent == -1)
-00254 {
-00255 this->SetWriteError(strerror(errno));
-00256 }
-00257 else
-00258 {
-00259 // advance the queue
-00260 tb += n_sent;
-00261 this->sendq = tb;
-00262 // update the user's stats counters
-00263 this->bytes_out += n_sent;
-00264 this->cmds_out++;
-00265 }
-00266 }
-00267 }
+Definition at line 262 of file users.cpp.
+ |
-Definition at line 62 of file users.cpp. +Definition at line 68 of file users.cpp.
References dhost, ident, nick, and result.
-
00063 {
-00064 snprintf(result,MAXBUF,"%s!%s@%s",nick,ident,dhost);
-00065 return result;
-00066 }
+00069 {
+00070 snprintf(result,MAXBUF,"%s!%s@%s",nick,ident,dhost);
+00071 return result;
+00072 }
@@ -619,18 +663,18 @@ Returns the full real host of the user This member function returns the hostname
If any form of hostname cloaking is in operation, e.g. through a module, then this method will ignore it and return the true hostname.
-Definition at line 69 of file users.cpp.
+Definition at line 84 of file users.cpp.
-References connection::host, ident, nick, and result.
+References connection::host, ident, nick, and result.
-
00070 {
-00071 snprintf(result,MAXBUF,"%s!%s@%s",nick,ident,host);
-00072 return result;
-00073 }
+00085 {
+00086 snprintf(result,MAXBUF,"%s!%s@%s",nick,ident,host);
+00087 return result;
+00088 }
-
@@ -659,17 +703,17 @@ Returns the list of channels this user has been invited to but has not yet joine
-Definition at line 89 of file users.cpp.
+Definition at line 104 of file users.cpp.
References InvitedList, and invites.
-
-
@@ -698,15 +742,15 @@ Returns the write error which last occured on this connection or an empty string
-Definition at line 277 of file users.cpp.
+Definition at line 292 of file users.cpp.
References WriteError.
-Referenced by AddWriteBuf().
+Referenced by AddWriteBuf().
-
00278 {
-00279 return this->WriteError;
-00280 }
+00293 {
+00294 return this->WriteError;
+00295 }
@@ -740,59 +784,59 @@ Returns true or false for if a user can execute a privilaged oper command.
This is done by looking up their oper type from userrec::oper, then referencing this to their oper classes and checking the commands they can execute.
-Definition at line 123 of file users.cpp.
-
-References config_f, and DEBUG.
-
-
00124 {
-00125 char TypeName[MAXBUF],Classes[MAXBUF],ClassName[MAXBUF],CommandList[MAXBUF];
-00126 char* mycmd;
-00127 char* savept;
-00128 char* savept2;
-00129
-00130 // are they even an oper at all?
-00131 if (strchr(this->modes,'o'))
-00132 {
-00133 log(DEBUG,"*** HasPermission: %s is an oper",this->nick);
-00134 for (int j =0; j < ConfValueEnum("type",&config_f); j++)
-00135 {
-00136 ConfValue("type","name",j,TypeName,&config_f);
-00137 if (!strcmp(TypeName,this->oper))
-00138 {
-00139 log(DEBUG,"*** HasPermission: %s is an oper of type '%s'",this->nick,this->oper);
-00140 ConfValue("type","classes",j,Classes,&config_f);
-00141 char* myclass = strtok_r(Classes," ",&savept);
-00142 while (myclass)
-00143 {
-00144 log(DEBUG,"*** HasPermission: checking classtype '%s'",myclass);
-00145 for (int k =0; k < ConfValueEnum("class",&config_f); k++)
-00146 {
-00147 ConfValue("class","name",k,ClassName,&config_f);
-00148 if (!strcmp(ClassName,myclass))
-00149 {
-00150 ConfValue("class","commands",k,CommandList,&config_f);
-00151 log(DEBUG,"*** HasPermission: found class named %s with commands: '%s'",ClassName,CommandList);
-00152
-00153
-00154 mycmd = strtok_r(CommandList," ",&savept2);
-00155 while (mycmd)
-00156 {
-00157 if (!strcasecmp(mycmd,command))
-00158 {
-00159 log(DEBUG,"*** Command %s found, returning true",command);
-00160 return true;
-00161 }
-00162 mycmd = strtok_r(NULL," ",&savept2);
-00163 }
-00164 }
-00165 }
-00166 myclass = strtok_r(NULL," ",&savept);
-00167 }
-00168 }
-00169 }
-00170 }
-00171 return false;
-00172 }
+Definition at line 138 of file users.cpp.
+
+References config_f, and DEBUG.
+
+
00139 {
+00140 char TypeName[MAXBUF],Classes[MAXBUF],ClassName[MAXBUF],CommandList[MAXBUF];
+00141 char* mycmd;
+00142 char* savept;
+00143 char* savept2;
+00144
+00145 // are they even an oper at all?
+00146 if (strchr(this->modes,'o'))
+00147 {
+00148 log(DEBUG,"*** HasPermission: %s is an oper",this->nick);
+00149 for (int j =0; j < ConfValueEnum("type",&config_f); j++)
+00150 {
+00151 ConfValue("type","name",j,TypeName,&config_f);
+00152 if (!strcmp(TypeName,this->oper))
+00153 {
+00154 log(DEBUG,"*** HasPermission: %s is an oper of type '%s'",this->nick,this->oper);
+00155 ConfValue("type","classes",j,Classes,&config_f);
+00156 char* myclass = strtok_r(Classes," ",&savept);
+00157 while (myclass)
+00158 {
+00159 log(DEBUG,"*** HasPermission: checking classtype '%s'",myclass);
+00160 for (int k =0; k < ConfValueEnum("class",&config_f); k++)
+00161 {
+00162 ConfValue("class","name",k,ClassName,&config_f);
+00163 if (!strcmp(ClassName,myclass))
+00164 {
+00165 ConfValue("class","commands",k,CommandList,&config_f);
+00166 log(DEBUG,"*** HasPermission: found class named %s with commands: '%s'",ClassName,CommandList);
+00167
+00168
+00169 mycmd = strtok_r(CommandList," ",&savept2);
+00170 while (mycmd)
+00171 {
+00172 if (!strcasecmp(mycmd,command))
+00173 {
+00174 log(DEBUG,"*** Command %s found, returning true",command);
+00175 return true;
+00176 }
+00177 mycmd = strtok_r(NULL," ",&savept2);
+00178 }
+00179 }
+00180 }
+00181 myclass = strtok_r(NULL," ",&savept);
+00182 }
+00183 }
+00184 }
+00185 }
+00186 return false;
+00187 }
@@ -826,15 +870,15 @@ Adds a channel to a users invite list (invites them to a channel).
-Definition at line 94 of file users.cpp.
+Definition at line 109 of file users.cpp.
References Invited::channel, and invites.
-
00095 {
-00096 Invited i;
-00097 strlcpy(i.channel,channel,CHANMAX);
-00098 invites.push_back(i);
-00099 }
+00110 {
+00111 Invited i;
+00112 strlcpy(i.channel,channel,CHANMAX);
+00113 invites.push_back(i);
+00114 }
@@ -868,22 +912,75 @@ Returns true if a user is invited to a channel.
-Definition at line 75 of file users.cpp.
+Definition at line 90 of file users.cpp.
References invites.
-
00076 {
-00077 for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++)
-00078 {
-00079 if (i->channel) {
-00080 if (!strcasecmp(i->channel,channel))
-00081 {
-00082 return true;
-00083 }
-00084 }
-00085 }
-00086 return false;
-00087 }
+00091 {
+00092 for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++)
+00093 {
+00094 if (i->channel) {
+00095 if (!strcasecmp(i->channel,channel))
+00096 {
+00097 return true;
+00098 }
+00099 }
+00100 }
+00101 return false;
+00102 }
+
+
+
+
+
+
+
+
+
+ int userrec::ReadData
+ (
+ void *
+ buffer,
+
+
+
+
+ size_t
+ size
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Calls read() to read some data for this user using their fd.
+
+
+
+Definition at line 74 of file users.cpp.
+
+References connection::fd.
+
+
00075 {
+00076 if (this->fd > -1)
+00077 {
+00078 return read(this->fd, buffer, size);
+00079 }
+00080 else return 0;
+00081 }
@@ -917,34 +1014,34 @@ Removes a channel from a users invite list.
This member function is called on successfully joining an invite only channel to which the user has previously been invited, to clear the invitation.
-Definition at line 101 of file users.cpp.
+Definition at line 116 of file users.cpp.
References DEBUG, and invites.
-
00102 {
-00103 log(DEBUG,"Removing invites");
-00104 if (channel)
-00105 {
-00106 if (invites.size())
-00107 {
-00108 for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++)
-00109 {
-00110 if (i->channel)
-00111 {
-00112 if (!strcasecmp(i->channel,channel))
-00113 {
-00114 invites.erase(i);
-00115 return;
-00116 }
-00117 }
-00118 }
-00119 }
-00120 }
-00121 }
+00117 {
+00118 log(DEBUG,"Removing invites");
+00119 if (channel)
+00120 {
+00121 if (invites.size())
+00122 {
+00123 for (InvitedList::iterator i = invites.begin(); i != invites.end(); i++)
+00124 {
+00125 if (i->channel)
+00126 {
+00127 if (!strcasecmp(i->channel,channel))
+00128 {
+00129 invites.erase(i);
+00130 return;
+00131 }
+00132 }
+00133 }
+00134 }
+00135 }
+00136 }
-
@@ -974,18 +1071,18 @@ Sets the write error for a connection.
This is done because the actual disconnect of a client may occur at an inopportune time such as half way through /LIST output. The WriteErrors of clients are checked at a more ideal time (in the mainloop) and errored clients purged.
-Definition at line 269 of file users.cpp.
+Definition at line 284 of file users.cpp.
References DEBUG, and WriteError.
-Referenced by AddBuffer(), AddWriteBuf(), and FlushWriteBuf().
+Referenced by AddBuffer(), AddWriteBuf(), and FlushWriteBuf().
-
00270 {
-00271 log(DEBUG,"Setting error string for %s to '%s'",this->nick,error.c_str());
-00272 // don't try to set the error twice, its already set take the first string.
-00273 if (this->WriteError == "")
-00274 this->WriteError = error;
-00275 }
+00285 {
+00286 log(DEBUG,"Setting error string for %s to '%s'",this->nick,error.c_str());
+00287 // don't try to set the error twice, its already set take the first string.
+00288 if (this->WriteError == "")
+00289 this->WriteError = error;
+00290 }
@@ -1015,7 +1112,7 @@ If this string is empty, the user is not marked as away.
Definition at line 151 of file users.h.
-Referenced by userrec().
+Referenced by userrec().
@@ -1041,7 +1138,7 @@ Referenced by userrec().
Definition at line 142 of file users.h.
-Referenced by Server::PseudoToUser(), and userrec().
+Referenced by Server::PseudoToUser(), and userrec().
@@ -1069,7 +1166,7 @@ This usually matches the value of u
Definition at line 130 of file users.h.
-Referenced by GetFullHost(), and userrec().
+Referenced by GetFullHost(), and userrec().
@@ -1097,7 +1194,7 @@ True when DNS lookups are completed.
Definition at line 179 of file users.h.
-Referenced by userrec().
+Referenced by userrec().
@@ -1125,7 +1222,7 @@ Number of lines the user can place into the buffer (up to the global NetBufferSi
Definition at line 162 of file users.h.
-Referenced by userrec().
+Referenced by userrec().
@@ -1153,7 +1250,7 @@ The users full name.
Definition at line 134 of file users.h.
-Referenced by userrec().
+Referenced by userrec().
@@ -1181,7 +1278,7 @@ The users ident reply.
Definition at line 125 of file users.h.
-Referenced by GetFullHost(), GetFullRealHost(), Server::PseudoToUser(), userrec(), and Server::UserToPseudo().
+Referenced by GetFullHost(), GetFullRealHost(), Server::PseudoToUser(), userrec(), and Server::UserToPseudo().
@@ -1209,7 +1306,7 @@ A list of channels the user has a pending invite to.
Definition at line 114 of file users.h.
-Referenced by GetInviteList(), InviteTo(), IsInvited(), RemoveInvite(), and userrec().
+Referenced by GetInviteList(), InviteTo(), IsInvited(), RemoveInvite(), and userrec().
@@ -1237,7 +1334,7 @@ Flood counters.
Definition at line 204 of file users.h.
-Referenced by userrec().
+Referenced by userrec().
@@ -1265,7 +1362,7 @@ This may contain any of the following RFC characters: o, w, s, i Your module may
Definition at line 140 of file users.h.
-Referenced by userrec().
+Referenced by userrec().
@@ -1293,7 +1390,7 @@ An invalid nickname indicates an unregistered connection prior to the NICK comma
Definition at line 121 of file users.h.
-Referenced by ConfigReader::DumpErrors(), GetFullHost(), GetFullRealHost(), Server::PseudoToUser(), and userrec().
+Referenced by ConfigReader::DumpErrors(), GetFullHost(), GetFullRealHost(), Server::PseudoToUser(), and userrec().
@@ -1321,7 +1418,7 @@ This is used to check permissions in operclasses, so that we can say 'yay' or 'n
Definition at line 175 of file users.h.
-Referenced by userrec().
+Referenced by userrec().
@@ -1401,7 +1498,7 @@ Lines from the IRCd awaiting processing are stored here. Upgraded april 2005, ol
Definition at line 195 of file users.h.
-Referenced by AddBuffer(), BufferIsReady(), ClearBuffer(), GetBuffer(), and userrec().
+Referenced by AddBuffer(), BufferIsReady(), ClearBuffer(), GetBuffer(), and userrec().
@@ -1429,7 +1526,7 @@ Maximum size this user's recvq can become.
Definition at line 218 of file users.h.
-Referenced by AddBuffer().
+Referenced by AddBuffer().
@@ -1455,7 +1552,7 @@ Referenced by AddBuffer()
Definition at line 205 of file users.h.
-Referenced by userrec().
+Referenced by userrec().
@@ -1483,7 +1580,7 @@ You may use this to increase the speed of use of this class.
Definition at line 156 of file users.h.
-Referenced by GetFullHost(), GetFullRealHost(), and userrec().
+Referenced by GetFullHost(), GetFullRealHost(), and userrec().
@@ -1511,7 +1608,7 @@ Lines waiting to be sent are stored here until their buffer is flushed.
Definition at line 200 of file users.h.
-Referenced by AddWriteBuf(), FlushWriteBuf(), and userrec().
+Referenced by AddWriteBuf(), FlushWriteBuf(), and userrec().
@@ -1539,7 +1636,7 @@ Maximum size this user's sendq can become.
Definition at line 214 of file users.h.
-Referenced by AddWriteBuf().
+Referenced by AddWriteBuf().
@@ -1567,7 +1664,7 @@ The server the user is connected to.
Definition at line 146 of file users.h.
-Referenced by userrec().
+Referenced by userrec().
@@ -1619,7 +1716,7 @@ Number of seconds this user is given to send USER/NICK If they do not send their
Definition at line 168 of file users.h.
-Referenced by userrec().
+Referenced by userrec().
@@ -1645,12 +1742,12 @@ Referenced by userrec().
Definition at line 210 of file users.h.
-Referenced by GetWriteError(), and SetWriteError().
+Referenced by GetWriteError(), and SetWriteError().
The documentation for this class was generated from the following files:
-
Generated on Sun May 15 18:39:14 2005 for InspIRCd by
+
Generated on Tue May 24 02:32:48 2005 for InspIRCd by
1.3.3
--
cgit v1.3.1-10-gc9f91