[Commits] [wesnoth/wesnoth] 1e3508: MP Lobby: actually properly display required addon...

GitHub noreply at github.com
Thu Feb 15 06:38:35 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 1e3508f977484ba74eff929d2cc845fdc4c7a3ec
      https://github.com/wesnoth/wesnoth/commit/1e3508f977484ba74eff929d2cc845fdc4c7a3ec
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-02-15 (Thu, 15 Feb 2018)

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

  Log Message:
  -----------
  MP Lobby: actually properly display required addon names

Turns out I implemented ba9274ea7b9ec418623522e38482d4b3c6bcb7de incorrectly. I had naively thought
that the name= key in both instances (required addon parsing and version compatibility check) was
the right key to use. I was wrong.

In the case of required addon parsing, it turns out there was no name= key in the first place, so
the "Missing addon: foo" message was using the addon id. In the case of the version compatibility
check, it was using the *content* name, not the *addon* name. For example, it was displaying the name
of a given modification shipped with an addon, but not the actual addon that shipped it. That was
definitely not what we wanted.

To fix this issue, I've added a name field to the config for required addons. This is populated with
the addon_title= key (see below) of the required addon when the host creates a game. Do note the list
of required addons is sent over the network. In the case of the version compatibility check, I made
use of the same addon_title= key, except taken from the player's local config (this is because the
version compatibility check only happens if you already have the given modification/era/etc installed
from an addon).

The addon_title= key itself is added to an era/mod/scenario/campaign/etc's config when addons are
loaded, same as the addon_id= and addon_version= key. Currently it takes its value from _info.cfg's
[info] title= field. If that isn't present, it falls back to addon_id=.





More information about the Commits mailing list