Skip to forum content

You are not logged in. Please login or register.


forums.pvpgn.pro → [EN] The Source Code → Error on message.cpp

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 2

1 (edited by Satria 24.12.2013 08:18)

Topic: Error on message.cpp

Please help me !

http://forums.harpywar.com/extensions/hcs_image_uploader/uploads/0/5500/5651/thumb/p18chcsp661akgtn51fao1hmr8f61.JPG


My Code _Handle_Chat_command

static int _handle_chat_command(t_connection * c, char const *text)
{
  t_connection * conn;
  char key[256];
  unsigned int i,j,k;
  t_account *acc=conn_get_account(c);
  text = skip_command(text);
  if ( k = account_get_numattr(acc,"chat\\num_chat") ) {
  i = 1;
  j = 0;

  while ( i <= k ) {
  std::sprintf(key,"chat\\chat_%d",i);
  if (conn=connlist_find_connection_by_accountname(account_get_strattr(acc,key))) {
  message_send_text(conn,message_type_whisper,c,text);
  
  j++;
  } 
  i++;
  }
  if ( j == 0 ) {
  message_send_text(c,message_type_info,c,"all member offline");
  }
  else {
  std::sprintf(key,"Success sent to %d other",k);
  message_send_text(c,message_type_info,c,key);
   }
  }
  else {
  message_send_text(c,message_type_info,c,"please usage /addchat <username> to add a new chat");
  }
return 0;
}

And My code on Message.cpp :

extern int message_send_user(t_connection * src, t_message_type type, char const * text)
{
    t_elem    const * curr;
    t_connection *    tc;
    int            counter = 0;

    LIST_TRAVERSE_CONST(connlist(),curr)
    {
    tc = (t_connection*)elem_get_data(curr);
    if (!tc)
        continue;
      if (!conn_get_game(tc) || strcasecmp(game_status_get_str(game_get_status(conn_get_game(tc))),"open")==0 )
    {
        message_send_text(tc,type,src,text);
        counter++;
    }
    }

    return counter;
}

2 (edited by Zeloit 24.12.2013 12:22)

Re: Error on message.cpp

retern 0;

and

char const * strcasecmp

Posts: 2

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 → Error on message.cpp



Generated in 0.056 seconds (76% PHP - 24% DB) with 20 queries