Freeciv-3.2: /fast/freeciv/nightly/S3_2/server/scripting/api_server_notify.c Source File

Freeciv-3.2

Loading...
Searching...
No Matches
api_server_notify.c
Go to the documentation of this file.
1/*****************************************************************************
2 Freeciv - Copyright (C) 2005 - The Freeciv Project
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
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18/* common */
19#include "featured_text.h"
20#include "research.h"
21
22/* common/scriptcore */
23#include "luascript.h"
24
25/* server */
26#include "notify.h"
27
28#include "api_server_notify.h"
29
30
31/**********************************************************************/
34 void api_notify_embassies_msg(lua_State *L, Player *pplayer, Tile *ptile,
35 int event, const char *message)
36{
37 LUASCRIPT_CHECK_STATE(L);
38
39 notify_embassies(pplayer, ptile, event, ftc_any, "%s", message);
40}
41
42/**********************************************************************/
45 void api_notify_event_msg(lua_State *L, Player *pplayer, Tile *ptile,
46 int event, const char *message)
47{
48 LUASCRIPT_CHECK_STATE(L);
49
50 notify_player(pplayer, ptile, event, ftc_any, "%s", message);
51}
52
53/**********************************************************************/
56 void api_notify_research_msg(lua_State *L, Player *pplayer,
57 bool include_plr,
58 int event, const char *message)
59{
60 struct research *pres;
61
62 LUASCRIPT_CHECK_STATE(L);
63
64 pres = research_get(pplayer);
65
66 notify_research(pres, include_plr ? NULL : pplayer, event,
67 ftc_any, "%s", message);
68}
69
70/**********************************************************************/
73 void api_notify_research_embassies_msg(lua_State *L, Player *pplayer,
74 int event, const char *message)
75{
76 struct research *pres;
77
78 LUASCRIPT_CHECK_STATE(L);
79
80 pres = research_get(pplayer);
81
82 notify_research_embassies(pres, NULL, event, ftc_any, "%s", message);
83}
api_notify_event_msg
void api_notify_event_msg(lua_State *L, Player *pplayer, Tile *ptile, int event, const char *message)
Definition api_server_notify.c:45
api_notify_embassies_msg
void api_notify_embassies_msg(lua_State *L, Player *pplayer, Tile *ptile, int event, const char *message)
Definition api_server_notify.c:34
api_notify_research_embassies_msg
void api_notify_research_embassies_msg(lua_State *L, Player *pplayer, int event, const char *message)
Definition api_server_notify.c:73
api_notify_research_msg
void api_notify_research_msg(lua_State *L, Player *pplayer, bool include_plr, int event, const char *message)
Definition api_server_notify.c:56
api_server_notify.h
incite_cost
char * incite_cost
Definition comments.c:74
event
enum event_type event
Definition events.c:81
ftc_any
const struct ft_color ftc_any
Definition featured_text.c:73
featured_text.h
luascript.h
LUASCRIPT_CHECK_STATE
#define LUASCRIPT_CHECK_STATE(L,...)
Definition luascript.h:117
notify_research
void notify_research(const struct research *presearch, const struct player *exclude, enum event_type event, const struct ft_color color, const char *format,...)
Definition notify.c:394
notify_player
void notify_player(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
Definition notify.c:292
notify_research_embassies
void notify_research_embassies(const struct research *presearch, const struct player *exclude, enum event_type event, const struct ft_color color, const char *format,...)
Definition notify.c:434
notify_embassies
void notify_embassies(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
Definition notify.c:316
notify.h
research_get
struct research * research_get(const struct player *pplayer)
Definition research.c:128
research.h
message
Definition messagewin_common.h:29
player
Definition player.h:247
research
Definition research.h:39
tile
Definition tile.h:50