~ubuntu-branches/debian/squeeze/freeciv/squeeze

« back to all changes in this revision

Viewing changes to server/notify.h

  • Committer: Bazaar Package Importer
  • Author(s): Clint Adams, Karl Goetz, Clint Adams
  • Date: 2010-02-23 22:09:02 UTC
  • mfrom: (1.2.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20100223220902-kiyrmr9i4152cka5
Tags: 2.2.0-1
[ Karl Goetz ]
* Remove civserver files in /etc/ggzd/ (Closes: 523772, 517787)
* Adding ${misc:Depends} to all binary packages (lintian warnings)

[ Clint Adams ]
* New upstream version.
  - Drop data_dsc_use_bindir.diff (binary pathnames have changed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
30
void package_chat_msg(struct packet_chat_msg *packet,
 
31
                      const struct connection *sender,
 
32
                      const struct ft_color color,
 
33
                      const char *format, ...)
 
34
                      fc__attribute((__format__ (__printf__, 4, 5)));
 
35
void vpackage_chat_msg(struct packet_chat_msg *packet,
 
36
                       const struct connection *sender,
 
37
                       const struct ft_color color,
 
38
                       const char *format,
 
39
                       va_list vargs);
 
40
void vpackage_event(struct packet_chat_msg *packet,
 
41
                    const struct tile *ptile,
 
42
                    enum event_type event,
 
43
                    const struct ft_color color,
 
44
                    const char *format,
 
45
                    va_list vargs);
 
46
 
 
47
void notify_conn(struct conn_list *dest,
 
48
                 const struct tile *ptile,
 
49
                 enum event_type event,
 
50
                 const struct ft_color color,
 
51
                 const char *format, ...)
 
52
                 fc__attribute((__format__ (__printf__, 5, 6)));
 
53
void notify_player(const struct player *pplayer,
 
54
                   const struct tile *ptile,
 
55
                   enum event_type event,
 
56
                   const struct ft_color color,
 
57
                   const char *format, ...)
 
58
                   fc__attribute((__format__ (__printf__, 5, 6)));
 
59
void notify_embassies(const struct player *pplayer,
 
60
                      const struct player *exclude,
 
61
                      const struct tile *ptile,
 
62
                      enum event_type event,
 
63
                      const struct ft_color color,
 
64
                      const char *format, ...)
 
65
                      fc__attribute((__format__ (__printf__, 6, 7)));
 
66
void notify_team(const struct player *pplayer,
 
67
                 const struct tile *ptile,
 
68
                 enum event_type event,
 
69
                 const struct ft_color color,
 
70
                 const char *format, ...)
 
71
                 fc__attribute((__format__ (__printf__, 5, 6)));
 
72
void notify_research(const struct player *pplayer,
 
73
                     enum event_type event,
 
74
                     const struct ft_color color,
 
75
                     const char *format, ...)
 
76
                     fc__attribute((__format__ (__printf__, 4, 5)));
 
77
 
 
78
/* Event cache. */
 
79
 
 
80
/* The type of event target. */
 
81
struct event_cache_players;
 
82
 
 
83
void event_cache_init(void);
 
84
void event_cache_free(void);
 
85
void event_cache_remove_old(void);
 
86
 
 
87
void event_cache_add_for_all(const struct packet_chat_msg *packet);
 
88
void event_cache_add_for_global_observers(const struct packet_chat_msg *packet);
 
89
void event_cache_add_for_player(const struct packet_chat_msg *packet,
 
90
                                const struct player *pplayer);
 
91
struct event_cache_players *
 
92
event_cache_player_add(struct event_cache_players *players,
 
93
                       const struct player *pplayer)
 
94
                       fc__attribute((warn_unused_result));
 
95
void event_cache_add_for_players(const struct packet_chat_msg *packet,
 
96
                                 struct event_cache_players *players);
 
97
 
 
98
void send_pending_events(struct connection *pconn, bool include_public);
 
99
 
 
100
struct section_file;
 
101
void event_cache_load(struct section_file *file, const char *section);
 
102
void event_cache_save(struct section_file *file, const char *section);
 
103
 
 
104
#endif  /* FC__NOTIFY_H */