A throw in question

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   A throw in question
scz74
CZ Active Member
scz74 has been a member for over 20 year's 20 Year Member
philippines.gif
Age: 50
Gender: Male
Website:
Status: Offline
Joined: Aug 15, 2004
0.02 posts per day
Posts: 145
Points: 7,972
   
hi everyone im just gonna try asking this problem here i know the mod didnt came from here but ill just give it a try coz i wasnt able to have a clear answer in portedmods.

here goes...i have installed arcade mod v3 and got a game pack from nukegaming.com now almost everything is working including the scoring the problem is whenever a player finishes a game he is redirected to an error 404 or the page cannot be found this is the url i am getting after a finished game "root/arcade.php" but i think it the code inside the arcade.php is the problem.

heres the code to my arcade.php (root)



<?php
/***************************************************************************
*                                arcade.php
*                            -------------------
*   Released                    : June 3, 2004
*   
*   Original Mod Author's Site  : http://www.gf-phpbb.com
*
***************************************************************************/


define('IN_PHPBB', true);

$phpbb_root_path = 'modules/Forums/';
include($phpbb_root_path . 'extension.inc');
include('config.'.$phpEx);
include($phpbb_root_path . 'common.'.$phpEx);
include( $phpbb_root_path . 'includes/functions_arcade.' . $phpEx);
require( $phpbb_root_path . 'gf_funcs/gen_funcs.' . $phpEx);
include( $phpbb_root_path . 'includes/constants.php');

$userdata = session_pagestart($user_ip, PAGE_GAME, $nukeuser);

$sessdo = get_var(array('name'=>'sessdo', 'method'=>'POST', 'default'=>''));

if ($sessdo != '')
{

//==============================================
/*
$fd = fopen ("XXXXXX$sessdo.txt", "w");
while( list($var, $param) = @each($HTTP_POST_VARS) )
{
   $$var = $param ;
   $str = $var . '= ' . $$var . "<br>\n";
   fwrite($fd, $str);
}

while( list($var, $param) = @each($HTTP_GET_VARS) )
{
   $$var = $param ;

   $str = $var . '= ' . $$var . "<br>\n";
   fwrite($fd, $str);
}
fwrite($fd, 'username='.$userdata['username'].$user_id);
fclose($fd);
*/
//==============================================
  $gamename = get_var(array('name'=>'gamename', 'method'=>'POST', 'default'=>''));
  $microone = get_var(array('name'=>'microone', 'method'=>'POST', 'default'=>''));
  $id = get_var(array('name'=>'id', 'method'=>'POST', 'default'=>''));
  $score = get_var(array('name'=>'score', 'method'=>'POST', 'default'=>''));
  $fakekey = get_var(array('name'=>'fakekey', 'method'=>'POST', 'default'=>''));
  $gametime = get_var(array('name'=>'gametime', 'method'=>'POST', 'default'=>''));
 
  $header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";

  switch($sessdo)
  {
   case 'sessionstart' :
      //Recuperation of the id of the game. 
      $sql = "SELECT game_id FROM " . GAMES_TABLE . " WHERE game_scorevar = '$gamename'" ;      
      if( !($result = $db->sql_query($sql)) )
      {
            $connStatus = 0;
            echo "&connStatus=$connStatus";
         message_die(GENERAL_ERROR, "Impossible to update the highscore", '', __LINE__, __FILE__, $sql);
         exit;
      }
      if( !$row = $db->sql_fetchrow($result))
      {
            $connStatus = 0;
            echo "&connStatus=$connStatus";
         message_die(GENERAL_ERROR, "No highscore corresponds to the variable score : $gamename");
         exit;
      }
      $gamehash_id = md5(uniqid($user_ip)) ;
      $sql = "INSERT INTO " . GAMEHASH_TABLE . " ( gamehash_id , game_id , user_id , hash_date ) VALUES ( '$gamehash_id' , '" . $row['game_id'] . "' , '" . $userdata['user_id'] . "' , '" . time() . "')" ;

      if( !($db->sql_query($sql)) )
      {
            $connStatus = 0;
            echo "&connStatus=$connStatus";
         message_die(GENERAL_ERROR, "Impossible to update the hash game table", '', __LINE__, __FILE__, $sql);
         exit;
      }
         $connStatus = 1;
         $gametime = time();
         $initbar = $gamename . '|' . $gamehash_id;
         $lastid = $row['game_id'];
         echo "&connStatus=$connStatus&gametime=$gametime&initbar=$initbar&lastid=$lastid&val=x";

      exit;
    break;
   case 'permrequest' :
        $validate = 1 ;
        $microone = $score . '|'. $fakekey;
        echo "&validate=$validate&microone=$microone&val=x";
      exit;
    break;
   
   case 'burn' :
         $header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
      $tbinfos = explode('|',$microone);
      $newhash = substr( $tbinfos[2] , 24 , 8 ) . substr( $tbinfos[2] , 0 , 24 ) ;
      header($header_location . append_sid("proarcade.$phpEx?" . $tbinfos[1] . "=" . $tbinfos[0] . "&gid=$id&newhash=$newhash&hashoffset=8&settime=$gametime&gpaver=GFARV2", true));
      exit;
   }
}


