本文整理汇总了C++中Reference::SendReply方法的典型用法代码示例。如果您正苦于以下问题:C++ Reference::SendReply方法的具体用法?C++ Reference::SendReply怎么用?C++ Reference::SendReply使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reference
的用法示例。
在下文中一共展示了Reference::SendReply方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnFail
void OnFail(NickServ::IdentifyRequest *req) override
{
if (!client || !server)
return;
replacements["INVALID_LOGIN"] = "Invalid username or password";
TemplateFileServer page("login.html");
page.Serve(server, page_name, client, message, reply, replacements);
client->SendReply(&reply);
}
示例2: OnFail
void OnFail(NickServ::IdentifyRequest *req) override
{
if (!xinterface || !client)
return;
request.r = this->repl;
request.reply("error", "Invalid password");
xinterface->Reply(request);
client->SendReply(&request.r);
}
示例3: OnSuccess
void OnSuccess(NickServ::IdentifyRequest *req) override
{
if (!xinterface || !client)
return;
request.r = this->repl;
request.reply("result", "Success");
request.reply("account", req->GetAccount());
xinterface->Reply(request);
client->SendReply(&request.r);
}
示例4: OnSuccess
void OnSuccess(NickServ::IdentifyRequest *req) override
{
if (!client || !server)
return;
::NickServ::Nick *na = ::NickServ::FindNick(req->GetAccount());
if (!na)
{
this->OnFail(req);
return;
}
if (na->GetAccount()->HasFieldS("NS_SUSPENDED"))
{
this->OnFail(req);
return;
}
Anope::string id;
for (int i = 0; i < 64; ++i)
{
char c;
do
c = 48 + (rand() % 75);
while (!isalnum(c));
id += c;
}
na->Extend<Anope::string>("webcpanel_id", id);
na->Extend<Anope::string>("webcpanel_ip", client->GetIP());
{
HTTPReply::cookie c;
c.push_back(std::make_pair("account", na->GetNick()));
c.push_back(std::make_pair("Path", "/"));
reply.cookies.push_back(c);
}
{
HTTPReply::cookie c;
c.push_back(std::make_pair("id", id));
c.push_back(std::make_pair("Path", "/"));
reply.cookies.push_back(c);
}
reply.error = HTTP_FOUND;
reply.headers["Location"] = Anope::string("http") + (server->IsSSL() ? "s" : "") + "://" + message.headers["Host"] + "/nickserv/info";
client->SendReply(&reply);
}