Merge remote-tracking branch 'origin/together-for-fun' into nginx
authorMatteo Nastasi <nastasi@alternativeoutput.it>
Sun, 9 Jul 2017 17:02:31 +0000 (19:02 +0200)
committerMatteo Nastasi <nastasi@alternativeoutput.it>
Sun, 9 Jul 2017 17:02:31 +0000 (19:02 +0200)
Conflicts:
web/briskin5/Obj/briskin5.phh
web/briskin5/index_wr.php
web/briskin5/stat-day.php
web/briskin5/statadm.php

1  2 
INSTALL.sh
web/Obj/brisk.phh
web/Obj/dbase_pgsql.phh
web/Obj/user.phh
web/briskin5/Obj/briskin5.phh
web/briskin5/index.php
web/briskin5/index_wr.php
web/index.php

diff --cc INSTALL.sh
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -1610,11 -1560,13 +1561,13 @@@ function show_table(&$bri, &$user, $sen
      $table_pos = $user->table_pos;
  
      $ret = "table_init();";
 -    $ret .= $table->exitlock_show(&$bri->user, $table_pos);
 +    $ret .= $table->exitlock_show($bri->user, $table_pos);
      if (!$is_again) {
          /* GENERAL STATUS */
-         $ret .= sprintf( 'gst.st = %d; stat = "%s"; subst = "%s"; table_pos = %d;',
-                          $sendstep, $user->stat, $user->subst, $table_pos);
+         $user_rules = $user->rules_get();
+         $ret .= sprintf('gst.st = %d; stat = "%s"; subst = "%s"; table_pos = %d; rules_set(%d);',
+                         $sendstep, $user->stat, $user->subst, $table_pos,
+                         ($user_rules == BIN5_USER_CONTINUE_INIT ? $table->rules->id_get() : $user_rules));
  
          log_rd(sprintf( 'SHOW_TABLE: gst.st = %d; stat = "%s"; subst = "%s"; table_pos = %d;', $sendstep, $user->stat, $user->subst, $table_pos));
  
Simple merge
@@@ -53,13 -54,9 +54,9 @@@ function bin5_index_wr_main(&$bin5, $re
      if (($CO_bin5_pref_ring_endauct = gpcs_var('CO_bin5_pref_ring_endauct', $get, $post, $cookie)) === FALSE)
          $CO_bin5_pref_ring_endauct = "";
  
      log_wr(0, 'bin::index_wr.php: COMM: '.xcapemesg($mesg));
  
 -    if (($user = &$bin5->get_user($sess, &$idx)) == FALSE) {
 +    if (($user = &$bin5->get_user($sess, $idx)) == FALSE) {
          echo "Get User Error";
          log_wr("Get User Error");
          return FALSE;
          }
          else if ($user->subst == 'asta') {
              if ($argz[0] == 'lascio') {
-                 //  && $user->handpt <= 2) {
-                 /* $index_cur = $table->gstart % BIN5_PLAYERS_N; */
-                 /* log_wr(sprintf("GIOCO FINITO !!!")); */
-                 /* $table->mult += 1;  */
-                 /* $table->old_reason = sprintf("Ha lasciato %s perché aveva al massimo 2 punti.", xcape($user->name)); */
-                 /* // Non si cambia mazzo se si abbandona la partita */
-                 /* $table->game_next(0); */
-                 /* if ($user->table_orig < TABLES_AUTH_N) { */
-                 /*     require_once("../Obj/dbase_".$G_dbasetype.".phh"); */
-                 /*     if (($bdb = BriskDB::create()) != FALSE) { */
-                 /*         $bdb->bin5_points_save($curtime, $table, $user->table_orig, $ucodes, $pt_cur); */
-                 /*         unset($bdb); */
-                 /*     } */
-                 /*     else { */
-                 /*         log_points($remote_addr, $curtime, $user, "STAT:BRISKIN5:FINISH_GAME", "DATABASE CONNECTION FAILED"); */
-                 /*     } */
-                 /*     log_points($curtime, $user, "STAT:BRISKIN5:FINISH_GAME", $plist); */
-                 /* } */
-                 /* $table->game_init(&$bin5->user); */
-                 if ($table->rules_engine($bin5, $curtime, BIN5_RULES_ABANDON, $user)) {
 -                if ($table->rules->engine(&$bin5, $curtime, BIN5_RULES_ABANDON, $user)) {
++                if ($table->rules->engine($bin5, $curtime, BIN5_RULES_ABANDON, $user)) {
                      for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
                          $user_cur = &$bin5->user[$table->player[$i]];
  
                      if ($table->turn == (BIN5_PLAYERS_N * BIN5_CARD_HAND)) { /* game finished */
                          log_wr(sprintf("GIOCO FINITO !!!"));
  
-                         if ($table->rules_engine($bin5, $curtime, BIN5_RULES_FINISH, $user)) {
 -                        if ($table->rules->engine(&$bin5, $curtime, BIN5_RULES_FINISH, $user)) {
++                        if ($table->rules->engine($bin5, $curtime, BIN5_RULES_FINISH, $user)) {
                              for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
                                  $user_cur = &$bin5->user[$table->player[$i]];
 -                                $retar[$i] .= show_table(&$bin5,&$user_cur,$user_cur->step+1,TRUE, TRUE);
 +                                $retar[$i] .= show_table($bin5, $user_cur, $user_cur->step+1, TRUE, TRUE);
                              }
                          }
                      }
diff --cc web/index.php
Simple merge