// Is one on the list of the categories or games
$arcade_catid = get_var(array('name'=>'cid', 'intval'=>true ));
$start = get_var(array('name'=>'start', 'intval'=>true ));
$arcade_config = array();
$arcade_config = read_arcade_config();

//recuperation of the list of the private categories to which ones the user to access
$liste_cat_auth = get_arcade_categories($userdata['user_id'], $userdata['user_level'],'view');
if( $liste_cat_auth == '' ) $liste_cat_auth = "''";

$order_by = '';
switch ( $arcade_config['game_order'])
{
   case 'Alpha':
      $order_by = ' game_name ASC ';
      break;
   case 'Popular':
      $order_by = ' game_set DESC ';
      break;
   case 'Fixed':
      $order_by = ' game_order ASC ';
      break;
   case 'Random':
      $order_by = ' RAND() ';
      break;
   case 'News':
      $order_by = ' game_id DESC ';
      break;
   default :
      $order_by = ' game_order ASC ';
      break;
}

/*--------------------------------------------------/
/ Has one to post the list of the categories?
/---------------------------------------------------*/
$games_par_categorie = $arcade_config['category_preview_games'] ; //Number of posted games in preview for every category.

if (( $arcade_catid == 0 ) and ( $arcade_config['use_category_mod'] ))
{
      //chargement du template
      $template->set_filenames(array(
         'body' => 'arcade_cat_body.tpl')
      );

      $template->assign_vars(array(
         'URL_ARCADE' => '<nobr><a class="cattitle" href="' . append_sid("arcade.$phpEx") . '">' . $lang['lib_arcade'] . '</a></nobr> ',
         'URL_BESTSCORES' => '<nobr><a class="cattitle" href="' . append_sid("toparcade.$phpEx") . '">' . $lang['best_scores'] . '</a></nobr> ',   
         'URL_SCOREBOARD' => '<nobr><a class="cattitle" href="' . append_sid("scoreboard.$phpEx?gid=$gid") . '">' . $lang['scoreboard'] . '</a></nobr> ',
         'L_GAME' => $lang['games'],
         'L_HIGHSCORE' => $lang['highscore'],
         'L_YOURSCORE' => $lang['yourbestscore'],
         'L_DESC' => $lang['desc_game'],
         'L_ARCADE' => $lang['lib_arcade'])
         );
   
   $liste_jeux = array();      
//   $sql = "SELECT arcade_catid, game_id, game_pic, game_name, game_desc, game_set FROM " . GAMES_TABLE . " ORDER BY arcade_catid, game_order";
   $sql = "SELECT g.*, u.username, u.user_id, s.score_game, s.score_date FROM " . GAMES_TABLE . " g LEFT JOIN " . USERS_TABLE . " u ON g.game_highuser = u.user_id LEFT JOIN "
         . SCORES_TABLE
         . " s on s.game_id = g.game_id and s.user_id = " . $userdata['user_id'] . " ORDER BY g.arcade_catid, $order_by" ;

   if( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, "Impossible d'accéder à la tables des catégories", '', __LINE__, __FILE__, $sql);
   }
   while( $row = $db->sql_fetchrow($result))
   {
      $liste_jeux[$row['arcade_catid']][] = $row ;
   }

   $sql = "SELECT arcade_catid, arcade_cattitle, arcade_nbelmt FROM " . ARCADE_CATEGORIES_TABLE . " ORDER BY arcade_catorder";
   if( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, "Impossible d'accéder à la tables des catégories", '', __LINE__, __FILE__, $sql);
   }
   while( $row = $db->sql_fetchrow($result))
   {
      $nbjeux = sizeof($liste_jeux[$row['arcade_catid']]);
      if ($nbjeux > 0) //On affiche une catégorie seulement si elle contient au moins 1 jeu.
      {
         $template->assign_block_vars('cat_row',array(
            'U_ARCADE' => append_sid("arcade.$phpEx?cid=" . $row['arcade_catid'] ),
            'L_ARCADE' => sprintf($lang['Other_games'],$row['arcade_nbelmt']),
            'CATTITLE' => $row['arcade_cattitle'])

            );
         $nbjeux = ( $nbjeux < $games_par_categorie ) ? $nbjeux : $games_par_categorie ;
         for ($i=0 ; $i<$nbjeux ; $i++)
         {
              $template->assign_block_vars('cat_row.game_row',array(
               'GAMENAME' => $liste_jeux[$row['arcade_catid']][$i]['game_name'],
               'GAMELINK' => '<nobr><a href="' . append_sid("games.$phpEx?gid=" . $liste_jeux[$row['arcade_catid']][$i]['game_id'] ) . '">' . $liste_jeux[$row['arcade_catid']][$i]['game_name'] . '</a></nobr> ',
               'GAMEPIC' => ( $liste_jeux[$row['arcade_catid']][$i]['game_pic'] != '' ) ? "<a href='" . append_sid("games.$phpEx?gid=" . $liste_jeux[$row['arcade_catid']][$i]['game_id'] ) . "'><img src='" . $phpbb_root_path."games/pics/" . $liste_jeux[$row['arcade_catid']][$i]['game_pic'] . "' align='absmiddle' border='0' width='30' height='30' vspace='2' hspace='2' alt='" . $liste_jeux[$row['arcade_catid']][$i]['game_name'] . "' ></a>" : '' ,
               'GAMESET' => ( $liste_jeux[$row['arcade_catid']][$i]['game_set'] != 0  ) ? $lang['game_actual_nbset'] . $liste_jeux[$row['arcade_catid']][$i]['game_set'] : '',
               'HIGHSCORE' => $liste_jeux[$row['arcade_catid']][$i]['game_highscore'],
               'YOURHIGHSCORE' => $liste_jeux[$row['arcade_catid']][$i]['score_game'],
               'NORECORD' => ( $liste_jeux[$row['arcade_catid']][$i]['game_highscore'] == 0 ) ? $lang['no_record'] : '',
               'HIGHUSER' => ( $liste_jeux[$row['arcade_catid']][$i]['game_highuser'] != 0 ) ? '(' . $liste_jeux[$row['arcade_catid']][$i]['username'] . ')' : '' ,
                   'URL_SCOREBOARD' => '<nobr><a class="cattitle" href="' . append_sid("scoreboard.$phpEx?gid=" . $liste_jeux[$row['arcade_catid']][$i]['game_id'] ) . '">' . "<img src='".$phpbb_root_path."templates/" . $theme['template_name'] . "/images/scoreboard.gif' align='absmiddle' border='0' alt='" . $lang['scoreboard'] . " " . $liste_jeux[$row['arcade_catid']][$i]['game_name'] . "'>" . '</a></nobr> ',
               'GAMEID' => $liste_jeux[$row['arcade_catid']][$i]['game_id'],
               'DATEHIGH' => "<nobr>" . create_date( $board_config['default_dateformat'] , $liste_jeux[$row['arcade_catid']][$i]['game_highdate'] , $board_config['board_timezone'] ) . "</nobr>",
               'YOURDATEHIGH' => "<nobr>" . create_date( $board_config['default_dateformat'] , $liste_jeux[$row['arcade_catid']][$i]['score_date'] , $board_config['board_timezone'] ) . "</nobr>",
               'IMGFIRST' => ( $liste_jeux[$row['arcade_catid']][$i]['game_highuser'] == $userdata['user_id'] ) ? " ;; ;;<img src='".$phpbb_root_path."templates/" . $theme['template_name'] . "/images/couronne.gif' align='absmiddle'>" : "" ,
               'GAMEDESC' => $liste_jeux[$row['arcade_catid']][$i]['game_desc']
                     )
               );

            if ( $liste_jeux[$row['arcade_catid']][$i]['game_highscore'] !=0 )
            {
               $template->assign_block_vars('cat_row.game_row.recordrow',array()) ;
            }   
            if ( $liste_jeux[$row['arcade_catid']][$i]['score_game'] !=0 )
            {
               $template->assign_block_vars('cat_row.game_row.yourrecordrow',array()) ;
            }   
         }
      }
   }
   include($phpbb_root_path . 'whoisplaying.'.$phpEx);
    include($phpbb_root_path . 'headingarcade.'.$phpEx);
   //
   // Output page header
   $page_title = $lang['arcade'];
   include('includes/page_header.'.$phpEx);   
   $template->pparse('body');
   include('includes/page_tail.'.$phpEx);
   exit;
}

