46 Commits

Author SHA1 Message Date
Charles Dang
8118cc5f1b GUI2/Dialogs: made use of nested namespace specifiers where possible 2021-02-20 21:41:13 +11:00
Charles Dang
91d74a5aa0 Removed unnecessary include 2019-08-05 06:50:00 +11:00
Charles Dang
6049851251 Small cleanup
We don't really need the return value.
2019-08-02 21:25:23 +11:00
Charles Dang
13b1758526
Use an atomic bool flag since Soliton pointed out the last method still had a race condition 2019-08-02 01:23:10 +11:00
Charles Dang
21d21b0a26
GUI2/Network Transmission: delegate connection polling to a worker thread 2019-08-01 13:45:53 +11:00
Martin Hrubý (hrubymar10)
674fda85b7 Migrate links to https if available - Fwd c18537edc0678f40a209797d72dfaba3e5e88545
(cherry-picked from commit bc4d22dc72e79c3d6a3364ac896e473afd298246)
2018-10-07 03:23:36 +00:00
Charles Dang
45f871067f Use std::size_t everywhere instead of plain size_t
Excludes:
* spirit_po/
* xBRZ/

(cherry-picked from commit fc2a58f6935176b70a035d3e1c03080f79687f94)
2018-10-07 03:17:59 +00:00
Gregory A Lundberg
b5f76eff79
Bump copyright to 2018 2018-01-19 00:02:20 -06:00
Jyrki Vesterinen
c9ec111cf1 Addon client: close connection if the player cancels the download
This ensures that the game won't interpret the rest of the addon as a
response for the client's next request.

Fixes #2203.
2018-01-13 14:59:58 +02:00
Charles Dang
d7302d684d Refactor general-purpose fetch-server-data-with-loading-screen functions
This fully splits the wesnothd loading screen handling from the network_transmission dialog and
into wesnothd_connection. Much cleaner this way. I've also added wait_and_receive_data as a general
spin-and-wait-for-data-to-come-in function instead of having it local in open_connection.
2017-11-07 20:32:36 +11:00
Charles Dang
e07a32e658 Use an enum for loading screen stages instead of string IDs
This allows for compile-time verification of stage ID names, instead of leaving it until runtime.
It also allows the use of std::atomic for the current stage class variable since we're no longer
using a const-qualified type.
2017-11-07 18:11:05 +11:00
Charles Dang
50c9b526a7 Refactor MP connection code to avoid constantly creating loading screens
Previously, the use of the wesnothd_connect_dialog and wesnothd_receive_dialog wrappers meant
multiple loading screen instances were created when connecting to MP. This change means only
one (or two, if the config is reloaded) loading screen objects are created when connecting to
the server. It also ensures the entire connection process (ie, the extent of open_connection)
is done with a loading screen displayed.
2017-11-07 16:36:29 +11:00
Charles Dang
302d2353b7 GUI2/Dialogs: minor include cleanup of widget files in headers 2017-08-15 11:23:13 +11:00
gfgtdf
36f19f7572 use a worker thread to send packages in wesnothd_connection
fixes #1674
This fixed a problem where at game start the host sends first a [scenario_diff]
and then a [start_game] but then the host loads the scenario config and
wesnothd_connection::poll isn't called while the loadingscreen is showing. so
the other players receive the [start_game] with a lot delay since
wesnothd_connection won't send it before the the loadingscreen has finished.

This isn't finished yet. In particular i still have to figure out how to
handle (network) exceptions here.
2017-06-13 16:14:20 +02:00
gfgtdf
015338a1bb use shared_ptr for wesnothd_connection 2017-06-13 16:14:19 +02:00
Charles Dang
96ea0eb6b9 Removed trailing tabs and whitespaces from C++ source
[ci skip]

I ran the command used in 9b7b1751fdda, excluding results in lua/ and spirit_po/.

Also, once again, for some reason actions/vision.hpp gets registered as massively changed
(similar to f11fa0652af0) despite nothing really having changed at all.
2017-05-16 06:46:43 +11:00
Charles Dang
2101353d36 Convert include guards to the shorter #pragma once
Turns out I mistook @celticminstrel's opinion that we should use include guards over pragma (737916e).
Since all major compilers support `#pragma once`, there's no reason not to use it.

