From: <Jef...@us...> - 2007-10-10 01:31:41
|
Revision: 260 http://libirc.svn.sourceforge.net/libirc/?rev=260&view=rev Author: JeffM2501 Date: 2007-10-09 18:31:38 -0700 (Tue, 09 Oct 2007) Log Message: ----------- get some command processing going Modified Paths: -------------- trunk/libirc/include/IRCServer.h trunk/libirc/src/IRCServer.cpp Modified: trunk/libirc/include/IRCServer.h =================================================================== --- trunk/libirc/include/IRCServer.h 2007-10-09 23:34:31 UTC (rev 259) +++ trunk/libirc/include/IRCServer.h 2007-10-10 01:31:38 UTC (rev 260) @@ -139,6 +139,8 @@ virtual int getDebugLevel ( void ); // general connection methods + virtual bool setHostName ( const char* host ); + virtual bool listen ( int maxConnections = 32, int port = -1 ); virtual bool disconnect ( std::string reason ); @@ -185,8 +187,19 @@ virtual bool process ( IRCServer *ircServer, teIRCEventType eventType, trBaseServerEventInfo &info ); // super high level common overides - virtual const char * getConnectionText ( IRCServerConnectedClient *client ){return NULL;} + typedef struct + { + std::string welome; + std::string host; + std::string created; + std::string info; + std::string bounce; + std::string motd; + }ConnectionText; + + virtual void getConnectionText ( IRCServerConnectedClient *client, ConnectionText &text ){return;} + protected: friend class IRCServerConnectedClient; @@ -203,10 +216,12 @@ virtual void processIRCLine ( std::string line, IRCServerConnectedClient *client ); // networking - TCPServerConnection *tcpServer; - TCPConnection &tcpConnection; - int ircServerPort; + TCPServerConnection *tcpServer; + TCPConnection &tcpConnection; + int ircServerPort; + std::string hostname; + // loging IRCServerLogHandler *logHandler; std::string logfile; @@ -249,7 +264,10 @@ void clearDefaultEventHandlers ( void ); void registerDefaultEventHandlers ( void ); + // utilities + void sendLinesOutToClient ( int numeric, IRCServerConnectedClient *client, const std::string &text ); + }; #endif //_IRC_SERVER_H_ Modified: trunk/libirc/src/IRCServer.cpp =================================================================== --- trunk/libirc/src/IRCServer.cpp 2007-10-09 23:34:31 UTC (rev 259) +++ trunk/libirc/src/IRCServer.cpp 2007-10-10 01:31:38 UTC (rev 260) @@ -686,22 +686,21 @@ { case eIRCConnectedEvent: { - const char *text = getConnectionText(info.client); - if (!text) - return false; - - std::vector<std::string> lines = string_util::tokenize(std::string(text),std::string("\n")); - for (unsigned int i = 0; i < (unsigned int)lines.size(); i++) - { - // send out each line as it's own message - } + ConnectionText record; + getConnectionText(info.client,record); } return true; } return false; } +void IRCServer::sendLinesOutToClient ( int numeric, IRCServerConnectedClient *client, const std::string &text ) +{ +} + + + // Local Variables: *** // mode:C++ *** // tab-width: 8 *** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |