00king00 Posted April 18, 2007 Share Posted April 18, 2007 Hi all I think something wrong with this script file (vsys.php) I attached the file to your review if anyone got hint or tip plz let me know thanx [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/47620-can-you-help-me-with-this-code/ Share on other sites More sharing options...
flappy_warbucks Posted April 18, 2007 Share Posted April 18, 2007 there are over 2000 lines of code in that file. what exactly is the problem, whats PHP reporting? Whats it doing that its not supposed to be doing. when you have found that out, then nail it down to a function/class and then post that only... Debugging is 1/3 of the programmers job Link to comment https://forums.phpfreaks.com/topic/47620-can-you-help-me-with-this-code/#findComment-232512 Share on other sites More sharing options...
00king00 Posted April 18, 2007 Author Share Posted April 18, 2007 well thanx for your reply mate The Sentry Skill upgrade won't work if the player press (upgrade Sentry Skill ) Sorry I didn't mentioned that! Link to comment https://forums.phpfreaks.com/topic/47620-can-you-help-me-with-this-code/#findComment-232529 Share on other sites More sharing options...
HaLo2FrEeEk Posted April 18, 2007 Share Posted April 18, 2007 I think what he means is find what line in the code you are getting the error from, and we will look at it, its not our job to search through 2000 lines of code for something. Link to comment https://forums.phpfreaks.com/topic/47620-can-you-help-me-with-this-code/#findComment-232556 Share on other sites More sharing options...
00king00 Posted April 18, 2007 Author Share Posted April 18, 2007 yeah i know what he mean mate..but the problem is .. the code is fine as a coding line..but in game fuction dosen't work !! Its only the Sentry Skill won't work, all the functions are working fine! Thanx for your help! Link to comment https://forums.phpfreaks.com/topic/47620-can-you-help-me-with-this-code/#findComment-232562 Share on other sites More sharing options...
00king00 Posted April 19, 2007 Author Share Posted April 19, 2007 no one can help? Link to comment https://forums.phpfreaks.com/topic/47620-can-you-help-me-with-this-code/#findComment-233310 Share on other sites More sharing options...
bsprogs Posted April 19, 2007 Share Posted April 19, 2007 On the page where the user actually clicks to use the Sentry Skill, what function does it call on? Everything I see points to currentSentrySkill Example: $pris=pow(2,$user->currentSentrySkill)*12000; Throughout all the code, that is nowhere to be found. It's probably in the lib.php file which contains the class(s). The problem may be within the lib.php file. Link to comment https://forums.phpfreaks.com/topic/47620-can-you-help-me-with-this-code/#findComment-233339 Share on other sites More sharing options...
00king00 Posted April 19, 2007 Author Share Posted April 19, 2007 Great hint mate! But the lib file got this info: //---------- Game options $conf["gold_from_soldier"]=25; $conf["minutes_per_turn"]=10; $conf["days_of_inactivity_before_delete_this_user"]=35; $conf["users_per_page"]=25; $conf["mercenaries_per_turn"]=5; $conf["days_to_hold_logs"]=10; //For Battle Logs $conf["hours_to_block_same_user_recruiting"]=24; $conf["ips_to_hold_per_user"]=20; But the Sentry Skill got the function from another file called ( train.php) here the code: <TABLE class=table_lines cellSpacing=0 cellPadding=2 width="100%" border=0> <TBODY> <TR> <TH align=middle colSpan=2>Upgrade Spy Skill:</TH></TR> <TR> <TH class=subh align=left>Current Spy Skill:</TH> <TH class=subh>Upgrade:</TH></TR> <TR> <TD>Level <? echo $user->currentSpySkill?></TD> <? $pris=pow(2,$user->currentSpySkill)*12000;?> <TD align=middle><INPUT type=submit size=5 value="<? numecho($pris)?> Gold" name=spyupgrade> <INPUT type=hidden value=yes name=upgrade_spy></TD></TR></TBODY></TABLE><INPUT type=hidden value=93aa2b6a02603399396203313b45827e name=hash> </FORM></TD> <TR> <TD style="PADDING-RIGHT: 25px" vAlign=top> <FORM action=train.php method=post> <TABLE class=table_lines cellSpacing=0 cellPadding=2 width="100%" border=0> <TBODY> <TR> <TH align=middle colSpan=2>Upgrade Sentry Skill:</TH></TR> <TR> <TH class=subh align=left>Current Sentry Skill:</TH> <TH class=subh>Upgrade:</TH></TR> <TR> <TD>Level <? echo $user->currentSentrySkill?></TD> <? $pris=pow(2,$user->currentSentrySkill)*12000;?> <TD align=middle><INPUT type=submit size=5 value="<? numecho($pris)?> Gold" name=sentryupgrade> <INPUT type=hidden value=yes name=upgrade_sentry></TD></TR></TBODY></TABLE><INPUT type=hidden value=93aa2b6a02603399396203313b45827e name=hash> </FORM></TD> <TD> <FORM action=train.php method=post> Link to comment https://forums.phpfreaks.com/topic/47620-can-you-help-me-with-this-code/#findComment-233365 Share on other sites More sharing options...
bsprogs Posted April 19, 2007 Share Posted April 19, 2007 You're going to have to find the "currentSentrySkill" method which is located in a class. Is there a class.php file or anything? Link to comment https://forums.phpfreaks.com/topic/47620-can-you-help-me-with-this-code/#findComment-233369 Share on other sites More sharing options...
00king00 Posted April 19, 2007 Author Share Posted April 19, 2007 You're going to have to find the "currentSentrySkill" method which is located in a class. Is there a class.php file or anything? No mate, there is no class.php file with the folder! But that function can be done with (train.php) I think and the lib file got no more opitions! Link to comment https://forums.phpfreaks.com/topic/47620-can-you-help-me-with-this-code/#findComment-233386 Share on other sites More sharing options...
00king00 Posted April 19, 2007 Author Share Posted April 19, 2007 I searched for the (currentSentrySkill) for all script folders and I got this (currentSentrySkill) located only on 1- vsys.php 2- train.php So maybe the vsys.php is the class.php file? Link to comment https://forums.phpfreaks.com/topic/47620-can-you-help-me-with-this-code/#findComment-233390 Share on other sites More sharing options...
bsprogs Posted April 19, 2007 Share Posted April 19, 2007 The only reason I mentioned a class.php file is because thats what I've seen people use most of the time. Keep in mind I haven't seen a whole lot. class.php was just a thought. If you look at the train.php you see it uses an object called $user and calls on the method named "currentSentrySkill" It looks as if the train.php file is included in a larger file (such as index.php, game.php, or whatever the main file is called). Inside that file, the $user object will be defined. Look for $user = new USER (USER will be the name of the class you need to find). Inside that class, you will find the line that looks something like "public function currentSentrySkill(.....) {". Once you find that piece of code, post the function. Link to comment https://forums.phpfreaks.com/topic/47620-can-you-help-me-with-this-code/#findComment-233395 Share on other sites More sharing options...
00king00 Posted April 19, 2007 Author Share Posted April 19, 2007 I will attched the train.php here coz the vsys.php attched above Thanx [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/47620-can-you-help-me-with-this-code/#findComment-233397 Share on other sites More sharing options...
00king00 Posted April 19, 2007 Author Share Posted April 19, 2007 The only reason I mentioned a class.php file is because thats what I've seen people use most of the time. Keep in mind I haven't seen a whole lot. class.php was just a thought. If you look at the train.php you see it uses an object called $user and calls on the method named "currentSentrySkill" It looks as if the train.php file is included in a larger file (such as index.php, game.php, or whatever the main file is called). Inside that file, the $user object will be defined. Look for $user = new USER (USER will be the name of the class you need to find). Inside that class, you will find the line that looks something like "public function currentSentrySkill(.....) {". Once you find that piece of code, post the function. Hi mate I searched for all file plus the index.php all the files got this code on the first lines: <? include "vsys.php"; ?> is this mean anything? Link to comment https://forums.phpfreaks.com/topic/47620-can-you-help-me-with-this-code/#findComment-233402 Share on other sites More sharing options...
00king00 Posted April 19, 2007 Author Share Posted April 19, 2007 I think I found it mate..the main Its in (train.php) I already attached it Here the first lines codes in the file: <? include "vsys.php"; $user=getUserDetails($_SESSION['isLogined'],"*"); if($cgi[train]){ $wal=round($wal); if($cgi[atsold]){ $wal=$cgi[atsold];$typ=0; $detail.=Train($user,$wal,$typ); $buylog=BuyLog(AT,$wal,$cgi[atsold],$user,1,$HTTP_SERVER_VARS['REMOTE_ADDR']); $user=getUserDetails($_SESSION['isLogined'],"*"); } if($cgi[defsold]){ $wal=$cgi[defsold];$typ=1; $detail.=Train($user,$wal,$typ); $buylog=BuyLog(DE,$wal,$cgi[atsold],$user,0,$HTTP_SERVER_VARS['REMOTE_ADDR']); $user=getUserDetails($_SESSION['isLogined'],"*"); } if($cgi[spy]){ $wal=$cgi[spy];$typ=2; $detail.=Train($user,$wal,$typ); $buylog=BuyLog(SP,$wal,$cgi[atsold],$user,1,$HTTP_SERVER_VARS['REMOTE_ADDR']); $user=getUserDetails($_SESSION['isLogined'],"*"); } if($cgi[sentry]){ $wal=$cgi[sentry];$typ=5; $detail.=Train($user,$wal,$typ); $buylog=BuyLog(SE,$wal,$cgi[atsold],$user,0,$HTTP_SERVER_VARS['REMOTE_ADDR']); $user=getUserDetails($_SESSION['isLogined'],"*"); } if($cgi[reat]){ $wal=$cgi[reat];$typ=3; $detail.=Train($user,$wal,$typ); } if($cgi[redef]){ $wal=$cgi[redef];$typ=4; $detail.=Train($user,$wal,$typ); } //echo "--$typ--"; header("Location: train.php?strErr=$detail"); } if($cgi[spyupgrade]){$detail=Trainupgrade($user,'spy');header("Location: train.php?strErr=$detail");} if($cgi[sentryupgrade]){$detail=Trainupgrade($user,'spy');header("Location: train.php?strErr=$detail");} if($cgi[unitupgrade]){$detail=Trainupgrade($user,'unit');header("Location: train.php?strErr=$detail");} if($cgi[unitupgradeall]){$detail=TrainupgradeAll($user,'unitall');header("Location: train.php?strErr=$detail");} if($cgi[unitupgradeallwithout]){$detail=TrainupgradeAllWithout($user,'unitall');header("Location: train.php?strErr=$detail");} ?> Thanx :-) Link to comment https://forums.phpfreaks.com/topic/47620-can-you-help-me-with-this-code/#findComment-233414 Share on other sites More sharing options...
bsprogs Posted April 19, 2007 Share Posted April 19, 2007 Hmm, I'm not quite sure anymore :-/ I'm still newer to php and the way it's coded seems very strange to me. My lack of experience is showing, lol. I've got homework to get done so hopefully one of the moderators and/or experienced programmers will jump in and help out! Link to comment https://forums.phpfreaks.com/topic/47620-can-you-help-me-with-this-code/#findComment-233438 Share on other sites More sharing options...
00king00 Posted April 19, 2007 Author Share Posted April 19, 2007 LOOL Thanx mate for your help and i am still waiting :-) Link to comment https://forums.phpfreaks.com/topic/47620-can-you-help-me-with-this-code/#findComment-233441 Share on other sites More sharing options...
00king00 Posted April 20, 2007 Author Share Posted April 20, 2007 up for your help! Link to comment https://forums.phpfreaks.com/topic/47620-can-you-help-me-with-this-code/#findComment-234070 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.