Page MenuHomeWildfire Games

Reregister game in multiplayer lobby when host disconnects from lobby.
Changes PlannedPublic

Authored by elexis on Sep 15 2018, 10:50 PM.

Details

Reviewers
nani
Summary

When in the multiplayer, if the host is either in the game setup or playing a game and loses connection to the lobby server, the server automatically unregisters the game from the lobby.
This patch reregisters the game to the lobby.

This reregistering will only happen if the host tries to open the lobby dialog on the game setup or in-game and presses "yes" in the already existing reconnect box.

Test Plan

Trying the patch in the lobby as a host, client, observer in the game setup and in-game.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

nani created this revision.Sep 15 2018, 10:50 PM
nani retitled this revision from Reregister game in multiplayer lobby when host disconects from lobby. to Reregister game in multiplayer lobby when host disconnects from lobby..
nani abandoned this revision.Jun 12 2019, 1:14 AM

Probably wrong approach.

elexis added a subscriber: elexis.Jun 12 2019, 1:33 AM

(as mentioned some time in the lobby)

The feature is definitely needed.

Ideally the game is reregistered as soon as the connection is rebuilt, and the connection rebuilt without the user having to open the lobby dialog (so that observers or lost players can rejoin even without the host having a suspicion that the game may be unregistered), but I don't know how much work it is to make that happen.

binaries/data/mods/public/gui/lobby/lobby.js
133

Engine.HasNetServer()

143

Avoid globals as much as possible. This value is true if the session is active, can also be true if observing.
If it's called from within gamesetup or session, then one doesn't have to pass it on here.

479

This function can be in gui/common/ somewhere, (maybe a new file or not, didnt look), and then it can be called in the gamesetup and session.

binaries/data/mods/public/gui/session/session.js
202

It would be better to not cache this, but to move the function building this value to gui/common/ or so and just call the function again if in need of the value.

elexis commandeered this revision.Jun 12 2019, 1:34 AM
elexis reclaimed this revision.
elexis planned changes to this revision.
elexis added a reviewer: nani.
nani awarded a token.Jun 12 2019, 2:00 AM
nani added a comment.Jun 12 2019, 4:12 PM

Nice, what it will become of this diff now?

In D1628#82092, @nani wrote:

Nice, what it will become of this diff now?

I can rewrite it, but for which repository?

Stan added a subscriber: Stan.Jun 12 2019, 7:49 PM

Why not both ? Isn't that what open source is for ? Giving the ability to everyone to adapt code ?

smiley added a subscriber: smiley.Jun 12 2019, 8:51 PM

The cathedral and the bazaar
To be honest, i never figured out which was which. It's all cathedrals.