本文整理汇总了C++中Plan::procesar方法的典型用法代码示例。如果您正苦于以下问题:C++ Plan::procesar方法的具体用法?C++ Plan::procesar怎么用?C++ Plan::procesar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plan
的用法示例。
在下文中一共展示了Plan::procesar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: event_privmsg
void event_privmsg(irc_session_t * session, const char * event, const char * origin, const char ** params, unsigned int count)
{
char *pch;
std::string comandos = params[1];
std::vector<std::string> notificar;
sql::Driver *driver;
sql::Connection *con;
sql::Statement *stmt;
sql::ResultSet *res;
driver = get_driver_instance();
con = driver->connect(direccion, usuario, password);
if ( !origin || count != 2 )
return;
irc_ctx_t * ctx = (irc_ctx_t *) irc_get_ctx (session);
char nickbuf[128], text[1024];
irc_target_get_nick (origin, nickbuf, sizeof(nickbuf));
pch = strtok ((char *)params[1]," ,.-/\r\n");
if(pch != NULL)
{
if(strcmp(pch,"login") == 0)
{
char *arg1;
char *arg2;
pch = strtok (NULL," ,.-/\r\n");
if(pch == NULL){return;}
arg1 = pch;
pch = strtok (NULL," ,.-/\r\n");
if(pch == NULL){return;}
arg2 = pch;
con->setSchema("bigbug");
stmt = con->createStatement();
char querysql[256];
sprintf (querysql, "SELECT * from users where usuario = '%s' and clave = md5('%s');", arg1,arg2);
res = stmt->executeQuery(querysql);
while (res->next()) {
if ( ctx->userLogged.find(nickbuf) == ctx->userLogged.end() )
ctx->userLogged[nickbuf] = arg1;
sprintf (text, "%s, estas loggeado.", nickbuf);
irc_cmd_notice (session, nickbuf, text);
}
delete res;
delete stmt;
delete con;
}
else if(strcmp(pch,"amilogin") == 0)
{
if ( ctx->userLogged.find(nickbuf) != ctx->userLogged.end() )
{
sprintf (text, "%s, estas loggeado. Usuario: %s", nickbuf,ctx->userLogged[nickbuf].c_str());
irc_cmd_notice (session, nickbuf, text);
}
}
else if(strcmp(pch,"plan") == 0)
{
if ( ctx->userLogged.find(nickbuf) != ctx->userLogged.end() )
{
Plan *plan = new Plan(direccion, usuario, password);
notificar = plan->procesar(ctx->userLogged[nickbuf],comandos.c_str());
for(size_t i=0; i<notificar.size(); i++)
{
irc_cmd_notice (session, nickbuf, irc_color_convert_to_mirc(notificar[i].c_str()));
}
delete plan;
}
}
}
}