2003-01-23 19:45:57 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
< html > < head > < meta http-equiv = "Content-Type" content = "text/html;charset=iso-8859-1" >
< title > users.cpp Source File< / title >
2004-04-03 15:46:53 +00:00
< link href = "inspircd.css" rel = "stylesheet" type = "text/css" >
2003-01-23 19:45:57 +00:00
< / head > < body >
2003-03-30 12:32:32 +00:00
<!-- Generated by Doxygen 1.3 - rc3 -->
2003-01-23 19:45:57 +00:00
< center >
2004-04-04 22:03:32 +00:00
< a class = "qindex" href = "main.html" > Main Page< / a > < a class = "qindex" href = "namespaces.html" > Namespace List< / a > < a class = "qindex" href = "hierarchy.html" > Class Hierarchy< / a > < a class = "qindex" href = "classes.html" > Alphabetical List< / a > < a class = "qindex" href = "annotated.html" > Compound List< / a > < a class = "qindex" href = "files.html" > File List< / a > < a class = "qindex" href = "functions.html" > Compound Members< / a > < a class = "qindex" href = "globals.html" > File Members< / a > < / center >
2003-01-23 19:45:57 +00:00
< hr > < h1 > users.cpp< / h1 > < a href = "users_8cpp.html" > Go to the documentation of this file.< / a > < div class = "fragment" > < pre > 00001 < span class = "comment" > /*< / span >
00002 < span class = "comment" > < / span >
2003-02-09 12:49:00 +00:00
00003 < span class = "comment" > */< / span >
00004
00005 < span class = "preprocessor" > #include "inspircd_config.h"< / span >
00006 < span class = "preprocessor" > #include "< a class = "code" href = "channels_8h.html" > channels.h< / a > "< / span >
00007 < span class = "preprocessor" > #include "< a class = "code" href = "users_8h.html" > users.h< / a > "< / span >
00008 < span class = "preprocessor" > #include "inspircd.h"< / span >
00009 < span class = "preprocessor" > #include < stdio.h> < / span >
00010
< a name = "l00011" > < / a > < a class = "code" href = "classuserrec.html#a0" > 00011< / a > < a class = "code" href = "classuserrec.html#a0" > userrec::userrec< / a > ()
00012 {
00013 < span class = "comment" > // the PROPER way to do it, AVOID bzero at *ALL* costs< / span >
00014 strcpy(nick,< span class = "stringliteral" > ""< / span > );
00015 < a class = "code" href = "classconnection.html#m3" > ip< / a > = 0;
2004-04-08 18:14:00 +00:00
00016 < a class = "code" href = "classuserrec.html#m10" > timeout< / a > = 0;
2004-04-06 10:43:34 +00:00
00017 strcpy(ident,< span class = "stringliteral" > ""< / span > );
00018 strcpy(host,< span class = "stringliteral" > ""< / span > );
00019 strcpy(dhost,< span class = "stringliteral" > ""< / span > );
00020 strcpy(fullname,< span class = "stringliteral" > ""< / span > );
00021 strcpy(modes,< span class = "stringliteral" > ""< / span > );
00022 strcpy(inbuf,< span class = "stringliteral" > ""< / span > );
00023 strcpy(server,< span class = "stringliteral" > ""< / span > );
00024 strcpy(awaymsg,< span class = "stringliteral" > ""< / span > );
00025 < a class = "code" href = "classconnection.html#m1" > fd< / a > = < a class = "code" href = "classconnection.html#m12" > lastping< / a > = < a class = "code" href = "classconnection.html#m13" > signon< / a > = < a class = "code" href = "classconnection.html#m14" > idle_lastmsg< / a > = < a class = "code" href = "classconnection.html#m15" > nping< / a > = < a class = "code" href = "classconnection.html#m11" > registered< / a > = 0;
00026 < a class = "code" href = "classconnection.html#m10" > port< / a > = < a class = "code" href = "classconnection.html#m5" > bytes_in< / a > = < a class = "code" href = "classconnection.html#m6" > bytes_out< / a > = < a class = "code" href = "classconnection.html#m7" > cmds_in< / a > = < a class = "code" href = "classconnection.html#m8" > cmds_out< / a > = 0;
00027 < a class = "code" href = "classconnection.html#m9" > haspassed< / a > = < span class = "keyword" > false< / span > ;
00028 strcpy(result,< span class = "stringliteral" > ""< / span > );
00029 < span class = "keywordflow" > for< / span > (< span class = "keywordtype" > int< / span > i = 0; i < MAXCHANS; i++)
00030 {
00031 < a class = "code" href = "classuserrec.html#m5" > chans< / a > [i].< a class = "code" href = "classucrec.html#m1" > channel< / a > = NULL;
00032 }
00033 < a class = "code" href = "classuserrec.html#o0" > invites< / a > .clear();
00034 }
00035
2004-04-08 18:14:00 +00:00
00036
00037
< a name = "l00038" > < / a > < a class = "code" href = "classuserrec.html#a2" > 00038< / a > < span class = "keywordtype" > char< / span > * < a class = "code" href = "classuserrec.html#a2" > userrec::GetFullHost< / a > ()
00039 {
00040 sprintf(result,< span class = "stringliteral" > "%s!%s@%s"< / span > ,nick,ident,dhost);
00041 < span class = "keywordflow" > return< / span > < a class = "code" href = "classuserrec.html#m8" > result< / a > ;
00042 }
2004-04-06 10:43:34 +00:00
00043
2004-04-08 18:14:00 +00:00
00044
< a name = "l00045" > < / a > < a class = "code" href = "classuserrec.html#a3" > 00045< / a > < span class = "keywordtype" > char< / span > * < a class = "code" href = "classuserrec.html#a3" > userrec::GetFullRealHost< / a > ()
00046 {
00047 sprintf(result,< span class = "stringliteral" > "%s!%s@%s"< / span > ,nick,ident,host);
00048 < span class = "keywordflow" > return< / span > < a class = "code" href = "classuserrec.html#m8" > result< / a > ;
00049 }
00050
< a name = "l00051" > < / a > < a class = "code" href = "classuserrec.html#a4" > 00051< / a > < span class = "keywordtype" > bool< / span > < a class = "code" href = "classuserrec.html#a4" > userrec::IsInvited< / a > (< span class = "keywordtype" > char< / span > * channel)
00052 {
00053 < span class = "keywordflow" > for< / span > (InvitedList::iterator i = < a class = "code" href = "classuserrec.html#o0" > invites< / a > .begin(); i != < a class = "code" href = "classuserrec.html#o0" > invites< / a > .end(); i++)
00054 {
00055 < span class = "keywordflow" > if< / span > (i-> channel) {
00056 < span class = "keywordflow" > if< / span > (!strcasecmp(i-> channel,channel))
00057 {
00058 < span class = "keywordflow" > return< / span > < span class = "keyword" > true< / span > ;
00059 }
00060 }
00061 }
00062 < span class = "keywordflow" > return< / span > < span class = "keyword" > false< / span > ;
00063 }
00064
< a name = "l00065" > < / a > < a class = "code" href = "classuserrec.html#a5" > 00065< / a > < span class = "keywordtype" > void< / span > < a class = "code" href = "classuserrec.html#a5" > userrec::InviteTo< / a > (< span class = "keywordtype" > char< / span > * channel)
00066 {
00067 < a class = "code" href = "classInvited.html" > Invited< / a > i;
00068 strcpy(i.< a class = "code" href = "classInvited.html#m0" > channel< / a > ,channel);
00069 < a class = "code" href = "classuserrec.html#o0" > invites< / a > .push_back(i);
00070 }
00071
< a name = "l00072" > < / a > < a class = "code" href = "classuserrec.html#a6" > 00072< / a > < span class = "keywordtype" > void< / span > < a class = "code" href = "classuserrec.html#a6" > userrec::RemoveInvite< / a > (< span class = "keywordtype" > char< / span > * channel)
00073 {
00074 log(DEBUG,< span class = "stringliteral" > "Removing invites"< / span > );
00075 < span class = "keywordflow" > if< / span > (< a class = "code" href = "classuserrec.html#o0" > invites< / a > .size())
00076 {
00077 < span class = "keywordflow" > for< / span > (InvitedList::iterator i = < a class = "code" href = "classuserrec.html#o0" > invites< / a > .begin(); i != < a class = "code" href = "classuserrec.html#o0" > invites< / a > .end(); i++)
00078 {
00079 < span class = "keywordflow" > if< / span > (i-> channel) {
00080 < span class = "keywordflow" > if< / span > (!strcasecmp(i-> channel,channel))
00081 {
00082 < a class = "code" href = "classuserrec.html#o0" > invites< / a > .erase(i);
00083 < span class = "keywordflow" > return< / span > ;
00084 }
00085 }
00086 }
00087 }
00088 }
< / pre > < / div > < hr > < address style = "align: right;" > < small > Generated on Thu Apr 8 19:12:28 2004 for InspIRCd by
2003-01-23 19:45:57 +00:00
< a href = "http://www.doxygen.org/index.html" >
< img src = "doxygen.png" alt = "doxygen" align = "middle" border = 0
2003-03-30 12:32:32 +00:00
width=110 height=53>< / a > 1.3-rc3 < / small > < / address >
2003-01-23 19:45:57 +00:00
< / body >
< / html >