X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fbrisk.phh;h=01240fca628db86b5209448421a55fc1c9a8eb01;hb=6b64cbbff491b226b173a4b0b88690c87373a57a;hp=69b15547531909fbf3530da2ae4b18f90eabae6f;hpb=2ffe8702c97539aa287d4babb3f12331ae1d9401;p=brisk.git diff --git a/web/brisk.phh b/web/brisk.phh index 69b1554..01240fc 100644 --- a/web/brisk.phh +++ b/web/brisk.phh @@ -19,7 +19,8 @@ * */ -define( FTOK_PATH, "/var/lib/brisk"); +define(FTOK_PATH, "/var/lib/brisk"); +define(LEGAL_PATH, "/tmp/legal_brisk"); define(TABLES_N, 8); define(PLAYERS_N, 3); define(MAX_POINTS, 5); @@ -38,9 +39,9 @@ define(BRISK_DEBUG, FALSE); // define(DEBUGGING, "local"); $G_all_points = array( 11,10,4,3,2, 0,0,0,0,0 ); -$G_brisk_version = "0.5.0"; +$G_brisk_version = "0.6.2"; -$root_wellarr = Array ( 'Benvenuto in brisk (Ver. '.$G_brisk_version.'), NOVITA\': audio a inizio partita, uscita concordata dai tavoli e "lascio" per troppo pochi punti in mano.', +$root_wellarr = Array ( 'Benvenuto in brisk (Ver. '.$G_brisk_version.'), NOVITA\': "donate" e piccole rifiniture.', 'Se vuoi iscriverti alla Mailing List, cliccala!' ); $table_wellarr = Array ( 'Benvenuto al tavolo. Se almeno tre giocatori non sbloccano l\'uscita cliccando il lucchetto, chi esce non può risedersi a un qualunque tavolo per '.floor(BAN_TIME/60).' minuti.'); @@ -50,6 +51,10 @@ $G_room_help= ' Descrizione
Questa è un\'implementazione della briscola in cinque, così come è spiegata su Wikipedia; in breve è la variante con l\'asta prima sulla carta e poi sui punti.

+Configurazione del browser.
+Occorre abilitare i cookies.
+Se usate Internet Explorer dovete anche settare: strumenti->cronologia_esplorazioni->impostazioni ad \\"apertura alla pagina web\\".
+
Uso del sito
Potete sedervi a un tavolo o rimanere in piedi.
Se al vostro tavolo si raggiungono i 5 giocatori inizia automaticamente la partita.
@@ -58,7 +63,7 @@ Se al vostro tavolo si raggiungono i 5 giocatori inizia automaticamente la parti All\'inizio vengono distribuite le carte e parte l\'asta; per partecipare all\'asta, quando sarà il vostro turno, potrete scegliere se andare avanti o passare cliccando sulle icone corrispondenti. Se si arriva ai punti, scrivete nella textbox il vostro rilancio e cliccate PUNTI.

Chi vince l\'asta dovrà decidere il seme della carta scelta e inizierà la mano.
Per giocare le carte dovrete trascinarle nel quadrato al centro del vostro schermo.

-Il vostro turno è sempre segnalato da una cornice verde lampeggiante intorno quadrato al centro del vostro schermo.

+Il vostro turno è sempre segnalato da una cornice verde lampeggiante intorno al quadrato al centro del vostro schermo.

Durante la partita, se vorrete ricaricare la pagina, usate l\'apposito bottone \\"reload\\" in basso a destra.
Dopo che è iniziata una partita per uscirne dovete chiedere agli altri giocatori di sbloccarla cliccando sul lucchetto. Se non si segue questa prassi, una volta usciti, non vi potrete sedere a nessun tavolo per '.floor(BAN_TIME/60).' minuti.
@@ -185,10 +190,11 @@ class Table { $ret = array(); for ($i = 0 ; $i < 40 ; $i++) { - $ret[$i] = new Card($i, 'bunch', 'no_owner'); + $ret[$i] =& new Card($i, 'bunch', 'no_owner'); } - return ($ret); + $oret = &$ret; + return ($oret); } function bunch_make() @@ -390,10 +396,10 @@ class brisco { $this->user = array(); for ($i = 0 ; $i < MAX_PLAYERS ; $i++) { - $this->user[$i] = new User("", ""); + $this->user[$i] =& new User("", ""); } for ($i = 0 ; $i < TABLES_N ; $i++) - $this->table[$i] = new Table(); + $this->table[$i] =& new Table(); $this->garbage_timeout = 0; } @@ -608,7 +614,9 @@ class brisco { $user_mesg = substr($mesg,6); - $dt = date("H:i ",time()); + $timecur = time(); + + $dt = date("H:i ", $timecur); if (strncmp($user_mesg, "/nick ", 6) == 0) { log_main($user->sess, "chatt_send BEGIN"); @@ -695,6 +703,8 @@ class brisco { $dt.xcape($user->name), xcape($user_mesg)); $user_cur->step++; } + log_legal($timecur, $user->sess, $user->name, + ($user->stat == 'room' ? 'room' : 'table '.$user->table),$user_mesg); } } @@ -707,7 +717,8 @@ class brisco { if (strcmp($sess, $this->user[$i]->sess) == 0) { // find it $idx = $i; - return ($this->user[$i]); + $ret = &$this->user[$i]; + return ($ret); } } log_main($sess, sprintf("get_user: Wrong sess from page [%s]",$PHP_SELF)); @@ -764,6 +775,7 @@ class brisco { if ($idx != -1 && $i == MAX_PLAYERS) { /* SUCCESS */ + $curtime = time(); if ($sess == "") { $this->user[$idx]->sess = uniqid(""); $sess = $this->user[$idx]->sess; @@ -775,7 +787,9 @@ class brisco { $this->user[$idx]->name = $name_new; $this->user[$idx]->stat = "room"; $this->user[$idx]->subst = "standup"; - $this->user[$idx]->laccwr = time(); + $this->user[$idx]->lacc = $curtime; + $this->user[$idx]->laccwr = $curtime; + $this->user[$idx]->bantime = 0; log_main("XXX", sprintf("TROVATO LIBERO A [%d] sess [%s] name [%s]", $idx, $sess, $name_new)); @@ -878,9 +892,21 @@ function log_load($sess, $log) { fclose($fp); } +function log_legal($timecur, $sess, $name, $where, $mesg) +{ + GLOBAL $_SERVER; + + $fp = fopen(LEGAL_PATH, 'a'); + /* Unix time | session | nickname | IP | where was | mesg */ + fwrite($fp, sprintf("%ld|%s|%s|%s|%s|%s|\n", $timecur, $sess, $name, $_SERVER['REMOTE_ADDR'], $where , $mesg)); + fclose($fp); +} + + + function init_data() { - $brisco = new brisco(); + $brisco =& new brisco(); return $brisco; } @@ -927,7 +953,8 @@ function &load_data() shm_detach($shm); - return ($bri); + $ret = &$bri; + return ($ret); } return (NULL);