Freeciv21
Develop your civilization from humble roots to a global empire
connectdlg.cpp
Go to the documentation of this file.
1
/*
2
Copyright (c) 1996-2020 Freeciv21 and Freeciv contributors. This file is
3
part of Freeciv21. Freeciv21 is free software: you can redistribute it
4
and/or modify it under the terms of the GNU General Public License as
5
published by the Free Software Foundation, either version 3 of the
6
License, or (at your option) any later version. You should have received
7
a copy of the GNU General Public License along with Freeciv21. If not,
8
see https://www.gnu.org/licenses/.
9
*/
10
11
// common
12
#include "
game.h
"
13
// client
14
#include "
chatline_common.h
"
15
#include "
fc_client.h
"
16
#include "packhand_gen.h"
17
#include "
page_network.h
"
18
#include "
pages_g.h
"
19
#include "
qtg_cxxside.h
"
20
25
void
handle_authentication_req
(
enum
authentication_type
type,
26
const
char
*
message
)
27
{
28
set_client_page
(PAGE_NETWORK);
29
qobject_cast<page_network *>(
king
()->pages[PAGE_NETWORK])
30
->handle_authentication_req(type,
message
);
31
}
32
39
void
handle_game_load
(
bool
load_successful,
const
char
*filename)
40
{
41
Q_UNUSED(filename)
42
if
(load_successful) {
43
set_client_page
(PAGE_START);
44
45
if
(
game
.
info
.is_new_game) {
46
// It's pregame. Create a player and connect to him
47
send_chat
(
"/take -"
);
48
}
49
}
50
}
send_chat
int send_chat(const char *message)
Send the message as a chat to the server.
Definition:
chatline_common.cpp:35
chatline_common.h
handle_game_load
void handle_game_load(bool load_successful, const char *filename)
Provide a packet handler for packet_game_load.
Definition:
connectdlg.cpp:39
handle_authentication_req
void handle_authentication_req(enum authentication_type type, const char *message)
Configure the dialog depending on what type of authentication request the server is making.
Definition:
connectdlg.cpp:25
fc_client.h
king
class fc_client * king()
Return fc_client instance.
Definition:
gui_main.cpp:58
game
struct civ_game game
Definition:
game.cpp:47
game.h
authentication_type
authentication_type
Definition:
packets.h:67
page_network.h
pages_g.h
set_client_page
void set_client_page(enum client_pages page)
Definition:
update_queue.cpp:292
qtg_cxxside.h
civ_game::info
struct packet_game_info info
Definition:
game.h:80
message
Definition:
messagewin_common.h:16
client
connectdlg.cpp
Generated by
1.9.1