Freeciv-3.1: /fast/freeciv/nightly/S3_1/client/gui-stub/connectdlg.c Source File

Freeciv-3.1

Loading...
Searching...
No Matches
connectdlg.c
Go to the documentation of this file.
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)
6 any later version.
7
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***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18#include <errno.h>
19
20/* utility */
21#include "fcintl.h"
22#include "log.h"
23#include "support.h"
24
25/* gui main header */
26#include "gui_stub.h"
27
28#include "connectdlg_g.h"
29
30/* client */
31#include "chatline_common.h" /* for append_output_window */
32#include "client_main.h"
33#include "connectdlg.h"
34#include "packhand_gen.h"
35
36
37/**********************************************************************/
41 void gui_close_connection_dialog(void)
42{
43 /* PORTME */
44}
45
46/**********************************************************************/
50 void handle_authentication_req(enum authentication_type type,
51 const char *message)
52{
53 switch (type) {
54 case AUTH_NEWUSER_FIRST:
55 /* PORTME: switch configs if need be */
56 return;
57 case AUTH_NEWUSER_RETRY:
58 /* PORTME: switch configs if need be */
59 return;
60 case AUTH_LOGIN_FIRST:
61 /* if we magically have a password already present in 'fc_password'
62 * then, use that and skip the password entry dialog */
63 if (fc_password[0] != '\0') {
64 struct packet_authentication_reply reply;
65
66 sz_strlcpy(reply.password, fc_password);
67 send_packet_authentication_reply(&client.conn, &reply);
68 return;
69 } else {
70 /* PORTME: switch configs if need be */
71 }
72 return;
73 case AUTH_LOGIN_RETRY:
74 /* PORTME: switch configs if need be */
75 return;
76 }
77
78 log_error("Unsupported authentication type %d: %s.", type, message);
79}
80
81/**********************************************************************/
87 void handle_game_load(bool load_successful, const char *filename)
88{
89 /* PORTME */
90}
91
92
93/**********************************************************************/
96 void gui_server_connect(void)
97{
98 /* PORTME */
99}
chatline_common.h
client
struct civclient client
Definition client_main.c:149
fc_password
char fc_password[MAX_LEN_PASSWORD]
Definition client_main.c:142
client_main.h
connectdlg_g.h
fcintl.h
type
GType type
Definition repodlgs.c:1312
handle_game_load
void handle_game_load(bool load_successful, const char *filename)
Definition connectdlg.c:80
handle_authentication_req
void handle_authentication_req(enum authentication_type type, const char *message)
Definition connectdlg.c:1118
gui_close_connection_dialog
void gui_close_connection_dialog(void)
Definition connectdlg.c:41
gui_server_connect
void gui_server_connect(void)
Definition connectdlg.c:96
connectdlg.h
gui_stub.h
log.h
log_error
#define log_error(message,...)
Definition log.h:103
authentication_type
authentication_type
Definition packets.h:88
AUTH_NEWUSER_RETRY
@ AUTH_NEWUSER_RETRY
Definition packets.h:92
AUTH_NEWUSER_FIRST
@ AUTH_NEWUSER_FIRST
Definition packets.h:90
AUTH_LOGIN_RETRY
@ AUTH_LOGIN_RETRY
Definition packets.h:91
AUTH_LOGIN_FIRST
@ AUTH_LOGIN_FIRST
Definition packets.h:89
send_packet_authentication_reply
int send_packet_authentication_reply(struct connection *pc, const struct packet_authentication_reply *packet)
Definition packets_gen.c:2464
packhand_gen.h
civclient::conn
struct connection conn
Definition client_main.h:96
message
Definition messagewin_common.h:29
packet_authentication_reply
Definition packets_gen.h:67
packet_authentication_reply::password
char password[MAX_LEN_PASSWORD]
Definition packets_gen.h:68
support.h
sz_strlcpy
#define sz_strlcpy(dest, src)
Definition support.h:161