157 pconn->server.delegation.playing =
nullptr;
172 _(
"Welcome to the %s Server running at %s port %d."),
176 _(
"Welcome to the %s Server at port %d."),
213 _(
"Your delegate %s was controlling your player '%s'; "
217 _(
"%s reconnected, ending your delegated control of "
222 log_error(
"Failed to revoke delegate %s's control of %s, so owner %s "
223 "can't regain control.",
pdelegate->username,
226 _(
"Couldn't get control of '%s' from delegation to %s."),
245 if (
wplayer->autoselect_weight > 0
256 if (
wplayer->autoselect_weight > 0
265 _(
"Couldn't attach your connection to a scenario player."));
278 _(
"Couldn't attach your connection to new player."));
288 if (pplayer ==
nullptr) {
296 _(
"You are logged in as '%s' connected to no player."),
300 _(
"You are logged in as '%s' connected to %s."),
315 _(
"%s has connected (player %s)."),
320 _(
"%s has connected from %s (player %s)."),
327 _(
"%s has connected."),
331 _(
"%s has connected from %s."),
349 _(
"Turn-blocking game play: "
350 "waiting on %s to finish turn..."),
358 _(
" *** Server is in edit mode. *** "));
361 if (pplayer !=
nullptr) {
408 log_normal(
_(
"Connection request from %s from %s"),
422 _(
"The client is missing a capability that this server needs.\n"
423 "Server version: %d.%d.%d%s Client version: %d.%d.%d%s."
424 " Upgrading may help!"),
429 log_normal(
_(
"%s was rejected: Mismatched capabilities."),
437 _(
"The server is missing a capability that the client needs.\n"
438 "Server version: %d.%d.%d%s Client version: %d.%d.%d%s."
439 " Upgrading may help!"),
444 log_normal(
_(
"%s was rejected: Mismatched capabilities."),
457#ifdef EMERGENCY_VERSION
472 log_normal(
_(
"%s was rejected: Invalid name [%s]."),
478 fc_snprintf(msg,
sizeof(msg),
_(
"You have been kicked from this server "
479 "and cannot reconnect for %d seconds."),
483 "(%d seconds remaining)."),
491 fc_snprintf(msg,
sizeof(msg),
_(
"'%s' already connected."),
494 log_normal(
_(
"%s was rejected: Duplicate login name [%s]."),
502 "Ping timer list size %d, should be 1. Have we sent "
503 "a ping to unestablished connection %s?",
541 _(
"Lost connection: %s."), desc);
651 "connections must be detached with "
652 "connection_detach() before calling this!");
655 if (pplayer ==
nullptr) {
659 if (pplayer ==
nullptr) {
705 }
else if (pplayer ==
nullptr) {
734 pconn->playing = pplayer;
815 if ((pplayer =
pconn->playing) !=
nullptr) {
820 pconn->playing =
nullptr;
831 if (!
aconn->observer) {
867 log_verbose(
"connection_detach() calls send_player_info_c()");
893 pconn->server.delegation.observer =
pconn->observer;
907 if (
pconn->playing !=
nullptr ||
pconn->observer) {
915#ifndef FREECIV_NDEBUG
919 pconn->server.delegation.playing,
920 pconn->server.delegation.observer);
925 pconn->server.delegation.playing =
nullptr;
929 oplayer->server.orig_username[0] =
'\0';
931 dplayer->server.orig_username[0] =
'\0';
949 if (!
pconn->server.delegation.status) {
953 if (
pconn->server.delegation.playing
954 && !
pconn->server.delegation.observer) {
958 strcmp(
pconn->server.delegation.playing->server.orig_username,
969 if (
pconn->playing !=
nullptr ||
pconn->observer) {
974 if ((
pconn->server.delegation.playing !=
nullptr
975 ||
pconn->server.delegation.observer)
977 pconn->server.delegation.observer)) {
983 pconn->server.delegation.playing =
nullptr;
990 oplayer->server.orig_username[0] =
'\0';
996 dplayer->server.orig_username[0] =
'\0';
const char * default_ai_type_name(void)
bool auth_user(struct connection *pconn, char *username)
bool has_capabilities(const char *us, const char *them)
const char *const our_capability
static bool connection_attach_real(struct connection *pconn, struct player *pplayer, bool observing, bool connecting)
void send_conn_info(struct conn_list *src, struct conn_list *dest)
bool connection_attach(struct connection *pconn, struct player *pplayer, bool observing)
static void package_conn_info(struct connection *pconn, struct packet_conn_info *packet)
void reject_new_connection(const char *msg, struct connection *pconn)
static void send_conn_info_arg(struct conn_list *src, struct conn_list *dest, bool remove_conn)
void handle_sync_serial(struct connection *conn, int serial)
bool connection_delegate_take(struct connection *pconn, struct player *dplayer)
bool handle_login_request(struct connection *pconn, struct packet_server_join_req *req)
struct player * find_uncontrolled_player(void)
static void restore_access_level(struct connection *pconn)
void lost_connection_to_client(struct connection *pconn)
void connection_close_server(struct connection *pconn, const char *reason)
void connection_detach(struct connection *pconn, bool remove_unused_player)
void conn_set_access(struct connection *pconn, enum cmdlevel new_level, bool granted)
bool connection_delegate_restore(struct connection *pconn)
void send_conn_info_remove(struct conn_list *src, struct conn_list *dest)
void establish_new_connection(struct connection *pconn)
struct player * conn_get_player(const struct connection *pconn)
bool can_conn_edit(const struct connection *pconn)
struct connection * conn_by_user(const char *user_name)
void flush_connection_send_buffer_all(struct connection *pc)
void conn_set_capability(struct connection *pconn, const char *capability)
void conn_reset_delta_state(struct connection *pc)
void connection_close(struct connection *pconn, const char *reason)
bool conn_controls_player(const struct connection *pconn)
const char * conn_description(const struct connection *pconn)
void conn_compression_freeze(struct connection *pconn)
enum cmdlevel conn_get_access(const struct connection *pconn)
bool conn_compression_thaw(struct connection *pconn)
#define conn_list_iterate(connlist, pconn)
#define conn_list_iterate_end
void send_diplomatic_meetings(struct connection *dest)
void edithand_send_initial_packets(struct conn_list *dest)
const struct ft_color ftc_player_lost
const struct ft_color ftc_server
const struct ft_color ftc_editor
const struct ft_color ftc_any
void send_scenario_description(struct conn_list *dest)
void send_scenario_info(struct conn_list *dest)
void send_game_info(struct conn_list *dest)
const char * new_challenge_filename(struct connection *pc)
#define fc_assert_msg(condition, message,...)
#define fc_assert_ret(condition)
#define log_verbose(message,...)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define fc_assert_action(condition, action)
#define log_debug(message,...)
#define log_normal(message,...)
#define log_error(message,...)
#define fc_assert_ret_val_msg(condition, val, message,...)
void send_pending_events(struct connection *pconn, bool include_public)
void notify_conn(struct conn_list *dest, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
void package_event(struct packet_chat_msg *packet, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
void event_cache_add_for_all(const struct packet_chat_msg *packet)
int dsend_packet_connect_msg(struct connection *pc, const char *message)
void lsend_packet_conn_info(struct conn_list *dest, const struct packet_conn_info *packet)
int send_packet_server_info(struct connection *pc, const struct packet_server_info *packet)
int send_packet_chat_msg(struct connection *pc, const struct packet_chat_msg *packet)
int send_packet_set_topology(struct connection *pc, const struct packet_set_topology *packet)
int dsend_packet_sync_serial_reply(struct connection *pc, int serial)
int dsend_packet_start_phase(struct connection *pc, int phase)
int send_packet_server_join_reply(struct connection *pc, const struct packet_server_join_reply *packet)
bool is_valid_username(const char *name)
int player_slot_count(void)
int player_number(const struct player *pplayer)
const char * player_name(const struct player *pplayer)
bool player_has_flag(const struct player *pplayer, enum plr_flag_id flag)
struct player * player_by_user(const char *name)
#define players_iterate_end
#define players_iterate(_pplayer)
#define set_as_human(plr)
#define players_iterate_alive_end
#define players_iterate_alive(_pplayer)
void server_player_set_name(struct player *pplayer, const char *name)
struct player * server_create_player(int player_id, const char *ai_tname, struct rgbcolor *prgbcolor, bool allow_ai_type_fallbacking)
int normal_player_count(void)
struct player * player_by_user_delegated(const char *name)
void send_player_info_c(struct player *src, struct conn_list *dest)
void send_delegation_info(const struct connection *pconn)
void server_remove_player(struct player *pplayer)
void server_player_init(struct player *pplayer, bool initmap, bool needs_team)
const char * player_delegation_get(const struct player *pplayer)
void reset_all_start_commands(bool plrchange)
void report_final_scores(struct conn_list *dest)
void send_current_history_report(struct conn_list *dest)
void send_rulesets(struct conn_list *dest)
bool script_fcdb_call(const char *func_name,...)
struct setting_list * level[OLEVELS_NUM]
void send_server_setting_control(struct connection *pconn)
void send_server_settings(struct conn_list *dest)
void send_server_access_level_settings(struct conn_list *dest, enum cmdlevel old_level, enum cmdlevel new_level)
void remove_leading_trailing_spaces(char *s)
const char * aifill(int amount)
bool game_was_started(void)
struct server_arguments srvarg
void check_for_full_turn_done(void)
void send_all_info(struct conn_list *dest)
enum server_states server_state(void)
void notify_if_first_access_level_is_available(void)
bool conn_is_kicked(struct connection *pconn, int *time_remaining)
void toggle_ai_player_direct(struct connection *caller, struct player *pplayer)
char connectmsg[MAX_LEN_MSG]
struct conn_list * glob_observers
struct conn_list * est_connections
struct packet_game_info info
struct conn_list * all_connections
struct civ_game::@32::@36 server
char capability[MAX_LEN_CAPSTR]
char username[MAX_LEN_NAME]
enum cmdlevel access_level
char challenge_file[4095]
char username[MAX_LEN_NAME]
struct conn_list * connections
struct nation_type * nation
int fc_snprintf(char *str, size_t n, const char *format,...)
int fc_gethostname(char *buf, size_t len)
int fc_strcasecmp(const char *str0, const char *str1)
#define sz_strlcpy(dest, src)
#define fc_strncmp(_s1_, _s2_, _len_)
void team_remove_player(struct player *pplayer)
const char * freeciv_name_version(void)
void send_running_votes(struct connection *pconn, bool only_team_votes)
void send_remove_team_votes(struct connection *pconn)
void cancel_connection_votes(struct connection *pconn)
void send_updated_vote_totals(struct conn_list *dest)