From 6206ef89ad9a9a1a541ecb67971815d11f12199b Mon Sep 17 00:00:00 2001
From: Arun Persaud <arun@nubati.net>
Date: Mon, 16 Mar 2009 22:06:21 -0700
Subject: BUGFIX: store canceled games, don't delete them

deleting the games could result in the same people getting the same hand redealt over and over again.
By just keeping track of the hands in the game table, this problem should be gone.

Fixed issue #50.
---
 include/user.php | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

(limited to 'include/user.php')

diff --git a/include/user.php b/include/user.php
index 8855fc0..0273183 100644
--- a/include/user.php
+++ b/include/user.php
@@ -154,7 +154,7 @@ else
 	    $Multi = ($r[5]>1) ? "multi" : "";
 	    if($r[4]=='pre')
 	      echo "   <span class=\"gamestatuspre $Multi\"><a href=\"".$INDEX."?action=game&amp;me=".$r[0]."\">p </a></span>\n";
-	    else if ($r[4]=='gameover')
+	    else if (in_array($r[4],array('gameover','cancel-timedout','cancel-nines','cancel-noplay','cancel-trump')))
 	    {
 	      echo "   <span class=\"gamestatusover $Multi\"><a href=\"".$INDEX."?action=game&amp;me=".$r[0]."\">";
 	      if($r[5]<2)
@@ -165,7 +165,7 @@ else
 	    }
 	    else
 	      echo "   <span class=\"gamestatusplay $Multi\"><a href=\"".$INDEX."?action=game&amp;me=".$r[0]."\">P </a></span>\n";
-	    if($r[4] != 'gameover')
+	    if($r[4] == 'pre' || $r[4] == 'play')
 	      {
 		echo "</td>\n<td>\n    ";
 		if($r[3]==$myid || !$r[3])
@@ -190,8 +190,7 @@ else
 		      echo "(it's $name's turn)\n";
 		  };
 		if(time()-strtotime($r[2]) > 60*60*24*30)
-		  echo "<a href=\"$INDEX?action=cancel&amp;me=".$r[0]."\">Cancel?</a>".
-		    " (clicking here is final and can't be restored)";
+		  echo "<a href=\"$INDEX?action=cancel&amp;me=".$r[0]."\">Cancel?</a> ";
 	      }
 	  }
 	echo "</td></tr>\n</table>\n";
-- 
cgit v1.2.3-18-g5258