diff options
| author | Adam <Adam@anope.org> | 2011-11-25 00:44:31 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2011-11-25 00:44:31 -0500 |
| commit | cef3eb78dfd2ea20e0a482d040cc99902fdb4b2a (patch) | |
| tree | d9e964ac19137e87a6fb97d25dda9be6487c2aa9 /src/send.cpp | |
| parent | 12d0a7302f76fe21c54ffcead286fc31e870b817 (diff) | |
Remove send_cmd and replace it with a stringstream
Diffstat (limited to 'src/send.cpp')
| -rw-r--r-- | src/send.cpp | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/src/send.cpp b/src/send.cpp deleted file mode 100644 index 28c1ca08c..000000000 --- a/src/send.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* Routines for sending stuff to the network. - * - * (C) 2003-2011 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - */ - -#include "services.h" - -/*************************************************************************/ - -/** - * Send a command to the server. The two forms here are like - * printf()/vprintf() and friends. - * @param source Orgin of the Message (some times NULL) - * @param fmt Format of the Message - * @param ... any number of parameters - * @return void - */ -void send_cmd(const Anope::string &source, const char *fmt, ...) -{ - va_list args; - char buf[BUFSIZE] = ""; - - va_start(args, fmt); - - vsnprintf(buf, BUFSIZE - 1, fmt, args); - - if (!UplinkSock) - { - if (!source.empty()) - Log(LOG_DEBUG) << "Attempted to send \"" << source << " " << buf << "\" with UplinkSock NULL"; - else - Log(LOG_DEBUG) << "Attempted to send \"" << buf << "\" with UplinkSock NULL"; - return; - } - - if (!source.empty() && source.find(".") == Anope::string::npos) - { - BotInfo *bi = findbot(source); - if (bi != NULL && bi->introduced == false) - { - Log(LOG_DEBUG) << "Attempted to send \"" << source << " " << buf << "\" with source not introduced"; - return; - } - } - - if (!source.empty()) - { - UplinkSock->Write(":%s %s", source.c_str(), buf); - Log(LOG_RAWIO) << "Sent: :" << source << " " << buf; - } - else - { - UplinkSock->Write(buf); - Log(LOG_RAWIO) << "Sent: " << buf; - } - - va_end(args); -} - -/*************************************************************************/ - -/** - * Send a server notice - * @param source Orgin of the Message - * @param s Server Struct - * @param fmt Format of the Message - * @param ... any number of parameters - * @return void - */ -void notice_server(const Anope::string &source, const Server *s, const char *fmt, ...) -{ - if (fmt) - { - va_list args; - char buf[BUFSIZE] = ""; - - va_start(args, fmt); - vsnprintf(buf, BUFSIZE - 1, fmt, args); - - if (Config->NSDefFlags.HasFlag(NI_MSG)) - ircdproto->SendGlobalPrivmsg(findbot(source), s, buf); - else - ircdproto->SendGlobalNotice(findbot(source), s, buf); - va_end(args); - } -} - |
