<?php
-/* Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Arun Persaud <arun@nubati.net>
+/* Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Arun Persaud <arun@nubati.net>
*
* This file is part of e-DoKo.
*
echo ' '._('Game')." $session.$j";
if($gamestatus != 'pre')
if($gametype_raw != 'normal') /* only show when needed */
- if(!($gametype_raw == 'solo' && $gametyep_solo == 'silent') )
+ if(!($gametype_raw == 'solo' && $gametype_solo == 'silent') )
echo " ($GT)";
if(isset($_SESSION['id']) && $_SESSION['id']==$myid)
/* output vorbehalte */
if($gametype_raw != 'normal') /* only show when needed */
- if(!($gametype_raw == 'solo' && $gametyep_solo == 'silent') )
+ if(!($gametype_raw == 'solo' && $gametype_solo == 'silent') )
echo " <li onclick=\"hl(0);\" class=\"old\"><a href=\"#\">Pre</a></li>\n";
$result = DB_query('SELECT Trick.id'.
*/
DB_set_hand_status_by_hash($me,'init');
+ $mystatus='init';
/* check if everyone has reached this stage, set player in game-table to the next player */
$userids = DB_get_all_userid_by_gameid($gameid);
{
/* user wants to play a solo */
+ /* double check input value */
+ $s = $_REQUEST['solo'];
+ $solos = array('trumpless','jack','queen','trump','club','spade','heart');
+ if (!in_array($s, $solos))
+ {
+ $messages[] = sprintf(_('There is a problem with the type of solo you selected (%s does not exist), please go back '.
+ 'and answer the <a href="%s">question</a> again.'),
+ $s,$INDEX.'?action=game&me=$me&in=yes');
+ break;
+ }
+
/* store the info in the user's hand info */
DB_set_solo_by_hash($me,$_REQUEST['solo']);
DB_set_sickness_by_hash($me,'solo');
* this outputs status of healthy, *
* sick, etc during pre-game phase *
**********************************/
+
+$posmax=5; // if user is still in init, we only show vorbehalte from players before him, otherwise all of them
+
switch($mystatus)
{
case 'start':
break;
case 'init':
+ $posmax=$mypos;
case 'check':
/* output sickness of other playes, in case they already selected and are sitting in front of the current player */
echo "\n".'<div class="tricks">'."\n";
echo ' <div class="trick" id="trick0">'."\n";
- for($pos=1;$pos<5;$pos++)
+ for($pos=1;$pos<$posmax;$pos++)
{
$usersick = DB_get_sickness_by_pos_and_gameid($pos,$gameid);
$userid = DB_get_userid('gameid-position',$gameid,$pos);