14 #include <fc_config.h>
16 #ifdef FREECIV_MSWINDOWS
24 #include <QApplication>
26 #include <QCommandLineParser>
27 #include <QElapsedTimer>
28 #include <QGlobalStatic>
98 #include "packhand_gen.h"
101 const struct player *pplayer,
105 const struct player *pplayer,
bool knowledge);
107 const struct player *pplayer,
110 const struct player *pplayer,
113 const struct player *pplayer,
150 bool hackless =
false;
159 static char *
put_conv(
const char *src,
size_t *length)
164 *length = qstrlen(out);
177 static bool get_conv(
char *dst,
size_t ndst,
const char *src,
size_t nsrc)
191 if (ndst > 0 &&
len >= ndst) {
196 memcpy(dst, out,
len);
304 QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
305 QApplication::setHighDpiScaleFactorRoundingPolicy(
306 Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
307 QApplication app(argc, argv);
309 app.setDesktopFileName(QStringLiteral(
"net.longturn.freeciv21"));
320 for (
int aii = 0; aii < FREECIV_AI_MOD_LAST; aii++) {
335 QCommandLineParser parser;
336 parser.addHelpOption();
337 parser.addVersionOption();
340 bool ok = parser.addOptions(
341 {{{
"A",
_(
"Announce")},
343 _(
"Announce game in LAN using protocol PROTO (IPv4/IPv6/none)."),
346 {{
"a",
"autoconnect"},
_(
"Skip connect dialog.")},
350 _(
"Set debug log level (fatal/critical/warning/info/debug)."),
352 QStringLiteral(
"info")},
353 {{
"F",
_(
"Fatal")},
_(
"Raise a signal on failed assertion.")},
354 {{
"f",
"file"},
_(
"Load saved game FILE."),
"FILE"},
357 _(
"Do not request hack access to local, but not spawned, server.")},
360 _(
"Use FILE as logfile (spawned server also uses this)."),
362 {{
"M",
"Meta"},
_(
"Connect to the metaserver at HOST."),
"HOST"},
363 {{
"n",
"name"},
_(
"Use NAME as username on server."),
"NAME"},
365 _(
"Connect to server port PORT (usually with -a)."),
367 {{
"P",
_(
"Plugin")},
_(
"Use PLUGIN for sound output."),
"PLUGIN"},
369 _(
"Read startup script FILE (for spawned server only)."),
372 _(
"Connect to the server at HOST (usually with -a)."),
374 {{
"S",
"Sound"},
_(
"Read sound tags from FILE."),
"FILE"},
375 {{
"m",
"music"},
_(
"Read music tags from FILE."),
"FILE"},
376 {{
"t",
"tiles"},
_(
"Use data file FILE.tilespec for tiles."),
"FILE"},
377 {{
"w",
"warnings"},
_(
"Warn about deprecated modpack constructs.")},
378 {
"debug-tileset",
_(
"Prints tileset debugging information.")}});
380 parser.addPositionalArgument(
381 _(
"url"),
_(
"Server information in URL format."),
_(
"[url]"));
383 qFatal(
"Adding command line arguments failed.");
393 if (!parser.isSet(QStringLiteral(
"debug-tileset"))) {
394 extra.push_back(QStringLiteral(
"freeciv.tileset.info = false"));
396 if (!
log_init(parser.value(QStringLiteral(
"debug")), extra)) {
400 if (parser.isSet(QStringLiteral(
"version"))) {
405 if (parser.isSet(QStringLiteral(
"Hackless"))) {
409 if (parser.isSet(QStringLiteral(
"log"))) {
410 logfile = parser.value(QStringLiteral(
"log"));
413 if (parser.isSet(QStringLiteral(
"read"))) {
414 scriptfile = parser.value(QStringLiteral(
"read"));
416 if (parser.isSet(QStringLiteral(
"file"))) {
417 savefile = parser.value(QStringLiteral(
"file"));
420 if (parser.isSet(QStringLiteral(
"name"))) {
421 url.setUserName(parser.value(QStringLiteral(
"name")));
423 if (parser.isSet(QStringLiteral(
"Meta"))) {
426 if (parser.isSet(QStringLiteral(
"Sound"))) {
429 if (parser.isSet(QStringLiteral(
"music"))) {
432 if (parser.isSet(QStringLiteral(
"Plugin"))) {
435 if (parser.isSet(QStringLiteral(
"port"))) {
437 url.setPort(parser.value(QStringLiteral(
"port")).toUInt(&conversion_ok));
438 if (!conversion_ok) {
439 qFatal(
_(
"Invalid port number %s"),
440 qUtf8Printable(parser.value(
"port")));
444 if (parser.isSet(QStringLiteral(
"server"))) {
445 url.setHost(parser.value(QStringLiteral(
"server")));
447 if (parser.isSet(QStringLiteral(
"autoconnect"))) {
450 if (parser.isSet(QStringLiteral(
"tiles"))) {
454 if (parser.isSet(QStringLiteral(
"Announce"))) {
455 auto value = parser.value(QStringLiteral(
"Announce")).toLower();
456 if (value == QLatin1String(
"ipv4")) {
458 }
else if (value == QLatin1String(
"ipv6")) {
460 }
else if (value == QLatin1String(
"none")) {
463 qCritical(
_(
"Illegal value \"%s\" for --Announce"),
464 qUtf8Printable(parser.value(
"Announce")));
467 if (parser.isSet(QStringLiteral(
"warnings"))) {
468 qCWarning(deprecations_category,
470 _(
"The --warnings option is deprecated."));
474 auto positional = parser.positionalArguments();
475 if (positional.size() == 1) {
476 url = QUrl(positional.constFirst());
478 if (!url.isValid() || (!url.scheme().startsWith(
"fc21"))) {
480 url = QUrl(QStringLiteral(
"fc21://") + positional.constFirst());
482 if (!url.isValid()) {
483 qFatal(
"%s", qPrintable(url.errorString()));
487 }
else if (!positional.isEmpty()) {
488 qFatal(
_(
"Too many positional arguments."));
491 url.setScheme(QStringLiteral(
"fc21"));
496 fc_fprintf(stderr,
_(
"-f/--file and -a/--autoconnect options are "
560 if (url.host().isEmpty()) {
565 if (url.userName().isEmpty()) {
572 const char *oldaddr =
"http://www.cazfi.net/freeciv/metaserver/";
575 qInfo(
_(
"Updating old metaserver address \"%s\"."), oldaddr);
577 qInfo(
_(
"Default metaserver has been set to value \"%s\"."),
588 if (url.port() <= 0) {
602 qCritical(
_(
"Can't load requested tileset %s!"),
637 qDebug(
"%s", qUtf8Printable(msg));
640 qInfo(
"%s", qUtf8Printable(msg));
643 qWarning(
"%s", qUtf8Printable(msg));
646 qCritical(
"%s", qUtf8Printable(msg));
649 qFatal(
"%s", qUtf8Printable(msg));
702 && PACKET_PROCESSING_STARTED != type
703 && PACKET_PROCESSING_FINISHED != type
704 && PACKET_SERVER_JOIN_REPLY != type
705 && PACKET_AUTHENTICATION_REQ != type && PACKET_SERVER_SHUTDOWN != type
706 && PACKET_CONNECT_MSG != type && PACKET_EARLY_CHAT_MSG != type
707 && PACKET_SERVER_INFO != type) {
708 qCritical(
"Received packet %s (%d) before establishing connection!",
709 packet_name(
static_cast<packet_type
>(type)), type);
711 }
else if (!client_handle_packet(
static_cast<packet_type
>(type), packet)) {
712 qCritical(
"Received unknown packet (type %d) from server!", type);
771 qFatal(
_(
"Failed to start local server; aborting."));
778 qFatal(
_(
"There was an error while auto connecting; aborting."));
792 if (oldstate == newstate) {
809 qCritical(
"%d is not a valid client state to set.",
C_S_INITIAL);
896 if (pplayer && pplayer->
cities) {
958 "Trying to remove a non existing connection");
960 if (
nullptr != pconn->
playing) {
993 send_packet_player_attribute_block(&
client.
conn);
1025 turndone_timer->setSingleShot(
true);
1026 turndone_timer->start(miliseconds);
1086 double time_until_next_call = 1.0;
1092 time_until_next_call =
MIN(time_until_next_call, autoconnect_time);
1096 return time_until_next_call;
1101 time_until_next_call = std::min(time_until_next_call, blink_time / 1000);
1106 time_until_next_call = std::min(time_until_next_call, blink_time / 1000);
1117 time_until_next_call = std::min(time_until_next_call, 1.0);
1122 int iseconds = ceil(seconds) + 0.1;
1124 if (iseconds <
game.
tinfo.last_turn_change_time) {
1131 static long counter = 0;
1140 return std::max(time_until_next_call, 0.0);
1237 const struct player *pplayer,
1238 enum vision_layer vlayer)
1247 const struct player *pplayer)
1267 qCritical(
"No server setting named %s exists.",
name);
1282 qCritical(
"No server setting with the id %d exists.",
id);
1296 qCritical(
"No server setting with the id %d exists.",
id);
1297 return sset_type_invalid();
1304 sset_type_invalid(),
1305 "%s is a client option type but not a server "
1311 sset_type_invalid());
1316 && (
enum sset_type) OT_INTEGER == SST_INT
1317 && (
enum sset_type) OT_STRING == SST_STRING
1318 && (
enum sset_type) OT_ENUM == SST_ENUM
1319 && (
enum sset_type) OT_BITWISE == SST_BITWISE
1320 && SST_COUNT == (
enum sset_type) 5,
1321 server_setting_type_not_equal_to_client_option_type);
1325 return static_cast<enum sset_type
>(opt_type);
1338 qCritical(
"No server setting with the id %d exists.",
id);
1353 qCritical(
"No server setting with the id %d exists.",
id);
1368 qCritical(
"No server setting with the id %d exists.",
id);
1400 const struct player *pplayer,
1416 const struct player *pplayer,
bool knowledge)
1427 const struct player *pplayer,
1439 const struct player *pplayer,
1457 const struct player *pplayer,
1462 int unit_count = unit_list_size(ptile->
units);
1464 if (unit_count == 0) {
1491 return pplayer->
rgb;
void init_ai(struct ai_type *ai)
Initializes AI structure.
struct ai_type * get_ai_type(int id)
Returns ai_type of given id.
void attribute_init()
Initializes the attribute module.
void attribute_flush()
Send current state to the server.
void attribute_free()
Frees the attribute module.
void audio_init()
Initialize base audio system.
void audio_real_init(const QString &soundset_name, const QString &musicset_name, const QString &preferred_plugin_name)
Initialize audio system and autoselect a plugin.
void audio_shutdown()
Call this at end of program only.
void init_our_capability()
Setup our internal network capability string.
void fc_destroy_ow_mutex()
Destroy output window mutex.
void fc_init_ow_mutex()
Initialize output window mutex.
struct player * city_owner(const struct city *pcity)
Return the owner of the city.
#define city_list_iterate(citylist, pcity)
#define city_list_iterate_end
void popdown_city_dialog()
Closes the city overlay.
static update_queue * uq()
static void client_game_free()
Called by set_client_state() and client_exit() below.
static struct player * mapimg_client_tile_city(const struct tile *ptile, const struct player *pplayer, bool knowledge)
Helper function for the mapimg module - city owner.
static enum client_states civclient_state
int get_seconds_to_new_turn()
Return the number of seconds until turn-done.
static server_setting_id client_ss_by_name(const char *name)
Returns the id of the server setting with the specified name.
enum client_states client_state()
Return current client state.
static struct player * mapimg_client_tile_unit(const struct tile *ptile, const struct player *pplayer, bool knowledge)
Helper function for the mapimg module - unit owner.
void start_turn_change_wait()
Start waiting of the server turn change activities.
void client_remove_cli_conn(struct connection *pconn)
Remove pconn from all connection lists in client, then free it.
static bool waiting_turn_change
QUrl & client_url()
Returns the URL that this client connects to.
static int client_plr_tile_city_id_get(const struct tile *ptile, const struct player *pplayer)
Returns the id of the city the player believes exists at 'ptile'.
static struct rgbcolor * mapimg_client_plrcolor_get(int i)
Helper function for the mapimg module - one player color.
bool can_meet_with_player(const struct player *pplayer)
Returns TRUE iff the client can do diplomatic meetings with another given player.
void client_packet_input(void *packet, int type)
Handle packet received from server.
int client_player_number()
Returns number of player attached to client.
bool client_map_is_known_and_seen(const struct tile *ptile, const struct player *pplayer, enum vision_layer vlayer)
Return the vision of the player on a tile.
bool waiting_for_end_turn
static enum sset_type client_ss_type_get(server_setting_id id)
Returns the type of the server setting with the specified id.
bool is_server_busy()
Returns if server is considered busy at the moment.
static struct terrain * mapimg_client_tile_terrain(const struct tile *ptile, const struct player *pplayer, bool knowledge)
Helper function for the mapimg module - tile terrain.
int client_main(int argc, char *argv[])
Entry point for common client code.
enum announce_type announce
QString sound_plugin_name
bool client_has_player()
Either controlling or observing.
void set_miliseconds_to_turndone(int miliseconds)
Reset the number of seconds to turndone from an "authentic" source.
static char * put_conv(const char *src, size_t *length)
Convert a text string from the internal to the data encoding, when it is written to the network.
void client_remove_all_cli_conn()
Remove (and free) all connections from all connection lists in client.
bool client_is_global_observer()
Returns whether client is global observer.
static enum known_type mapimg_client_tile_known(const struct tile *ptile, const struct player *pplayer, bool knowledge)
Helper function for the mapimg module - tile knowledge.
double real_timer_callback()
This function should be called at least once per second.
void start_quitting()
Mark client as one going to quit as soon as possible,.
static bool client_quitting
void set_server_busy(bool busy)
Sets if server is considered busy.
static bool client_ss_val_bool_get(server_setting_id id)
Returns the value of the boolean server setting with the specified id.
struct player * client_player()
Either controlling or observing.
static bool get_conv(char *dst, size_t ndst, const char *src, size_t nsrc)
Convert a text string from the data to the internal encoding when it is first read from the network.
static int client_ss_val_int_get(server_setting_id id)
Returns the value of the integer server setting with the specified id.
static void at_exit()
This is called at program exit.
int get_seconds_to_turndone()
Return the number of seconds until turn-done.
bool can_client_issue_orders()
Returns TRUE iff the client can issue orders (such as giving unit commands).
static unsigned int client_ss_val_bitwise_get(server_setting_id id)
Returns the value of the bitwise server setting with the specified id.
static int seconds_shown_to_new_turn
void user_ended_turn()
Handle user ending his/her turn.
bool client_is_observer()
Returns whether client is observer.
void send_attribute_block_request()
Send attribute block.
static int seconds_shown_to_turndone
void send_report_request(enum report_type type)
Send request for some report to server.
bool is_client_quitting()
Is the client marked as one going down?
static void log_option_save_msg(QtMsgType lvl, const QString &msg)
Write messages from option saving to the log.
static void client_game_reset()
Called only by set_client_state() below.
static void charsets_init()
Set up charsets for the client.
void send_turn_done()
Send information about player having finished his/her turn to server.
bool can_client_control()
Returns TRUE iff the client can control player.
bool is_waiting_turn_change()
Are we in turn-change wait state?
static struct player * mapimg_client_tile_owner(const struct tile *ptile, const struct player *pplayer, bool knowledge)
Helper function for the mapimg module - tile owner.
bool can_client_change_view()
Return TRUE if the client can change the view; i.e.
QString forced_tileset_name
static void fc_interface_init_client()
Initialize client specific functions.
void stop_turn_change_wait()
Server is responsive again.
void client_exit()
Main client execution stop function.
static void emergency_exit()
This is called at program exit in any emergency.
static const char * client_ss_name_get(server_setting_id id)
Returns the name of the server setting with the specified id.
static int mapimg_client_plrcolor_count()
Helper function for the mapimg module - number of player colors.
static void client_game_init()
Called only by set_client_state() below.
void set_client_state(enum client_states newstate)
Change client state.
const char *const gui_character_encoding
const bool gui_use_transliteration
void create_event(struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
Creates a struct packet_generic_message packet and injects it via handle_chat_msg.
struct nation_set * client_current_nation_set()
Returns the nation set in use.
void center_on_something()
Find something sensible to display.
double try_to_autoconnect(const QUrl &url)
Make an attempt to autoconnect to the server.
void start_autoconnecting_to_server(const QUrl &url)
Start trying to autoconnect to freeciv21-server.
void disconnect_from_server()
Get rid of server connection.
bool client_start_server(const QString &user_name)
Forks a server if it can.
void client_kill_server(bool force)
Kills the server if the client has started it.
void conn_reset_delta_state(struct connection *pc)
Remove all is-game-info cached packets from the connection.
std::vector< unit * > & get_units_in_focus()
Returns list of units currently in focus.
void unit_focus_update()
If there is no unit currently in focus, or if the current unit in focus should not be in focus,...
void control_init()
Called only by client_game_init() in client/client_main.c.
void unit_focus_set(struct unit *punit)
Sets the focus unit directly.
void control_free()
Called only by client_game_free() in client/client_main.c.
int get_num_units_in_focus()
Return the number of units currently in focus (0 or more).
int blink_turn_done_button()
Blink the turn done button (if necessary).
void control_mouse_cursor(struct tile *ptile)
Determines which mouse cursor should be used, according to hover_state, and the information gathered ...
int blink_active_unit()
Blink the active unit (if necessary).
void dio_set_get_conv_callback(DIO_GET_CONV_FUN fun)
Sets string conversion callback to use when getting text.
void dio_set_put_conv_callback(DIO_PUT_CONV_FUN fun)
Sets string conversion callback to be used when putting text.
void popdown_races_dialog(void)
Close the nation selection dialog.
void popdown_all_game_dialogs(void)
This function is called when the client disconnects or the game is over.
void close_all_diplomacy_dialogs()
Close all open diplomacy dialogs.
bool could_meet_with_player(const struct player *pplayer, const struct player *aplayer)
Returns TRUE iff pplayer could do diplomatic meetings with aplayer.
void editor_free()
Free the client's editor.
void editor_init()
Initialize the client's editor state information to some suitable default values.
void editor_clear()
Clear the editor data which is game dependent.
void free_libfreeciv()
Free misc resources allocated for libfreeciv.
struct functions * fc_interface_funcs()
Return the function pointer.
void fc_interface_init()
Test and initialize the functions.
#define IDENTITY_NUMBER_ZERO
void backtrace_init()
Take backtrace log callback to use.
void backtrace_deinit()
Remove backtrace log callback from use.
char * internal_to_data_string_malloc(const char *text)
void fc_fprintf(FILE *stream, const char *format,...)
Do a fprintf from the internal charset into the local charset.
void init_character_encodings(const char *my_internal_encoding, bool my_use_transliteration)
Must be called during the initialization phase of server and client to initialize the character encod...
const char * get_internal_encoding()
Return the internal encoding.
char * data_to_internal_string_malloc(const char *text)
const char * get_locale_dir()
Return directory containing locales.
const struct ft_color ftc_client
void configure_fonts()
Tries to choose good fonts for Freeciv21.
void i_am_client()
Set program type to client.
void game_reset()
Do all changes to change view, and not full game_free()/game_init().
void game_init(bool keep_ruleset_value)
Initialise all game settings.
int current_turn_timeout()
Return timeout value for the current turn.
void game_free()
Frees all memory of the game.
void global_worklists_build()
Check if the global worklists are valid or not for the ruleset.
void global_worklists_unbuild()
Convert the universal pointers to strings to work out-ruleset.
bool cma_is_city_under_agent(const struct city *pcity, struct cm_parameter *parameter)
Check whether city is under governor control, and fill parameter if it is.
void cma_release_city(struct city *pcity)
Release city from governor control.
const char * client_string
void editgui_tileset_changed()
Stub for editor function.
void ui_exit()
Do any necessary UI-specific cleanup.
void editgui_popdown_all()
Stub for editor function.
void ui_main()
The main loop for the UI.
void conn_list_dialog_update()
void free_help_texts()
Free all allocations associated with help_nodes.
void boot_help_texts(const nation_set *nations_to_show, help_item *tileset_help)
pplayer may be nullptr.
void popdown_help_dialog(void)
Close the help dialog.
bool log_init(const QString &level_str, const QStringList &extra_rules)
Parses a log level string as provided by the user on the command line, and installs the corresponding...
void fc_assert_set_fatal(bool fatal)
Set what signal the assert* macros should raise on failed assertion (-1 to disable).
void log_set_file(const QString &path)
Redirects the log to a file.
void log_close()
Deinitialize logging module.
#define fc_assert_msg(condition, message,...)
#define fc_assert_ret(condition)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_debug(message,...)
#define FC_STATIC_ASSERT(cond, tag)
#define fc_assert_ret_val_msg(condition, val, message,...)
void update_turn_done_button_state()
Update the turn done button state.
bool can_end_turn()
Return TRUE iff client can end turn.
void mapimg_reset()
Reset the map image subsystem.
void mapimg_init(mapimg_tile_known_func mapimg_tile_known, mapimg_tile_terrain_func mapimg_tile_terrain, mapimg_tile_player_func mapimg_tile_owner, mapimg_tile_player_func mapimg_tile_city, mapimg_tile_player_func mapimg_tile_unit, mapimg_plrcolor_count_func mapimg_plrcolor_count, mapimg_plrcolor_get_func mapimg_plrcolor_get)
Initialisation of the map image subsystem.
void mapimg_free()
Free all memory allocated by the map image subsystem.
void update_info_label(void)
Typically an info box is provided to tell the player about the state of their civilization.
void update_unit_info_label(const std::vector< unit * > &unit_list)
Update the information label which gives info on the current unit and the tile under the current unit...
void meswin_clear_older(int turn, int phase)
Clear all messages.
void update_timeout_label()
Update the timeout display.
void start_style_music()
Start music suitable for current game situation.
void start_menu_music(const QString &tag, const QString &alt_tag)
Start menu music.
void stop_menu_music()
Stop menu music completely.
void stop_style_music()
Stop style music completely.
void options_free()
Free the option module.
void options_init()
Initialize the option module.
const char * option_name(const struct option *poption)
Returns the name of the option.
const struct option_set * server_optset
void options_dialogs_set()
This set the city and player report dialog options.
client_options * gui_options
void options_dialogs_update()
This set the city and player report dialog options to the current ones.
int option_number(const struct option *poption)
Returns the number of the option.
void server_options_free()
Free the server options, if already received.
int option_int_get(const struct option *poption)
Returns the current value of this integer option.
struct option * optset_option_by_name(const struct option_set *poptset, const char *name)
Returns the option corresponding of the name in this option set.
bool option_bool_get(const struct option *poption)
Returns the current value of this boolean option.
enum option_type option_type(const struct option *poption)
Returns the type of the option.
struct option * optset_option_by_number(const struct option_set *poptset, int id)
Returns the option corresponding of the number in this option set.
void fill_topo_ts_default()
Fill default tilesets for topology-specific settings.
void options_save(option_save_log_callback log_cb)
Save all options.
void options_load()
Load from the rc file any options that are not ruleset specific.
unsigned option_bitwise_get(const struct option *poption)
Returns the current value of this bitwise option.
void server_options_init()
Initialize the server options (not received yet).
#define DEFAULT_METASERVER_OPTION
void refresh_overview_canvas()
Redraw the entire backing store for the overview minimap.
void overview_free()
Free overview resources.
void packets_deinit()
Call when there is no longer a requirement for protocol processing.
const char * packet_name(enum packet_type type)
void packhand_free()
Called below, and by client/client_main.c client_game_free()
void set_client_page(enum client_pages page)
enum client_pages get_client_page()
bool is_valid_username(const char *name)
Returns whether this is a valid username.
int player_number(const struct player *pplayer)
Return the player index/number/id.
int player_count()
Return the number of players.
#define players_iterate_end
#define players_iterate(_pplayer)
void fc_srand(std::uint_fast32_t seed)
Initialize the generator; see comment at top of file.
struct research * research_get(const struct player *pplayer)
Returns the research structure associated with the player.
Q_GLOBAL_STATIC(QVector< QString >, future_name_translation)
void research_update(struct research *presearch)
Mark as TECH_PREREQS_KNOWN each tech which is available, not known and which has all requirements ful...
bool script_client_init()
Initialize the scripting state.
void script_client_free()
Free the scripting data.
#define SERVER_SETTING_NONE
void dont_run_as_root(const char *argv0, const char *fallback)
If we have root privileges, die with an error.
void free_nls()
Free memory allocated by Native Language Support.
void init_nls()
Setup for Native Language Support, if configured to use it.
char * user_username(char *buf, size_t bufsz)
Returns string which gives user's username, as specified by $USER or as given in password file for th...
static civtimer * between_turns
struct civ_game::@28::@31 client
struct conn_list * est_connections
struct packet_game_info info
struct conn_list * all_connections
struct packet_timeout_info tinfo
char default_sound_set_name[512]
char default_metaserver[512]
bool auto_center_each_turn
char default_server_host[512]
bool save_options_on_exit
char default_music_set_name[512]
char default_sound_plugin_name[512]
char default_user_name[512]
int(* player_tile_city_id_get)(const struct tile *ptile, const struct player *pplayer)
int(* server_setting_val_int_get)(server_setting_id id)
void(* create_extra)(struct tile *ptile, const extra_type *pextra, struct player *pplayer)
bool(* player_tile_vision_get)(const struct tile *ptile, const struct player *pplayer, enum vision_layer vision)
const char *(* server_setting_name_get)(server_setting_id id)
bool(* server_setting_val_bool_get)(server_setting_id id)
void(* destroy_extra)(struct tile *ptile, struct extra_type *pextra)
server_setting_id(* server_setting_by_name)(const char *name)
unsigned int(* server_setting_val_bitwise_get)(server_setting_id id)
enum sset_type(* server_setting_type_get)(server_setting_id id)
The base class for options.
struct city_list * cities
struct player::@65::@68 client
struct conn_list * connections
int fc_snprintf(char *str, size_t n, const char *format,...)
See also fc_utf8_snprintf_trunc(), fc_utf8_snprintf_rep().
int fc_at_quick_exit(void(*func)())
Set quick_exit() callback if possible.
#define sz_strlcpy(dest, src)
void init_themes()
Initialized themes data.
enum known_type tile_get_known(const struct tile *ptile, const struct player *pplayer)
Return a known_type enumeration value for the tile.
struct city * tile_city(const struct tile *ptile)
Return the city on this tile (or nullptr), checking for city center.
#define tile_terrain(_tile)
#define tile_owner(_tile)
void tileset_free(struct tileset *t)
Clean up.
help_item * tileset_help(const struct tileset *t)
Creates the help item for the given tileset.
bool tilespec_try_read(const QString &tileset_name, bool verbose, int topo_id)
Read a new tilespec in when first starting the game.
void role_unit_precalcs()
Initialize; it is safe to call this multiple times (e.g., if units have changed due to rulesets in cl...
const char * freeciv21_version()
Returns the raw version string.
const char * freeciv_name_version()
Return string containing both name of Freeciv21 and version.
void init_city_report_game_data()
Initialize city report data.
void link_marks_free()
Free the link marks.
void link_marks_init()
Initialize the link marks.
void update_map_canvas_visible()
Schedules an update of (only) the visible part of the map at the next unqueue_mapview_update().
void init_player_dlg_common()
Translate all titles.
void voteinfo_queue_init()
Initialize data structures used by this module.
void voteinfo_queue_free()
Free memory allocated by this module.
void voteinfo_queue_check_removed()
Check for old votes that should be removed from the queue.
void voteinfo_gui_update(void)
Refresh all vote related GUI widgets.