41#define MAX_LEN_CHAT_NAME (2*MAX_LEN_NAME+10)
46 const char *format, ...)
86 const char *format, ...)
109 _(
"%s is an ambiguous player name-prefix."),
name);
113 _(
"%s is an ambiguous connection name-prefix."),
name);
117 _(
"%s is an anonymous name. Use connection name."),
name);
136 _(
"You cannot send messages to %s; you are ignored."),
169 if (!
pconn->observer) {
173 _(
"You cannot send messages to %s; you are ignored."),
330 if (*
cp ==
'\n' || *
cp ==
'\r') {
335 if (*
cp ==
'<' || *
cp ==
'>' || *
cp ==
'"' || *
cp ==
'\'') {
360 _(
"You are not attached to a player."));
457 _(
"There is no connection by the name %s."),
name);
460 _(
"There is no player nor connection by the name %s."),
#define CHAT_DIRECT_PREFIX
#define CHAT_ALLIES_PREFIX
#define SERVER_COMMAND_PREFIX
struct connection * conn_by_user_prefix(const char *user_name, enum m_pre_result *result)
bool conn_is_global_observer(const struct connection *pconn)
bool conn_pattern_list_match(const struct conn_pattern_list *plist, const struct connection *pconn)
#define conn_list_iterate(connlist, pconn)
#define conn_list_iterate_end
void con_write(enum rfc_status rfc_status, const char *message,...)
const struct ft_color ftc_chat_private
const struct ft_color ftc_server
const struct ft_color ftc_warning
const struct ft_color ftc_chat_public
const struct ft_color ftc_chat_ally
static void static bool conn_is_ignored(const struct connection *sender, const struct connection *dest)
static void complain_ambiguous(struct connection *pconn, const char *name, int player_conn)
static void chat_msg_to_player(struct connection *sender, struct player *pdest, char *msg)
static void form_chat_name(struct connection *pconn, char *buffer, size_t len)
#define MAX_LEN_CHAT_NAME
static void send_chat_msg(struct connection *pconn, const struct connection *sender, const struct ft_color color, const char *format,...) fc__attribute((__format__(__printf__
static void chat_msg_to_all(struct connection *sender, char *msg)
static void chat_msg_to_allies(struct connection *sender, char *msg)
static void chat_msg_to_global_observers(struct connection *sender, char *msg)
void handle_chat_msg_req(struct connection *pconn, const char *message)
static void chat_msg_to_conn(struct connection *sender, struct connection *dest, char *msg)
#define log_error(message,...)
void package_chat_msg(struct packet_chat_msg *packet, const struct connection *sender, const struct ft_color color, const char *format,...)
void event_cache_add_for_players(const struct packet_chat_msg *packet, struct event_cache_players *players)
struct event_cache_players * event_cache_player_add(struct event_cache_players *players, const struct player *pplayer)
void notify_conn(struct conn_list *dest, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
void event_cache_add_for_global_observers(const struct packet_chat_msg *packet)
void vpackage_chat_msg(struct packet_chat_msg *packet, const struct connection *sender, const struct ft_color color, const char *format, va_list vargs)
void event_cache_add_for_all(const struct packet_chat_msg *packet)
void lsend_packet_chat_msg(struct conn_list *dest, const struct packet_chat_msg *packet)
int send_packet_chat_msg(struct connection *pc, const struct packet_chat_msg *packet)
struct player * player_by_name_prefix(const char *name, enum m_pre_result *result)
const char * player_name(const struct player *pplayer)
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
#define players_iterate_end
#define players_iterate(_pplayer)
char * skip_leading_spaces(char *s)
bool handle_stdin_input(struct connection *caller, char *str)
struct conn_list * est_connections
char message[MAX_LEN_MSG]
int fc_snprintf(char *str, size_t n, const char *format,...)
size_t fc_strlcpy(char *dest, const char *src, size_t n)
#define sz_strlcpy(dest, src)