boionfire81 Posted March 26, 2016 Share Posted March 26, 2016 This line is keeping my cron day from running require_once('globals_nonauth.php'); if ($argc == 2) { if ($argc[1] != $_CONFIG['code']) { exit; } } else if (!isset($_GET['code']) || $_GET['code'] !== $_CONFIG['code']) { exit; } reason argc undefined. It is right under globals.php Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted March 26, 2016 Share Posted March 26, 2016 You can probably just remove that and just check the config code. Replace that snippet with this: if(!isset($_GET['code']) || $_GET['code'] !== $_CONFIG['code']) exit; I dont really understand what that is. I just checked my copy of globals and non_auth and cant find it Quote Link to comment Share on other sites More sharing options...
NonStopCoding Posted March 26, 2016 Share Posted March 26, 2016 This line is keeping my cron day from running require_once('globals_nonauth.php'); if ($argc == 2) { if ($argc[1] != $_CONFIG['code']) { exit; } } else if (!isset($_GET['code']) || $_GET['code'] !== $_CONFIG['code']) { exit; } reason argc undefined. It is right under globals.php have you checked your cron job manager to make sure the code matches the code in the config.php file this will stop your cron from running. You can probably just remove that and just check the config code. Replace that snippet with this: if(!isset($_GET['code']) || $_GET['code'] !== $_CONFIG['code']) exit; I dont really understand what that is. I just checked my copy of globals and non_auth and cant find it there is no reference to it anyplace that i can find lol Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted March 27, 2016 Share Posted March 27, 2016 Nope and that is likely the error that is stopping it from running Quote Link to comment Share on other sites More sharing options...
boionfire81 Posted March 27, 2016 Author Share Posted March 27, 2016 I have a few that are argc that keep my crons from running. It's not just the day one, but the minute one too. Quote Link to comment Share on other sites More sharing options...
boionfire81 Posted March 27, 2016 Author Share Posted March 27, 2016 I have my cron jobs set to alert me when there is an error. This is what I get A non-critical error has occurred. Page execution will continue. Below are the details:<br /><strong>PHP Deprecation Notice</strong>: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead (8192)<br /><br /><strong>Line executed</strong>: /home/public_html/class/class_db_mysql.php:82<br /><br /> My cron is <?php /** * MCCodes Version 2.0.5b * Copyright (C) 2005-2012 Dabomstew * All rights reserved. * * Redistribution of this code in any form is prohibited, except in * the specific cases set out in the MCCodes Customer License. * * This code license may be used to run one (1) game. * A game is defined as the set of users and other game database data, * so you are permitted to create alternative clients for your game. * * If you did not obtain this code from MCCodes.com, you are in all likelihood * using it illegally. Please contact MCCodes to discuss licensing options * in this case. * * File: cron_minute.php * */ require_once('globals_nonauth.php'); //if ($argc == 2) //{ // if ($argv[1] != $_CONFIG['code']) // { // exit; // } //} //else if (!isset($_GET['code']) || $_GET['code'] !== $_CONFIG['code']) //{ // exit; //} if(!isset($_GET['code']) || $_GET['code'] !== $_CONFIG['code']) { exit; } $db->query( "UPDATE `users` SET `hospital` = GREATEST(`hospital` - 1, 0), `jail` = GREATEST(`jail` - 1, 0)"); $counts = $db->fetch_row( $db->query( "SELECT SUM(IF(`hospital` > 0, 1, 0)) AS `hc`, SUM(IF(`jail` > 0, 1, 0)) AS `jc` FROM `users`")); $db->query( "UPDATE `settings` SET `conf_value` = '{$counts['hc']}' WHERE `conf_name` = 'hospital_count'"); $db->query( "UPDATE `settings` SET `conf_value` = '{$counts['jc']}' WHERE `conf_name` = 'jail_count'"); $expired = $db->query("SELECT `userid`,`expire` FROM `users` WHERE `expire`=1"); while($ex=$db->fetch_row($expired)) { $findout = $db->query("SELECT `strength`,`agility`,`guard` FROM `oldstats` WHERE `userid`=".$ex['userid'].""); $update = $db->fetch_row($findout); $db->query("UPDATE `userstats` SET `agility`=".$update['agility'].",`strength`=".$update['strength'].",`guard`=".$update['guard']." WHERE `userid`=".$ex['userid'].""); } $db->query("DELETE FROM `oldstats` WHERE `userid`=".$ex['userid'].""); $db->query("UPDATE `users` SET `expire`=0 WHERE `userid`=".$ex['userid'].""); $db->query("UPDATE `rehab` SET `rTIME`=`rTIME`-1 WHERE `rTIME`>0"); # check if there is anyone traveling $tcheck = $db->query("SELECT `time`,`userid`,`location`,`ttype` FROM `traveling` WHERE `time` >= 0"); if($db->num_rows($tcheck)) { while($t = $db->fetch_row($tcheck)) { if($t['time']) { $db->query("UPDATE `traveling` SET `time` = GREATEST(`time` - 1, 0)"); if(mt_rand(1,3) == 3) { $insured = $db->query("SELECT `insured`,`money` FROM `users` WHERE `userid` = {$t['userid']}"); $in = $db->fetch_row($insured); if($in['insured']) { $travelcost = $db->fetch_single($db->query("SELECT `travelcost` FROM `locations` WHERE `ttype` = {$t['ttype']} AND `cityid` = {$t['location']}")); if($t['ttype'] == 'Car') { switch(mt_rand(1,4)) { case 1: $msg = $db->escape("Your tire poped and your car spun out of control"); $time = mt_rand(1,5); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); $db->query("INSERT INTO `mail` VALUES (NULL, 0, 0, {$t['userid']}, ".time().", 'Insurance Team', 'As you are insured we have returned half of your travel cost which is ".money_formatter($money)."')"); $db->query("UPDATE `users` SET `new_mail` = `new_mail` + 1 WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); $db->query("DELETE FROM `traveling` WHERE `userid` = {$t['userid']}"); break; case 2: $msg = $db->escape("You fainted while driving"); $time = mt_rand(1,15); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); $db->query("INSERT INTO `mail` VALUES (NULL, 0, 0, {$t['userid']}, ".time().", 'Insurance Team', 'As you are insured we have returned half of your travel cost which is ".money_formatter($money)."')"); $db->query("UPDATE `users` SET `new_mail` = `new_mail` + 1 WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); $db->query("DELETE FROM `traveling` WHERE `userid` = {$t['userid']}"); break; case 3: $msg = $db->escape("A crazy driver ran you off the road"); $time = mt_rand(1,25); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); $db->query("INSERT INTO `mail` VALUES (NULL, 0, 0, {$t['userid']}, ".time().", 'Insurance Team', 'As you are insured we have returned half of your travel cost which is ".money_formatter($money)."')"); $db->query("UPDATE `users` SET `new_mail` = `new_mail` + 1 WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); $db->query("DELETE FROM `traveling` WHERE `userid` = {$t['userid']}"); break; case 4; $msg = $db->escape("Your car engine exploded"); $time = mt_rand(1,50); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); $db->query("INSERT INTO `mail` VALUES (NULL, 0, 0, {$t['userid']}, ".time().", 'Insurance Team', 'As you are insured we have returned half of your travel cost which is ".money_formatter($money)."')"); $db->query("UPDATE `users` SET `new_mail` = `new_mail` + 1 WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); $db->query("DELETE FROM `traveling` WHERE `userid` = {$t['userid']}"); break; } } else if($t['ttype'] == 'Boat') { switch(mt_rand(1,3)) { case 1: $msg = $db->escape("Your boat hit a rock and you bumped your head"); $time = mt_rand(1,5); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; case 2: $msg = $db->escape("The boats engine stopped working and you tried to fix it and lost your hand"); $time = mt_rand(1,15); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; case 3: $msg = $db->escape("The boats engine exploded"); $time = mt_rand(1,25); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; } } else if($t['ttype'] == 'Bus') { switch(mt_rand(1,3)) { case 1: $msg = $db->escape("The bus swearved another car and tumbled over you were hurt in acident"); $time = mt_rand(1,5); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; case 2: $msg = $db->escape("Gang of thugs pull a driveby on your bus"); $time = mt_rand(1,15); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; case 3: $msg = $db->escape("The buses engine exploded"); $time = mt_rand(1,25); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; } } else { switch(mt_rand(1,2)) { case 1: $msg = $db->escape("Pilot fell aleep at wheel lucky the co was there and stoped a big acidident"); $time = mt_rand(1,5); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; case 2: $msg = $db->escape("Planes Engines failed and crashed you were the only survior"); $time = mt_rand(1,45); $money = $travelcost / 100 * 50 / 2; $in['money'] += $money; $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}',`money` = {$in['money']} WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; } } } else { if($t['ttype'] == 'Car') { switch(mt_rand(1,4)) { case 1: $msg = $db->escape("Your tire poped and your car spun out of control"); $time = mt_rand(1,5); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}'WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); $db->query("DELETE FROM `traveling` WHERE `userid` = {$t['userid']}"); break; case 2: $msg = $db->escape("You fainted while driving"); $time = mt_rand(1,15); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); $db->query("DELETE FROM `traveling` WHERE `userid` = {$t['userid']}"); break; case 3: $msg = $db->escape("A crazy driver ran you off the road"); $time = mt_rand(1,25); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); $db->query("DELETE FROM `traveling` WHERE `userid` = {$t['userid']}"); break; case 4; $msg = $db->escape("Your car engine exploded"); $time = mt_rand(1,50); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); $db->query("DELETE FROM `traveling` WHERE `userid` = {$t['userid']}"); break; } } else if($t['ttype'] == 'Boat') { switch(mt_rand(1,3)) { case 1: $msg = $db->escape("Your boat hit a rock and you bumped your head"); $time = mt_rand(1,5); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; case 2: $msg = $db->escape("The boats engine stopped working and you tried to fix it and lost your hand"); $time = mt_rand(1,15); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; case 3: $msg = $db->escape("The boats engine exploded"); $time = mt_rand(1,25); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; } } else if($t['ttype'] == 'Bus') { switch(mt_rand(1,3)) { case 1: $msg = $db->escape("The bus swearved another car and tumbled over you were hurt in acident"); $time = mt_rand(1,5); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; case 2: $msg = $db->escape("Gang of thugs pull a driveby on your bus"); $time = mt_rand(1,15); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; case 3: $msg = $db->escape("The buses engine exploded"); $time = mt_rand(1,25); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; } } else { switch(mt_rand(1,2)) { case 1: $msg = $db->escape("Pilot fell aleep at wheel lucky the co was there and stoped a big acidident"); $time = mt_rand(1,5); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; case 2: $msg = $db->escape("Planes Engines failed and crashed you were the only survior"); $time = mt_rand(1,45); $db->query("UPDATE `users` SET `hospital` = {$time}, `hospreason` = '{$msg}' WHERE `userid` = {$t['userid']}"); event_add($t['userid'], "You had a acident while traveling.<br /> {$msg}."); break; } } } } } else { $db->query("UPDATE `users` SET `location` = {$t['location']},`traveling` = 0 WHERE `userid` = {$t['userid']}"); $db->query("DELETE FROM `traveling` WHERE `userid` = {$t['userid']} AND `time` = 0"); } } } Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted March 27, 2016 Share Posted March 27, 2016 Easy to fix, go to your config file and change mysql to mysqli. This error should not stop anything from working though since it is just a notice Quote Link to comment Share on other sites More sharing options...
boionfire81 Posted March 27, 2016 Author Share Posted March 27, 2016 I went through the files. Other than the cron_minute the arg isn't called anywhere. However, the beginning of the file has if & else if. Adding another if breaks anything after the original cron info. Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted March 27, 2016 Share Posted March 27, 2016 Well pick a problem you are having and stick with that for the time being. I gave you two solutions and both should work for your two problems. What is your current issue? Is it the $argc or the deprecation notice? Quote Link to comment Share on other sites More sharing options...
boionfire81 Posted March 27, 2016 Author Share Posted March 27, 2016 lol well with the args in nothing below the args were working despite the error actually only being a notice. That was because of the ifs. So the arg error wasnt actually the issue. Make sense? lol 1 file, 30 lines, hundreds of possible reasons lol. But it's fixed I think. Removed the args completely (might be a security risk though?) and everything is working. I just cant subscribe to get error reports for crons because of the mysqli notice I get an email every 60 seconds. >.< Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted March 27, 2016 Share Posted March 27, 2016 Well, you shouldn't even be using MySQL to begin with since its outdated and vulnerable to injections a lot more. If you open your config.php file you will see the $_CONFIG array: $_CONFIG = array( 'hostname' => 'localhost', 'username' => 'root', 'password' => 'root', 'database' => 'originalmcc', 'persistent' => 0, 'driver' => 'mysqli', // <- This is what you want to change to 'code' => 'mysupersecretcodeishere', ); Just change the driver from mysql to mysqli and you should be in business Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.