I have this ladder script that I purchased and the Creator will not support or help me with a major bug in it.
What is happening is a team CHALLENGES another team to a battle on the Ladder. Then the Other Team RESPONDS to the challenge. Now if the ORIGINAL Team who made the challenge DOES NOT Finalize the match withing 48 hrs then the script executes a FORFEIT..but the problem is the script is creating the FORFEIT to the team that was challenged even tho they responded to the original challenge..it should give the fofeit to the Orginal Team because they didnt FINALIZE the match. I have found the section of code in the script that creates the forfeits..any help would be appreciated.
The Script is Running here:
http://www.squadgames.com/ladder_network
here is a URL with screenshots of what is happening
http://www.squadgames.com/legacy/ladderscript2_bug.php
I think it needs more code added to work properly..but i dont know about this stuff
I really could use some help with this..It Gives a forfeit to the wrong team and after paying $400.00 for this script the creator wont help me and the script is Useless.
also if you need more files e-mail me at admin@squadgames.com I'll provide anything you might need
//NEXT 2 FUNCTIONS DELETES AND AWARDS WINS FOR UNRESPONDED OR UNFINALIZED CHALLENGES
function check_unrespondedchallenges(){
$challengeladders=mysql_query("SELECT id,respondhours,finalizehours FROM ladders WHERE challenge='1'");
while(list($id,$respondhours,$finalizehours)=mysql_fetch_row($challengeladders)){
$laterespond=date("Y-m-d H:i:s",time()-60*60*$respondhours);
$latefinalize=date("Y-m-d H:i:s",time()-60*60*$finalizehours);
$challengeinfo=mysql_query("SELECT challid,challenger,challenged,ladderid,challengerrank,challengedrank,respondedby,finalizedby FROM challenges WHERE
ladderid='$id' AND respondedby='0' AND finalizedby='0' AND challengedtime < '$laterespond' OR
ladderid='$id' AND respondedby > '0' AND finalizedby='0' AND respondedtime < '$latefinalize'");
while(list($challid,$challenger,$challenged,$ladderid,$challengerrank,$challengedrank,$respondedby,$finalizedby)=mysql_fetch_row($challengeinfo)){
//DIDNT RESPOND IN TIME or DIDNT FINALIZE IN TIME
if(($respondedby=="0") && ($finalizedby=="0") || ($respondedby > 0) && ($finalizedby=="0")){
create_forfeit($challid,$id,$challenger,$challenged,$challengerrank,$challengedrank);
}
}
}
}
function create_forfeit($challid,$ladderid,$winnerid,$loserid,$winrank,$loserank){
global $dir, $file, $url, $out, $plyr;
$loserteaminfo=mysql_query("SELECT teamname FROM teams WHERE id='$loserid'");
$lteam=mysql_fetch_array($loserteaminfo);
$winnerteaminfo=mysql_query("SELECT teamname FROM teams WHERE id='$winnerid'");
$wteam=mysql_fetch_array($winnerteaminfo);
$ladderinfo=mysql_query("SELECT laddername FROM ladders WHERE id='$ladderid'");
$linfo=mysql_fetch_array($ladderinfo);
$ip=getenv("REMOTE_ADDR");
$tday=date("Y-m-d H:i:s");
if(!$wteam[teamname]){
$wteam[teamname]="[DELETED]";
}
if(!$lteam[teamname]){
$lteam[teamname]="[DELETED]";
}
/*
//REPORT MATCH TO MATCH DATABASE
mysql_query("INSERT INTO matchdb VALUES (
'$challid',
'$winnerid',
'$loserid',
'$wteam[teamname]',
'$lteam[teamname]',
'$ladderid',
'$linfo[laddername]',
'$winrank',
'$loserank',
'0',
'0',
'',
'',
'',
'',
'Win by forfeit.',
'Loss by forfeit.',
'0',
'0',
'$plry[id]',
'$tday',
'0.0.0.0',
'$plry[id]',
'$tday',
'$ip');");
*/