X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=include%2Fgame.php;h=bd25e78eff6a36d889e2bee2d685609c88bda4ec;hb=c7d334c4782dd4bc07e5bda8bb364d62e5537d1e;hp=5c367e954891bdcc3b583ee0926e854477e37233;hpb=8866e45d0593dc0564ad8fb4ecfe108f413eaffb;p=e-DoKo.git
diff --git a/include/game.php b/include/game.php
index 5c367e9..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; @@ -568,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; @@ -586,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) @@ -601,12 +668,8 @@ 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"; - return; + 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); @@ -693,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 */ @@ -744,7 +807,7 @@ switch($mystatus) } } else - echo " \n"; + echo "Please, start the game.Game ".DB_format_gameid($gameid)." has been canceled.
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 "