本文整理汇总了C++中LookupPlayerSearchCommand函数的典型用法代码示例。如果您正苦于以下问题:C++ LookupPlayerSearchCommand函数的具体用法?C++ LookupPlayerSearchCommand怎么用?C++ LookupPlayerSearchCommand使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LookupPlayerSearchCommand函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: getSelectedPlayer
bool ChatHandler::HandleLookupPlayerIpCommand(const char* args)
{
std::string ip;
int32 limit;
char* limit_str;
Player *chr = getSelectedPlayer();
if (!*args)
{
// NULL only if used from console
if (!chr || chr == GetSession()->GetPlayer())
return false;
ip = chr->GetSession()->GetRemoteAddress();
limit = -1;
}
else
{
ip = strtok ((char*)args, " ");
limit_str = strtok (NULL, " ");
limit = limit_str ? atoi (limit_str) : -1;
}
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_IP);
stmt->setString(0, ip);
PreparedQueryResult result = LoginDatabase.Query(stmt);
return LookupPlayerSearchCommand(result, limit);
}
开发者ID:BlackWolfsDen,项目名称:Justicar-WoW,代码行数:29,代码来源:Level2.cpp
示例2: getSelectedPlayer
bool ChatHandler::HandleLookupPlayerIpCommand(const char* args)
{
std::string ip;
int32 limit;
char* limit_str;
Player *chr = getSelectedPlayer();
if (!*args)
{
// NULL only if used from console
if (!chr || chr == GetSession()->GetPlayer())
return false;
ip = chr->GetSession()->GetRemoteAddress();
limit = -1;
}
else
{
ip = strtok ((char*)args, " ");
limit_str = strtok (NULL, " ");
limit = limit_str ? atoi (limit_str) : -1;
}
LoginDatabase.EscapeString(ip);
QueryResult result = LoginDatabase.PQuery("SELECT id, username FROM account WHERE last_ip = '%s'", ip.c_str());
return LookupPlayerSearchCommand(result, limit);
}
开发者ID:aedansilver,项目名称:CzechFunCore,代码行数:29,代码来源:Level2.cpp
示例3: strtok
bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args)
{
if (!*args)
return false;
std::string email = strtok ((char*)args, " ");
char* limit_str = strtok (NULL, " ");
int32 limit = limit_str ? atoi (limit_str) : -1;
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL);
stmt->setString(0, email);
PreparedQueryResult result = LoginDatabase.Query(stmt);
return LookupPlayerSearchCommand(result, limit);
}
开发者ID:BlackWolfsDen,项目名称:Justicar-WoW,代码行数:15,代码来源:Level2.cpp
示例4: strtok
bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args)
{
if (!*args)
return false;
std::string email = strtok ((char*)args, " ");
char* limit_str = strtok (NULL, " ");
int32 limit = limit_str ? atoi (limit_str) : -1;
LoginDatabase.EscapeString (email);
QueryResult result = LoginDatabase.PQuery ("SELECT id, username FROM account WHERE email = '%s'", email.c_str ());
return LookupPlayerSearchCommand (result, limit);
}
开发者ID:Sar777,项目名称:SkyFireEMU,代码行数:15,代码来源:Level2.cpp
注:本文中的LookupPlayerSearchCommand函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论