Crossfire Server, Trunk
|
#include <cfnewspaper.h>
#include <stdarg.h>
#include <cfnewspaper_proto.h>
#include <sqlite3.h>
#include <stdlib.h>
#include <string.h>
#include <svnversion.h>
Go to the source code of this file.
Data Structures | |
struct | kill_format |
struct | paper_properties |
Typedefs | |
typedef struct kill_format | kill_format |
typedef struct paper_properties | paper_properties |
Functions | |
CF_PLUGIN int | cfnewspaper_globalEventListener (int *type,...) |
CF_PLUGIN int | cfnewspaper_runPluginCommand (object *op, char *params) |
CF_PLUGIN int | closePlugin (void) |
static void | do_kills (char *buffer, int size, time_t start, time_t end, const char *reg, kill_format *format) |
static void | do_region (region *reg, char *buffer, int size, time_t start, time_t end) |
static void | do_region_kills (region *reg, char *buffer, int size, time_t start, time_t end) |
static void | do_sql (const char *sql, sqlite3 *base) |
static void | do_world (char *buffer, int size, time_t start, time_t end) |
static void | do_world_kills (char *buffer, int size, time_t start, time_t end) |
CF_PLUGIN int | eventListener (int *type,...) |
static void | format_time (timeofday_t *tod, char *buffer, int size) |
static paper_properties * | get_newspaper (const char *name) |
static void | get_newspaper_content (object *paper, paper_properties *properties, region *reg) |
static int | get_region_id (region *reg) |
CF_PLUGIN void * | getPluginProperty (int *type,...) |
CF_PLUGIN int | initPlugin (const char *iversion, f_plug_api gethooksptr) |
static void | news_cat (char *buffer, int size, const char *format,...) |
CF_PLUGIN int | postInitPlugin (void) |
static void | read_parameters (void) |
Variables | |
static paper_properties | default_properties |
f_plug_api | gethook |
static sqlite3 * | logger_database |
static sqlite3 * | newspaper_database |
f_plug_api | reCmp |
f_plug_api | registerGlobalEvent |
CF_PLUGIN char | SvnRevPlugin [] = SVN_REV |
f_plug_api | unregisterGlobalEvent |
typedef struct kill_format kill_format |
typedef struct paper_properties paper_properties |
CF_PLUGIN int cfnewspaper_globalEventListener | ( | int * | type, |
... | |||
) |
Definition at line 137 of file cfnewspaper.c.
References make_face_from_files::args, and is_valid_types_gen::type.
Definition at line 133 of file cfnewspaper.c.
CF_PLUGIN int closePlugin | ( | void | ) |
Close the plugin.
Closes the sqlite database.
Definition at line 400 of file cfnewspaper.c.
References cf_log(), llevInfo, logger_database, newspaper_database, and PLUGIN_VERSION.
|
static |
Definition at line 219 of file cfnewspaper.c.
References cf_log(), llevError, logger_database, kill_format::many_monster_death, kill_format::many_player_death, navar-midane_pickup::msg, news_cat(), kill_format::no_monster_death, kill_format::no_player_death, kill_format::one_monster_death, kill_format::one_player_death, PLUGIN_NAME, and diamondslots::results.
Referenced by do_region_kills(), and do_world_kills().
|
static |
Definition at line 286 of file cfnewspaper.c.
References do_region_kills(), regiondef::name, and news_cat().
Referenced by get_newspaper_content().
|
static |
Definition at line 268 of file cfnewspaper.c.
References do_kills(), get_region_id(), kill_format::many_monster_death, kill_format::many_player_death, kill_format::no_monster_death, kill_format::no_player_death, kill_format::one_monster_death, kill_format::one_player_death, and python_pickup::where.
Referenced by do_region().
|
static |
Definition at line 53 of file cfnewspaper.c.
References cf_log(), llevError, navar-midane_pickup::msg, and PLUGIN_NAME.
Referenced by get_region_id().
|
static |
Definition at line 304 of file cfnewspaper.c.
References do_world_kills(), and news_cat().
Referenced by get_newspaper_content().
|
static |
Definition at line 292 of file cfnewspaper.c.
References do_kills(), kill_format::many_monster_death, kill_format::many_player_death, kill_format::no_monster_death, kill_format::no_player_death, kill_format::one_monster_death, and kill_format::one_player_death.
Referenced by do_world().
CF_PLUGIN int eventListener | ( | int * | type, |
... | |||
) |
Handles an object-related event. Doesn't do anything.
type | ignored. |
Definition at line 351 of file cfnewspaper.c.
References diamondslots::activator, make_face_from_files::args, cf_create_object_by_name(), cf_map_get_region_property(), cf_object_insert_object(), cf_object_set_string_property(), CFAPI_MAP_PROP_REGION, CFAPI_OBJECT_PROP_NAME, CFAPI_OBJECT_PROP_NAME_PLURAL, animate::event, EVENT_APPLY, get_newspaper(), get_newspaper_content(), paper_properties::name, is_valid_types_gen::type, and autojail::who.
|
static |
Definition at line 91 of file cfnewspaper.c.
References _timeofday::day, _timeofday::hour, _timeofday::minute, _timeofday::month, and _timeofday::year.
Referenced by get_newspaper_content().
|
static |
Definition at line 204 of file cfnewspaper.c.
References default_properties.
Referenced by eventListener().
|
static |
Definition at line 310 of file cfnewspaper.c.
References cf_get_time(), cf_log(), cf_object_set_string_property(), CFAPI_OBJECT_PROP_MESSAGE, givecontents::contents, send::date, do_region(), do_world(), format_time(), llevError, logger_database, navar-midane_pickup::msg, PLUGIN_NAME, properties, and diamondslots::results.
Referenced by eventListener().
|
static |
Definition at line 67 of file cfnewspaper.c.
References do_sql(), diamondslots::id, is_valid_types_gen::line, logger_database, and regiondef::name.
Referenced by do_region_kills().
CF_PLUGIN void* getPluginProperty | ( | int * | type, |
... | |||
) |
Gets a plugin property.
type | ignored. |
Definition at line 104 of file cfnewspaper.c.
References make_face_from_files::args, buf, PLUGIN_NAME, PLUGIN_VERSION, and is_valid_types_gen::type.
CF_PLUGIN int initPlugin | ( | const char * | iversion, |
f_plug_api | gethooksptr | ||
) |
Plugin initialisation function.
iversion | server version. |
gethooksptr | function to get the hooks. |
Main plugin entry point.
iversion | server version. |
gethooksptr | function to get hooks from. |
Definition at line 98 of file cfnewspaper.c.
References cf_init_plugin(), cf_log(), llevInfo, and PLUGIN_VERSION.
|
static |
Definition at line 208 of file cfnewspaper.c.
References make_face_from_files::args.
Referenced by do_kills(), do_region(), and do_world().
CF_PLUGIN int postInitPlugin | ( | void | ) |
Plugin was initialized, now to finish.
Registers events, initializes the database.
Definition at line 152 of file cfnewspaper.c.
References cf_get_directory(), cf_log(), llevError, llevInfo, logger_database, newspaper_database, python_init::path, PLUGIN_NAME, PLUGIN_VERSION, and read_parameters().
|
static |
Definition at line 95 of file cfnewspaper.c.
Referenced by postInitPlugin().
|
static |
Definition at line 189 of file cfnewspaper.c.
Referenced by get_newspaper().
f_plug_api gethook |
Definition at line 41 of file cfnewspaper.c.
|
static |
Definition at line 49 of file cfnewspaper.c.
Referenced by closePlugin(), do_kills(), get_newspaper_content(), get_region_id(), and postInitPlugin().
|
static |
Definition at line 51 of file cfnewspaper.c.
Referenced by closePlugin(), and postInitPlugin().
f_plug_api reCmp |
Definition at line 47 of file cfnewspaper.c.
f_plug_api registerGlobalEvent |
Definition at line 43 of file cfnewspaper.c.
Definition at line 39 of file cfnewspaper.c.
f_plug_api unregisterGlobalEvent |
Definition at line 45 of file cfnewspaper.c.