Freeciv-3.3
|
#include <stdio.h>
#include <string.h>
#include "bitvector.h"
#include "fciconv.h"
#include "fcintl.h"
#include "log.h"
#include "mem.h"
#include "rand.h"
#include "support.h"
#include "achievements.h"
#include "calendar.h"
#include "connection.h"
#include "culture.h"
#include "events.h"
#include "game.h"
#include "government.h"
#include "nation.h"
#include "packets.h"
#include "player.h"
#include "research.h"
#include "specialist.h"
#include "unitlist.h"
#include "version.h"
#include "citytools.h"
#include "plrhand.h"
#include "score.h"
#include "srv_main.h"
#include "report.h"
Go to the source code of this file.
Data Structures | |
struct | plrdata_slot |
struct | logging_civ_score |
struct | player_score_entry |
struct | city_score_entry |
struct | dem_row |
struct | dem_col |
Macros | |
#define | HISTORIAN_FIRST HISTORIAN_RICHEST |
#define | HISTORIAN_LAST HISTORIAN_CULTURAL |
#define | MAX_SCORELOG_LINE_LEN (119 + 1) |
#define | GOOD_PLAYER(p) ((p)->is_alive && !is_barbarian(p)) |
Enumerations | |
enum | historian_type { HISTORIAN_RICHEST = 0 , HISTORIAN_ADVANCED = 1 , HISTORIAN_MILITARY = 2 , HISTORIAN_HAPPIEST = 3 , HISTORIAN_LARGEST = 4 , HISTORIAN_CULTURAL = 5 } |
enum | dem_flag { DEM_COL_QUANTITY , DEM_COL_RANK , DEM_COL_BEST , DEM_COL_LAST } |
Variables | ||
struct history_report | latest_history_report = { -2 } | |
static struct logging_civ_score * | score_log = nullptr | |
static const char * | historian_message [] | |
static const char * | historian_name [] | |
static const char | scorelog_magic [] = "#FREECIV SCORELOG2 " | |
struct { | ||
char * name | ||
int(* get_value )(const struct player *) | ||
} | score_tags [] | |
static struct dem_row | rowtable [] | |
static struct dem_col | coltable [] = {{'q'}, {'r'}, {'b'}} | |
static const char * | ranking [] | |
#define GOOD_PLAYER | ( | p | ) | ((p)->is_alive && !is_barbarian(p)) |
#define HISTORIAN_FIRST HISTORIAN_RICHEST |
#define HISTORIAN_LAST HISTORIAN_CULTURAL |
BV_DEFINE | ( | bv_cols | , |
DEM_COL_LAST | |||
) |
|
static |
Construct one demographics line.
Definition at line 1094 of file report.c.
Referenced by report_demographics().
Land area controlled by player
Definition at line 705 of file report.c.
Referenced by report_final_scores().
Literacy score calculated one way. See also get_literacy() to see alternative way.
Military service length
Definition at line 753 of file report.c.
Referenced by report_final_scores().
Number of citizen units of player
Definition at line 689 of file report.c.
Referenced by get_real_pop().
Number of citizens of player
Definition at line 697 of file report.c.
Referenced by report_final_scores().
Return score of the type associated to the tag
Definition at line 1867 of file report.c.
Referenced by api_methods_tag_score().
Number of units killed
Definition at line 854 of file report.c.
Referenced by report_final_scores().
|
static |
Construct Historian Report
Definition at line 317 of file report.c.
Referenced by make_history_report().
struct history_report * history_report_get | ( | void | ) |
Return current history report
Definition at line 1859 of file report.c.
Referenced by sg_load_history(), sg_load_history(), and sg_save_history().
Verify that a given demography string is valid. See game.demography. If the string is not valid the index of the first invalid character is return as 'error'.
Other settings callback functions are in settings.c, but this one uses static values from this file so it's done separately.
Definition at line 1158 of file report.c.
Referenced by demography_callback().
Free resources allocated for score logging system
Definition at line 1514 of file report.c.
Referenced by log_civ_score_now(), scorelog_action(), and server_game_free().
Initialize score logging system
Definition at line 1491 of file report.c.
Referenced by scorelog_action().
Create a log file of the civilizations so you can see what was happening.
Definition at line 1544 of file report.c.
Referenced by begin_turn(), and srv_scores().
Produce random history report if it's time for one.
Definition at line 1702 of file report.c.
Referenced by end_turn().
Returns the number of wonders the given city has.
Definition at line 394 of file report.c.
Referenced by report_top_cities().
|
static |
This function pops up a non-modal message dialog on the player's desktop
Definition at line 1804 of file report.c.
Referenced by report_achievements(), report_demographics(), report_top_cities(), report_wonders_of_the_world(), and report_wonders_of_the_world_long().
|
static |
This function pops up a non-modal message dialog on the player's desktop
event == E_REPORT: message should not be ignored by clients watching AI players with ai_popup_windows off. Example: Server Options, Demographics Report, etc.
event == E_BROADCAST_REPORT: message can safely be ignored by clients watching AI players with ai_popup_windows off. For example: Herodot's report... and similar messages.
Definition at line 1821 of file report.c.
Referenced by page_conn(), and send_current_history_report().
|
static |
Free resources allocated for plrdata slot.
Definition at line 1322 of file report.c.
Referenced by log_civ_score_now(), and scan_score_log().
Allocate and initialize plrdata slot.
Definition at line 1299 of file report.c.
Referenced by log_civ_score_now(), and scan_score_log().
Replace plrdata slot with new one named according to input parameter.
Definition at line 1311 of file report.c.
Referenced by log_civ_score_now(), and plrdata_slot_init().
void report_achievements | ( | struct connection * | pconn | ) |
void report_demographics | ( | struct connection * | pconn | ) |
Send demographics report; what gets reported depends on value of demographics server option.
Definition at line 1205 of file report.c.
Referenced by handle_report_req().
Inform clients about player scores and statistics when the game ends. Called only from server/srv_main.c srv_scores()
Definition at line 1724 of file report.c.
Referenced by connection_attach_real(), and srv_scores().
Send report listing the "best" cities in the world.
Definition at line 410 of file report.c.
Referenced by handle_report_req().
Send report listing all built and destroyed wonders, and wonders currently being built.
Definition at line 604 of file report.c.
Referenced by handle_report_req().
Send report listing all built and destroyed wonders, and wonders currently being built.
Definition at line 493 of file report.c.
Referenced by handle_report_req().
Reads the whole file denoted by fp. Sets last_turn and id to the values contained in the file. Returns the player_names indexed by player_no at the end of the log file.
Returns TRUE iff the file had read successfully.
Definition at line 1337 of file report.c.
Referenced by log_civ_score_now().
Compare two player score entries. Used as callback for qsort.
Definition at line 308 of file report.c.
Referenced by historian_generic(), report_final_scores(), and report_top_cities().
Send history report of this turn.
Definition at line 381 of file report.c.
Referenced by establish_new_connection(), and make_history_report().
Construct string containing value and its unit.
Definition at line 1002 of file report.c.
Referenced by area_to_text(), culture_to_text(), economics_to_text(), mil_service_to_text(), percent_to_text(), pollution_to_text(), production_to_text(), and science_to_text().
Referenced by is_valid_demography(), and report_demographics().
Definition at line 193 of file report.c.
Referenced by log_civ_score_now().
Definition at line 95 of file report.c.
Referenced by historian_generic().
struct history_report latest_history_report = { -2 } |
Definition at line 68 of file report.c.
Referenced by history_report_get(), log_civ_score_init(), make_history_report(), and send_current_history_report().
char* name |
Definition at line 192 of file report.c.
Referenced by get_tag_score(), plrdata_slot_init(), plrdata_slot_replace(), and report_demographics().
Definition at line 272 of file report.c.
Referenced by historian_generic().
Referenced by is_valid_demography(), and report_demographics().
|
static |
Definition at line 70 of file report.c.
Referenced by log_civ_score_free(), log_civ_score_init(), log_civ_score_now(), and scan_score_log().
const struct { ... } score_tags[] |
Referenced by get_tag_score(), and log_civ_score_now().
Definition at line 132 of file report.c.
Referenced by log_civ_score_now(), and scan_score_log().