NEW FEATURE: automatically accept new games
[e-DoKo.git] / include / game.php
index 4dbf68f0a6e291dd194c485d8844a4c8aa49bc2b..3540be4592c052f77ba5b791482939e4d9d01ce5 100644 (file)
@@ -142,7 +142,11 @@ display_table();
 switch($mystatus)
   {
   case 'start':
-    if( !myisset("in") )
+    /* don't ask if user has autosetup set to yest */
+    $skip = 0;
+    if($PREF['autosetup']=='yes') $skip = 1;
+
+    if( !myisset("in") && !$skip)
       {
        /* asks the player, if he wants to join the game */
        output_check_want_to_play($me);
@@ -151,7 +155,7 @@ switch($mystatus)
     else
       {
        /* check the result, if player wants to join, got next stage, else cancel game */
-       if($_REQUEST["in"] == "no")
+       if($_REQUEST["in"] == "no" && !$skip)
          {
            /* cancel the game */
            $message = "Hello, \n\n".