Go to the documentation of this file.
53 static void do_sql(
const char *sql, sqlite3 *base) {
60 err = sqlite3_exec(base, sql, NULL, NULL, &
msg);
61 if (err != SQLITE_OK) {
70 int nrow, ncolumn,
id;
75 sql = sqlite3_mprintf(
"select reg_id from region where reg_name='%q'", reg->
name);
79 id = atoi(
line[ncolumn]);
82 sql = sqlite3_mprintf(
"insert into region(reg_name) values( '%q' )", reg->
name);
87 sqlite3_free_table(
line);
106 const char *propname;
111 propname = va_arg(
args,
const char *);
113 if (!strcmp(propname,
"Identification")) {
115 size = va_arg(
args,
int);
121 if (!strcmp(propname,
"FullName")) {
123 size = va_arg(
args,
int);
143 event_code = va_arg(
args,
int);
145 switch (event_code) {
159 snprintf(
path, 500,
"%s/cflogger.db", dir);
168 snprintf(
path, 500,
"%s/cfnewspaper.db", dir);
211 size -= strlen(buffer)-1;
212 buffer += strlen(buffer);
226 const char *raw_players =
"select sum(1) as deaths from kill_event inner join living on liv_id = ke_victim_id where liv_is_player = %d and ke_time >= %d and ke_time < %d %s";
227 const char *raw_monsters =
"select sum(1) as deaths from kill_event inner join living on liv_id = ke_victim_id where liv_is_player = %d and ke_time >= %d and ke_time < %d";
229 sql = sqlite3_mprintf(raw_players, 1, start, end, reg);
232 if (err != SQLITE_OK) {
236 if (nrow > 0 &&
results[ncolumn] != NULL)
237 deaths = atoi(
results[ncolumn]);
242 else if (deaths == 1)
248 sql = sqlite3_mprintf(raw_monsters, 0, start, end);
251 if (err != SQLITE_OK) {
255 if (nrow > 0 &&
results[ncolumn] != NULL)
256 deaths = atoi(
results[ncolumn]);
261 else if (deaths == 1)
276 f.
no_monster_death =
"No monster was killed, players were lazy around here.";
281 snprintf(
where, 50,
"and map_reg_id = %d", region_id);
286 static void do_region(
region *reg,
char *buffer,
int size, time_t start, time_t end) {
287 news_cat(buffer, size,
"--- local %s news ---\n", reg->
name);
296 f.
one_player_death =
"Only one player died in the whole world, May Fido(tm) Have Mercy.";
297 f.
many_player_death =
"Monsters all around the world were busy, %d players died.";
298 f.
no_monster_death =
"No monster was killed at all, players must be tired!";
299 f.
one_monster_death =
"One poor monster was killed in the whole world, too bad for it.";
301 do_kills(buffer, size, start, end,
"", &f);
304 static void do_world(
char *buffer,
int size, time_t start, time_t end) {
305 news_cat(buffer, size,
"--- worldnews section ---\n");
327 sql = sqlite3_mprintf(
"select * from time where time_ingame < '%q' order by time_ingame desc",
date);
330 if (err != SQLITE_OK) {
334 if (nrow > 1 &&
results[ncolumn+1] != NULL) {
335 end = atol(
results[ncolumn+1]);
336 if (nrow > 1 &&
results[ncolumn+2] != NULL)
337 start = atol(
results[ncolumn+2]);
369 va_arg(
args,
object *);
370 va_arg(
args,
char *);
373 event = va_arg(
args,
object *);
374 event_code =
event->subtype;
region * cf_map_get_region_property(mapstruct *map, int propcode)
static void do_world(char *buffer, int size, time_t start, time_t end)
f_plug_api unregisterGlobalEvent
void cf_log(LogLevel logLevel, const char *format,...)
static void read_parameters(void)
Install Bug reporting Credits so make sure you have version or later There are files involved in the automatic convert convertall and filelist py GuildList has the list of guilds for the server GuildLocations is what is used by the install script for setting up the maps It has columns in the first is the name of the no spaces The second is the region of the the third is the destination folder for the the fourth is the exit the fifth and sixth are the x and y coords within the exit the seventh eighth and ninth are the exit location for the storage hall If field seven is then it uses the same exit map as for the guild hall itself filelist py has a list of which files to process for each guild hall convert py takes all the files in filelist py and customises them to the specific guild then outputs them into a in the same order that they are listed in GuildLocations convertall py reads the lines from GuildLocations and runs line by line
struct paper_properties paper_properties
static void do_sql(const char *sql, sqlite3 *base)
const char * cf_get_directory(int id)
static paper_properties * get_newspaper(const char *name)
int cfnewspaper_globalEventListener(int *type,...)
int eventListener(int *type,...)
object * cf_create_object_by_name(const char *name)
int cfnewspaper_runPluginCommand(object *op, char *params)
non standard information is not specified or uptime this means how long since the executable has been started A particular host may have been running a server for quite a long time
void cf_object_set_string_property(object *op, int propcode, const char *value)
static void do_kills(char *buffer, int size, time_t start, time_t end, const char *reg, kill_format *format)
static void format_time(timeofday_t *tod, char *buffer, int size)
Plugin animator file specs[Config] name
#define CFAPI_MAP_PROP_REGION
static sqlite3 * logger_database
CF_PLUGIN char SvnRevPlugin[]
static void do_region_kills(region *reg, char *buffer, int size, time_t start, time_t end)
void(* f_plug_api)(int *type,...)
int cf_init_plugin(f_plug_api getHooks)
void * getPluginProperty(int *type,...)
int initPlugin(const char *iversion, f_plug_api gethooksptr)
static void do_region(region *reg, char *buffer, int size, time_t start, time_t end)
static sqlite3 * newspaper_database
#define CFAPI_OBJECT_PROP_NAME_PLURAL
pluglist shows those as well as a short text describing each the list will simply appear empty The keyword for the Python plugin is Python plugout< keyword > Unloads a given identified by its _keyword_ So if you want to unload the Python you need to do plugout Python plugin< libname > Loads a given whose _filename_ is libname So in the case of you d have to do a plugin cfpython so Note that all filenames are relative to the default plugin path(SHARE/plugins). Console messages. ----------------- When Crossfire starts
static void get_newspaper_content(object *paper, paper_properties *properties, region *reg)
f_plug_api registerGlobalEvent
#define CFAPI_OBJECT_PROP_NAME
static void do_world_kills(char *buffer, int size, time_t start, time_t end)
Python Guilds Quick outline Add a guild(mapmakers) this is still a problem *after dropping the token to gain access to the stove a woodfloor now appears which is Toolshed Token(found in Guild_HQ) *Note also have multiple gates in place to protect players and items from the mana explosion drop x for Jewelers room *Jewelers room works just need to determine what x is drop x for Thaumaturgy room *Thaumaturgy room works just need to determine what x is drop gold dropping the Firestar named fearless allows access to but I suspect that the drop location of the chest is not as intended because the player is in the way once you enter the chest the exit back to the basement is things such as the message et al reside on teleporters which then transport items to the map as they are when the map is already purchased items reappear in that area From my this does not cause any problems at the moment But this should be corrected fixed Major it s now possible to buy guilds Ryo Update Uploaded guild package to CVS Changes the cauldrons and the charging room I spent a while agonizing over They were natural guild enhancements but much too much value for any reasonable expense to buy them Then I thought that they should be pay access but at a greatly reduced rate SO when you buy a forge or whatever for your guild it is available on a perplayer daily rate but it will be accessable for testing and to DMs to play with Like I said lots still to do with the especially comingt up with quest items for buying things like the new workshops and stuff One of the things I would like some input on would be proposals for additional fields for either the guildhouses or guild datafiles to play with Currently the Guildhouse but there is no reason we can t have more than one measure of a guild perhaps have dues relate to Dues and use points for some other suspended or inactive or when a guild is founded inactive active Guilds have the format
static paper_properties default_properties
static void news_cat(char *buffer, int size, const char *format,...)
const char * properties[PROPERTY_COUNT]
bool contents
DIALOGCHECK MINARGS 1 MAXARGS 1
event
DIALOGCHECK MINARGS 1 MAXARGS 2
static int get_region_id(region *reg)
object * cf_object_insert_object(object *op, object *container)
#define CFAPI_OBJECT_PROP_MESSAGE
struct kill_format kill_format
void cf_get_time(timeofday_t *tod)