Topic: Изменить красный цвет текста announce
https://forums.pvpgn.pro/viewtopic.php?id=577
тут тема про Announce, при вводе команд работает текст красный и тд.
extern void channel_message_send(t_channel const * channel, t_message_type type, t_connection * me, char const * text)
{
t_connection * c;
unsigned int heard;
char const * tname;
t_message * message1; //send to people with clienttag matching channel clienttag
// or everyone when channel has no clienttag set
t_message * message2; //send to people with clienttag not matching channel clienttag
t_message * message_to_send;
t_account * acc;
if (!channel)
{
eventlog(eventlog_level_error,__FUNCTION__,"got NULL channel");
return;
}
if (!me)
{
eventlog(eventlog_level_error,__FUNCTION__,"got NULL connection");
return;
}
acc = conn_get_account(me);
if(channel_get_flags(channel) & channel_flags_thevoid) // no talking in the void
if (type!=message_type_join && type!=message_type_part)
return;
// if user muted
if (account_get_auth_mute(acc) == 1)
{
char msgtemp[MAX_MESSAGE_LEN], msgtemp2[MAX_MESSAGE_LEN];
snprintf(msgtemp, sizeof(msgtemp), "You can't talk on the channel. Your account has been muted%s", account_get_locktext(acc, true));
message_send_text(me, message_type_error, me, msgtemp);
return;
}
if(channel_get_flags(channel) & channel_flags_moderated) // moderated channel - only admins,OPs and voices may talk
{
if (type==message_type_talk || type==message_type_emote)
{
if (!((account_is_operator_or_admin(acc,channel_get_name(channel))) ||
(channel_conn_has_tmpVOICE(channel,me)) || (account_get_auth_voice(acc,channel_get_name(channel)) == 1)))
{
message_send_text(me,message_type_error,me,"This channel is moderated");
return;
}
}
}
if (!channel->clienttag){
if (!(message1 = message_create(type,me,text)))
{
eventlog(eventlog_level_error,__FUNCTION__,"could not create message1");
return;
}
message2 = NULL;
} else {
if (!(message1 = message_create(type,me,text)))
{
eventlog(eventlog_level_error,__FUNCTION__,"could not create message1");
return;
}
if (!(message2 = message_create(type,me,text)))
{
eventlog(eventlog_level_error,__FUNCTION__,"could not create message2");
message_destroy(message1);
return;
}
}
heard = 0;
tname = conn_get_chatname(me);
for (c=channel_get_first(channel); c; c=channel_get_next())
{
if (c==me && (type==message_type_talk || type==message_type_gameopt_talk))
continue; /* ignore ourself */
if (c==me && (!conn_is_irc_variant(c)) && type==message_type_part)
continue; /* only on irc we need to inform ourself about leaving the channel */
if (c!=me && (!conn_is_irc_variant(c)) && (channel_get_flags(channel) & channel_flags_thevoid) && (type==message_type_join || type==message_type_part))
continue; /* make sure we even get join part information about self in The Void */
if ((type==message_type_talk || type==message_type_whisper || type==message_type_emote || type==message_type_broadcast) &&
conn_check_ignoring(c,tname)==1)
continue; /* ignore squelched players */
if (!channel->clienttag || channel->clienttag==conn_get_clienttag(c)) {
message_to_send = message1;
} else {
message_to_send = message2;
}
if (message_send(message_to_send,c)==0 && c!=me)
heard = 1;
}
conn_unget_chatname(me,tname);
message_destroy(message1);
if (message2)
message_destroy(message2);
if ((conn_get_wol(me) == 0))
{
if (!heard && (type==message_type_talk || type==message_type_emote))
message_send_text(me,message_type_info,me,"No one hears you.");
}
}
можно ли тут заменить красный и тд цвета?
то где править