Jump to content

bobl61

Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by bobl61

  1. I upgraded to PHP 8 and reinstalled VSP. I'm now getting this error when parsing the logs: Warning: Trying to access array offset on value of type bool in C:\xampp\htdocs\q3eplus.servequake.com\vsp.php on line 807 Line 807: $awardset_expanded[$Vee670b78]['result'] = $awardset_expanded[$Vee670b78]['sql'][$Vf5c8a086][0]; The stats do process, but the player names do not appear.
  2. I was just going to post back that I got the sig to work, but the player online time didn't match the sig. Your code works perfectly 😉 Thank you!
  3. PHP Deprecated: Implicit conversion from float 0.1322222222222222 to int loses precision in sig.php on line 407, referer: hlstats.php?mode=playerinfo&player=1 PHP Deprecated: Implicit conversion from float 1.15 to int loses precision in sig.php on line 410, referer: hlstats.php?mode=playerinfo&player=8 line 407 $hours += floor($timestamp / 3600 % 24); line 410 $min = floor($timestamp / 60 % 60); Program is HlstatX. Server: XAMPP 8.2.4 (PHP 8.2.4). OS Windows 11 sig.txt
  4. AHA! That got me thinking. Xampp installed Try into that directory. ActivePerl installed it in it's own library. So I changed: type C:\xampp\htdocs\ggturbo.ddns.net\cstrike\logs *.log | C:\xampp\perl\bin\perl.exe C:\xampp\scripts\hlstats.pl -s -t --norcon --server-ip 192.168.1.10 --server-port 27015 to: type C:\xampp\htdocs\ggturbo.ddns.net\cstrike\logs\*.log | C:\Perl64\bin\perl.exe C:\xampp\scripts\hlstats.pl -s -t --norcon --server-ip 192.168.0.10 --server-port 27015 and BAM! The logs were imported successfully. Thanks, @requinix, as always 😉
  5. I'm using ActivePerl-5.24.3.2404-MSWin32-x64-404865. I don't know of ant way to specify where to install modules. I guess PPM just installs them wherever it wants 🤔
  6. I'm trying to import logs into a game stats program and am getting an error: C:\WINDOWS\system32>type C:\xampp\htdocs\ggturbo.ddns.net\cstrike\logs *.log | C:\xampp\perl\bin\perl.exe C:\xampp\scripts\hlstats.pl -s -t --norcon --server-ip 192.168.1.10 --server-port 27015 C:\xampp\htdocs\ggturbo.ddns.net\cstrike\logs \l0102000.log Can't locate Syntax/Keyword/Try.pm in @INC (you may need to install the Syntax::Keyword::Try module) (@INC contains: C:/xampp/perl/site/lib C:/xampp/perl/vendor/lib C:/xampp/perl/lib) at C:/xampp/scripts/HLstats_Server.pm line 41. BEGIN failed--compilation aborted at C:/xampp/scripts/HLstats_Server.pm line 41. Compilation failed in require at C:\xampp\scripts\hlstats.pl line 75. The process tried to write to a nonexistent pipe. I verified that the Syntax::Keyword::Try module is installed. HLstats_Server.pm line 41: use Syntax::Keyword::Try; hlstats.pl line 75: require "$opt_libdir/HLstats_Server.pm"; I tried adding... use lib 'C:/xampp/perl/vendor/lib/Log/Report/Dispatcher'; use Syntax::Keyword::Try;
  7. With Firefox browser I get this error: Cookie “ps_install_sess_opts” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite index.php Cookie “ps_install_sess_opts” has been rejected because a non-HTTPS cookie can’t be set as “secure”
  8. The cookie never shows up and see this error:
  9. The cookie is not there: This happens as soon as I click on "Install". There are no errors in the site error logs (I'm assuming since the install gets halted immediately).
  10. It appears that the installation script is not setting the cookie required to proceed. The script resides in common.php: <?php /** * This file is part of PsychoStats. * * Written by Jason Morriss * Copyright 2008 Jason Morriss * * PsychoStats is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * PsychoStats is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with PsychoStats. If not, see <http://www.gnu.org/licenses/>. * * Version: $Id: common.php 565 2008-10-10 12:27:02Z lifo $ */ if (!defined("PSYCHOSTATS_INSTALL_PAGE")) die("Unauthorized access to " . basename(__FILE__)); define("PS_INSTALL_VERSION", '3.2.8b'); define("PS_ROOTDIR", rtrim(dirname(__DIR__), '/\\')); define("PS_INSTALLDIR", __DIR__); // enable some sane error reporting (ignore notice errors) and turn off the magic. // we also want to to disable E_STRICT. error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED); //set_magic_quotes_runtime(0); /**/ @ini_set('display_errors', 'On'); @ini_set('log_errors', 'On'); /**/ // IIS does not have REQUEST_URI defined (apache specific). // This URI is handy in certain pages so we create it if needed. if (empty($_SERVER['REQUEST_URI'])) { $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME']; if (!empty($_SERVER['QUERY_STRING'])) { $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; } } // read in all of our required libraries for basic functionality! require_once(PS_ROOTDIR . "/includes/functions.php"); require_once(PS_ROOTDIR . "/includes/class_DB.php"); require_once(PS_ROOTDIR . "/includes/class_PS.php"); require_once(PS_ROOTDIR . "/includes/class_CMS.php"); require_once(PS_ROOTDIR . "/includes/class_HTTP.php"); require_once(PS_ROOTDIR . "/includes/class_session.php"); // try to load the current config $dbtype = 'mysql'; $dbhost = 'localhost'; $dbport = ''; $dbname = 'psychostats'; $dbuser = ''; $dbpass = ''; $dbtblprefix = 'ps_'; $site_url = ''; if (file_exists(PS_ROOTDIR . "/config.php") and file_exists(PS_ROOTDIR . "/install/go-dbinit.php")) { @include_once(PS_ROOTDIR . "/config.php"); } else { echo "You must install game support before you can install PsychoStats, please see INSTALL.md for details."; exit; } // Initialize our global variables for PsychoStats. // Lets be nice to the global Name Space. $db = null; $cms = null; // global PsychoCMS object $php_scnm = $_SERVER['SCRIPT_NAME']; // this is used so much we make sure it's global // Sanitize PHP_SELF and avoid XSS attacks. // We use the constant in places we know we'll be outputting $PHP_SELF to the user define("SAFE_PHP_SCNM", htmlentities($_SERVER['REQUEST_URI'], ENT_QUOTES, "UTF-8")); // create database handle $db = PsychoDB::create(array( 'dbtype' => 'mysql', 'delaystart' => true, 'fatal' => false, )); // start the PS CMS object $cms = new PsychoCMS(array( 'dbhandle' => &$db, 'plugin_dir' => PS_ROOTDIR . '/plugins', 'site_url' => $site_url )); **// this session will not actually store a session in a database or file. // it's mearly used in the install for cookie support. $cms->session = new PsychoSession(array( 'cms' => $cms, 'cookiename' => 'ps_install_sess', 'cookiesalt' => '', 'cookiecompress' => true, 'cookieencode' => true, 'cookielifeoptions' => 0, 'dbhandle' => $db, 'delaystart' => true, ));** $cms->init(true); // quick init; no plugins, session or user $cms->init_theme('default', array( 'theme_default' => 'default', 'theme_opt' => 'install_theme', 'in_db' => false, 'force_theme' => true, 'fetch_compile' => false, 'compile_id' => 'install', 'compile_dir' => null, 'js_compress' => false, 'css_compress' => false, 'template_dir' => __DIR__ . '/themes', 'theme_url' => null, )); $cms->theme->load_styles(); $cms->theme->assign(array( 'SELF' => SAFE_PHP_SCNM, 'install_version' => PS_INSTALL_VERSION )); // ---------------------------------- function init_session_opts($delete = false) { global $cms; $opts = $cms->session->load_session_options(); if ($delete || !$opts || !$opts['install']) { $cms->session->set_opts(array('install' => uniqid(rand(),true)), true); $cms->session->save_session_options(); $opts = $cms->session->load_session_options(); } return $opts; } // load DB conf from POST'ed form, or session variables if no form variable was found function load_db_opts($conf = null) { global $cms; $list = array('dbhost','dbport','dbname','dbuser','dbpass','dbtblprefix'); $opts = $cms->session->load_session_options(); foreach ($list as $var) { if ($conf and is_array($conf) and array_key_exists($var, $conf)) { $GLOBALS[$var] = $conf[$var]; # print "CONF: $var == '$conf[$var]'<br>"; } else if (array_key_exists($var, $opts)) { $GLOBALS[$var] = $opts[$var]; # print "OPTS: $var == '$opts[$var]'<br>"; } } } function save_db_opts() { global $cms, $dbhost, $dbport, $dbname, $dbuser, $dbpass, $dbtblprefix; $opts = $cms->session->load_session_options(); $opts['dbhost'] = $dbhost; $opts['dbport'] = $dbport; $opts['dbname'] = $dbname; $opts['dbuser'] = $dbuser;`your text` $opts['dbpass'] = $dbpass; $opts['dbtblprefix'] = $dbtblprefix; $cms->session->save_session_options($opts); } ?> I've searched how to set cookie in PHP 7, but can't find a resolution for my particular problem.
  11. I can't seem to get the install script to work for PsychoStats. Error message is: "Installation Aborted! The most likely cause for this error is that you have not created a database and database user for PsychoStats and/or entered your database name, database username and database user password into the config.php file. You need to create a database and a database user, and give that user full permissions on that database. The other possible reason for this error is that your session either timed out or another installation session was started. If that was the case you must start over and try again. Make sure you start the installation from the beginning and do not use your back button to attemp to restart the installation. Make sure you do not open a second installation window or it will fail again." I have the database setup with a new user with full privileges to the psychostats database. I have entered the information into the config.php file. I'm running the server and stats on same machine (Windows 11). Xampp - Apache/2.4.46 (Win64) OpenSSL/1.1.1g PHP/7.4.16 Any ideas?
  12. WOO-HOO! Everything is working perfectly now. The player names are perfect. The country flags are working properly. Thanks so much for your help requinix!
  13. Only the theme. Changed some images and banners. Nothing to do with the processing of the stats. I did see this further down the file. I forgot that I changed this also... //change: special chars if ($this->V93da65a9['xp_version'] <= 103) { // 1.03 special chars $Vaa8af3eb = preg_replace("/\+([\x01-\x7F])#/e", "chr(ord('\\1') + 127)", $Vaa8af3eb); } else { // 1.04 special chars $Vaa8af3eb = preg_replace("/#(#|[0-9a-f]{2})/ie", "'\\1' == '#' ? '#' : chr(hexdec('\\1'))", $Vaa8af3eb); } $Vaa8af3eb = strtr($Vaa8af3eb, $this->V42dfa3a4['char_trans']); //endchange $this->Vae2aeb93->F8405e6ea($this->Va2bbabfe[$V2bfe9d72]['id'], $this->F7212cda9($Vaa8af3eb)); } return true; } return false; } function Fe7c49e90(&$V6438c669) // si descongela (oO, no sabía esto) { To this... //change: special chars if ($this->V93da65a9['xp_version'] <= 103) { // 1.03 special chars $Vaa8af3eb = preg_replace_callback("/\+([\x01-\x7F])#/", function($matches){ foreach($matches as $match){ return chr($match); } }, $Vaa8af3eb ); } else { // 1.04 special chars $Vaa8af3eb = preg_replace_callback("/#(#|[0-9a-f]{2})/", function($matches){ foreach($matches as $match){ return chr($match); } }, $Vaa8af3eb ); Maybe that's causing it?
  14. Okay, got it. Definitely getting closer. Players with special characters in their names are still not displaying properly, though. Here's what I ahve now... //$V70dda5df = array("black", "red", "lime", "yellow", "blue", "aqua", "fuchsia", "white", "orange"); //change: special chars if ($this->V93da65a9['xp_version'] <= 103) { // 1.03 special chars $V341be97d = preg_replace_callback("/\+([\x01-\x7F])#/", fn($matches) => chr(ord($matches[1]) + 127), $V341be97d); } else { // 1.04 special chars $V341be97d = preg_replace_callback('/\^([^\^<])/', fn($matches) => '`' . $V70dda5df[ord($matches[1]) % 8], $V341be97d); } //endchange $V70dda5df = array("#555555", "#e90000", "#00dd24", "#f5d800", "#2e61c8", "#16b4a5", "#f408f1", "#efefef", "#ebbc1b"); $tmp = array("\xde" => "^"); $V341be97d = strtr($V341be97d, array_diff_assoc($this->V42dfa3a4['char_trans'], $tmp)); if ($V341be97d[0] != "^") $V341be97d = "^7" . $V341be97d; $V341be97d = preg_replace('/\^(a[1-9]|[fFrRbBl])/', "", $V341be97d); $V341be97d = preg_replace('/\^s(\^x[a-fA-F0-9]{6}|\^[^\^])/', "\\1", $V341be97d); $V341be97d = preg_replace('/\^s/', "^7", $V341be97d); $V341be97d = preg_replace('/(\^(x[a-fA-F0-9]{6}|[^\^]))\^(x[a-fA-F0-9]{6}|[^\^])/', "\\1", $V341be97d); $V341be97d = preg_replace('/\^x([a-fA-F0-9]{6})/i', "`#\\1", $V341be97d); $V341be97d = preg_replace_callback('/\^([^\^<])/', fn($matches) => '`' . $V70dda5df[ord($matches[1]) % 8], $V341be97d); $V341be97d = strtr($V341be97d, $tmp); return $V341be97d; } function Fa3f5d48d($V341be97d) // parece eliminar efectos del nombre BTW - I really appreciate all your help.
  15. Here's what the code looks like now... //$V70dda5df = array("black", "red", "lime", "yellow", "blue", "aqua", "fuchsia", "white", "orange"); //change: special chars if ($this->V93da65a9['xp_version'] <= 103) { // 1.03 special chars preg_replace_callback("/\+([\x01-\x7F])#/", fn($matches) => chr(ord($matches[1]) + 127), $V341be97d); } else { // 1.04 special chars preg_replace_callback("/#(#|[0-9a-f]{2})/i", fn($matches) => $matches[1] == '#' ? '#' : chr(hexdec($matches[1])), $V341be97d); } //endchange $V70dda5df = array("#555555", "#e90000", "#00dd24", "#f5d800", "#2e61c8", "#16b4a5", "#f408f1", "#efefef", "#ebbc1b"); $tmp = array("\xde" => "^"); $V341be97d = strtr($V341be97d, array_diff_assoc($this->V42dfa3a4['char_trans'], $tmp)); if ($V341be97d[0] != "^") $V341be97d = "^7" . $V341be97d; $V341be97d = preg_replace('/\^(a[1-9]|[fFrRbBl])/', "", $V341be97d); $V341be97d = preg_replace('/\^s(\^x[a-fA-F0-9]{6}|\^[^\^])/', "\\1", $V341be97d); $V341be97d = preg_replace('/\^s/', "^7", $V341be97d); $V341be97d = preg_replace('/(\^(x[a-fA-F0-9]{6}|[^\^]))\^(x[a-fA-F0-9]{6}|[^\^])/', "\\1", $V341be97d); $V341be97d = preg_replace('/\^x([a-fA-F0-9]{6})/i', "`#\\1", $V341be97d); preg_replace_callback('/\^([^\^<])/', fn($matches) => '`' . $V70dda5df[ord($matches[1]) % 8], $V341be97d); $V341be97d = strtr($V341be97d, $tmp); return $V341be97d; } function Fa3f5d48d($V341be97d) // parece eliminar efectos del nombre
  16. I've implemented your fixes and the program runs without errors. Only problem now is all the players have ^ characters in their names.
  17. It's the latest working version of the script. There's supposedly a newer version, but I downloaded it and the files are corrupt. I'm not a coder, but I was able to replace other instances of the /e modifier using research. I replaced: //change: special chars if ($this->V93da65a9['xp_version'] <= 103) { // 1.03 special chars $V341be97d = preg_replace("/\+([\x01-\x7F])#/e", "chr(ord('\\1') + 127)", $V341be97d); } else { // 1.04 special chars $V341be97d = preg_replace("/#(#|[0-9a-f]{2})/ie", "'\\1' == '#' ? '#' : chr(hexdec('\\1'))", $V341be97d); } to this: //change: special chars if ($this->V93da65a9['xp_version'] <= 103) { // 1.03 special chars $V341be97d = preg_replace_callback("/\+([\x01-\x7F])#/", function($matches){ foreach($matches as $match){ return chr($match); } }, $V341be97d ); } else { // 1.04 special chars $V341be97d = preg_replace_callback("/#(#|[0-9a-f]{2})/", function($matches){ foreach($matches as $match){ return chr($match); } }, $V341be97d ); Those changes work without errors. I just can't seem to get the code in my first post to work correctly. Here's a link to the program I'm using.
  18. I'm using a game stats processor for my site called VSP. I've corrected all the /e modifier errors using the preg_replace_callback function except for this one. I'm hoping someone can help. The code is: $V341be97d = preg_replace('/\^([^\^<])/e', "'`' . \$V70dda5df[ord('\\1') % 8]", $V341be97d); I'm attaching the entire php file for reference.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.