/*--------------------------------------------------/
/ Otherwise, one posts the list of the games? 
/---------------------------------------------------*/
$games_par_page = $arcade_config['games_par_page'] ;
$sql_where = '';
$limit = " LIMIT $start,$games_par_page ";

$total_games = 0;

if ( $arcade_config['use_category_mod'])
{
   $sql_where = " WHERE arcade_catid = $arcade_catid ";
   $sql = "SELECT arcade_cattitle, arcade_nbelmt AS nbgames FROM " . ARCADE_CATEGORIES_TABLE . " WHERE arcade_catid = $arcade_catid";
   if( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, "Impossible d\acceder à la tables des catégories", '', __LINE__, __FILE__, $sql);
   }
   if ( $row = $db->sql_fetchrow($result))
   {
         $total_games = $row['nbgames'];
   }
   $template->assign_block_vars('use_category_mod', array());
}
else
{
   $sql = "SELECT COUNT(*) AS nbgames FROM " . GAMES_TABLE ;
   if( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, "Impossible d\acceder à la tables des jeux", '', __LINE__, __FILE__, $sql);
   }
   if ( $row = $db->sql_fetchrow($result))
   {
         $total_games = $row['nbgames'];
   }
}
//chargement du template
$template->set_filenames(array(
   'body' => 'arcade_body.tpl')
);

