From: Matteo Nastasi (mop) Date: Thu, 20 Mar 2014 06:42:23 +0000 (+0100) Subject: Merge branch 'master', remote branch 'origin' into auto-maintenance X-Git-Tag: v4.14.0~19 X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=ba4bca945d08c2719ce49625d493e5760c28a528;hp=20e2a68f563f8fb2451d587248240971b2927bf8;p=brisk.git Merge branch 'master', remote branch 'origin' into auto-maintenance --- diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index c20fedc..f9ea0a4 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -150,12 +150,12 @@ $mlang_brisk = array( 'btn_backstand'=> array( 'it' => 'torna in piedi', $G_lng = langtolng($G_lang); $G_all_points = array( 11,10,4,3,2, 0,0,0,0,0 ); -$G_brisk_version = "4.13.0"; +$G_brisk_version = "4.13.3"; /* MLANG: ALL THE INFO STRINGS IN brisk.phh */ -$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NOVITA\': nuovo sistema per calcolare le classifiche, corretto bug nel comando cont', +$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NOVITA\': nuovo sistema per calcolare le classifiche con bugfix, corretto bug nel comando cont', 'Se vuoi iscriverti alla Mailing List, cliccala!' ), - 'en' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NEWS: new placements calculation system, cont command fixed.', + 'en' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NEWS: new placements calculation system with bugfix, cont command fixed.', 'If you want to subscribe our Mailing List, click it!' ) ); $G_room_help = array( 'it' => ' diff --git a/web/brisk-fb-whois.php b/web/brisk-fb-whois.php new file mode 100644 index 0000000..9f6277a --- /dev/null +++ b/web/brisk-fb-whois.php @@ -0,0 +1,71 @@ + 'my name with & and /' ); +// echo json_encode($a); +// echo "{ name: 'pippopluto' }"; + +// http://www.alternativeoutput.it/briskblog/doku.php?id=utenti:social&do=edit +// header: ^ A ^^ +// footer: ===== Per essere aggiunto ===== +// |mop|[[https://www.facebook.com/bi.cci.5|bi.cci.5]]| + +function retrieve_login($userid) +{ + $cache_file = '/var/www/webspace/brisk-priv/brisk-fb-whois.cache'; + // $cache_file = '/tmp/brisk-fb-whois.cache'; + $cache_max_age = 3600; + + $page_name = 'http://www.alternativeoutput.it/briskblog/doku.php?id=utenti:social&do=edit'; + $userid_pfx = 'https://www.facebook.com/'; + + $curtime = time(); + $is_cache = FALSE; + + if (!file_exists($cache_file) || ($curtime - filemtime($cache_file)) > $cache_max_age) { + if (($content = file_get_contents($page_name)) == FALSE) { + echo json_encode(array('name' => 'problemi sul server', 'is_cache' => $is_cache, 'err' => 2)); + exit; + } + file_put_contents($cache_file, $content); + $is_cache = FALSE; + } + else { + if (($content = file_get_contents($cache_file)) == FALSE) { + echo json_encode(array('name' => 'problemi sul server', 'is_cache' => $is_cache, 'err' => 2)); + exit; + } + $is_cache = TRUE; + } + $content_ar = explode("\n", $content); + $st = 0; + foreach($content_ar as $key => $value) { + switch ($st) { + case 0: + if (substr($value, 0, 8) == '^ A ^^') { + $st = 1; + } + break; + + case 1: + if (substr($value, 0, 31) == '===== Per essere aggiunto =====') { + $st = 2; + break; + } + if (strstr($value, $userid_pfx.$userid.'|')) { + $ret_ar = explode('|', $value); + echo json_encode(array('name' => $ret_ar[1], 'is_cache' => $is_cache, 'err' => 0)); + exit; + } + break; + + case 2: + echo json_encode(array('name' => 'utente non trovato', 'is_cache' => $is_cache, 'err' => 1)); + exit; + break; + } + } +} + +retrieve_login($userid); + +?> diff --git a/web/briskin5/Obj/briskin5.phh b/web/briskin5/Obj/briskin5.phh index e247e93..ce0fa1d 100644 --- a/web/briskin5/Obj/briskin5.phh +++ b/web/briskin5/Obj/briskin5.phh @@ -567,7 +567,7 @@ class Bin5_table extends Table { log_wr(sprintf("PRO: [%d]", $pro)); // PATTA case ! - if ($this->asta_pnt == 61 && $pro == 60) { + if (game_result($this->asta_pnt, $pro) == 0) { $this->points[$this->points_n % MAX_POINTS] = array(); for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) { $this->points[$this->points_n % MAX_POINTS][$i] = 0; @@ -575,6 +575,7 @@ class Bin5_table extends Table { } $this->points_n++; $this->old_pnt = $pro; + $this->old_asta_win = $this->asta_win; $this->mult_inc(1); break; @@ -1976,10 +1977,11 @@ function briscola_show($bri, $table, $user) function game_result($asta_pnt, $pnt) { + $sixty = 60; if ($asta_pnt == 61) { - if ($pnt > 60) + if ($pnt > $sixty) return (1); - else if ($pnt == 60) + else if ($pnt == $sixty) return (0); else return (-1);