[Commits] [wesnoth/wesnoth] b71899: add "try_fetch_addon" function private in manager_...

GitHub noreply at github.com
Sun Mar 15 17:40:04 UTC 2015


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: b718995453953042316588e91576324be9149775
      https://github.com/wesnoth/wesnoth/commit/b718995453953042316588e91576324be9149775
  Author: Chris Beck <render787 at gmail.com>
  Date:   2015-03-15 (Sun, 15 Mar 2015)

  Changed paths:
    M src/addon/manager_ui.cpp

  Log Message:
  -----------
  add "try_fetch_addon" function private in manager_ui.cpp

This is a small refactor of the manager_ui.cpp implementation --
instead of duplicating the boilerplate involved in asking the addon
client to download and install an addon, and allocating a config
for temporary storage, we move this to a private function (at file
scope) in this file.


  Commit: 260ed9ddf30becc6bd866df34c8d96f34c9c7463
      https://github.com/wesnoth/wesnoth/commit/260ed9ddf30becc6bd866df34c8d96f34c9c7463
  Author: Chris Beck <render787 at gmail.com>
  Date:   2015-03-15 (Sun, 15 Mar 2015)

  Changed paths:
    M src/addon/manager_ui.cpp

  Log Message:
  -----------
  add ADDON_OP_RESULT struct, refactor do_resove_dependencies fcn

This is a small refactor of the "do_resolve_dependencies" function.
Instead of taking a reference to a bool which stores return info in,
bundle this with the info about the success or failure of the op.


  Commit: 5112a56439421666c0ebe32ce25c7c7328d98382
      https://github.com/wesnoth/wesnoth/commit/5112a56439421666c0ebe32ce25c7c7328d98382
  Author: Chris Beck <render787 at gmail.com>
  Date:   2015-03-15 (Sun, 15 Mar 2015)

  Changed paths:
    M src/addon/manager_ui.cpp

  Log Message:
  -----------
  add try_fetch_addon_with_checks fcn, use when gui installs addons

Extending the 'try_fetch_addon' fcn, this fcn also calls the dep
check and the check for dev overwrite functions beforehand. Thus it
does a fully 'smart' download of an add-on and tidies up many of the
details.

We plan to call this function also as part of the code path when we
do addon auto-downloads from the mp lobby.


  Commit: aef12fcebfd5d1339b2833d1ba6c712428896b5f
      https://github.com/wesnoth/wesnoth/commit/aef12fcebfd5d1339b2833d1ba6c712428896b5f
  Author: Chris Beck <render787 at gmail.com>
  Date:   2015-03-15 (Sun, 15 Mar 2015)

  Changed paths:
    M src/addon/manager_ui.cpp
    M src/addon/manager_ui.hpp

  Log Message:
  -----------
  add ad_hoc_addon_fetch_session fcn, installs an add-on given its id

This function is public and placed in the header, so that it may be
called by the mp lobby code.

Essentially, it just takes the client creation and connection
routines from addon_manager_ui, calls the try_fetch_addon_with_checks
function, and wraps this in the exception handlers from
addon_manager_ui.


  Commit: 1f793bb458e3ec69938a22cedf460bd600ee4d23
      https://github.com/wesnoth/wesnoth/commit/1f793bb458e3ec69938a22cedf460bd600ee4d23
  Author: Chris Beck <render787 at gmail.com>
  Date:   2015-03-15 (Sun, 15 Mar 2015)

  Changed paths:
    M src/game_config_manager.cpp

  Log Message:
  -----------
  in game cfg mgr, annotate era, mod tags with the addon_id

This is done at the time of loading the config of all addons. The
addon_id can be deduced without much difficulty from the path, we
do this calculation, then scan over the entire cfg that resulted
from that addon and add an addon_id attribute to appropriate top-
level tags.

The purpose of this is so that this info will be included in a
level config after it is constructed by the host, and can be made
available by connect engine to clients that wish to join.

It might be better to do this even earlier in the pipeline, i.e.
so that it happens before the contents are cached. At the moment
I don't see a compelling reason to do that though, and this way
was fairly simple.


  Commit: e334a506c154fe77602b44b755e8f027a75b6238
      https://github.com/wesnoth/wesnoth/commit/e334a506c154fe77602b44b755e8f027a75b6238
  Author: Chris Beck <render787 at gmail.com>
  Date:   2015-03-15 (Sun, 15 Mar 2015)

  Changed paths:
    M src/mp_game_settings.cpp
    M src/mp_game_settings.hpp
    M src/saved_game.cpp

  Log Message:
  -----------
  in fcn expand_mp_events, also collect addon_ids, for mp_settings

