56 const struct tile *ptile,
126 const char *format, ...)
148 const struct tile *ptile,
169 const struct tile *ptile,
172 const char *format, ...)
239 const struct tile *ptile,
242 const char *format, ...)
264 const struct tile *ptile,
267 const char *format, ...)
292 const struct tile *ptile,
295 const char *format, ...)
316 const struct tile *ptile,
319 const char *format, ...)
331 && pplayer != other_player) {
346 const struct tile *ptile,
349 const char *format, ...)
394 const struct player *exclude,
397 const char *format, ...)
434 const struct player *exclude,
437 const char *format, ...)
484#define SPECLIST_TAG event_cache_data
485#define SPECLIST_TYPE struct event_cache_data
487#define event_cache_iterate(pdata) \
488 TYPED_LIST_ITERATE(struct event_cache_data, event_cache, pdata)
489#define event_cache_iterate_end LIST_ITERATE_END
609 while (current !=
NULL
646 const struct player *pplayer)
648 if (
NULL == pplayer) {
682 if (
NULL != players) {
704 const struct player *pplayer)
706 if (
NULL == players) {
711 if (
NULL != pplayer) {
722 const struct player *pplayer,
736 switch (
pdata->target_type) {
740 return (
NULL != pplayer
814 log_verbose(
"[Event cache %4d] Missing event type.",
i);
819 log_verbose(
"[Event cache %4d] Not supported event type: %s",
i, p);
837 packet.
phase = phase;
840 "%s.events%d.timestamp",
845 log_verbose(
"[Event cache %4d] Missing server state info.",
i);
850 log_verbose(
"[Event cache %4d] Server state no supported: %s",
i, p);
856 log_verbose(
"[Event cache %4d] Missing target info.",
i);
870 }
else if (
'0' != *
q) {
879 if (!valid &&
NULL == players) {
880 log_verbose(
"[Event cache %4d] invalid target bitmap: %s",
i, p);
881 if (
NULL != players) {
889 target_type, players);
891 if (
NULL != players) {
941 switch (
pdata->target_type) {
953 fc_snprintf(target,
sizeof(target),
"Global Observers");
980 if (
pdata->packet.phase >= 0) {
#define BV_ISSET(bv, bit)
#define BV_ISSET_ANY(vec)
struct player * conn_get_player(const struct connection *pconn)
bool conn_is_global_observer(const struct connection *pconn)
#define conn_list_iterate(connlist, pconn)
#define conn_list_iterate_end
#define PHASE_INVALIDATED
#define MAX_NUM_PLAYER_SLOTS
char * capitalized_string(const char *str)
bool is_capitalization_enabled(void)
void free_capitalized(char *str)
size_t featured_text_apply_tag(const char *text_source, char *featured_text, size_t featured_text_len, enum text_tag_type tag_type, ft_offset_t start_offset, ft_offset_t stop_offset,...)
static bool ft_color_requested(const struct ft_color color)
#define GAME_MAX_EVENT_CACHE_MAX_SIZE
#define fc_assert_ret(condition)
#define log_verbose(message,...)
#define fc_assert_ret_val(condition, val)
bool is_normal_map_pos(int x, int y)
struct tile * index_to_tile(const struct civ_map *imap, int mindex)
static int map_pos_to_index(struct civ_map *nmap, int map_x, int map_y)
#define index_to_map_pos(pmap_x, pmap_y, mindex)
bool map_is_known(const struct tile *ptile, const struct player *pplayer)
void notify_research(const struct research *presearch, const struct player *exclude, enum event_type event, const struct ft_color color, const char *format,...)
#define event_cache_iterate(pdata)
void notify_player(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
void event_cache_remove_old(void)
void send_pending_events(struct connection *pconn, bool include_public)
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 event_cache_load(struct section_file *file, const char *section)
void notify_research_embassies(const struct research *presearch, const struct player *exclude, enum event_type event, const struct ft_color color, const char *format,...)
static struct event_cache_data * event_cache_data_new(const struct packet_chat_msg *packet, time_t timestamp, enum server_states server_status, enum event_cache_target target_type, struct event_cache_players *players)
void notify_conn(struct conn_list *dest, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
void vpackage_event(struct packet_chat_msg *packet, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format, va_list vargs)
void notify_team(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
void notify_embassies(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
static void notify_conn_packet(struct conn_list *dest, const struct packet_chat_msg *packet, bool early)
void package_event(struct packet_chat_msg *packet, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
void event_cache_clear(void)
void event_cache_free(void)
void event_cache_phases_invalidate(void)
void notify_conn_early(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)
static void package_event_full(struct packet_chat_msg *packet, const struct tile *ptile, enum event_type event, const struct connection *pconn, const struct ft_color color, const char *format, va_list vargs)
static bool event_cache_match(const struct event_cache_data *pdata, const struct player *pplayer, bool is_global_observer, bool include_public)
static void event_cache_data_free(struct event_cache_data *data)
void event_cache_add_for_player(const struct packet_chat_msg *packet, const struct player *pplayer)
void vpackage_chat_msg(struct packet_chat_msg *packet, const struct connection *sender, const struct ft_color color, const char *format, va_list vargs)
#define event_cache_iterate_end
static bool event_cache_status
void event_cache_add_for_all(const struct packet_chat_msg *packet)
void event_cache_save(struct section_file *file, const char *section)
static struct event_cache_data_list * event_cache
void event_cache_init(void)
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)
int send_packet_early_chat_msg(struct connection *pc, const struct packet_early_chat_msg *packet)
bool players_on_same_team(const struct player *pplayer1, const struct player *pplayer2)
bool team_has_embassy(const struct team *pteam, const struct player *tgt_player)
int player_index(const struct player *pplayer)
#define players_iterate_end
#define players_iterate(_pplayer)
const char * secfile_lookup_str(const struct section_file *secfile, const char *path,...)
int secfile_lookup_int_default(const struct section_file *secfile, int def, const char *path,...)
#define secfile_insert_int(secfile, value, path,...)
#define secfile_insert_str(secfile, string, path,...)
struct research * research_get(const struct player *pplayer)
#define research_players_iterate(_presearch, _pplayer)
#define research_players_iterate_end
enum server_states server_state(void)
struct conn_list * est_connections
struct packet_game_info info
struct civ_game::@32::@36::@38 event_cache
struct civ_game::@32::@36 server
enum server_states server_state
struct packet_chat_msg packet
enum event_cache_target target_type
char message[MAX_LEN_MSG]
struct conn_list * connections
int fc_snprintf(char *str, size_t n, const char *format,...)
int fc_strcasecmp(const char *str0, const char *str1)
struct tm * fc_localtime(const time_t *timep, struct tm *result)
int fc_vsnprintf(char *str, size_t n, const char *format, va_list ap)
#define sz_strlcpy(dest, src)