Skip to forum content

You are not logged in. Please login or register.


forums.pvpgn.pro → [EN] The Source Code → Source /Clan Change is not work

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 15

1

Topic: Source /Clan Change is not work

Command.cpp:

    else if (clanmember_get_status(member)==CLAN_CHIEFTAIN) {
    if (strstart(text,"change")==0) {
     const char * channel = skip_command(text);
     clan=clanmember_get_clan(member);
     if ( channel[0] == '\0' ) {
      message_send_text(c,message_type_info,c,"Usage: /clan change <Channel Name>");
      return 0;
         }
     if ( clan_set_channel( clan,channel)<0 )
      message_send_text(c,message_type_error,c,"Failed to change clan channel");
      else
      message_send_text(c,message_type_info,c,"Change Clan Channel Sucsessfully");
       }
     }
    }
  }

Clan.cpp:

extern int clan_set_channel(t_clan * clan, char const *channel)
{
    t_list * cl_member_list;
    t_elem * curr;
    t_clanmember * member;
    t_account * account;
    if (!clan) {
        eventlog(eventlog_level_error, __FUNCTION__, "got NULL clan");
        return -1;
    }
    cl_member_list = clan_get_members(clan);
    LIST_TRAVERSE(cl_member_list,curr) {
        if (!(member = (t_clanmember*)elem_get_data(curr))) {
            eventlog(eventlog_level_error,__FUNCTION__,"found NULL entry in list");
            continue;
        }
        if ( clanmember_get_status(member) == CLAN_CHIEFTAIN ) {
            account= clanmember_get_account( member );
          if ( account_set_strattr(account,"status\\name",channel) ) {
           return 1;
        }
      }
    }
 return 0;
}


extern char const * clan_get_channel(t_clan * clan)
{
    t_list * cl_member_list;
    t_elem * curr;
    t_clanmember * member;
    t_account * account;
    if (!clan) {
        eventlog(eventlog_level_error, __FUNCTION__, "got NULL clan");
        return NULL;
    }
    cl_member_list = clan_get_members(clan);
    LIST_TRAVERSE(cl_member_list,curr) {
        if (!(member = (t_clanmember*)elem_get_data(curr))) {
            eventlog(eventlog_level_error,__FUNCTION__,"found NULL entry in list");
            continue;
        }
        if ( clanmember_get_status(member) == CLAN_CHIEFTAIN ) {
            account= clanmember_get_account( member );
          if ( account_get_strattr(account,"status\\name")) {
           return account_get_strattr(account,"status\\name");
        }
    }
  }
 return 0;
}

clan.hpp:

extern int clan_set_channel(t_clan * clan, const char *channel);
extern char const *clan_get_channel(t_clan * clan);


source so it fits my build, but after I try commandnya on battle.net, clan channel is not replaced

why, if there is something wrong in my source?

please help in correction  smile   smile

Thanks before ^^

2

Re: Source /Clan Change is not work

