Jump to content
MakeWebGames

yuriorlov

Members
  • Posts

    28
  • Joined

  • Last visited

    Never
  • Days Won

    1

Everything posted by yuriorlov

  1. Re: google and your game ok the question remains how to get it to login... I use sessions (but that requires a cookie to hold the session id) so how if the bot cant accept cookies?
  2. Re: google and your game   it says in the google page not to count on the ip address...
  3. Re: google and your game   can someone explain to me how you get the bot to login to your demo account?
  4. Re: MDShare's mod recomendation from general discussion (item sales graphs)   got a link for it? cause I'll update the code I posted for a nicer looking graph (that was the only free graphing api i could find when I was doing my stockmarket ages ago.)
  5. Re: Monitor your server from PHP   I'll give you a few reasons: 1.) GUI 2.) Compatibility with some nifty backend things you dont / cant get with unix / linux 3.) Memory is cheap 2gb DDR2 sticks are like $20
  6. yuriorlov

    Mod Ideas

    Re: Mod Ideas   I never said anyone was good or bad. I just think its bad when people sit around here and toot their own horns, so to speak. Everyone has their own flaws, I don't think I could pinpoint anyone here that I think is better than anyone else. Just sick of certain game owners thinking they are above and beyond. At least I contribute actual mods to this site...toot your own horn... btw that mod was posted in free mods that night and it works...
  7. yuriorlov

    Mod Ideas

    Re: Mod Ideas     you aren't worth responding to
  8. FFS i just got logged out now I gotta retype this shit! Note: MD you killin me f00l -> The message exceeds the maximum allowed length (20000 characters). itmsalegraph.php <?php require_once("gdgraph.php"); include "myconnect.php"; global $c; $gdg = new GDGraph(500,300,'',255); $_GET['ID']=abs(intval($_GET['ID'])); $test=mysql_query("SELECT price FROM itmmarketsales WHERE itmID={$_GET['ID']} ORDER BY time ASC",$c); $i=0; While ($tester=mysql_fetch_array($test)) { $pr[$i] = $tester['price']; $i=$i+1; } $arr = Array( 'Price' => Array($pr[0],$pr[1],$pr[2],$pr[3],$pr[4],$pr[5],$pr[6],$pr[7],$pr[8],$pr[9],$pr[10],$pr[11],$pr[12],$pr[13],$pr[14]) ); $colors = Array( 'Price' => Array(50,50,50,50,50,50,50,50,50,50,50,50,50,50,50) ); $thicknesses = Array( 'Price' => 8 ); //Example 1 $gdg->line_graph($arr, $colors,'','','','',$thicknesses,0,0,200); ?>   gdgraph.php (not mine but open gl) had to be deleted so I could post get it here: http://makko.com.mx/gden.php in item info page add $test=mysql_query("SELECT price,time FROM itmmarketsales WHERE itmID={$_GET['ID']} ORDER BY time DESC",$c); print"<table width=75% align=center class=content><tr style='background: gray;color:#EDE275;'><th colspan=4>[b]Looking up recent sales of {$id['itmname']}[/b]</th></tr><tr style='background: gray;color:#EDE275;'> <th>Last 15 Sale Prices</th><th>Sales Graph</th></tr>"; if (mysql_num_rows($test) < 1) {print "<tr style='background: gray;color:#EDE275;'><th colspan=2>No Recent Sales</th></tr></table>";} else {print"<tr><td valign=top><table align=center class=content width=100% valign=top><tr style='background: gray;color:#EDE275;'><th>Date</th><th>Price</th></tr>"; while ($testee=mysql_fetch_array($test)) { $date=date('F j, Y g:i a',$testee['time']); $price=money_formatter($testee['price']); print"<tr><td>$date</td><td>$price</td></tr>"; } print "</table></td><td align=center valign=top>[img=itmsalegraph.php?ID={$_GET[]</td></tr></table>";}   in item market after the money is taken from the user add mysql_query("INSERT INTO itmmarketsales VALUES ({$r['imITEM']},{$r['imPRICE']},unix_timestamp())",$c); $che=mysql_query("SELECT itmID from itmmarketsales WHERE itmID = {$r['imITEM']}",$c); If (mysql_num_rows($che) > 15) { mysql_query("Delete FROM itmmarketsales ORDER BY time ASC LIMIT 1"); }   SQL for it CREATE TABLE IF NOT EXISTS `itmmarketsales` ( `itmID` int(11) NOT NULL, `price` int(11) NOT NULL, `time` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1;   tested and working for mccode lite bastardized edition (aka my game :p). If anyone asks how to convert it for v2 they are not allowed to have it xD you can see it working on my game http://www.lostcity.cc demo / demo1 <-- for the demo account
  9. yuriorlov

    Mod Ideas

    Re: Mod Ideas Md if I get a chance I will take a whack at your mod request. Nyna will probably complain as always that i suck at life and Someone else will steal it and change 3 words and call it their own...but still for the love this board I might
  10. Re: [mccode] Advanced IP Tracking   long2ip() brings it back to a normal format so not an issue, just more efficient to store a number than a string in mysql or any DB for that matter CIDR can still be faked (cause you just pick up the location of the proxy) also it just shows a range of IPs as far as I know and therefore just as effective As far as I know there is only one way to truly check using javascript Remote_ADDR is the most secure of the ip functions built in (as far as I know) X_Forwarded_For can be changed by the user. As to the commas I haven't had a problem doing it this way If you know something why do you always have to be cryptic nyna?
  11. Re: [mccode] Advanced IP Tracking   actually its a string...not until you convert it using ip2long does it actually become a number.
  12. Yes I know IPs can get messed with and you cannot tell for sure that people aren't using proxies and that dynamic ips aren't reissued to another one of your players...but here is one half of what I use to stop multies:   // this is what you would normally see on mccode except for the cleaning of it for an injection point $ip = $_SERVER['REMOTE_ADDR']; $ip = mysql_real_escape_string($ip); mysql_query("UPDATE users SET laston=unix_timestamp(),lastip='$ip' WHERE userid=$userid",$c); //this is the added code $numip = 10; //modify variable here, this is the number of ips to keep history on $ip =ip2long($ip); $ipcompare=mysql_query("SELECT ip FROM iplogs where ipUserid=$userid AND ip='$ip'"); if (mysql_num_rows($ipcompare) == 0) { mysql_query("INSERT INTO iplogs (ipUserid, ip) VALUES ($userid, '$ip')",$c); } $ipch=mysql_query("SELECT ip FROM iplogs WHERE ipUserid=$userid",$c); if (mysql_num_rows($ipch) > $numip) { mysql_query("DELETE FROM iplogs WHERE ipUserid=$userid ORDER BY ipid ASC LIMIT 1",$c); }   on any page where there is a user to user transaction: (I know there is a db way of doing this more efficient but this works)   $iten=mysql_query("SELECT * FROM iplogs WHERE ipUserid=$userid", $c); while ($df=mysql_fetch_array($iten)) { $j=mysql_query("SELECT ip FROM iplogs WHERE ipUserid={$_GET['user']}", $c); while ($jp=mysql_fetch_array($j)) { if ($df['ip'] == $jp['ip']) {$sameIP=1;} } } if($sameIP==1){ Print "You are using or have previously used the same IP address as the recipient of this item. Item transfers are prohibited to users of the same IP. "; exit; }   obviously change the message to reflect the page that you are securing. create a table called iplogs with 2 fields (if someone wants to make a query for it I will edit this section) ipUserid interger ip long   This will make your staff lazy but happy as all they now have to do is be watchful of middle man transactions and proxy multi transfers. Maybe if I feel generous I will release the second half of the automation i've written to stop both of those things.
  13. yuriorlov

    IE issue

    Re: IE issue i will try to get you a second set of pages with it enabled this weekend, im currently in the middle of painting a room in my house
  14. yuriorlov

    IE issue

    Re: IE issue does this mean i need to include the gzip module on my php install? (was more of the question I was asking)
  15. yuriorlov

    IE issue

    Re: IE issue 5.2.6 havent turned it off yet, can you break down how to substitute the obstart() function.
  16. Re: Get your site free traffic! nyna: why don't you fix the code and re-post it....
  17. Re: Get your site free traffic! Parse error: syntax error, unexpected '=' in Z:\stumble.php on line 35 uh I dont understand what / how that line is supposed to function THIS_WEBSITE = str_replace($st,'', THIS_WEBSITE); can someone explain? or if someone got this working please post it?
  18. Re: Upgrade Users Online good catch, I guess I selected from the wrong spot to start
  19. Re: Upgrade Users Online thanks If I don't get flamed I'll add more, I have used a bunch of stuff from this forum. (granted most of the stuff doesn't work out of the box 90% of the time) If you see a mod from me you can be sure its been tested thoroughly
  20. historical tracking for your users online page   add this code somewhere on your users online page:   $q=mysql_query("SELECT * FROM records WHERE recid=1",$c); $v=mysql_fetch_array($q); $q=mysql_query("SELECT username FROM users WHERE laston>unix_timestamp()-300*300 ORDER BY laston DESC",$c); $twsev=mysql_num_rows($q); $q=mysql_query("SELECT username FROM users WHERE laston>unix_timestamp()-60*60 ORDER BY laston DESC",$c); $lasthr=mysql_num_rows($q); $q=mysql_query("SELECT username,userid,laston FROM users WHERE laston>unix_timestamp()-15*60 ORDER BY laston DESC",$c); $fifteen=mysql_num_rows($q); if ($v['rec15']<$fifteen) {mysql_query("UPDATE records SET rec15=$fifteen WHERE recid=1",$c);} if ($v['rec24']<$twsev) {mysql_query("UPDATE records SET rec24=$twsev WHERE recid=1",$c);} if ($v['rec60']<$lasthr) {mysql_query("UPDATE records SET rec60=$lasthr WHERE recid=1",$c);} Print" Users on within the last 15 minutes: $fifteen [b]15 Minute All Time Record: {$v['rec15']}[/b] Users on within the last hour: $lasthr [b]1 Hour All Time Record: {$v['rec60']}[/b] Users on within the last 24 hours: $twsev [b]1 Day All Time Record: {$v['rec24']}[/b] ";   here is the sql for it   CREATE TABLE IF NOT EXISTS `records` ( `recID` int(11) NOT NULL, `rec24` int(11) NOT NULL, `rec60` int(11) NOT NULL, `rec15` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  21. A lot of people don't prune their db's properly from what I can tell, this is something I wrote for my game and I run it every night to keep things nice and tidy... Features: *Deletes events and mails older than 30 days *Deletes logs older than 30 days *Deletes forum posts older than 120 days (basically checks the last reply date) *Deletes users that haven't logged in for 120 days and all related records to these users Notes: *Make sure you know your table structures, mine are kinda screwy since I started with v1 beta and have built extensively on it with a lot of custom stuff. *I am not responsible for you modifying this code and not checking your DB structure first   <?php /* Clean up script from [url]www.lostcity.cc[/url] written by YuriOrlov Free for use by all */ include "mysql.php"; global $c; print"deleting events and mail...."; //delete events and mail older than 30 days mysql_query("DELETE FROM mail WHERE mail_time < (unix_timestamp() -2592000)",$c); mysql_query("DELETE FROM events WHERE evTIME < (unix_timestamp() -2592000)",$c); mysql_query("DELETE FROM gangevents WHERE gevTIME < (unix_timestamp() -2592000)",$c); print"done "; Print"deleting old logs...."; //delete logs older than 30 days mysql_query("DELETE FROM attacklogs WHERE time < (unix_timestamp() -2592000)",$c); mysql_query("DELETE FROM donatorlogs WHERE donationDATE < (unix_timestamp() -2592000)",$c); mysql_query("DELETE FROM forumlogs WHERE logtime < (unix_timestamp() -2592000)",$c); mysql_query("DELETE FROM imbuylogs WHERE imTimestamp < (unix_timestamp() -2592000)",$c); mysql_query("DELETE FROM itembuylogs WHERE ibTIME < (unix_timestamp() -2592000)",$c); mysql_query("DELETE FROM itemselllogs WHERE isTIME < (unix_timestamp() -2592000)",$c); mysql_query("DELETE FROM itemxferlogs WHERE ixTIME < (unix_timestamp() -2592000)",$c); mysql_query("DELETE FROM itembuylogs WHERE ibTIME < (unix_timestamp() -2592000)",$c); Print "done "; Print"deleting old forum posts..."; $r=mysql_query("SELECT * FROM forum_topics WHERE toplast < (unix_timestamp() - 7776000)",$c); while ($s=mysql_fetch_array($r)) { mysql_query("DELETE FROM forum_replies WHERE repTOP={$s['topID']}",$c); } mysql_query("DELETE FROM forum_topics WHERE toplast < (unix_timestamp() - 7776000)",$c); $r=mysql_query("SELECT * FROM forum_replies",$c); while ($s=mysql_fetch_array($r)) { $ch=mysql_query("SELECT * FROM old_forum_topics WHERE topID={$s['repTOP']}",$c); if (mysql_num_rows($ch)==0) { mysql_query("DELETE FROM forum_replies WHERE repTOP={$s['repTOP']}",$c); } } Print "done "; //select users that havent logged on in 120 days as well as the corresponding date //info like stats, inventory, and market items well everything related to the user $r=mysql_query("SELECT * FROM users WHERE laston < (unix_timestamp() - 7776000) AND user_level>0",$c); while ($s=mysql_fetch_array($r)) { Print"deleting {$s['username']}..."; mysql_query("DELETE FROM userstats WHERE userid={$s['userid']}",$c); mysql_query("DELETE FROM petinv WHERE pivOWNER={$s['userid']}",$c); mysql_query("DELETE FROM itemmarket WHERE imADDER={$s['userid']}",$c); mysql_query("DELETE FROM crimerecord WHERE crUSERID={$s['userid']}",$c); mysql_query("DELETE FROM cars_playercars WHERE cpcPLAYER={$s['userid']}",$c); mysql_query("DELETE FROM carmarket WHERE cmADDER={$s['userid']}",$c); mysql_query("DELETE FROM coursesdone WHERE userid={$s['userid']}",$c); mysql_query("DELETE FROM crystalmarket WHERE cmADDER={$s['userid']}",$c); mysql_query("DELETE FROM deadpets WHERE pivOWNER={$s['userid']}",$c); mysql_query("DELETE FROM friendslist WHERE fl_ADDER={$s['userid']}",$c); mysql_query("DELETE FROM inventory WHERE inv_userid={$s['userid']}",$c); mysql_query("DELETE FROM mine WHERE mineID={$s['userid']}",$c); mysql_query("DELETE FROM persnotes WHERE notesID={$s['userid']}",$c); mysql_query("DELETE FROM questscompleted WHERE questUID={$s['userid']}",$c); mysql_query("DELETE FROM referals WHERE refREFER={$s['userid']}",$c); mysql_query("DELETE FROM shortcuts WHERE shortUID={$s['userid']}",$c); mysql_query("DELETE FROM users WHERE userid={$s['userid']}",$c); Print"done "; } ?>
×
×
  • Create New...