Open clevengr opened 4 years ago
Something that needs to be checked is whether this bug exists in the new WTI Scoreboard implementation (see https://github.com/pc2ccs/pc2v9/issues/75). The issue likely still exists there because the WTI uses the PC2 API to obtain contest state -- so it may be the case that the WTI Scoreboard currently is always the live, unfrozen scoreboard. This would be very bad.
If on the other hand the WTI Scoreboard update (Issue 75) somehow fixed this issue, the the problem only exists with the old EWTeam (plus of course any third-party users of the PC2 API, but we don't know of any such at this time). This would make it much less of a priority to fix (although it still should be fixed).
Further investigation appears to reveal that this bug is NOT present in the WTI implementation. Specifically:
getStandings()
in class controllers.ContestController
in the WTI project. ContestController
constructor instantiates its own copy of class DefaultScoringAlgorithm
, and sets it to "obey freeze" by calling dsa.setObeyFreeze(true);
. getStandings()
method, that method returns the results obtained by calling dsa.getStandings()
, which in turn respects the obeyFreeze
setting.So this bug IS a problem with the EWTeam scoreboard, as well as with any new clients which directly use the PC2 API. However, it's not present in the current WTI implementation.
For more details on the WTI Scoreboard implementation, including insight as to how the WTI avoids the PC2 API bug, see this wiki page, noting in particular the instance of DefaultScoringAlgorithm
imbedded within the WTI project.
Describe the issue: The PC2 API represents a contest as an instance of
pc2.api.IContest
. InterfaceIContest
defines a methodgetStandings()
which returns an array ofIStanding
. This is the method which API clients call to obtain current scoreboard standings.The API implementation of interface
IContest
is classpc2.api.implementation.Contest
. This class instantiates apc2.api.implementation.GenerateStandings
object and uses it to obtain the standings whenIContest.getStandings()
is invoked. Each timeGenerateStandings.getStandings()
is invoked it creates a new instance ofDefaultScoringAlgorithm
and uses it to obtain a new XML string giving the standings.The instance of
DefaultScoringAlgorithm
which is created byGenerateStandings
defaults toobeyFreeze=false
. This means that the standings returned by the API are current (real, live). Any client which connects through the API (for example, the EWTeam) can therefore see the unfrozen standings.To Reproduce:
Expected behavior: Teams should not be able to see the live standings when a scoreboard is frozen.
Actual behavior: Teams can see live standings during the scoreboard freeze.
Additional context: It may be that a fix is as simple as calling
setObeyFreeze(true)
inGenerateStandings.getStandings()
.