Move the check for events for a non-puzzler after the checks
for invalid rounds and straggling events; if we've ended the game and are getting straggling events, _playerOids has already been cleared out, so it'll always look like a non-player. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@332 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -515,21 +515,10 @@ public abstract class PuzzleManager extends GameManager
|
||||
/**
|
||||
* Called when the puzzle manager receives a progress update. It
|
||||
* checks to make sure that the progress update is valid and the
|
||||
* puzzle is still in play and then applies the updates via {@link
|
||||
* #applyProgressEvents}.
|
||||
* puzzle is still in play and then applies the updates via {@link #applyProgressEvents}.
|
||||
*/
|
||||
public void updateProgressSync (
|
||||
ClientObject caller, int roundId, int[] events, Board[] states)
|
||||
public void updateProgressSync (ClientObject caller, int roundId, int[] events, Board[] states)
|
||||
{
|
||||
// determine the caller's player index in the game
|
||||
int pidx = IntListUtil.indexOf(_playerOids, caller.getOid());
|
||||
if (pidx == -1) {
|
||||
Log.warning("Received progress update for non-player?! " +
|
||||
"[game=" + _puzobj.which() + ", who=" + caller.who() +
|
||||
", ploids=" + StringUtil.toString(_playerOids) + "].");
|
||||
return;
|
||||
}
|
||||
|
||||
// bail if the progress update isn't for the current round
|
||||
if (roundId != _puzobj.roundId) {
|
||||
// only warn if this isn't a straggling update from the
|
||||
@@ -547,11 +536,21 @@ public abstract class PuzzleManager extends GameManager
|
||||
if (!_puzobj.isInPlay()) {
|
||||
Log.debug("Ignoring straggling events " +
|
||||
"[game=" + _puzobj.which() +
|
||||
", user=" + getPlayerName(pidx) +
|
||||
", who=" + caller.who() +
|
||||
", events=" + StringUtil.toString(events) + "].");
|
||||
return;
|
||||
}
|
||||
|
||||
// determine the caller's player index in the game
|
||||
int pidx = IntListUtil.indexOf(_playerOids, caller.getOid());
|
||||
if (pidx == -1) {
|
||||
Log.warning("Received progress update for non-player?! " +
|
||||
"[game=" + _puzobj.which() + ", who=" + caller.who() +
|
||||
", ploids=" + StringUtil.toString(_playerOids) + "].");
|
||||
//return;
|
||||
}
|
||||
|
||||
|
||||
// Log.info("Handling progress events [game=" + _puzobj.which() +
|
||||
// ", pidx=" + pidx + ", roundId=" + roundId +
|
||||
// ", count=" + events.length + "].");
|
||||
|
||||
Reference in New Issue
Block a user