50#define USER_AREA_MULT 1000
62#define LAND_AREA_DEBUG 0
64#if LAND_AREA_DEBUG >= 2
72 static char list[] = {
73 '0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
74 'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
75 'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
76 'U',
'V',
'W',
'X',
'Y',
'Z',
'a',
'b',
'c',
'd',
77 'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
78 'o',
'p',
'q',
'r',
's',
't',
'u',
'v',
'w',
'x',
92#define WRITE_MAP_DATA(type, map_char_expr) \
95 for (nat_x = 0; nat_x < map.xsize; nat_x++) { \
96 printf("%d", nat_x % 10); \
99 for (nat_y = 0; nat_y < map.ysize; nat_y++) { \
100 printf("%d ", nat_y % 10); \
101 for (nat_x = 0; nat_x < map.xsize; nat_x++) { \
103 NATIVE_TO_MAP_POS(&x, &y, nat_x,nat_y); \
104 printf(type, map_char_expr); \
106 printf(" %d\n", nat_y % 10); \
119 log_error(
"Debugging not possible! Player slots >= 32 are used.");
129 printf(
"Player Info...\n");
132 printf(
".know (%d)\n ", p);
136 printf(
".cities (%d)\n ", p);
211#if LAND_AREA_DEBUG >= 2
224 if (
pcmap && pplayer) {
225#if LAND_AREA_DEBUG >= 1
231#if LAND_AREA_DEBUG >= 1
238#if LAND_AREA_DEBUG >= 1
242#if LAND_AREA_DEBUG >= 1
254 struct city *wonder_city;
255 int landarea = 0, settledarea = 0;
302 bonus =
CLIP(0, bonus, 100);
435 log_error(
"couldn't open ranking log file: \"%s\"",
471 }
else if (pplayer->is_alive
483 if (
aplayer->team == pplayer->team) {
497 if (pplayer->is_alive
524 fprintf(fp,
"%s,%s,%s,%i,, ", pplayer->ranked_username,
533 fprintf(fp,
"%s,%s,%s,%i,, ", pplayer->ranked_username,
#define BV_ISSET(bv, bit)
int city_population(const struct city *pcity)
int get_final_city_output_bonus(const struct city *pcity, Output_type_id otype)
int city_map_radius_sq_get(const struct city *pcity)
#define city_list_iterate(citylist, pcity)
#define city_tile(_pcity_)
#define city_owner(_pcity_)
#define city_list_iterate_end
#define city_tile_iterate(_nmap, _radius_sq, _city_tile, _tile)
#define city_tile_iterate_end
static struct fc_sockaddr_list * list
int player_culture(const struct player *plr)
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
#define MAX_NUM_PLAYER_SLOTS
bool is_great_wonder(const struct impr_type *pimprove)
struct city * city_from_great_wonder(const struct impr_type *pimprove)
#define improvement_iterate_end
#define improvement_iterate(_p)
#define log_error(message,...)
static int map_pos_to_index(struct civ_map *nmap, int map_x, int map_y)
#define whole_map_iterate(_map, _tile)
#define whole_map_iterate_end
#define fc_calloc(n, esz)
struct city_list * cities
bool player_slot_is_used(const struct player_slot *pslot)
int player_slot_count(void)
const char * player_name(const struct player *pplayer)
int player_slot_index(const struct player_slot *pslot)
int player_index(const struct player *pplayer)
bool player_owns_city(const struct player *pplayer, const struct city *pcity)
#define players_iterate_end
#define players_iterate(_pplayer)
#define player_list_iterate(playerlist, pplayer)
static bool is_barbarian(const struct player *pplayer)
#define player_slots_iterate(_pslot)
#define player_list_iterate_end
#define player_slots_iterate_end
void player_status_add(struct player *plr, enum player_status pstatus)
bool player_status_check(struct player *plr, enum player_status pstatus)
struct research * research_get(const struct player *pplayer)
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
static void get_player_landarea(struct claim_map *pcmap, struct player *pplayer, int *return_landarea, int *return_settledarea)
void calc_civ_score(struct player *pplayer)
int get_civ_score(const struct player *pplayer)
static void build_landarea_map(struct claim_map *pcmap)
void rank_users(bool interrupt)
static int get_units_score(const struct player *pplayer)
static int get_spaceship_score(const struct player *pplayer)
int total_player_citizens(const struct player *pplayer)
#define CLIP(lower, current, upper)
#define specialist_type_iterate_end
#define specialist_type_iterate(sp)
struct server_arguments srvarg
struct packet_game_info info
enum borders_mode borders
enum spaceship_state state
struct city_list * cities
struct player_spaceship spaceship
struct player_score score
FILE * fc_fopen(const char *filename, const char *opentype)
const struct player_list * team_members(const struct team *pteam)
#define teams_iterate_end
#define teams_iterate(_pteam)
struct advance * valid_advance_by_number(const Tech_type_id id)
#define advance_index_iterate_end
#define advance_index_iterate(_start, _index)
#define is_ocean_tile(ptile)
struct city * tile_city(const struct tile *ptile)
#define tile_worked(_tile)
#define tile_owner(_tile)
bool is_special_unit(const struct unit *punit)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end