24 #include <QHostAddress>
68 #define SPECENUM_NAME server_states
69 #define SPECENUM_VALUE0 S_S_INITIAL
70 #define SPECENUM_VALUE1 S_S_RUNNING
71 #define SPECENUM_VALUE2 S_S_OVER
72 #include "specenum_gen.h"
85 #define IDENTITY_NUMBER_SKIP (100)
106 const struct player *pplayer);
136 const char *
aifill(
int amount);
145 const struct player *pplayer,
148 const struct player *pplayer,
151 const struct player *pplayer,
154 const struct player *pplayer,
157 const struct player *pplayer,
#define MAX_LEN_GAME_IDENTIFIER
void server_game_init(bool keep_ruleset_value)
Initialize game data for the server (corresponds to server_game_free).
void srv_scores()
Score calculation.
void srv_ready()
Set up one game.
const char * aifill(int amount)
Fill or remove players to meet the given aifill.
void check_for_full_turn_done()
Check if turn is really done.
int mapimg_server_plrcolor_count()
Helper function for the mapimg module - number of player colors.
void identity_number_release(int id)
Mark identity number free.
void end_phase()
End a phase of movement.
int server_plr_tile_city_id_get(const struct tile *ptile, const struct player *pplayer)
Returns the id of the city the player map of 'pplayer' has at 'ptile' or IDENTITY_NUMBER_ZERO if the ...
void player_nation_defaults(struct player *pplayer, struct nation_type *pnation, bool set_name)
Set nation for player with nation default values.
void server_game_free()
Free game data that we reinitialize as part of a server soft restart.
player * mapimg_server_tile_owner(const struct tile *ptile, const struct player *pplayer, bool knowledge)
Helper function for the mapimg module - tile owner.
void save_game_auto(const char *save_reason, enum autosave_type type)
Save game with autosave filename.
const char * server_ss_name_get(server_setting_id id)
Returns the name of the server setting with the specified id.
bool check_for_game_over()
Returns TRUE if any one game end condition is fulfilled, FALSE otherwise.
void start_game()
Start actual game.
player * mapimg_server_tile_unit(const struct tile *ptile, const struct player *pplayer, bool knowledge)
Helper function for the mapimg module - unit owner.
void set_server_state(enum server_states newstate)
Set current server state.
void end_turn()
Handle the end of each turn.
void identity_number_reserve(int id)
Mark identity number allocated.
void server_quit()
Quit the server and exit.
struct server_arguments srvarg
void init_game_seed()
Initialize the game seed.
known_type mapimg_server_tile_known(const struct tile *ptile, const struct player *pplayer, bool knowledge)
Helper function for the mapimg module - tile knowledge.
bool game_was_started()
Returns iff the game was started once upon a time.
bool server_ss_val_bool_get(server_setting_id id)
Returns the value of the boolean server setting with the specified id.
server_setting_id server_ss_by_name(const char *name)
Returns the id of the server setting with the specified name.
enum server_states server_state()
Return current server state.
rgbcolor * mapimg_server_plrcolor_get(int i)
Helper function for the mapimg module - one player color.
void begin_phase(bool is_new_phase)
Begin a phase of movement.
bool server_packet_input(struct connection *pconn, void *packet, int type)
Returns FALSE if connection should be closed (because the clients was rejected).
void srv_init()
Initialize freeciv server.
int server_ss_val_int_get(server_setting_id id)
Returns the value of the integer server setting with the specified id.
unsigned int server_ss_val_bitwise_get(server_setting_id id)
Returns the value of the bitwise server setting with the specified id.
void begin_turn(bool is_new_turn)
Handle the beginning of each turn.
void send_all_info(struct conn_list *dest)
Send all information for when game starts or client reconnects.
const char * pick_random_player_name(const struct nation_type *pnation)
Returns a random ruler name picked from given nation's ruler names that is not already in use.
int identity_number()
Identity ids wrap at IDENTITY_NUMBER_SIZE, skipping IDENTITY_NUMBER_ZERO Setup in server_game_init()
enum sset_type server_ss_type_get(server_setting_id id)
Returns the type of the server setting with the specified id.
void update_nations_with_startpos()
Update information about which nations have start positions on the map.
terrain * mapimg_server_tile_terrain(const struct tile *ptile, const struct player *pplayer, bool knowledge)
Helper function for the mapimg module - tile terrain.
player * mapimg_server_tile_city(const struct tile *ptile, const struct player *pplayer, bool knowledge)
Helper function for the mapimg module - city owner.
struct unit_wait_list * unit_waits
char game_identifier[MAX_LEN_GAME_IDENTIFIER]
unsigned short identity_number
bool metaconnection_persistent
enum announce_type announce
unsigned short int metaserver_port
QString scenarios_pathname