Freeciv-3.2
|
#include "fc_prehdrs.h"
#include <fcntl.h>
#include <stdio.h>
#include <signal.h>
#include <string.h>
#include <time.h>
#include "astring.h"
#include "capability.h"
#include "deprecations.h"
#include "fciconv.h"
#include "fcintl.h"
#include "ioz.h"
#include "log.h"
#include "mem.h"
#include "netintf.h"
#include "rand.h"
#include "registry.h"
#include "shared.h"
#include "support.h"
#include "attribute.h"
#include "client_main.h"
#include "climisc.h"
#include "clinet.h"
#include <packhand_gen.h>
#include "chatline_common.h"
#include "connectdlg_g.h"
#include "connectdlg_common.h"
#include "tilespec.h"
Go to the source code of this file.
Macros | |
#define | WAIT_BETWEEN_TRIES 100000 /* usecs */ |
#define | NUMBER_OF_TRIES 500 |
Functions | |
bool | is_server_running (void) |
bool | can_client_access_hack (void) |
void | client_kill_server (bool force) |
bool | client_start_server (void) |
static void | randomize_string (char *str, size_t n) |
void | send_client_wants_hack (const char *filename) |
void | handle_single_want_hack_reply (bool you_have_hack) |
void | send_save_game (const char *filename) |
void | handle_ruleset_choices (const struct packet_ruleset_choices *packet) |
void | set_ruleset (const char *ruleset) |
Variables | |
bool | server_quitting = FALSE |
static char | challenge_fullname [MAX_LEN_PATH] |
static bool | client_has_hack = FALSE |
int | internal_server_port |
#define NUMBER_OF_TRIES 500 |
Definition at line 74 of file connectdlg_common.c.
Definition at line 69 of file connectdlg_common.c.
Returns TRUE if the client has hack access.
Definition at line 141 of file connectdlg_common.c.
Referenced by mr_menu::menus_sensitive(), real_menus_init(), real_menus_update(), fc_client::update_buttons(), and update_start_page_buttons().
Kills the server if the client has started it.
If the 'force' parameter is unset, we just do a /quit. If it's set, then we'll send a signal to the server to kill it (use this when the socket is disconnected already).
Definition at line 153 of file connectdlg_common.c.
Referenced by client_conn_close_callback(), client_start_server(), disconnect_from_server(), emergency_exit(), and handle_single_want_hack_reply().
Forks a server if it can. Returns FALSE if we find we couldn't start the server.
Definition at line 224 of file connectdlg_common.c.
Referenced by client_start_server_and_set_page(), real_set_client_page(), set_client_state(), fc_client::start_from_save(), fc_client::start_new_game(), start_new_game_callback(), start_new_game_callback(), and fc_client::start_scenario().
void handle_ruleset_choices | ( | const struct packet_ruleset_choices * | packet | ) |
Handle the list of rulesets sent by the server.
Definition at line 765 of file connectdlg_common.c.
Referenced by client_handle_packet().
Handle response (by the server) if the client has got hack or not.
Definition at line 723 of file connectdlg_common.c.
Referenced by client_handle_packet().
Tests if the client has started the server.
Definition at line 124 of file connectdlg_common.c.
Referenced by mr_menu::back_to_menu(), client_kill_server(), handle_single_want_hack_reply(), leave_callback(), leave_callback(), load_selected_game_callback(), real_set_client_page(), refresh_chat_buttons(), resend_desired_settable_options(), fc_client::start_from_save(), fc_client::start_new_game(), start_new_game_callback(), start_new_game_callback(), fc_client::start_scenario(), fc_client::switch_page(), and chatwdg::update_widgets().
Generate a random string.
Definition at line 659 of file connectdlg_common.c.
Referenced by send_client_wants_hack().
If the client is capable of 'wanting hack', then the server will send the client a filename in the packet_join_game_reply packet.
This function creates the file with a suitably random string in it and then sends the string to the server. If the server can open and read the string, then the client is given hack access.
Definition at line 679 of file connectdlg_common.c.
Referenced by handle_server_join_reply().
Send server command to save game.
Definition at line 751 of file connectdlg_common.c.
Referenced by mr_menu::save_game(), mr_menu::save_game_as(), save_game_callback(), save_game_callback(), save_game_callback(), and save_game_dialog_popup().
Called by the GUI code when the user sets the ruleset. The ruleset passed in here should match one of the strings given to set_rulesets().
Definition at line 792 of file connectdlg_common.c.
Referenced by pregame_options::ruleset_change(), and ruleset_selected().
|
static |
Definition at line 91 of file connectdlg_common.c.
Referenced by handle_single_want_hack_reply(), and send_client_wants_hack().
Definition at line 92 of file connectdlg_common.c.
Referenced by can_client_access_hack(), client_kill_server(), and handle_single_want_hack_reply().
int internal_server_port |
Definition at line 94 of file connectdlg_common.c.
Referenced by client_start_server().
Definition at line 89 of file connectdlg_common.c.
Referenced by client_kill_server(), client_start_server(), and is_server_running().