Freeciv-3.3: /fast/freeciv/nightly/main/server/notify.h Source File

Freeciv-3.3

Loading...
Searching...
No Matches
notify.h
Go to the documentation of this file.
1/**********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13#ifndef FC__NOTIFY_H
14#define FC__NOTIFY_H
15
16#include <stdarg.h>
17
18/* utility */
19#include "support.h" /* fc__attribute */
20
21/* common */
22#include "events.h"
23#include "fc_types.h"
24#include "featured_text.h" /* ftc_*: color pre-definitions. */
25#include "packets.h"
26
27/* server */
28#include "srv_main.h" /* enum server_states */
29
30struct research;
31
32
33 void package_chat_msg(struct packet_chat_msg *packet,
34 const struct connection *sender,
35 const struct ft_color color,
36 const char *format, ...)
37 fc__attribute((__format__ (__printf__, 4, 5)));
38void vpackage_chat_msg(struct packet_chat_msg *packet,
39 const struct connection *sender,
40 const struct ft_color color,
41 const char *format,
42 va_list vargs);
43 void package_event(struct packet_chat_msg *packet,
44 const struct tile *ptile,
45 enum event_type event,
46 const struct ft_color color,
47 const char *format, ...)
48 fc__attribute((__format__ (__printf__, 5, 6)));
49void vpackage_event(struct packet_chat_msg *packet,
50 const struct tile *ptile,
51 enum event_type event,
52 const struct ft_color color,
53 const char *format,
54 va_list vargs);
55
56 void notify_conn(struct conn_list *dest,
57 const struct tile *ptile,
58 enum event_type event,
59 const struct ft_color color,
60 const char *format, ...)
61 fc__attribute((__format__ (__printf__, 5, 6)));
62 void notify_conn_early(struct conn_list *dest,
63 const struct tile *ptile,
64 enum event_type event,
65 const struct ft_color color,
66 const char *format, ...)
67 fc__attribute((__format__ (__printf__, 5, 6)));
68 void notify_player(const struct player *pplayer,
69 const struct tile *ptile,
70 enum event_type event,
71 const struct ft_color color,
72 const char *format, ...)
73 fc__attribute((__format__ (__printf__, 5, 6)));
74 void notify_embassies(const struct player *pplayer,
75 const struct tile *ptile,
76 enum event_type event,
77 const struct ft_color color,
78 const char *format, ...)
79 fc__attribute((__format__ (__printf__, 5, 6)));
80 void notify_team(const struct player *pplayer,
81 const struct tile *ptile,
82 enum event_type event,
83 const struct ft_color color,
84 const char *format, ...)
85 fc__attribute((__format__ (__printf__, 5, 6)));
86 void notify_research(const struct research *presearch,
87 const struct player *exclude,
88 enum event_type event,
89 const struct ft_color color,
90 const char *format, ...)
91 fc__attribute((__format__ (__printf__, 5, 6)));
92 void notify_research_embassies(const struct research *presearch,
93 const struct player *exclude,
94 enum event_type event,
95 const struct ft_color color,
96 const char *format, ...)
97 fc__attribute((__format__ (__printf__, 5, 6)));
98
99/* Event cache. */
100
101/* The type of event target. */
102 struct event_cache_players;
103
104void event_cache_init(void);
105void event_cache_free(void);
106void event_cache_clear(void);
107void event_cache_remove_old(void);
108
109void event_cache_add_for_all(const struct packet_chat_msg *packet);
110void event_cache_add_for_global_observers(const struct packet_chat_msg *packet);
111void event_cache_add_for_player(const struct packet_chat_msg *packet,
112 const struct player *pplayer);
113 struct event_cache_players *
114 event_cache_player_add(struct event_cache_players *players,
115 const struct player *pplayer)
116 fc__warn_unused_result;
117void event_cache_add_for_players(const struct packet_chat_msg *packet,
118 struct event_cache_players *players);
119
120void send_pending_events(struct connection *pconn, bool include_public);
121
122void event_cache_phases_invalidate(void);
123
124 struct section_file;
125void event_cache_load(struct section_file *file, const char *section);
126void event_cache_save(struct section_file *file, const char *section);
127
128#endif /* FC__NOTIFY_H */
incite_cost
char * incite_cost
Definition comments.c:74
event
enum event_type event
Definition events.c:81
events.h
fc_types.h
featured_text.h
notify_player
void void void notify_player(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...) fc__attribute((__format__(__printf__
event_cache_remove_old
void event_cache_remove_old(void)
Definition notify.c:603
notify_research
void void void void void void notify_research(const struct research *presearch, const struct player *exclude, enum event_type event, const struct ft_color color, const char *format,...) fc__attribute((__format__(__printf__
send_pending_events
void send_pending_events(struct connection *pconn, bool include_public)
Definition notify.c:754
event_cache_add_for_players
void event_cache_add_for_players(const struct packet_chat_msg *packet, struct event_cache_players *players)
Definition notify.c:672
notify_embassies
void void void void notify_embassies(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...) fc__attribute((__format__(__printf__
event_cache_load
void event_cache_load(struct section_file *file, const char *section)
Definition notify.c:784
vpackage_chat_msg
void void vpackage_chat_msg(struct packet_chat_msg *packet, const struct connection *sender, const struct ft_color color, const char *format, va_list vargs)
Definition notify.c:104
notify_conn_early
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,...) fc__attribute((__format__(__printf__
package_chat_msg
void package_chat_msg(struct packet_chat_msg *packet, const struct connection *sender, const struct ft_color color, const char *format,...) fc__attribute((__format__(__printf__
notify_research_embassies
void void void void void void void notify_research_embassies(const struct research *presearch, const struct player *exclude, enum event_type event, const struct ft_color color, const char *format,...) fc__attribute((__format__(__printf__
notify_team
void void void void void notify_team(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...) fc__attribute((__format__(__printf__
vpackage_event
void 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)
Definition notify.c:147
event_cache_clear
void event_cache_clear(void)
Definition notify.c:595
event_cache_free
void event_cache_free(void)
Definition notify.c:583
event_cache_phases_invalidate
void event_cache_phases_invalidate(void)
Definition notify.c:978
event_cache_add_for_global_observers
void event_cache_add_for_global_observers(const struct packet_chat_msg *packet)
Definition notify.c:631
notify_conn
void notify_conn(struct conn_list *dest, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...) fc__attribute((__format__(__printf__
event_cache_add_for_player
void event_cache_add_for_player(const struct packet_chat_msg *packet, const struct player *pplayer)
Definition notify.c:646
event_cache_player_add
struct event_cache_players * event_cache_player_add(struct event_cache_players *players, const struct player *pplayer) fc__warn_unused_result
Definition notify.c:704
event_cache_add_for_all
void event_cache_add_for_all(const struct packet_chat_msg *packet)
Definition notify.c:620
package_event
void package_event(struct packet_chat_msg *packet, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...) fc__attribute((__format__(__printf__
event_cache_save
void event_cache_save(struct section_file *file, const char *section)
Definition notify.c:904
event_cache_init
void event_cache_init(void)
Definition notify.c:571
packets.h
srv_main.h
color
Definition colors.h:21
connection
Definition connection.h:136
event_cache_players
Definition notify.c:492
ft_color
Definition featured_text.h:141
packet_chat_msg
Definition packets_gen.h:296
player
Definition player.h:249
research
Definition research.h:39
section_file
Definition section_file.h:36
section
Definition section_file.h:28
tile
Definition tile.h:50
support.h
fc__attribute
#define fc__attribute(x)
Definition support.h:99
fc__warn_unused_result
#define fc__warn_unused_result
Definition support.h:109