$template->assign_vars(array(
   'URL_ARCADE' => '<nobr><a class="cattitle" href="' . append_sid("arcade.$phpEx") . '">' . $lang['lib_arcade'] . '</a></nobr> ',
   'URL_BESTSCORES' => '<nobr><a class="cattitle" href="' . append_sid("toparcade.$phpEx") . '">' . $lang['best_scores'] . '</a></nobr> ',   
   'URL_SCOREBOARD' => '<nobr><a class="cattitle" href="' . append_sid("scoreboard.$phpEx?gid=$gid") . '">' . $lang['scoreboard'] . '</a></nobr> ',
   'CATTITLE' => $row['arcade_cattitle'],
   'L_GAME' => $lang['games'],
   'PAGINATION' => generate_pagination(append_sid("arcade.$phpEx?cid=$arcade_catid"), $total_games, $games_par_page, $start),
   'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $games_par_page ) + 1 ), ceil( $total_games / $games_par_page )),
   'L_HIGHSCORE' => $lang['highscore'],
   'L_YOURSCORE' => $lang['yourbestscore'],
   'L_DESC' => $lang['desc_game'],
   'L_ARCADE' => $lang['lib_arcade'])
   );

$sql = "SELECT g.*, u.username, u.user_id, s.score_game, s.score_date FROM " . GAMES_TABLE . " g left join " . USERS_TABLE . " u on g.game_highuser = u.user_id left join "
. SCORES_TABLE
. " s on s.game_id = g.game_id and s.user_id = " . $userdata['user_id'] . " $sql_where ORDER BY $order_by $limit" ;

