1 /**********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 ***********************************************************************/
15 #include <fc_config.h>
28 #include "connectdlg_g.h"
31 #include "chatline_common.h" /* for append_output_window */
32 #include "client_main.h"
33 #include "connectdlg.h"
34 #include "packhand_gen.h"
36 /**************************************************************************
37 Really close and destroy the dialog.
38 **************************************************************************/
39 void really_close_connection_dialog(void)
44 /**************************************************************************
45 Close and destroy the dialog. But only if we don't have a local
46 server running (that we started).
47 **************************************************************************/
48 void gui_close_connection_dialog()
53 /**************************************************************************
54 Configure the dialog depending on what type of authentication request the
56 **************************************************************************/
57 void handle_authentication_req(enum authentication_type type
,
61 case AUTH_NEWUSER_FIRST
:
62 /* PORTME: switch configs if need be */
64 case AUTH_NEWUSER_RETRY
:
65 /* PORTME: switch configs if need be */
67 case AUTH_LOGIN_FIRST
:
68 /* if we magically have a password already present in 'password'
69 * then, use that and skip the password entry dialog */
70 if (password
[0] != '\0') {
71 struct packet_authentication_reply reply
;
73 sz_strlcpy(reply
.password
, password
);
74 send_packet_authentication_reply(&client
.conn
, &reply
);
77 /* PORTME: switch configs if need be */
80 case AUTH_LOGIN_RETRY
:
81 /* PORTME: switch configs if need be */
85 log_error("Unsupported authentication type %d: %s.", type
, message
);
88 /**************************************************************************
89 Provide a packet handler for packet_game_load.
91 This regenerates the player information from a loaded game on the
93 **************************************************************************/
94 void handle_game_load(bool load_successful
, const char *filename
)
100 /**************************************************************************
101 Provide an interface for connecting to a Freeciv server.
102 **************************************************************************/
103 void gui_server_connect(void)