From afb51347b493a6ab54fcc8595b4a3f46972ce18f Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 17 Apr 2004 12:33:39 +0000 Subject: Added new documentation to cover ircd_connector git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@629 e03df62e-2008-0410-955e-edbf42e46eb7 --- docs/module-doc/modules_8cpp-source.html | 405 ++++++++++++++++--------------- 1 file changed, 210 insertions(+), 195 deletions(-) (limited to 'docs/module-doc/modules_8cpp-source.html') diff --git a/docs/module-doc/modules_8cpp-source.html b/docs/module-doc/modules_8cpp-source.html index 8281865c1..9f8bf98d1 100644 --- a/docs/module-doc/modules_8cpp-source.html +++ b/docs/module-doc/modules_8cpp-source.html @@ -164,12 +164,12 @@ 00156 00157 chanrec* Server::JoinUserToChannel(userrec* user, std::string cname, std::string key) 00158 { -00159 return add_channel(user,cname.c_str(),key.c_str()); +00159 return add_channel(user,cname.c_str(),key.c_str(),true); 00160 } 00161 00162 chanrec* Server::PartUserFromChannel(userrec* user, std::string cname, std::string reason) 00163 { -00164 return del_channel(user,cname.c_str(),reason.c_str()); +00164 return del_channel(user,cname.c_str(),reason.c_str(),false); 00165 } 00166 00167 void Server::ChangeUserNick(userrec* user, std::string nickname) @@ -179,250 +179,265 @@ 00171 00172 void Server::QuitUser(userrec* user, std::string reason) 00173 { -00174 kill_link(user,reason.c_str()); -00175 } -00176 +00174 send_network_quit(user->nick,reason.c_str()); +00175 kill_link(user,reason.c_str()); +00176 } 00177 -00178 void Server::Log(int level, std::string s) +00178 void Server::CallCommandHandler(std::string commandname, char** parameters, int pcnt, userrec* user) 00179 { -00180 log(level,"%s",s.c_str()); +00180 call_handler(commandname.c_str(),parameters,pcnt,user); 00181 } 00182 -00183 void Server::AddCommand(char* cmd, handlerfunc f, char flags, int minparams) +00183 void Server::Log(int level, std::string s) 00184 { -00185 createcommand(cmd,f,flags,minparams); +00185 log(level,"%s",s.c_str()); 00186 } 00187 -00188 void Server::SendMode(char **parameters, int pcnt, userrec *user) +00188 void Server::AddCommand(char* cmd, handlerfunc f, char flags, int minparams) 00189 { -00190 server_mode(parameters,pcnt,user); +00190 createcommand(cmd,f,flags,minparams); 00191 } 00192 -00193 void Server::Send(int Socket, std::string s) +00193 void Server::SendMode(char **parameters, int pcnt, userrec *user) 00194 { -00195 Write(Socket,"%s",s.c_str()); +00195 server_mode(parameters,pcnt,user); 00196 } 00197 -00198 void Server::SendServ(int Socket, std::string s) +00198 void Server::Send(int Socket, std::string s) 00199 { -00200 WriteServ(Socket,"%s",s.c_str()); +00200 Write(Socket,"%s",s.c_str()); 00201 } 00202 -00203 void Server::SendFrom(int Socket, userrec* User, std::string s) +00203 void Server::SendServ(int Socket, std::string s) 00204 { -00205 WriteFrom(Socket,User,"%s",s.c_str()); +00205 WriteServ(Socket,"%s",s.c_str()); 00206 } 00207 -00208 void Server::SendTo(userrec* Source, userrec* Dest, std::string s) +00208 void Server::SendFrom(int Socket, userrec* User, std::string s) 00209 { -00210 if (!Source) -00211 { -00212 // if source is NULL, then the message originates from the local server -00213 Write(Dest->fd,":%s %s",this->GetServerName().c_str(),s.c_str()); -00214 } -00215 else +00210 WriteFrom(Socket,User,"%s",s.c_str()); +00211 } +00212 +00213 void Server::SendTo(userrec* Source, userrec* Dest, std::string s) +00214 { +00215 if (!Source) 00216 { -00217 // otherwise it comes from the user specified -00218 WriteTo(Source,Dest,"%s",s.c_str()); +00217 // if source is NULL, then the message originates from the local server +00218 Write(Dest->fd,":%s %s",this->GetServerName().c_str(),s.c_str()); 00219 } -00220 } -00221 -00222 void Server::SendChannel(userrec* User, chanrec* Channel, std::string s,bool IncludeSender) -00223 { -00224 if (IncludeSender) -00225 { -00226 WriteChannel(Channel,User,"%s",s.c_str()); -00227 } -00228 else -00229 { -00230 ChanExceptSender(Channel,User,"%s",s.c_str()); -00231 } -00232 } -00233 -00234 bool Server::CommonChannels(userrec* u1, userrec* u2) -00235 { -00236 return (common_channels(u1,u2) != 0); +00220 else +00221 { +00222 // otherwise it comes from the user specified +00223 WriteTo(Source,Dest,"%s",s.c_str()); +00224 } +00225 } +00226 +00227 void Server::SendChannel(userrec* User, chanrec* Channel, std::string s,bool IncludeSender) +00228 { +00229 if (IncludeSender) +00230 { +00231 WriteChannel(Channel,User,"%s",s.c_str()); +00232 } +00233 else +00234 { +00235 ChanExceptSender(Channel,User,"%s",s.c_str()); +00236 } 00237 } 00238 -00239 void Server::SendCommon(userrec* User, std::string text,bool IncludeSender) +00239 bool Server::CommonChannels(userrec* u1, userrec* u2) 00240 { -00241 if (IncludeSender) -00242 { -00243 WriteCommon(User,"%s",text.c_str()); -00244 } -00245 else -00246 { -00247 WriteCommonExcept(User,"%s",text.c_str()); -00248 } -00249 } -00250 -00251 void Server::SendWallops(userrec* User, std::string text) -00252 { -00253 WriteWallOps(User,"%s",text.c_str()); +00241 return (common_channels(u1,u2) != 0); +00242 } +00243 +00244 void Server::SendCommon(userrec* User, std::string text,bool IncludeSender) +00245 { +00246 if (IncludeSender) +00247 { +00248 WriteCommon(User,"%s",text.c_str()); +00249 } +00250 else +00251 { +00252 WriteCommonExcept(User,"%s",text.c_str()); +00253 } 00254 } 00255 -00256 bool Server::IsNick(std::string nick) +00256 void Server::SendWallops(userrec* User, std::string text) 00257 { -00258 return (isnick(nick.c_str()) != 0); +00258 WriteWallOps(User,false,"%s",text.c_str()); 00259 } 00260 -00261 userrec* Server::FindNick(std::string nick) +00261 void Server::ChangeHost(userrec* user, std::string host) 00262 { -00263 return Find(nick); +00263 ChangeDisplayedHost(user,host.c_str()); 00264 } 00265 -00266 chanrec* Server::FindChannel(std::string channel) +00266 void Server::ChangeGECOS(userrec* user, std::string gecos) 00267 { -00268 return FindChan(channel.c_str()); +00268 ChangeName(user,gecos.c_str()); 00269 } 00270 -00271 std::string Server::ChanMode(userrec* User, chanrec* Chan) +00271 bool Server::IsNick(std::string nick) 00272 { -00273 return cmode(User,Chan); +00273 return (isnick(nick.c_str()) != 0); 00274 } 00275 -00276 std::string Server::GetServerName() +00276 userrec* Server::FindNick(std::string nick) 00277 { -00278 return getservername(); +00278 return Find(nick); 00279 } 00280 -00281 std::string Server::GetNetworkName() +00281 chanrec* Server::FindChannel(std::string channel) 00282 { -00283 return getnetworkname(); +00283 return FindChan(channel.c_str()); 00284 } 00285 -00286 Admin Server::GetAdmin() +00286 std::string Server::ChanMode(userrec* User, chanrec* Chan) 00287 { -00288 return Admin(getadminname(),getadminemail(),getadminnick()); +00288 return cmode(User,Chan); 00289 } 00290 -00291 -00292 -00293 bool Server::AddExtendedMode(char modechar, int type, bool requires_oper, int params_when_on, int params_when_off) -00294 { -00295 if (type == MT_SERVER) -00296 { -00297 log(DEBUG,"*** API ERROR *** Modes of type MT_SERVER are reserved for future expansion"); -00298 return false; -00299 } -00300 if (((params_when_on>0) || (params_when_off>0)) && (type == MT_CLIENT)) -00301 { -00302 log(DEBUG,"*** API ERROR *** Parameters on MT_CLIENT modes are not supported"); -00303 return false; -00304 } -00305 if ((params_when_on>1) || (params_when_off>1)) -00306 { -00307 log(DEBUG,"*** API ERROR *** More than one parameter for an MT_CHANNEL mode is not yet supported"); -00308 return false; -00309 } -00310 return DoAddExtendedMode(modechar,type,requires_oper,params_when_on,params_when_off); -00311 } -00312 -00313 int Server::CountUsers(chanrec* c) -00314 { -00315 return usercount(c); -00316 } -00317 -00318 -00319 ConfigReader::ConfigReader() -00320 { -00321 this->cache = new std::stringstream(std::stringstream::in | std::stringstream::out); -00322 this->error = LoadConf(CONFIG_FILE,this->cache); -00323 } -00324 -00325 -00326 ConfigReader::~ConfigReader() -00327 { -00328 if (this->cache) -00329 delete this->cache; -00330 } -00331 +00291 std::string Server::GetServerName() +00292 { +00293 return getservername(); +00294 } +00295 +00296 std::string Server::GetNetworkName() +00297 { +00298 return getnetworkname(); +00299 } +00300 +00301 Admin Server::GetAdmin() +00302 { +00303 return Admin(getadminname(),getadminemail(),getadminnick()); +00304 } +00305 +00306 +00307 +00308 bool Server::AddExtendedMode(char modechar, int type, bool requires_oper, int params_when_on, int params_when_off) +00309 { +00310 if (type == MT_SERVER) +00311 { +00312 log(DEBUG,"*** API ERROR *** Modes of type MT_SERVER are reserved for future expansion"); +00313 return false; +00314 } +00315 if (((params_when_on>0) || (params_when_off>0)) && (type == MT_CLIENT)) +00316 { +00317 log(DEBUG,"*** API ERROR *** Parameters on MT_CLIENT modes are not supported"); +00318 return false; +00319 } +00320 if ((params_when_on>1) || (params_when_off>1)) +00321 { +00322 log(DEBUG,"*** API ERROR *** More than one parameter for an MT_CHANNEL mode is not yet supported"); +00323 return false; +00324 } +00325 return DoAddExtendedMode(modechar,type,requires_oper,params_when_on,params_when_off); +00326 } +00327 +00328 int Server::CountUsers(chanrec* c) +00329 { +00330 return usercount(c); +00331 } 00332 -00333 ConfigReader::ConfigReader(std::string filename) -00334 { -00335 this->cache = new std::stringstream(std::stringstream::in | std::stringstream::out); -00336 this->error = LoadConf(filename.c_str(),this->cache); -00337 }; -00338 -00339 std::string ConfigReader::ReadValue(std::string tag, std::string name, int index) -00340 { -00341 char val[MAXBUF]; -00342 ReadConf(cache,tag.c_str(),name.c_str(),index,val); -00343 return val; -00344 } -00345 +00333 +00334 ConfigReader::ConfigReader() +00335 { +00336 this->cache = new std::stringstream(std::stringstream::in | std::stringstream::out); +00337 this->error = LoadConf(CONFIG_FILE,this->cache); +00338 } +00339 +00340 +00341 ConfigReader::~ConfigReader() +00342 { +00343 if (this->cache) +00344 delete this->cache; +00345 } 00346 -00347 int ConfigReader::Enumerate(std::string tag) -00348 { -00349 return EnumConf(cache,tag.c_str()); -00350 } -00351 -00352 int ConfigReader::EnumerateValues(std::string tag, int index) -00353 { -00354 return EnumValues(cache, tag.c_str(), index); -00355 } -00356 -00357 bool ConfigReader::Verify() -00358 { -00359 return this->error; -00360 } +00347 +00348 ConfigReader::ConfigReader(std::string filename) +00349 { +00350 this->cache = new std::stringstream(std::stringstream::in | std::stringstream::out); +00351 this->error = LoadConf(filename.c_str(),this->cache); +00352 }; +00353 +00354 std::string ConfigReader::ReadValue(std::string tag, std::string name, int index) +00355 { +00356 char val[MAXBUF]; +00357 ReadConf(cache,tag.c_str(),name.c_str(),index,val); +00358 return val; +00359 } +00360 00361 -00362 -00363 FileReader::FileReader(std::string filename) -00364 { -00365 file_cache c; -00366 readfile(c,filename.c_str()); -00367 this->fc = c; -00368 } -00369 -00370 FileReader::FileReader() -00371 { -00372 } -00373 -00374 void FileReader::LoadFile(std::string filename) -00375 { -00376 file_cache c; -00377 readfile(c,filename.c_str()); -00378 this->fc = c; -00379 } -00380 -00381 -00382 FileReader::~FileReader() -00383 { -00384 } -00385 -00386 bool FileReader::Exists() -00387 { -00388 if (fc.size() == 0) -00389 { -00390 return(false); -00391 } -00392 else -00393 { -00394 return(true); -00395 } -00396 } -00397 -00398 std::string FileReader::GetLine(int x) -00399 { -00400 if ((x<0) || (x>fc.size())) -00401 return ""; -00402 return fc[x]; -00403 } -00404 -00405 int FileReader::FileSize() -00406 { -00407 return fc.size(); -00408 } -00409 -00410 -00411 std::vector<Module*> modules(255); -00412 std::vector<ircd_module*> factory(255); -00413 -00414 int MODCOUNT = -1; -00415 -00416 -
1.3-rc3
--
cgit v1.3.1-10-gc9f91