Skip to forum content

You are not logged in. Please login or register.


forums.pvpgn.pro → [EN] The Source Code → [GUIDE]New Command /online (see crew online on battlenet

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 6

1 (edited by Zeloit 28.05.2013 09:04)

Topic: [GUIDE]New Command /online (see crew online on battlenet

static int _handle_online_command(t_connection * c, char const *text)
{
  unsigned int    i;
  t_elem const *  curr;
  t_connection *  tc;
  char const *    nick;

/*Edited by Somad Sikimat (Zeloit)  3/5/2012*/
  
  message_send_text(c,message_type_error,c,"=-=-= Online Guardian Crew =-=-=");
  
 std::strcpy(msgtemp,"Owner Online:");
  i = std::strlen(msgtemp);
  LIST_TRAVERSE_CONST(connlist(),curr)
    {
      tc = (t_connection*)elem_get_data(curr);
      if (!tc)
    continue;
      if (!conn_get_account(tc))
        continue;
      if (account_get_auth_owner(conn_get_account(tc),NULL)==1)
    {
      if ((nick = conn_get_username(tc)))
        {
          if (i+std::strlen(nick)+2>sizeof(msgtemp)) /* " ", name, '\0' */
        {
          message_send_text(c,message_type_info,c,msgtemp);
          i = 0;
        }
        
          std::sprintf(&msgtemp[i]," %s", nick);
          i += std::strlen(&msgtemp[i]);
        }
    }
    }
  if (i>0)
    message_send_text(c,message_type_info,c,msgtemp);
    
std::strcpy(msgtemp,"Master Online:");
  i = std::strlen(msgtemp);
  LIST_TRAVERSE_CONST(connlist(),curr)
    {
      tc = (t_connection*)elem_get_data(curr);
      if (!tc)
    continue;
      if (!conn_get_account(tc))
        continue;
      if (account_get_auth_master(conn_get_account(tc),NULL)==1)
    {
      if ((nick = conn_get_username(tc)))
        {
          if (i+std::strlen(nick)+2>sizeof(msgtemp)) /* " ", name, '\0' */
        {
          message_send_text(c,message_type_info,c,msgtemp);
          i = 0;
        }
        
          std::sprintf(&msgtemp[i]," %s", nick);
          i += std::strlen(&msgtemp[i]);
        }
    }
    }
  if (i>0)
    message_send_text(c,message_type_info,c,msgtemp);
    
std::strcpy(msgtemp,"Developer Online:");
  i = std::strlen(msgtemp);
  LIST_TRAVERSE_CONST(connlist(),curr)
    {
      tc = (t_connection*)elem_get_data(curr);
      if (!tc)
    continue;
      if (!conn_get_account(tc))
        continue;
      if (account_get_auth_developer(conn_get_account(tc),NULL)==1)
    {
      if ((nick = conn_get_username(tc)))
        {
          if (i+std::strlen(nick)+2>sizeof(msgtemp)) /* " ", name, '\0' */
        {
          message_send_text(c,message_type_info,c,msgtemp);
          i = 0;
        }
        
          std::sprintf(&msgtemp[i]," %s", nick);
          i += std::strlen(&msgtemp[i]);
        }
    }
    }
  if (i>0)
    message_send_text(c,message_type_info,c,msgtemp);
  
 std::strcpy(msgtemp,"Head Admin Online:");
  i = std::strlen(msgtemp);
  LIST_TRAVERSE_CONST(connlist(),curr)
    {
      tc = (t_connection*)elem_get_data(curr);
      if (!tc)
    continue;
      if (!conn_get_account(tc))
        continue;
      if (account_get_auth_headadmin(conn_get_account(tc),NULL)==1)
    {
      if ((nick = conn_get_username(tc)))
        {
          if (i+std::strlen(nick)+2>sizeof(msgtemp)) /* " ", name, '\0' */
        {
          message_send_text(c,message_type_info,c,msgtemp);
          i = 0;
        }
        
          std::sprintf(&msgtemp[i]," %s", nick);
          i += std::strlen(&msgtemp[i]);
        }
    }
    }
  if (i>0)
    message_send_text(c,message_type_info,c,msgtemp);

    
  std::strcpy(msgtemp,"Admin Online:");
  i = std::strlen(msgtemp);
  LIST_TRAVERSE_CONST(connlist(),curr)
    {
      tc = (t_connection*)elem_get_data(curr);
      if (!tc)
    continue;
      if (!conn_get_account(tc))
        continue;
      if (account_get_auth_admin(conn_get_account(tc),NULL)==1)
    {
      if ((nick = conn_get_username(tc)))
        {
          if (i+std::strlen(nick)+2>sizeof(msgtemp)) /* " ", name, '\0' */
        {
          message_send_text(c,message_type_info,c,msgtemp);
          i = 0;
        }
        
          std::sprintf(&msgtemp[i]," %s", nick);
          i += std::strlen(&msgtemp[i]);
        }
    }
    }
  if (i>0)
    message_send_text(c,message_type_info,c,msgtemp);
    
  std::strcpy(msgtemp,"Supervisor Online:");
  i = std::strlen(msgtemp);
  LIST_TRAVERSE_CONST(connlist(),curr)
    {
      tc = (t_connection*)elem_get_data(curr);
      if (!tc)
    continue;
      if (!conn_get_account(tc))
        continue;
      if (account_get_auth_supervisor(conn_get_account(tc),NULL)==1)
    {
      if ((nick = conn_get_username(tc)))
        {
          if (i+std::strlen(nick)+2>sizeof(msgtemp)) /* " ", name, '\0' */
        {
          message_send_text(c,message_type_info,c,msgtemp);
          i = 0;
        }
        
          std::sprintf(&msgtemp[i]," %s", nick);
          i += std::strlen(&msgtemp[i]);
        }
    }
    }
  if (i>0)
    message_send_text(c,message_type_info,c,msgtemp);

 std::strcpy(msgtemp,"Head Operator Online:");
  i = std::strlen(msgtemp);
  LIST_TRAVERSE_CONST(connlist(),curr)
    {
      tc = (t_connection*)elem_get_data(curr);
      if (!tc)
    continue;
      if (!conn_get_account(tc))
        continue;
      if (account_get_auth_headoperator(conn_get_account(tc),NULL)==1)
    {
      if ((nick = conn_get_username(tc)))
        {
          if (i+std::strlen(nick)+2>sizeof(msgtemp)) /* " ", name, '\0' */
        {
          message_send_text(c,message_type_info,c,msgtemp);
          i = 0;
        }
        
          std::sprintf(&msgtemp[i]," %s", nick);
          i += std::strlen(&msgtemp[i]);
        }
    }
    }
  if (i>0)
    message_send_text(c,message_type_info,c,msgtemp);

    
  std::strcpy(msgtemp,"Operator Online:");
  i = std::strlen(msgtemp);
  LIST_TRAVERSE_CONST(connlist(),curr)
    {
      tc = (t_connection*)elem_get_data(curr);
      if (!tc)
    continue;
      if (!conn_get_account(tc))
        continue;
      if (account_get_auth_operator(conn_get_account(tc),NULL)==1)
    {
      if ((nick = conn_get_username(tc)))
        {
          if (i+std::strlen(nick)+2>sizeof(msgtemp)) /* " ", name, '\0' */
        {
          message_send_text(c,message_type_info,c,msgtemp);
          i = 0;
        }
        
          std::sprintf(&msgtemp[i]," %s", nick);
          i += std::strlen(&msgtemp[i]);
        }
    }
    }
  if (i>0)
    message_send_text(c,message_type_info,c,msgtemp);

  std::strcpy(msgtemp,"Voice Operator Online:");
  i = std::strlen(msgtemp);
  LIST_TRAVERSE_CONST(connlist(),curr)
    {
      tc = (t_connection*)elem_get_data(curr);
      if (!tc)
    continue;
      if (!conn_get_account(tc))
        continue;
      if (account_get_auth_voiceoperator(conn_get_account(tc),NULL)==1)
    {
      if ((nick = conn_get_username(tc)))
        {
          if (i+std::strlen(nick)+2>sizeof(msgtemp)) /* " ", name, '\0' */
        {
          message_send_text(c,message_type_info,c,msgtemp);
          i = 0;
        }
        
          std::sprintf(&msgtemp[i]," %s", nick);
          i += std::strlen(&msgtemp[i]);
        }
    }
    }
  if (i>0)
    message_send_text(c,message_type_info,c,msgtemp);
    
  std::strcpy(msgtemp,"Analyzer Online:");
  i = std::strlen(msgtemp);
  LIST_TRAVERSE_CONST(connlist(),curr)
    {
      tc = (t_connection*)elem_get_data(curr);
      if (!tc)
    continue;
      if (!conn_get_account(tc))
        continue;
      if (account_get_auth_cat(conn_get_account(tc),NULL)==1)
    {
      if ((nick = conn_get_username(tc)))
        {
          if (i+std::strlen(nick)+2>sizeof(msgtemp)) /* " ", name, '\0' */
        {
          message_send_text(c,message_type_info,c,msgtemp);
          i = 0;
        }
        
          std::sprintf(&msgtemp[i]," %s", nick);
          i += std::strlen(&msgtemp[i]);
        }
    }
    }
  if (i>0)
    message_send_text(c,message_type_info,c,msgtemp);
    
  std::strcpy(msgtemp,"Team Event Online:");
  i = std::strlen(msgtemp);
  LIST_TRAVERSE_CONST(connlist(),curr)
    {
      tc = (t_connection*)elem_get_data(curr);
      if (!tc)
    continue;
      if (!conn_get_account(tc))
        continue;
      if (account_get_auth_te(conn_get_account(tc),NULL)==1)
    {
      if ((nick = conn_get_username(tc)))
        {
          if (i+std::strlen(nick)+2>sizeof(msgtemp)) /* " ", name, '\0' */
        {
          message_send_text(c,message_type_info,c,msgtemp);
          i = 0;
        }
        
          std::sprintf(&msgtemp[i]," %s", nick);
          i += std::strlen(&msgtemp[i]);
        }
    }
    }
  if (i>0)
    message_send_text(c,message_type_info,c,msgtemp);

  return 0;
}

/online other type:

static int _handle_onlinecrew_command(t_connection * c, char const *text)
{
  unsigned int    i;
  t_elem const *  curr;
  t_connection *  tc;
  char const *    nick;

/* Edited by Somad Sikimat (Zeloit) 2/2/2012 */

  std::strcpy(msgtemp,"Currently Online Crew:");
  i = std::strlen(msgtemp);
  LIST_TRAVERSE_CONST(connlist(),curr)
    {
      tc = (t_connection*)elem_get_data(curr);
      if (!tc)
    continue;
      if (!conn_get_account(tc))
        continue;
      if ((account_get_auth_owner(conn_get_account(tc),NULL)==1) ||
          (account_get_auth_master(conn_get_account(tc),NULL)==1) ||
          (account_get_auth_developer(conn_get_account(tc),NULL)==1) ||
          (account_get_auth_headadmin(conn_get_account(tc),NULL)==1) ||
          (account_get_auth_admin(conn_get_account(tc),NULL)==1) || 
          (account_get_auth_cs(conn_get_account(tc),NULL)==1) ||
          (account_get_auth_supervisor(conn_get_account(tc),NULL)==1)  ||
          (account_get_auth_headoperator(conn_get_account(tc),NULL)==1) ||
          (account_get_auth_operator(conn_get_account(tc),NULL)==1) ||
          (account_get_auth_voiceoperator(conn_get_account(tc),NULL)==1) ||
          (account_get_auth_cat(conn_get_account(tc),NULL)==1) ||
          (account_get_auth_te(conn_get_account(tc),NULL)==1))
    {
      if ((nick = conn_get_username(tc)))
        {
          if (i+std::strlen(nick)+2>sizeof(msgtemp)) /* " ", name, '\0' */
        {
          message_send_text(c,message_type_info,c,msgtemp);
          i = 0;
        }
        
          std::sprintf(&msgtemp[i]," %s",nick);
          i += std::strlen(&msgtemp[i]);
        }
    }
    }
  if (i>0)
    message_send_text(c,message_type_info,c,msgtemp);

  return 0;
}

2

Re: [GUIDE]New Command /online (see crew online on battlenet

whether you can edit for pvpgn version 1.8.5?

3 (edited by Zeloit 28.05.2013 09:13)

Re: [GUIDE]New Command /online (see crew online on battlenet

aLbHy wrote:

whether you can edit for pvpgn version 1.8.5?

not support on version 1.8.5

4 (edited by Satria 28.05.2013 09:13)

Re: [GUIDE]New Command /online (see crew online on battlenet

Zeloit wrote:
aLbHy wrote:

whether you can edit for pvpgn version 1.8.5?

not support

zeloit can you make /crew
like openbattle??

5

Re: [GUIDE]New Command /online (see crew online on battlenet

answer from BOT:
/chat $nick List Crew:

change /w $nick Crew to /chat $nick Crew

before you creating /chat on command.cpp
check in: /whisper and change to /chat
do_whisper change to do_chat
like this post:
http://forums.harpywar.com/viewtopic.php?id=990

6

Re: [GUIDE]New Command /online (see crew online on battlenet

Zeloit wrote:

answer from BOT:
/chat $nick List Crew:

change /w $nick Crew to /chat $nick Crew

before you creating /chat on command.cpp
check in: /whisper and change to /chat
do_whisper change to do_chat
like this post:
http://forums.harpywar.com/viewtopic.php?id=990

ok i understand

Added: 28.05.2013 13:39

zeloit accept my friend request (facebook) satria negara

Posts: 6

Pages 1

You must login or register to post a reply

Who now at forum

Currently view post: 1 guest, 0 registered users

forums.pvpgn.pro → [EN] The Source Code → [GUIDE]New Command /online (see crew online on battlenet



Generated in 0.064 seconds (79% PHP - 21% DB) with 20 queries