X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Fgame.php;h=bd25e78eff6a36d889e2bee2d685609c88bda4ec;hp=30abe7d53687d8600f0c0ef51a6cc57c988e5f66;hb=5e3f5fe45c7d05a85f5e36637b3dd937e1ac3596;hpb=522e61d6c5c04dac9c3254ddd2fd7ebb82a1a104
diff --git a/include/game.php b/include/game.php
index 30abe7d..bd25e78 100644
--- a/include/game.php
+++ b/include/game.php
@@ -1,4 +1,23 @@
+ *
+ * This file is part of e-DoKo.
+ *
+ * e-DoKo is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * e-DoKo is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with e-DoKo. If not, see
'._('This step can only be handled after everyone finished the last step. '. + 'Seems like this is not the case, so you need to wait a bit... '. + 'you will get an email once that is the case, please use the link in '. + 'that email to continue the game.').'
Ok, everyone is done... figuring out what kind of game we are playing.
"; + echo ''._('Ok, everyone is done... figuring out what kind of game we are playing.').'
'; $gametype = DB_get_gametype_by_gameid($gameid); $startplayer = DB_get_startplayer_by_gameid($gameid); /* check for sickness */ - $nines = 0; + $cancel = 0; $poverty = 0; $wedding = 0; $solo = 0; @@ -574,12 +612,13 @@ switch($mystatus) { $name = DB_get_name('userid',$user); $usersick = DB_get_sickness_by_userid_and_gameid($user,$gameid); - if($usersick == 'nines') + if($usersick == 'nines' || ($RULES['lowtrump']=='cancel' && $usersick=='lowtrump') ) { - $nines = $user; + $cancel = $user; + $cancelsick = $usersick; break; /* no need to check for other poverties, since only solo can win and that is already set */ } - else if($usersick == 'poverty') + else if($usersick == 'poverty' || ($RULES['lowtrump']=='poverty' && $usersick=='lowtrump')) $poverty++; else if($usersick == 'wedding') $wedding=$user; @@ -592,13 +631,35 @@ switch($mystatus) { /* do nothing */ } - else if($nines) + else if($cancel) { /* cancel game */ - $message = "The game has been canceled because ".DB_get_name('userid',$nines). - " has five or more nines and nobody is playing solo.\n\n". - "To redeal either start a new game or, in case the game was part of a tournament,\n". - "go to the last game and use the link at the bottom of the page to redeal.\n\n"; + if($cancelsick == 'nines') + { + $message = "The game has been canceled because ".DB_get_name('userid',$cancel). + " has five or more nines and nobody is playing solo.\n\n". + "To redeal either start a new game or, in case the game was part of a tournament,\n". + "go to the last game and use the link at the bottom of the page to redeal.\n\n"; + + /* update game status */ + cancel_game('nines',$gameid); + + echo "The game has been canceled because ".DB_get_name('userid',$cancel). + " has five or more nines and nobody is playing solo.
\n"; + } + else if ($cancelsick == 'lowtrump') + { + $message = "The game has been canceled because ".DB_get_name('userid',$cancel). + " has low trump and nobody is playing solo.\n\n". + "To redeal either start a new game or, in case the game was part of a tournament,\n". + "go to the last game and use the link at the bottom of the page to redeal.\n\n"; + + /* update game status */ + cancel_game('lowtrump',$gameid); + + echo "The game has been canceled because ".DB_get_name('userid',$cancel). + " has low trump and nobody is playing solo.
\n"; + }; $userids = DB_get_all_userid_by_gameid($gameid); foreach($userids as $user) @@ -607,12 +668,7 @@ switch($mystatus) mymail($user,$subject,$message); } - /* update game status */ - cancel_game('nines',$gameid); - - echo "The game has been canceled because ".DB_get_name('userid',$nines). - " has five or more nines and nobody is playing solo.
\n"; - echo "Got it :)
"; + echo ''._('Got it').' :)
'; /* loop over all players, set re/contra if possible and start the game if possible */ $userids = DB_get_all_userid_by_gameid($gameid); @@ -700,7 +756,7 @@ switch($mystatus) case 'dpoverty': /* set person with poverty to play status */ $usersick = DB_get_sickness_by_userid_and_gameid($userid,$gameid); - if($usersick == 'poverty') + if($usersick == 'poverty' || ($RULES['lowtrump']=='poverty' && $usersick=='lowtrump')) DB_set_hand_status_by_hash($userhash,'play'); /* set status of first player to be asked to poverty */ @@ -751,7 +807,7 @@ switch($mystatus) } } else - echo " \n"; + echo "Please, start the game.See how other played the same hand:
\n";
+ echo "
See how other played the same hand: \n";
foreach($other_game_ids as $id)
{
$otherhash = DB_get_hash_from_game_and_pos($id,$mypos);
$othername = DB_get_name('hash',$otherhash);
- echo "$othername
";
+ echo " $othername ";
}
- echo "