[SithNet-Patches] [CVS] Module gnuworld-sithnet: Change committed
Brought to you by:
darthsidious_
From: Tim I. <dar...@us...> - 2003-09-01 12:20:41
|
Committer : Tim Ireland <dar...@us...> CVSROOT : /cvsroot/sithnet-dev Module : gnuworld-sithnet Commit time: 2003-09-01 12:20:39 UTC Modified files: src/Network.cc src/server.cc mod.cloner/cloner.cc Log message: GNUWorld Sync ---------------------- diff included ---------------------- Index: gnuworld-sithnet/mod.cloner/cloner.cc diff -u gnuworld-sithnet/mod.cloner/cloner.cc:1.1.1.1 gnuworld-sithnet/mod.cloner/cloner.cc:1.2 --- gnuworld-sithnet/mod.cloner/cloner.cc:1.1.1.1 Mon Aug 18 13:30:37 2003 +++ gnuworld-sithnet/mod.cloner/cloner.cc Mon Sep 1 05:20:29 2003 @@ -20,7 +20,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: cloner.cc,v 1.1.1.1 2003/08/18 20:30:37 darthsidious_ Exp $ + * $Id: cloner.cc,v 1.2 2003/09/01 12:20:29 darthsidious_ Exp $ */ #include <new> @@ -43,7 +43,7 @@ #include "misc.h" #include "ELog.h" -RCSTAG("$Id: cloner.cc,v 1.1.1.1 2003/08/18 20:30:37 darthsidious_ Exp $"); +RCSTAG("$Id: cloner.cc,v 1.2 2003/09/01 12:20:29 darthsidious_ Exp $"); namespace gnuworld { @@ -51,7 +51,6 @@ using std::vector ; using std::endl ; using std::stringstream ; -using std::ends ; using std::string ; /* @@ -201,9 +200,14 @@ if( st.size() > 1 ) { - topic = st[ 1 ] ; + topic = string_upper( st[ 1 ] ) ; } +//elog << "cloner::OnPrivateMessage> command: " +// << command +// << ", topic: " +// << endl ; + if( command == "SHOWCOMMANDS" ) { if( st.size() < 1 ) @@ -331,8 +335,7 @@ stringstream s ; s << (*ptr)->getCharYYXXX() << " J " - << chanName - << ends ; + << chanName ; MyUplink->Write( s ) ; } @@ -360,13 +363,12 @@ stringstream s ; s << (*ptr)->getCharYYXXX() << " L " - << chanName - << ends ; + << chanName ; MyUplink->Write( s ) ; } } - if( st.size() >= 2 ) + if( st.size() > 2 ) { string chanName( st[ 1 ] ) ; if( chanName[ 0 ] != '#' ) @@ -384,8 +386,7 @@ << " L " << chanName << " :" - << partReason - << ends ; + << partReason ; MyUplink->Write( s ) ; } @@ -400,37 +401,22 @@ return ; } - if( st.size() == 1 ) - { - for( list< iClient* >::const_iterator ptr = clones.begin(), - endPtr = clones.end() ; ptr != endPtr ; ++ptr ) - { - MyUplink->DetachClient( *ptr ) ; -// stringstream s ; -// s << (*ptr)->getCharYYXXX() -// << " Q :Quitting" -// << ends ; - -// MyUplink->Write( s ) ; - } - } - + string quitMsg ; if( st.size() >= 2 ) { - string quitMsg( st.assemble(1).c_str() ) ; + quitMsg = st.assemble( 1 ) ; + } for( list< iClient* >::const_iterator ptr = clones.begin(), - endPtr = clones.end() ; ptr != endPtr ; ++ptr ) + endPtr = clones.end() ; ptr != endPtr ; ++ptr { - stringstream s ; - s << (*ptr)->getCharYYXXX() - << " Q :" - << quitMsg - << ends ; - - MyUplink->Write( s ) ; + if( MyUplink->DetachClient( *ptr, quitMsg ) ) + { + delete *ptr ; } } + clones.clear() ; + } // KILLALL/QUITALL else if( command == "SAYALL" || command == "MSGALL" ) { @@ -464,8 +450,7 @@ << " P " << chanOrNickName << " :" - << privMsg - << ends ; + << privMsg ; MyUplink->Write( s ) ; } @@ -504,8 +489,7 @@ << chanOrNickName << " :\001ACTION " << action - << "\001" - << ends ; + << "\001" ; MyUplink->Write( s ) ; } @@ -542,8 +526,7 @@ << " O " << chanOrNickName << " :" - << notice - << ends ; + << notice ; MyUplink->Write( s ) ; } @@ -587,17 +570,10 @@ void cloner::addClone() { -//char buf[ 4 ] = { 0 } ; - // The XXX doesn't matter here, the core will choose an // appropriate value. string yyxxx( fakeServer->getCharYY() + "]]]" ) ; -//inttobase64( buf, Network->countClients( fakeServer ) + 1, 3 ) ; -//buf[ 3 ] = 0 ; - -//yyxxx += buf ; - iClient* newClient = new iClient( fakeServer->getIntYY(), yyxxx, @@ -607,7 +583,7 @@ randomHost(), randomHost(), cloneMode, - "", + string(), cloneDescription, ::time( 0 ) ) ; assert( newClient != 0 ); Index: gnuworld-sithnet/src/Network.cc diff -u gnuworld-sithnet/src/Network.cc:1.1.1.1 gnuworld-sithnet/src/Network.cc:1.2 --- gnuworld-sithnet/src/Network.cc:1.1.1.1 Mon Aug 18 13:31:26 2003 +++ gnuworld-sithnet/src/Network.cc Mon Sep 1 05:20:29 2003 @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: Network.cc,v 1.1.1.1 2003/08/18 20:31:26 darthsidious_ Exp $ + * $Id: Network.cc,v 1.2 2003/09/01 12:20:29 darthsidious_ Exp $ */ #include <new> @@ -44,7 +44,7 @@ #include "ip.h" #include "config.h" -RCSTAG( "$Id: Network.cc,v 1.1.1.1 2003/08/18 20:31:26 darthsidious_ Exp $" ) ; +RCSTAG( "$Id: Network.cc,v 1.2 2003/09/01 12:20:29 darthsidious_ Exp $" ) ; namespace gnuworld { @@ -131,9 +131,9 @@ return false ; } -elog << "xNetwork::addClient(xClient)> Added client: " - << *newClient - << endl ; +//elog << "xNetwork::addClient(xClient)> Added client: " +// << *newClient +// << endl ; return true ; } @@ -374,7 +374,7 @@ { assert( theClient != 0 ) ; -return removeClient( theClient->getIntYY(), theClient->getIntXXX() ) ; +return removeClient( theClient->getIntYYXXX() ) ; } xClient* xNetwork::removeLocalClient( xClient* theClient ) @@ -1090,7 +1090,7 @@ } // Make sure the nickname does not collide -if( findFakeNick( fakeClient->getNickName() ) != 0 ) +if( findNick( fakeClient->getNickName() ) != 0 ) { elog << "xNetwork::addFakeClient> Found matching nickname: " << fakeClient->getNickName() @@ -1179,10 +1179,10 @@ fakeClient->getIntYYXXX() ) ; if( cItr == fakeClient_end() ) { - elog << "xNetwork::removeFakeClient> Unable to find fake " - << "client: " - << *fakeClient - << endl ; +// elog << "xNetwork::removeFakeClient> Unable to find fake " +// << "client: " +// << *fakeClient +// << endl ; } else { Index: gnuworld-sithnet/src/server.cc diff -u gnuworld-sithnet/src/server.cc:1.1.1.1 gnuworld-sithnet/src/server.cc:1.2 --- gnuworld-sithnet/src/server.cc:1.1.1.1 Mon Aug 18 13:31:33 2003 +++ gnuworld-sithnet/src/server.cc Mon Sep 1 05:20:29 2003 @@ -23,7 +23,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: server.cc,v 1.1.1.1 2003/08/18 20:31:33 darthsidious_ Exp $ + * $Id: server.cc,v 1.2 2003/09/01 12:20:29 darthsidious_ Exp $ */ #include <sys/time.h> @@ -71,7 +71,7 @@ #include "ConnectionHandler.h" #include "Connection.h" -RCSTAG( "$Id: server.cc,v 1.1.1.1 2003/08/18 20:31:33 darthsidious_ Exp $" ) ; +RCSTAG( "$Id: server.cc,v 1.2 2003/09/01 12:20:29 darthsidious_ Exp $" ) ; namespace gnuworld { @@ -123,7 +123,6 @@ elog << "Uplink Port: " << Port << endl ; elog << "Server Name: " << ServerName << endl ; elog << "Server Description: " << ServerDescription << endl ; -elog << endl ; //elog << "xServer::charYY> " << getCharYY() << endl ; //elog << "xServer::charXXX> " << getCharXXX() << endl ; @@ -329,9 +328,10 @@ } // while() -elog << "xServer> Loaded " +elog << "Loaded " << commandMap.size() << " command handlers" + << endl << endl ; commandMapFile.close() ; @@ -943,7 +943,7 @@ } // Set the intXXX/charXXX to the max possible -fakeServer->setIntXXX( 64 * 64 * 64 ) ; +fakeServer->setIntXXX( 64 * 64 * 64 - 1 ) ; BurstServer( fakeServer ) ; @@ -1294,7 +1294,7 @@ Client->getHostName(), Client->getHostName(), Client->getModes(), - "", + string(), Client->getDescription(), ::time( 0 ) ) ; assert( theIClient != 0 ) ; @@ -1331,6 +1331,10 @@ Client->BurstGlines() ; } +elog << "Successfully loaded client module: " + << theIClient->getNickName() + << endl ; + // Success return true ; } @@ -3993,7 +3997,8 @@ case 'm': case 'p': case 's': - // No big deal, let the network deal with any + // No big deal, let the network deal +with any // problems break ; default: @@ -4274,10 +4279,17 @@ << endl ; return false ; } - -Write( "%s Q :%s", - fakeClient->getCharYYXXX().c_str(), - quitMessage.c_str() ) ; +if( !quitMessage.empty() ) ; + { + Write( "%s Q :%s", + fakeClient->getCharYYXXX().c_str(), + quitMessgae.c_str() ) ; + } +else + { + Write( "%s Q :Exiting", + fakeClient->getCharYYXXX().c_str() ) ; + } return true ; } ----------------------- End of diff ----------------------- |