For future mergability reasons, this excludes src/spirit_po and src/xBRZ. It also excludes src/boost-patched.
2017-05-09 19:41:37 +11:00
Charles Dang
7d8380cd87 GUI2: marked inherited dialog functions (pre_show, etc) as virtual override
The virtual is for style consistency, the override because it should be done.
2017-04-12 17:44:51 +11:00
Celtic Minstrel
b4dc11ce36 Belated 2017 copyright update 2017-03-19 10:05:38 -04:00
Celtic Minstrel
67ea79d86f Rename some GUI2 files to match the contained class 2016-11-19 17:16:10 -05:00
Celtic Minstrel
10b6a34615 Rename all GUI2 dialogs to drop t- prefix
This also places them in a new dialogs namespace.
2016-11-09 01:27:30 -05:00
Celtic Minstrel
c09125096b Rename GUI2 widget classes to drop t- prefix 2016-11-09 01:27:30 -05:00
Celtic Minstrel
e555ff9f43 Rename twesnothd_connection -> wesnothd_connection 2016-11-09 01:17:14 -05:00
Celtic Minstrel
e32b88568e Use loading screen instead of network transmission screen when connecting to the MP server 2016-09-08 02:24:13 -04:00
gfgtdf
a20f221e83 remove dialogs.cpp
And move its code in other files where it fits better.

This also moves some code from actions.cpp to the new file
advancements.cpp

This also removed a parameter from show_objectives and
menu_handler::objectives that was always gui_->viewing_side()
2016-08-10 16:06:54 +02:00
Celtic Minstrel
0ca410873a Fix some compiler warnings 2016-06-06 23:07:58 -04:00
gfgtdf
a6b114f6ae use boost asio on clientside wesnothd connection
The main advantage is that the new code is much shorter and easier to
understand then the preivous one.

It currently still used the network::error class on some places

This also removed support for 'ping' packages, the plan is to replace it
with SO_KEEPALIVE

Also this temporaily breaks the gui2 lobby since it still uses the old
network code.
2016-06-05 14:50:53 +02:00
Charles Dang
11b941ab58 GUI2: removed CVideo argument from tdialog::preshow
In all but three cases, this argument was unused. In those remaining cases,
the argument could be replaced by twindow::video().
2016-03-15 02:15:28 +11:00
Chris Beck
ba51524f6e update copyright to year 2016
using this shell script:

find src -type f -print0 | xargs -0 sed -i "s|Copyright (C) \([[:digit:]]*\)\([ ]*\)-\([ ]*\)2015|Copyright (C) \1\2-\32016|g"
2016-01-02 23:59:31 -05:00
Ignacio R. Morelle
57ae45387a New Year copyright update 2015-01-01 19:07:35 -03:00
Mark de Wever
e5253f3265 Use clang-format on the gui directory.
Most of the formatting has been done automatically, but some minor manual
polishing has been applied afterwards.

Also add .clang-format file containing the settings used for the
formatting.
2014-02-09 16:58:32 +01:00
Ignacio R. Morelle
a4f47a63c7 New Year copyright update 2014-01-01 02:08:52 -03:00
fendrin
1b1de2e720 Refactored the hotkeys system. 2013-12-03 18:13:51 +01:00
fendrin
d58ccfdc5a More spelling fixes :-P 2013-06-23 22:35:20 +02:00
Eric S. Raymond
043c4f9fd3 Remove $Id$ cookies. 2013-03-26 21:41:37 -04:00
Mark de Wever
43b71f2ff0 New year copyright update. 2013-01-01 09:22:03 +00:00
Sergey Popov
34008f458a Properly adhere to trailing _ for members policy. 2012-06-02 20:12:25 +00:00
Sergey Popov
44d72f94b4 Default initialize tnetwork_transmission::_track_upload 2012-06-02 20:12:20 +00:00
Sergey Popov
65f380433a Made transmission dialog for addon uploads track upload progress again. 2012-05-07 00:15:14 +00:00
Ignacio R. Morelle
cfcf345242 New year copyright update, part 2 2012-02-03 20:18:33 +00:00
Sergey Popov
f7da87291a Made the network transmission dialog track upload progress when uploading addons
instead of tracking the progress of downloading the server's responce.
2011-08-07 20:17:29 +00:00
Mark de Wever
5bf057903c Some minor tweaks to the network dialog.
Changes:

- Allows the progress to be translated.

- Sets the title directly upon creation.
2011-07-05 18:42:22 +00:00
Sergey Popov
882bed8c8b GUI2 network transmission dialog improvements:
Added feedback on whether it's connecting/downloading and
made strings translatable.
2011-07-02 18:06:03 +00:00
Mark de Wever
98fbaa775d Initialize all members. 2011-06-23 05:54:33 +00:00
Sergey Popov
301427f778 Started working on the new asio based network subsystem. 2011-06-18 23:10:55 +00:00
Sergey Popov
2e0b1f7853 Started implementing the gui2 network transmission dialog. 2011-06-17 00:17:41 +00:00