Follow-up Comment #4, bug #23334 (project wesnoth):

tekelili: 
Thank you for your advice.

I have resurrected an experimental branch which I made several months ago. The
idea was to make it so that if you cannot join a game because of missing
add-ons, you should be able to double click it in the lobby and automatically
fetch those add-ons.

I updated this branch today and tested it and fixed some things:
https://github.com/wesnoth/wesnoth/pull/284

Currently it does the following things:
- [era] and [modification] elements automatically get added an "addon_id"
attribute which matches the directory name used for your add-on.
- At the time that era and modification info is being added to your scenario,
the game keeps track also of the addon_ids where those are coming from.
- These addon_ids get sent to the server (and to the clients) as part of the
lobby game list when you host a game.
- If a client cannot join or observe a game but they would be able to if they
had era / modifications, they will be prompted if they want to do that. Then
the addon manager code will be executed to connect to the addon server and get
them.

I've been able to get this to work, by deleting Galactic Empires, launching 3
wesnoth, having one of them install Galactic empires, then hosting a game,
then the others get a grey title, but they can click the join button and join
if they agree to download.

The thing that it does not do at all right now is versions, and that is pretty
key to get right for this to be useful.

What I am thinking right now is that it will work like this:

- In the places where I record "addon_id" above, it also must have recorded
the version number of that addon from the pbl file.
- [scenario], [era] and [modification] will have optional entries
"min_version_number". This refers to the smallest pbl version number that you
released earlier with, that you are still compatible with.
- When you want to join a game, the lobby will check that you have the [era]
and [modification]'s that the game needs, and that for all addon_ids of the
[scenario], [era] and [modifications] of this game
  - Your version is at least the min version sent by the host.
    If its not then you may autodownload.
  - The host has at least your min version, for [era] and
    [modification]. If the host has too old a version, you 
    cannot fix it by downloading a newer version, so you just
    can't join the game. In this case the server might send a
    chat message to the host "A player could not join your game
    because you are holding outdated add-ons. Please update!"

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?23334>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to