if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, "Impossible d\acceder à la tables des jeux", '', __LINE__, __FILE__, $sql);
}

while( $row = $db->sql_fetchrow($result) )
{
   $template->assign_block_vars('gamerow', array(
   'GAMENAME' => $row['game_name'],
   'GAMEPIC' => ( $row['game_pic'] != '' ) ? "<a href='" . append_sid("games.$phpEx?gid=" . $row['game_id'] ) . "'><img src='" . $phpbb_root_path."games/pics/" . $row['game_pic'] . "' align='absmiddle' border='0' width='30' height='30' alt='" . $row['game_name'] . "' ></a>" : '' ,
   'GAMESET' => ( $row['game_set'] != 0  ) ? $lang['game_actual_nbset'] . $row['game_set'] : '',
   'GAMEDESC' => $row['game_desc'],
   'HIGHSCORE' => $row['game_highscore'],
   'YOURHIGHSCORE' => $row['score_game'],
   'NORECORD' => ( $row['game_highscore'] == 0 ) ? $lang['no_record'] : '',
   'HIGHUSER' => ( $row['game_highuser'] != 0 ) ? '(' . $row['username'] . ')' : '' ,
   'URL_SCOREBOARD' => '<nobr><a class="cattitle" href="' . append_sid("scoreboard.$phpEx?gid=" . $row['game_id'] ) . '">' . "<img src='".$phpbb_root_path."templates/" . $theme['template_name'] . "/images/scoreboard.gif' align='absmiddle' border='0' alt='" . $lang['scoreboard'] . " " . $row['game_name'] . "'>" . '</a></nobr> ',   
   'GAMEID' => $row['game_id'],
   'DATEHIGH' => "<nobr>" . create_date( $board_config['default_dateformat'] , $row['game_highdate'] , $board_config['board_timezone'] ) . "</nobr>",
   'YOURDATEHIGH' => "<nobr>" . create_date( $board_config['default_dateformat'] , $row['score_date'] , $board_config['board_timezone'] ) . "</nobr>",
   'IMGFIRST' => ( $row['game_highuser'] == $userdata['user_id'] ) ? " ;; ;;<img src='".$phpbb_root_path."templates/" . $theme['template_name'] . "/images/couronne.gif' align='absmiddle'>" : "" ,   
   'GAMELINK' => '<nobr><a href="' . append_sid("games.$phpEx?gid=" . $row['game_id'] ) . '">' . $row['game_name'] . '</a></nobr> ' )
   );
   if ( $row['game_highscore'] !=0 )
   {
      $template->assign_block_vars('gamerow.recordrow',array()) ;
   }   
   if ( $row['score_game'] !=0 )
   {
      $template->assign_block_vars('gamerow.yourrecordrow',array()) ;
   }   

}

include($phpbb_root_path . 'whoisplaying.'.$phpEx);
include($phpbb_root_path . 'headingarcade.'.$phpEx);

      
//
// Output page header
$page_title = $lang['arcade'];
include('includes/page_header.'.$phpEx);   
$template->pparse('body');
include('includes/page_tail.'.$phpEx);

