Page 1 of 1

[RESOLVED] Premature win declaration

Posted: Sun May 13, 2018 11:20 am
by peterlund
Is there any progress on the adjudicator bug I reported a while ago?
peterlund wrote:
Sun Apr 29, 2018 8:28 pm
The diplomacy adjudicator is buggy! It declared a win to Germany in this game even though Spain can retreat to Portugal.

http://webdiplomacy.net/board.php?gameID=220696

Re: Premature win declaration

Posted: Sun May 13, 2018 12:22 pm
by ChippeRock
I agree with peterlund, even though his game might not be the best example you should change the code so that the game will detect when a solo might not occur due to a retreat.

I still like the "instant win" that currently occurs when you hit 18 SCs because it results in not having to go through an extra useless phase but sometimes that extra phase isn't useless and I think the game should detect this and allow the game to go to the Retreats phase so the player(s) are given the opportunity to prevent the solo.

Re: Premature win declaration

Posted: Sun May 13, 2018 2:11 pm
by JECE
I thought that this had been fixed years ago. :-(

Re: Premature win declaration

Posted: Mon May 14, 2018 2:59 pm
by jmo1121109
Multiple pending code reviews were just finished in the last day, so ideally this fix will be coming soon.

Re: Premature win declaration

Posted: Fri May 25, 2018 8:05 pm
by Kremmen
I just lost a game due to this. I don't suppose there's any chance of erasing game results caused by the bug awarding an incorrect victory?

Re: Premature win declaration

Posted: Fri May 25, 2018 9:53 pm
by jmo1121109
Unfortunately, the fix is ready to go, but because of some bug fixes that had to go live on the server I can't make any site changes until 1 of the 2 code reviewers approve my pending PR request.

Re: Premature win declaration

Posted: Fri May 25, 2018 11:29 pm
by Claesar
Kremmen wrote:
Fri May 25, 2018 8:05 pm
I just lost a game due to this. I don't suppose there's any chance of erasing game results caused by the bug awarding an incorrect victory?
Usually not, but if you feel the solo could've been prevented if this bug didn't exist please email the mods at [email protected] and we'll take appropiate action.

Re: Premature win declaration

Posted: Sat May 26, 2018 3:44 am
by Kremmen
Claesar wrote:
Fri May 25, 2018 11:29 pm
Usually not, but if you feel the solo could've been prevented if this bug didn't exist please email the mods at [email protected] and we'll take appropiate action.
OK. Thanks. (Not just prevented. The game was awarded as 18 SCs vs 14 when I had two retreats into enemy territories. Should have been 16 SCs vs 16, with my opponent having only 1 free home SC and therefore only 1 build possible.)

Re: Premature win declaration

Posted: Sat May 26, 2018 2:56 pm
by JECE

Re: Premature win declaration

Posted: Sat May 26, 2018 7:39 pm
by peterlund
Horrendous really!

That is why I abstain all diplomacy play on this server until this bug is fixed!

Re: Premature win declaration

Posted: Mon May 28, 2018 5:16 pm
by jmo1121109
Fixed, see http://www.webdiplomacy.net/board.php?gameID=223421 as proof.
Autumn 06 would have previously been a win for France.

Re: [RESOLVED] Premature win declaration

Posted: Mon May 28, 2018 6:22 pm
by peterlund
VERY NICE! That proves that the last known adjudicator bug has been fixed. Great work everyone involved!

Re: [RESOLVED] Premature win declaration

Posted: Tue May 29, 2018 1:37 am
by JECE
I think that it's time to expand the DATC test cases now to 6.H, 6.I and 6.J:
http://webdiplomacy.net/datc.php

Re: Premature win declaration

Posted: Tue May 29, 2018 7:25 pm
by CptMike
jmo1121109 wrote:
Mon May 28, 2018 5:16 pm
Fixed, see http://www.webdiplomacy.net/board.php?gameID=223421 as proof.
Autumn 06 would have previously been a win for France.
There is no more mistake but the bug is not fixed...

This game should have ended in Autumn given the retreat from Moscow can't change the final result...

Anyway that's not a big issue and certainly not as critical as the consequences of the bug!

Re: [RESOLVED] Premature win declaration

Posted: Tue May 29, 2018 7:47 pm
by peterlund
I believe that the bug fix forces the autumn retreat to always be performed regardless of whether or not there is a retreat into a SC. The possible win is only calculated after the autumn retreats. Please correct me if I got this wrong!

Re: [RESOLVED] Premature win declaration

Posted: Tue May 29, 2018 11:32 pm
by bo_sox48
Yes, the adjudicator no longer checks for a winner until the retreat phase has been processed. That is how the bug was fixed.

Re: [RESOLVED] Premature win declaration

Posted: Wed May 30, 2018 12:40 am
by jmo1121109
peterlund wrote:
Tue May 29, 2018 7:47 pm
I believe that the bug fix forces the autumn retreat to always be performed regardless of whether or not there is a retreat into a SC. The possible win is only calculated after the autumn retreats. Please correct me if I got this wrong!
There will not always be an autumn retreat, only if there are retreat moves possible. But you are right in that it does not check out of the retreating units whether any are capable of retreating into a supply center. The reason for this is that the code would have to be unique across variants, so here, and even more so on vDip where it was coded, that isn't a feasible option.

Re: [RESOLVED] Premature win declaration

Posted: Wed May 30, 2018 12:45 am
by jmo1121109
For anyone curious, here's the added code block:

https://github.com/kestasjk/webDiplomacy/pull/322/files

Code: Select all

// If there is a diplpmacy-phase check for a retreating-phase and wait another round for the retreats to finish.
+	if ($this->Game->phase == 'Diplomacy')
+	{
+		list($retreating) = $DB->sql_row("SELECT COUNT(retreatingUnitID) FROM wD_TerrStatus WHERE gameID=".$this->Game->id);
+		if($retreating)
+			return false;
+	}