Return to Home Page    Login    Forum    Register    Search    FAQ

Board index » Risk Forums » Bugs and Game Problems




Post new topic Reply to topic  [ 3 posts ] 
 
Author Message
 Post subject: "Your Move" email broken link w/ netrisk 2.0
 Post Posted: Wed Jan 13, 2010 5:36 pm 
Offline

Joined: Wed Jan 13, 2010 5:24 pm
Posts: 2
Hi there,
I've searched the forums for a similar reported issue and found no post, so forgive a potential double-post here.

I've installed NetRisk 2.0 on one of my sites, and I'm in a game with a friend to test it.
I've received an email that it's my turn, and have the following text at the bottom of the email:
"You can visit the game here: Here."

When I click the "Here." link, it throws the following error:

"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1"

Is there a known bug/issue here with a known repair? Where is the code in NetRisk 2.0 which commands this email text? I'm thinking a compromise would be to modify the code slightly to simply hotlink to my install's index page (url).

Thanks in advance for any assistance! :wink:


Top 
 Profile E-mail  
 
 Post subject: Re: "Your Move" email broken link w/ netrisk 2.0
 Post Posted: Wed Jan 13, 2010 6:13 pm 
Offline

Joined: Tue Jan 09, 2007 5:01 pm
Posts: 1140
Honestly, I have looked at ANY of that code in probably a year.

I wish I had the time to help support it, but currently am just much to busy with work and home. I think some others may have picked up the project and made some code changes, and the code is open source, so of course you can modify it all yourself as well.

I'm sorry I can't give more help. I don't even have php installed at home right now to even begin troubleshooting for you.

Of course, you and anyone else you know is welcome to play here as well. We still used a highly modded 1.9.7 version that is pretty stable. And people are always looking for new players here, and its a mature group of players with no major bashing etc allowed.

_________________
Power Man Sports
Bored? Play Riskwars


Top 
 Profile  
 
 Post subject: Re: "Your Move" email broken link w/ netrisk 2.0
 Post Posted: Wed Jan 13, 2010 9:10 pm 
Offline

Joined: Wed Jan 13, 2010 5:24 pm
Posts: 2
Thanks, ptmuldoon

I seem to have located the code source for email blasts.
It's in functions/function_common.php lines 248-271:

Code:
         //Send Email to Next Player
         if($npmail == 1 ){  //0 is no updates, 1 is mail them
            //Query Users for Email address of next player
            $query4 = mysql_query("SELECT * FROM ". $_G['mysql_prefix'] ."users WHERE login = '{$nplayer}' ") or die(mysql_error());
            $query4_row = mysql_fetch_assoc($query4);
            $next_email = $query4_row['email'];    
      
            $EmailTo = $next_email;
            $EmailFrom = "WebMaster@{$_SERVER['SERVER_NAME']}";
            $FromName = "Webmaster";
            $EMailSubject = "NetRisk Game: {$gname}";
      
            $Glink = "<a href=\"{$_SERVER['SERVER_NAME']}". $_G['game_path'] ."login.php?id={$gid} \">Here</a>";
            $EmailMessage = "It is your turn in the NetRisk Game: {$gname}.<br />";
            $EmailMessage .= "You can visit the game here: {$Glink}.<br />";

            SendEmail($EmailTo,$EmailFrom,$FromName,$EMailSubject,$EmailMessage);
         }    
            
         //Update LastMove Time
         update_last_move($gid);
      }
   }
}



And lines 353-379:

Code:
         //Send Email to Dead Player
         if($pmail == 1 ){  //0 is no updates, 1 is mail them
            //Query Users for Email address of next player
            $query4 = mysql_query("SELECT * FROM ". $_G['mysql_prefix'] ."users WHERE login = '{$opposing_player}' ") or die(mysql_error());
            $query4_row = mysql_fetch_assoc($query4);
            $dead_email = $query4_row['email'];    
      
            $EmailTo = $dead_email;
            $EmailFrom = "WebMaster@{$_SERVER['SERVER_NAME']}";
            $FromName = "Webmaster";
            $EMailSubject = "NetRisk Game: {$gname} Player Defeated";
      
            $Glink = "<a href=\"{$_SERVER['SERVER_NAME']}". $_G['game_path'] ."index.php?p=create \">Create a New Game</a>";
            $EmailMessage = "Were sorry to inform you that your playder has died in the the NetRisk Game: {$gname}.<br />";
            $EmailMessage .= "Perhaps you would like to {$Glink}?<br />";

            SendEmail($EmailTo,$EmailFrom,$FromName,$EMailSubject,$EmailMessage);
         }
         
         //Check for Force Trade
         force_card_trade($game_id, $attack_name);
      } else {
         //Return player to attacking state
         $query_return = mysql_query("UPDATE ". $_G['mysql_prefix'] ."game_players SET pstate = 'attacking' WHERE gid = {$game_id} AND pid = {$attack_id} ") or die(mysql_error());
      }
      
}


I notice the url after clicking "Here" in the email looks like this:

http ://mysite.com//netrisk//login.php?id=

instead of:

http ://www.mysite.com/netrisk/login.php?id=

Note the lack of "www" and the double slashes where they don't belong surrounding the "//netrisk//" folder. (I purposely broke the links in the above examples by putting in the space considering this is a forum).

Thanks again! I hear you about being busy with family and work and such. It's been nuts, but just found a little window to mess around with your game source and get it running on my site. Any suggestion how to properly re-code this without frying sql - existing games and users - or the code? (I've tried and got errors, then fried mysql... now dropping all my tables and re-installing).
Appreciate it!!


Top 
 Profile E-mail  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 3 posts ] 

Board index » Risk Forums » Bugs and Game Problems


Who is online

Users browsing this forum: No registered users and 0 guests

 
 

 
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 post attachments in this forum

Search for:
Jump to:  
cron