?>


by the way my root location is "domain"/Nuke/nukeroot not "domain"/nukeroot



_________________
[ Register or login to view links on this board.]
[ Register or login to view links on this board.]
Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,475
   
If it is right when there done playing a game then it is in the proarcade.php file. Sounds like one of the header refreshes is pointing to the wrong location. Post that file instead.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   re: A throw in question
scz74
CZ Active Member
scz74 has been a member for over 20 year's 20 Year Member
philippines.gif
Age: 50
Gender: Male
Website:
Status: Offline
Joined: Aug 15, 2004
0.02 posts per day
Posts: 145
Points: 7,972
   
heres the code to the proarcade.php telli:


<?php

/***************************************************************************
*                                proarcade.php
*                            -------------------
*   Released                    : June 3, 2004
*   
*   Original Mod Author's Site  : http://www.gf-phpbb.com
*
***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');

include('../../config.php');
include('db/db.php');
include('includes/functions.php');
include('includes/constants.php');
include('includes/sessions.php');
include('common_arcade.php');

while( list($var, $param) = @each($HTTP_POST_VARS) )
{
   $$var = $param ;
}

while( list($var, $param) = @each($HTTP_GET_VARS) )
{
   $$var = $param ;
}

$gid = intval($gid);

$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";

//
// Start session management
//

$userdata = session_pagestart($user_ip, PAGE_GAME, $nukeuser);
//init_userprefs($userdata);

//
// End session management
//
// Start auth check
//

$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";

$sql = "SELECT * FROM " . GAMES_TABLE . " WHERE game_id = '$gid'";
if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, "Impossible d'acceder à la table des jeux", '', __LINE__, __FILE__, $sql);
}
if ( !( $row = $db->sql_fetchrow($result) ) )
{// Si l'utilisateur n'a encore aucun score pour ce jeu'
   message_die(GENERAL_ERROR, "Aucun jeu ne correspond.") ;
}

if ( $row['game_type'] == 0 )
{
   $deb = 32 - $hashoffset ;
   $gamehash_id = substr( $newhash , $deb , $hashoffset ) . substr( $newhash , 0 , $deb ) ;
}

if ( $row['game_type'] == 1 )
{
$gamehash_id = $gamehash ;
}

if ( $row['game_type'] == 2 )
{
if ( $vpaver == "100B" )
{
$gamehash_id = $gamehash ;
$vpaver = "100B2" ;
}
}

if ( $row['game_type'] == 3 )
{
   $gamehash_id = substr( $newhash , $hashoffset , 32 ) . substr( $newhash , 0 , $hashoffset ) ;
   $vpaver = ( $gpaver == "GFARV2") ? '100B2' : '' ;
}


$vscore = $row['game_scorevar'] ;
$score = $$vscore ;

if (  !$userdata['session_logged_in']  && !isset($valid) )
{
   header($header_location . "http://" . $board_config['server_name']."/modules/Forums/proarcade.php?$vscore=$score&gid=$gid&valid=X&newhash=$newhash&gamehash_id=$gamehash_id&gamehash=$gamehash&hashoffset=$hashoffset&settime=$settime&sid=$sid&vpaver=$vpaver", true);
   exit;
}

if ( !$userdata['session_logged_in'] )
{
   header($header_location . "http://" . $board_config['server_name']."/modules/Forums/login.php?redirect=arcade.php", true);
   exit;
}

$sql = "SELECT * FROM " . GAMEHASH_TABLE . " WHERE gamehash_id = '$gamehash_id' and game_id = '$gid' and user_id = '" . $userdata['user_id'] . "'";

if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, "Impossible d'acceder à la tables des hash game", '', __LINE__, __FILE__, $sql);
}

// Tentative de hack ?
if ( !( $row = $db->sql_fetchrow($result) ) or ($vpaver != "100B2") or (!isset($$vscore)) )
{
   $sql = "INSERT INTO " . HACKGAME_TABLE . " ( user_id , game_id , date_hack ) VALUES ( '" . $userdata['user_id'] . "' , '$gid' , '" . time() . "')" ;
   $db->sql_query($sql) ;
   header($header_location . "http://" . $board_config['server_name']."/modules.php?name=Forums&file=arcade", true);
   exit;
}

$sql = "DELETE FROM " . GAMEHASH_TABLE . " WHERE gamehash_id = '$gamehash_id' and game_id = $gid and user_id = " . $userdata['user_id'] ;

$db->sql_query($sql) ;



//
// End of auth check
//



$sql = "SELECT * FROM " . SCORES_TABLE . " WHERE game_id = $gid and user_id = " . $userdata['user_id'] ;

if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, "Impossible d'acceder à la tables des scores", '', __LINE__, __FILE__, $sql);
}

$datenow = time();
$ecart = $datenow - $settime ;

if ( !( $row = $db->sql_fetchrow($result) ) )
{// Si l'utilisateur n'a encore aucun score pour ce jeu'
   $sql = "INSERT INTO " . SCORES_TABLE . " (game_id , user_id , score_game , score_date , score_time , score_set )
   VALUES ( $gid , " . $userdata['user_id'] . " , $score , $datenow , $ecart , 1 ) ";
   $result = $db->sql_query($sql) ;
}
else
{
  if ( $row['score_game'] < $score )
  {
  $sql = "UPDATE " . SCORES_TABLE . " set score_game = $score , score_set = score_set + 1 , score_date = $datenow , score_time = score_time + $ecart 
   WHERE game_id = $gid and user_id = " . $userdata['user_id'] ;
  $result = $db->sql_query($sql) ;
  }   
  else
  {
    $sql = "UPDATE " . SCORES_TABLE . " set score_set = score_set + 1  , score_time = score_time + $ecart
   WHERE game_id = $gid and user_id = " . $userdata['user_id'] ;
    $result = $db->sql_query($sql) ;
  }
}


$sql = "SELECT * FROM " . GAMES_TABLE . " WHERE game_id = " . $gid ;
if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, "Impossible d'acceder à la tables des jeux", '', __LINE__, __FILE__, $sql);
}

if ( ( $row = $db->sql_fetchrow($result) ) && ( $row['game_highscore']< $score) )
{// Si l'utilisateur a battu le record du jeu
   $sql = "UPDATE " . GAMES_TABLE . " SET game_highscore = $score , game_highuser = "
   . $userdata['user_id'] . " , game_highdate = " . time() . ", game_set = game_set+1 WHERE game_id = $gid" ;
   $result = $db->sql_query($sql) ;
}
else
{
   $sql = "UPDATE " . GAMES_TABLE . " SET game_set = game_set+1 WHERE game_id = $gid" ;
   $result = $db->sql_query($sql) ;
}
   header($header_location . "http://" . $board_config['server_name']."/modules.php?name=Forums&file=games&gid=$gid", true);
   exit;

?>




_________________
[ Register or login to view links on this board.]
[ Register or login to view links on this board.]
Back to top Reply with quote
#4   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,475
   
Is it logging you out when your done playing a game?




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#5   re: A throw in question
scz74
CZ Active Member
scz74 has been a member for over 20 year's 20 Year Member
philippines.gif
Age: 50
Gender: Male
Website:
Status: Offline
Joined: Aug 15, 2004
0.02 posts per day
Posts: 145
Points: 7,972
   
hey telli you were right it was in the proarcade. got it fixed now thanks.




_________________
[ Register or login to view links on this board.]
[ Register or login to view links on this board.]
Back to top Reply with quote
#6   re: A throw in question
Jazzy
CZ Super Newbie
Jazzy has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Sep 25, 2004
0.01 posts per day
Posts: 64
Points: 3,820
   
What was the fix for this because I am having the same problem



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum