Page MenuHomeWildfire Games

Silence error if someone clicks on not-ready after the host started the game
ClosedPublic

Authored by elexis on Apr 4 2017, 5:28 AM.

Details

Summary

It occurs quite often that players change their mind on the gamesettings in the same moment when the host clicks on start game.
This yields a Net Client error message and this is often reported as a bug.
There is no reason to have that error message and it should just be dropped.
Notice it is very unlikely that someone clicks on ready while the host has already finished loading the game, so that transition doesn't seem necessary.

Test Plan
  1. Add a LOGWARNING("TOO LATE\n"); to that new early return
  2. Start a networked gamesetup
  3. Join with a second client via global IP address
  4. Click twice on the ready button to stay ready
  5. Simulate 5 second ping on that connection using setlag 5000
  6. Notice the host starts the game 5 seconds sooner and shows that debug message while not showing the error message
function setlag()
{
	for device in "eth0"; do
		sudo tc qdisc del dev $device root netem;
		if [ $1 -ne 0 ]; then
			sudo tc qdisc add dev $device root netem delay ${1}ms;
		fi
	done
}

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

elexis created this revision.Apr 4 2017, 5:28 AM
elexis updated the Trac tickets for this revision.Apr 4 2017, 5:32 AM
Vulcan added a subscriber: Vulcan.Apr 4 2017, 6:39 AM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!

http://jw:8080/job/phabricator/692/ for more details.

elexis added a comment.Apr 8 2017, 4:56 AM

(An alternative approach might be not changing the Server but changing the clients to show a warning. Might give some indication that a player wanted to change something. But on the other side, do we care? We won't know what he wanted until he speaks up in the chat. That notification might have to be translated too.)

elexis updated this revision to Diff 1153.Apr 8 2017, 7:04 PM

As pointed out by Imarok, remove the first hunk which was pointless, unneeded with regards to fixing the problem and added a safety check for rejoining clients.

Vulcan added a comment.Apr 8 2017, 8:06 PM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!

http://jw:8080/job/phabricator/715/ for more details.

Imarok accepted this revision.Apr 10 2017, 4:36 PM
This revision is now accepted and ready to land.Apr 10 2017, 4:36 PM

Thanks for the review!

This revision was automatically updated to reflect the committed changes.