[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pbmserv-dev] The resign/forfeit bug...



Some code changes were made (ages ago) in an attempt to fix this 
bug, and it apparently failed.

Here's what's supposed to happen...

when a board is initialised, all players' timer[] entries are set
to 0.  This is how much time a player[x] has

(timer 1850 1083549)

Also clock[] is setup with the current time, the time of the last move,
the time the board started (and something else... I can't recall now)

(clock 1046558228 1047643627 1047643627 1046560078)

The logic is (should be)...

when a player moves, update the clock to reflect the current time
update that player's timer[] entry to reflect time used.

What appears to be happening...

clock[] is getting updated even when a move is not made by a player
(e.g. someone subscribes/unsubscribes)

if a player swaps, all bets are off... I've seen people exploit this
to their advantage during tournament play.  (wait 6.5 days,
issue a swap [making it the original player's turn], and .5 days
later... they forfeit).

We need to fix the timer.  period.  to only update clock[] when it's 
supposed to.  And only update player timer[] entries as appropriate.


The forfeit part of the logis is...  If my timer is 0, I've not issued
a move.  And therefore, I should remove myself (vs. forfeit the game)



-- 
 /  \__  | Richard Rognlie / Sendmail Ninja / Gamerz.NET Lackey
 \__/  \ | http://www.gamerz.net/rrognlie/    <rrognlie@gamerz.net>
 /  \__/ | Today is the first day of the rest of your life.  Of course,
 \__/    |    so was yesterday, and look how you screwed *that* up...