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
Thanks before ^^