本文整理汇总了C++中CIRCNetwork::PutUser方法的典型用法代码示例。如果您正苦于以下问题:C++ CIRCNetwork::PutUser方法的具体用法?C++ CIRCNetwork::PutUser怎么用?C++ CIRCNetwork::PutUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIRCNetwork
的用法示例。
在下文中一共展示了CIRCNetwork::PutUser方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PutAllUser
bool CUser::PutAllUser(const CString& sLine, CClient* pClient, CClient* pSkipClient) {
PutUser(sLine, pClient, pSkipClient);
for (vector<CIRCNetwork*>::iterator it = m_vIRCNetworks.begin(); it != m_vIRCNetworks.end(); ++it) {
CIRCNetwork* pNetwork = *it;
if (pNetwork->PutUser(sLine, pClient, pSkipClient)) {
return true;
}
}
return (pClient == NULL);
}
示例2: OnWebRequest
virtual bool OnWebRequest(CWebSock& WebSock, const CString& sPageName, CTemplate& Tmpl) {
if (sPageName == "index") {
if (WebSock.IsPost()) {
CUser *pUser = CZNC::Get().FindUser(WebSock.GetParam("user").Token(0, false, "/"));
if (!pUser) {
WebSock.GetSession()->AddError("User not found");
return true;
}
CIRCNetwork *pNetwork = pUser->FindNetwork(WebSock.GetParam("user").Token(1, false, "/"));
if (!pNetwork) {
WebSock.GetSession()->AddError("Network not found");
return true;
}
bool bToServer = WebSock.GetParam("send_to") == "server";
const CString sLine = WebSock.GetParam("line");
Tmpl["user"] = pUser->GetUserName();
Tmpl[bToServer ? "to_server" : "to_client"] = "true";
Tmpl["line"] = sLine;
if (bToServer) {
pNetwork->PutIRC(sLine);
} else {
pNetwork->PutUser(sLine);
}
WebSock.GetSession()->AddSuccess("Line sent");
}
const map<CString,CUser*>& msUsers = CZNC::Get().GetUserMap();
for (map<CString,CUser*>::const_iterator it = msUsers.begin(); it != msUsers.end(); ++it) {
CTemplate& l = Tmpl.AddRow("UserLoop");
l["Username"] = (*it->second).GetUserName();
vector<CIRCNetwork*> vNetworks = (*it->second).GetNetworks();
for (vector<CIRCNetwork*>::const_iterator it2 = vNetworks.begin(); it2 != vNetworks.end(); ++it2) {
CTemplate& NetworkLoop = l.AddRow("NetworkLoop");
NetworkLoop["Username"] = (*it->second).GetUserName();
NetworkLoop["Network"] = (*it2)->GetName();
}
}
return true;
}
return false;
}
示例3: SendClient
void SendClient(const CString& sLine) {
CUser *pUser = CZNC::Get().FindUser(sLine.Token(1));
if (pUser) {
CIRCNetwork *pNetwork = pUser->FindNetwork(sLine.Token(2));
if (pNetwork) {
pNetwork->PutUser(sLine.Token(3, true));
PutModule("Sent [" + sLine.Token(3, true) + "] to " + pUser->GetUserName() + "/" + pNetwork->GetName());
} else {
PutModule("Network [" + sLine.Token(2) + "] not found for user [" + sLine.Token(1) + "]");
}
} else {
PutModule("User [" + sLine.Token(1) + "] not found");
}
}