void inet::sendOwner(const char *who, const char *lst, ...) { va_list ap; if(!who) return; if(config.bottype != BOT_MAIN) { HANDLE *h; if(!userlist.first) return; if(!userlist.first->next) return; h = userlist.first->next->next; while(h) { if(userlist.isMain(h)) { inetconn *c = findConn(h); if(c) { int len; va_start(ap, lst); len = va_getlen(ap, lst); va_end(ap); char *str; va_start(ap, lst); str = va_push(NULL, ap, lst, len + 1); va_end(ap); c->send(S_OREDIR, " ", userlist.first->next->name, " ", who, " ", str, NULL); free(str); } } h = h->next; } } else { for(int i=0; i<max_conns; ++i) if(conn[i].isRegOwner() && match(who, net.conn[i].handle->name)) { va_start(ap, lst); conn[i].va_send(ap, lst); va_end(ap); } } }
CliConn* EventLoop::addConn(const std::string& cid) { SDK_LOG(LOG_LEVEL_TRACE, "EventLoop::addConn cid=%s", cid.c_str()) CliConn* conn = findConn(cid); if (conn) { return conn; } conn = new CliConn(this); std::pair<CliConnMap::iterator, bool> ret = m_conns.insert(CliConnMap::value_type(cid, conn)); m_conns[cid] = conn; return conn; }