diff options
author | Arun Persaud <arun@nubati.net> | 2007-06-29 19:18:51 +0200 |
---|---|---|
committer | Arun Persaud <arun@nubati.net> | 2007-07-18 22:53:13 -0700 |
commit | 35687ace49ce0b41b1380603513d1f04cd6b458f (patch) | |
tree | 7fdc8d2f9a63998b463812fe8e0452ddf8f71131 /db.php | |
parent | b5f096688faaebf7846b3e725e1bd2dd9251b203 (diff) | |
download | e-DoKo-35687ace49ce0b41b1380603513d1f04cd6b458f.tar.gz e-DoKo-35687ace49ce0b41b1380603513d1f04cd6b458f.tar.bz2 e-DoKo-35687ace49ce0b41b1380603513d1f04cd6b458f.zip |
NEW FEATURE+BUGFIX: changed calling re/contra
you can call re/contra, etc. now even if it is not your turn.
Also fixed rule where you can say 90 with 9 cards, etc. so that
you need to say 120 to say 90, 90 to say 60, etc.
Diffstat (limited to 'db.php')
-rw-r--r-- | db.php | 41 |
1 files changed, 41 insertions, 0 deletions
@@ -842,4 +842,45 @@ function DB_get_current_playid($gameid) return ""; } +function DB_get_call_by_hash($hash) +{ + $queryresult = mysql_query("SELECT point_call FROM Hand WHERE hash='$hash'"); + + $r = mysql_fetch_array($queryresult,MYSQL_NUM); + if($r) + return $r[0]; + + return NULL; +} + +function DB_get_partner_call_by_hash($hash) +{ + $partner = DB_get_partner_hash_by_hash($hash); + + if($partner) + { + $queryresult = mysql_query("SELECT point_call FROM Hand WHERE hash='$partner'"); + + $r = mysql_fetch_array($queryresult,MYSQL_NUM); + if($r) + return $r[0]; + } + + return NULL; +} + +function DB_get_partner_hash_by_hash($hash) +{ + $gameid = DB_get_gameid_by_hash($hash); + $party = DB_get_party_by_hash($hash); + + $queryresult = mysql_query("SELECT hash FROM Hand WHERE game_id='$gameid' AND party='$party' AND hash<>'$hash'"); + + $r = mysql_fetch_array($queryresult,MYSQL_NUM); + if($r) + return $r[0]; + + return NULL; +} + ?>
\ No newline at end of file |