At the same time that we expand multiplayer events, by looking up
the tags of the given ids from the game config, we also note their
addon_id field if present and write this list to the mp_settings,
which will become an attribute of the [multiplayer] tag for the
scenario. When the scenario is hosted, this will tell other
clients what addons they can download to be able to play.


  Commit: 1cafaf296c301d5c83c9d4bbf9b59dad93468548
      https://github.com/wesnoth/wesnoth/commit/1cafaf296c301d5c83c9d4bbf9b59dad93468548
  Author: Chris Beck <render787 at gmail.com>
  Date:   2015-03-15 (Sun, 15 Mar 2015)

  Changed paths:
    M src/game_initialization/multiplayer_lobby.cpp
    M src/game_initialization/multiplayer_lobby.hpp
    M src/tests/gui/test_gui2.cpp

  Log Message:
  -----------
  in mp lobby, try to download addons if we can't join a game

If we try to join or observe a game but don't have addons to do it,
ask if we want to try to download them, then call addon client code
to initiate transactions.

Note that because the "is_joinable" / "is_observable" logic includes
this stuff, we would have to refactor to be able to determine
"would this game be joinable if I downloaded the addons". So in the
current state, it's possible that you will be prompted to download
add-ons for a game that you ultimately cannot join anyways, which
might be a bit dissappointing.


  Commit: 281014aee3de0b9ae51bdfd8976526096aeb13d3
      https://github.com/wesnoth/wesnoth/commit/281014aee3de0b9ae51bdfd8976526096aeb13d3
  Author: Chris Beck <render787 at gmail.com>
  Date:   2015-03-15 (Sun, 15 Mar 2015)

  Changed paths:
    M src/game_initialization/multiplayer_lobby.cpp

  Log Message:
  -----------
  fixup double-click not working to download addons in lobby


  Commit: eff4d0b3c6df39b34abfad2c06d9fa096af3edd2
      https://github.com/wesnoth/wesnoth/commit/eff4d0b3c6df39b34abfad2c06d9fa096af3edd2
  Author: Chris Beck <render787 at gmail.com>
  Date:   2015-03-15 (Sun, 15 Mar 2015)

  Changed paths:
    A src/game_initialization/lobby_reload_request_exception.hpp
    M src/game_initialization/multiplayer.cpp
    M src/game_initialization/multiplayer_lobby.cpp
    M src/game_initialization/multiplayer_lobby.hpp

  Log Message:
  -----------
  fix mp lobby autodownloading of addons

Makes the following changes:

When we download new add-ons,
- tear down the mp ui by throwing an exception
- refresh the changed game config, and reload for this game mode
- relaunch the mp lobby, without making a new network connection
- make sure to ask the mp lobby to refresh the games list, so that
we update the joinable / needs addon status appropriately.

After this commit, I have tested that I can prompt other clients
to download add-ons, and that they will do it successsfully and
then be able to join the game.

Still do: Version checking. And, check if the host has an old
version.


  Commit: 3f640b8e718e4c45d8f73798d839bfea0b413fab
      https://github.com/wesnoth/wesnoth/commit/3f640b8e718e4c45d8f73798d839bfea0b413fab
  Author: Chris Beck <render787 at gmail.com>
  Date:   2015-03-15 (Sun, 15 Mar 2015)

  Changed paths:
    M src/game_config_manager.cpp

  Log Message:
  -----------
  drop support for "single-file addons" (my_addon.cfg not with a dir)


  Commit: 60ec660e578767209857ad7503a2530b9b476f76
      https://github.com/wesnoth/wesnoth/commit/60ec660e578767209857ad7503a2530b9b476f76
  Author: Chris Beck <render787 at gmail.com>
  Date:   2015-03-15 (Sun, 15 Mar 2015)

  Changed paths:
    M src/game_config_manager.cpp

  Log Message:
  -----------
  annotate [era], [modification] with addon version, as well as id

This is done at loading time, at the same time that the addon_id
info is recorded. It may eventually be used by clients to determine
if they have out of date content when they try to join a game.


  Commit: 5e817689a536d1681317821656414ea4e1749cfd
      https://github.com/wesnoth/wesnoth/commit/5e817689a536d1681317821656414ea4e1749cfd
  Author: Chris Beck <render787 at gmail.com>
  Date:   2015-03-15 (Sun, 15 Mar 2015)

  Changed paths:
    M src/game_config_manager.cpp
    M src/mp_game_settings.cpp
    M src/mp_game_settings.hpp
    M src/saved_game.cpp

  Log Message:
  -----------
  add version metadata for add-ons to mp_game_settings