past to slashes after name
like:
if ( account_set_strattr(account,"status\\name\\",channel) ) {

3

Re: Source /Clan Change is not work

Zikoi5 wrote:

past to slashes after name
like:
if ( account_set_strattr(account,"status\\name\\",channel) ) {

english please , let me builds, the command works

smile   smile

4

Re: Source /Clan Change is not work

add code in handle_bnet.cpp > CLIENT_JOINCHANNEL_GENERIC

5

Re: Source /Clan Change is not work

where add code CLIENT_JOINCHANNEL_GENERIC ?  hmm

6

Re: Source /Clan Change is not work

case CLIENT_JOINCHANNEL_GENERIC:

        if ((user_clan = account_get_clan(account)) && (clantag = clan_get_clantag(user_clan)))
        {
            std::ostringstream ostr;
            ostr << "Clan " << clantag_to_str(clantag);
            tmpstr = ostr.str();
            cname = tmpstr.c_str();
        }

7

Re: Source /Clan Change is not work

Dante wrote:
Zeloit wrote:
case CLIENT_JOINCHANNEL_GENERIC:

        if ((user_clan = account_get_clan(account)) && (clantag = clan_get_clantag(user_clan)))
        {
            std::ostringstream ostr;
            ostr << "Clan " << clantag_to_str(clantag);
            tmpstr = ostr.str();
            cname = tmpstr.c_str();
        }

        if (prefs_get_ask_new_channel() && (!(channellist_find_channel_by_name(cname, conn_get_country(c), realm_get_name(conn_get_realm(c)))))) {
            found = 0;
            eventlog(eventlog_level_info, __FUNCTION__, "[%d] didn't find channel \"%s\" to join", conn_get_socket(c), cname);
            message_send_text(c, message_type_channeldoesnotexist, c, cname);
        }
        break;
        case CLIENT_JOINCHANNEL_GENERIC:

            if ((user_clan = account_get_clan(account)) && (clantag = clan_get_clantag(user_clan)))
            {
                std::ostringstream ostr;
                ostr << "Clan " << clantag_to_str(clantag);
                tmpstr = ostr.str();
                cname = tmpstr.c_str();
            }

is correct as well zeloit?

Ya this is correct

8

Re: Source /Clan Change is not work

i got same problem like abhy
can someone help us?

thx before

9

Re: Source /Clan Change is not work

Jimmy_Aquarius wrote:

i got same problem like abhy
can someone help us?

thx before

Thats a Factor Face

10

Re: Source /Clan Change is not work

Zeloit wrote:
case CLIENT_JOINCHANNEL_GENERIC:

        if ((user_clan = account_get_clan(account)) && (clantag = clan_get_clantag(user_clan)))
        {
            std::ostringstream ostr;
            ostr << "Clan " << clantag_to_str(clantag);
            tmpstr = ostr.str();
            cname = tmpstr.c_str();
        }

already exists but does not work

11

Re: Source /Clan Change is not work

aLbHy wrote:
Zeloit wrote:
case CLIENT_JOINCHANNEL_GENERIC:

        if ((user_clan = account_get_clan(account)) && (clantag = clan_get_clantag(user_clan)))
        {
            std::ostringstream ostr;
            ostr << "Clan " << clantag_to_str(clantag);
            tmpstr = ostr.str();
            cname = tmpstr.c_str();
        }

already exists but does not work

I have same problem

12

Re: Source /Clan Change is not work

Satria wrote:
aLbHy wrote:
Zeloit wrote:
case CLIENT_JOINCHANNEL_GENERIC:

        if ((user_clan = account_get_clan(account)) && (clantag = clan_get_clantag(user_clan)))
        {
            std::ostringstream ostr;
            ostr << "Clan " << clantag_to_str(clantag);
            tmpstr = ostr.str();
            cname = tmpstr.c_str();
        }

already exists but does not work

I have same problem

else if (clanmember_get_status(member) == CLAN_CHIEFTAIN) {
    if (strstart(text, "change") == 0) {
        const char * channel = skip_command(text);
        clan = clanmember_get_clan(member);
        if (channel[0] == '\0') {
            message_send_text(c, message_type_info, c, "Use: /clan change <Nombre Del Canal>");
            return 0;
        }
        if (clan_set_channel(clan, channel)<0)
            message_send_text(c, message_type_error, c, "Error al cambiar el canal de clan");
    }
    else
        snprintf(msgtemp, sizeof(msgtemp), " Cambio de canal de Clan se realizo con exito!");
        message_send_text(c, message_type_info, c, msgtemp);
    }

13

Re: Source /Clan Change is not work

anyone can help this?

14

Re: Source /Clan Change is not work

Jimmy_Aquarius wrote:

anyone can help this?

I can't

15

Re: Source /Clan Change is not work

forums.harpywar.com/viewtopic.php?id=909

Posts: 15

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 → Source /Clan Change is not work