Using the version_info class, which will provide methods later for
comparing version numbers.


  Commit: 6ffb9df33dd86388e606b6ba09ff3ea1e858963f
      https://github.com/wesnoth/wesnoth/commit/6ffb9df33dd86388e606b6ba09ff3ea1e858963f
  Author: Chris Beck <render787 at gmail.com>
  Date:   2015-03-15 (Sun, 15 Mar 2015)

  Changed paths:
    M src/game_initialization/multiplayer.cpp
    M src/game_initialization/multiplayer_lobby.cpp
    M src/game_initialization/multiplayer_lobby.hpp
    M src/saved_game.cpp

  Log Message:
  -----------
  add addon version checking and reporting to multiplayer lobby

This also includes a refactor of the "set_game_items" function,
which was quite large and difficult to understand at a glance.
The refactor splits most of the work among 5 or 6 helper functions.

We also add some reporting of add-on status to the name, just as
with the (Unknown Era) string.

We also give the mp lobby a reference, at construction time, to
the list of currently installed add-ons, which will have the same
lifespan as the game_config reference which it is passed. This
ensures that this list is not changing based on add-on directory
contents, unless the lobby gets rebuilt. This is for the sanity
of the lobby, but it also makes testing easier.


  Commit: bf0658522638e3b3d7d2394868b1dac556a5409a
      https://github.com/wesnoth/wesnoth/commit/bf0658522638e3b3d7d2394868b1dac556a5409a
  Author: Chris Beck <render787 at gmail.com>
  Date:   2015-03-15 (Sun, 15 Mar 2015)

  Changed paths:
    M src/addon/manager_ui.cpp
    M src/addon/manager_ui.hpp
    M src/game_initialization/multiplayer_lobby.cpp

  Log Message:
  -----------
  ad_hoc_addon_fetch_session now takes a list of add-ons not just one

This is better because you can use one add-on server connection for
the whole transaction.


  Commit: 4197f2777e10b8514e40166dcaad7182fdf983a2
      https://github.com/wesnoth/wesnoth/commit/4197f2777e10b8514e40166dcaad7182fdf983a2
  Author: Chris Beck <render787 at gmail.com>
  Date:   2015-03-15 (Sun, 15 Mar 2015)

  Changed paths:
    M src/saved_game.cpp

  Log Message:
  -----------
  respect the "require_era" type fields for scenario add-on deps

This is needed for these fields to work properly, that is, to
allow hosting and joining a game without the clients needing to
download an add-on.


  Commit: 36e181538ee3d038f570e67d60af76310520fb61
      https://github.com/wesnoth/wesnoth/commit/36e181538ee3d038f570e67d60af76310520fb61
  Author: Chris Beck <render787 at gmail.com>
  Date:   2015-03-15 (Sun, 15 Mar 2015)

  Changed paths:
    M src/game_initialization/multiplayer_lobby.cpp

  Log Message:
  -----------
  move addon dialog code out of from mp::lobby::process_event_impl

Slightly cleaner this way, and will be simpler later if we need
want to improve the quality of the reports generated by these
dialogs.


  Commit: 844dd5d799d4529461aaa926de3eb1dddbfde1d0
      https://github.com/wesnoth/wesnoth/commit/844dd5d799d4529461aaa926de3eb1dddbfde1d0
  Author: Chris Beck <beck.ct at gmail.com>
  Date:   2015-03-15 (Sun, 15 Mar 2015)

  Changed paths:
    M src/addon/manager_ui.cpp
    M src/addon/manager_ui.hpp
    M src/game_config_manager.cpp
    A src/game_initialization/lobby_reload_request_exception.hpp
    M src/game_initialization/multiplayer.cpp
    M src/game_initialization/multiplayer_lobby.cpp
    M src/game_initialization/multiplayer_lobby.hpp
    M src/mp_game_settings.cpp
    M src/mp_game_settings.hpp
    M src/saved_game.cpp
    M src/tests/gui/test_gui2.cpp

  Log Message:
  -----------
  Merge pull request #284 from cbeck88/autodownload_addons

automatically download needed addons in mp lobby


Compare: https://github.com/wesnoth/wesnoth/compare/fae7443e63a9...844dd5d799d4


More information about the Commits mailing list