[IMPORTANT REQUEST] Avoid Duping

09/24/2010 19:03 Danco1990#16
Will look into it, thank you for your reply.

#EDIT
Thank you alot, this script verifies from what i've read out in the database manually, had to alter a few things, but this is great! However, could someone with known dupers, or having the dupetheory applied in their server verify if this corresponds with what the given values show? Since i got myself a few players in the list where im 99.9% sure that they didn't dupe. We all know that SQL is not perfect, and makes some mistakes on noting down values, like for example, when you have a busy area, with the same monsters, and multiple people kill the same type of monsters, if they get a kill and the same drop drop at EXACT the same time, and the SQL server payload is quite high, it could end up as in duplicating itemuid's. Had this before i upgraded my server, new server handles the payload better.

Either way, i love the way this script works, and the information shown leaves alot of questionmarks unturned. Also it relieves alot of work on the admins for reading up data in the DB manually.

Can i request though that you put a bit of credits for our server, since i see you used my little SQL script? Would be nice, every bit helps =).

Once again, thank you for your reply,
09/24/2010 20:29 cosong#17
im good programmer with c++ and c# but only create a program and procedure, im dream to get resource game.exe, for example one of the way to create second "OK" button in transaction mode and create notice to GM when online when other players sold or buy item in AH more than 100 mil or 1 bil and etc., its to many helped with scammers etc. but i don't know how to unassemble game.exe or debugging to got sources....

P.S. Thanks for script!
09/24/2010 20:52 Danco1990#18
Ok, tested script proper, its working like a charm. There is one thing i request though since im working on the EP5 skills and got no time. Could you add a column called UserIP ? If you can, then it would be complete.

There is one thing though i noticed, the list is dynamic, when people NPC or recreate items, it will be deleted from the list. What i added is a "count" of the duped times. What i want to add now is to save ALL items in a list, and not deleted, so basicly a second database that writes a log of all +1 counts. Here is my remodified script:

Quote:
<html>

<BODY BGCOLOR="black" text="white">

<?php

function sql_quote( $value )
{
if( get_magic_quotes_gpc() )
{
$value = stripslashes( $value );
}
//check if this function exists
if( function_exists( "mysql_real_escape_string" ) )
{
$value = mysql_real_escape_string( $value );
}
//for PHP version < 4.3.0 use addslashes
else
{
$value = addslashes( $value );
}
return $value;
}

$IP="127.0.0.1";
$user="Shaiya";
$pass="Shaiya123";

// Connect to the server
if (!$link = @mssql_connect("$IP","$user","$pass"))
{
print "Failed to connect to MSSQL server<br>";
};

// select PS_GameData
if (!@mssql_select_db("PS_GameData",$link))
{
print "Failed to select database<br>";
};

// select PS_gamedefs
if (!@mssql_select_db("PS_gamedefs",$link))
{
print "Failed to select database<br>";
};


echo "<center>";
print"
<table border=1 cellpadding=5 cellspacing=0>
<tr>
<tr>
<td WIDTH=150><font size=2 face=arial color=red><b>Character</b></td>
<td WIDTH=150><font size=2 face=arial color=red><b>Username</b></td>
<td WIDTH=100><font size=2 face=arial color=red><b>UserUID</b></td>
<td WIDTH=200><font size=2 face=arial color=red><b>Item name</b></td>
<td WIDTH=150><font size=2 face=arial color=red><b>Date</b></td>
<td WIDTH=150><font size=2 face=arial color=red><b>Duped</b></td>
</tr>
</tr>
</table>";

$result3 = mssql_query("SELECT ItemUID, COUNT(ItemUID) AS Dupenumber FROM PS_GameData.dbo.CharItems GROUP BY ItemUID HAVING ( COUNT(Itemuid) > 1 ) ", $link); //Dupe find SQL query by Danco1990
$row3 = mssql_fetch_array($result3);
while ($row3 = mssql_fetch_array($result3)){

$result = mssql_query("SELECT ItemUID, CharID, ItemID, Maketime FROM [PS_GameData].[dbo].[CharItems] WHERE ItemUID='$row3[0]'", $link);
$row = mssql_fetch_array($result);

$result2 = mssql_query("SELECT CharName, UserID, UserUID FROM [PS_GameData].[dbo].[Chars] WHERE CharID='$row[1]'", $link);
$row2 = mssql_fetch_array($result2);

$result4 = mssql_query("SELECT ItemName FROM [PS_gamedefs].[dbo].[Items] WHERE ItemID='$row[2]'", $link);
$row4 = mssql_fetch_array($result4);

print"
<table border=1 cellpadding=5 cellspacing=0>
<tr>
<tr>
<td WIDTH=150><font size=2 face=arial>".$row2[0]."</td>
<td WIDTH=150><font size=2 face=arial>".$row2[1]."</td>
<td WIDTH=100><font size=2 face=arial>".$row2[2]."</td>
<td WIDTH=200><font size=2 face=arial>".$row4[0]."</td>
<td WIDTH=150><font size=2 face=arial>".$row[3]."</td>
<td WIDTH=150><font size=2 face=arial>".$row3[1]."</td>
</tr>
</tr>
</table>";
}

echo "</center>";

@mssql_free_result($result);
@mssql_free_result($result2);
@mssql_free_result($result3);
@mssql_free_result($result4);

mssql_close($link);

?>
Please reply to see what we can do here. Loving the coorporation lately.
09/24/2010 21:25 lilprohacker#19
Danco, read the topic in the Group discussion. There's some more info in there for you. This is my post that i wrote in it.

Quote:
The problem is that it is possible to have two ItemUID in the table that aren't truly a dupe. The only time you should check for dupes in the CharItems table is when the server is shut down. Only then there shouldn't be any dupes.

What happens is that the Char Items are loaded into memory when a toon logs in. If that toon, aka toon1 sells or gives that item to another toon aka toon2 and then that toon2 logs off the char items table will be updated for toon2's item which will be the same as toon1's. Toon1's charItems wont update until he logs out, at which point the item he sold is then removed.
09/24/2010 21:38 Danco1990#20
Yup, figured that out JUST after i posted that. This is seriously annoying. I heard Possum fixed it on evo back in the days? You reckon a OS GM can help us? Or do they just install patches and that's it? Don't know if they have true knowledge, if they do, i MIGHT be able to contact one... Hate to do so though, since i hate him >.<. Anycase im talking too much again, thank you for your reply, imma gonna play with CE to see if i can read out usefull information, perhaps the OPcode for itemuid is the same on all fronts as identifier, if this is the case, that would be a fix.
09/25/2010 07:22 il.mane#21
here ya go, IP column added, i dont mind collaborations too, i personally thing dupers should just be busted and banned, no matter what pserver, so yes this deserve a solution.

PHP Code:
<html>

<BODY BGCOLOR="black" text="white">

<?php

//php code by il.Mane, Battle for Dwater
//Dupe find SQL query by Danco1990, Shaiya Nemesis

function sql_quote$value )
{
if( 
get_magic_quotes_gpc() )
{
$value stripslashes$value );
}
//check if this function exists
if( function_exists"mysql_real_escape_string" ) )
{
$value mysql_real_escape_string$value );
}
//for PHP version < 4.3.0 use addslashes
else
{
$value addslashes$value );
}
return 
$value;
}

$IP="127.0.0.1";
$user="Shaiya";
$pass="Shaiya123"

// Connect to the server
if (!$link = @mssql_connect("$IP","$user","$pass"))
{
print 
"Failed to connect to MSSQL server<br>";
};

// select PS_GameData
if (!@mssql_select_db("PS_GameData",$link))
{
print 
"Failed to select database<br>";
};

// select PS_gamedefs
if (!@mssql_select_db("PS_gamedefs",$link))
{
print 
"Failed to select database<br>";
};

// select PS_userdata
if (!@mssql_select_db("PS_userdata",$link))
{
print 
"Failed to select database<br>";
};


echo 
"<center>";
print
"
<table border=1 cellpadding=5 cellspacing=0>
<tr>
<tr>
<td WIDTH=150><font size=2 face=arial color=red><b>Character</b></td>
<td WIDTH=150><font size=2 face=arial color=red><b>Username</b></td>
<td WIDTH=100><font size=2 face=arial color=red><b>UserUID</b></td>
<td WIDTH=100><font size=2 face=arial color=red><b>UserIP</b></td>
<td WIDTH=200><font size=2 face=arial color=red><b>Item name</b></td>
<td WIDTH=150><font size=2 face=arial color=red><b>Date</b></td>
<td WIDTH=150><font size=2 face=arial color=red><b>Duped</b></td>
</tr>
</tr>
</table>"
;

$result3 mssql_query("SELECT ItemUID, COUNT(ItemUID) AS Dupenumber FROM PS_GameData.dbo.CharItems GROUP BY ItemUID HAVING ( COUNT(Itemuid) > 1 ) "$link); 
$row3 mssql_fetch_array($result3);
while (
$row3 mssql_fetch_array($result3)){

$result mssql_query("SELECT ItemUID, CharID, ItemID, Maketime FROM [PS_GameData].[dbo].[CharItems] WHERE ItemUID='$row3[0]'"$link);
$row mssql_fetch_array($result);

$result2 mssql_query("SELECT CharName, UserID, UserUID FROM [PS_GameData].[dbo].[Chars] WHERE CharID='$row[1]'"$link);
$row2 mssql_fetch_array($result2);

$result4 mssql_query("SELECT ItemName FROM [PS_gamedefs].[dbo].[Items] WHERE ItemID='$row[2]'"$link);
$row4 mssql_fetch_array($result4);

$result5 mssql_query("SELECT UserIp FROM [PS_userdata].[dbo].[Users_Master] WHERE UserUID='$row2[2]'"$link);
$row5 mssql_fetch_array($result5);

print
"
<table border=1 cellpadding=5 cellspacing=0>
<tr>
<tr>
<td WIDTH=150><font size=2 face=arial>"
.$row2[0]."</td>
<td WIDTH=150><font size=2 face=arial>"
.$row2[1]."</td>
<td WIDTH=100><font size=2 face=arial>"
.$row2[2]."</td>
<td WIDTH=100><font size=2 face=arial>"
.$row5[0]."</td>
<td WIDTH=200><font size=2 face=arial>"
.$row4[0]."</td>
<td WIDTH=150><font size=2 face=arial>"
.$row[3]."</td>
<td WIDTH=150><font size=2 face=arial>"
.$row3[1]."</td>
</tr>
</tr>
</table>"
;
}

echo 
"</center>";

@
mssql_free_result($result);
@
mssql_free_result($result2);
@
mssql_free_result($result3);
@
mssql_free_result($result4);
@
mssql_free_result($result5);

mssql_close($link);

?>
09/25/2010 15:07 Danco1990#22
Im sorry mane, but this doesn't work, it searches for duplicate itemUIDs whereas we have to search in another place since its temporary, and that table isnt, try duping on your server, and see if your name gets in the list.
09/26/2010 03:33 il.mane#23
dam... let me know if u find out where else we can look, ill help you out to make a script
09/26/2010 05:37 ·Tyler·#24
It works for finding duplicated armors and stuff like that, but as for Lapis or any useable items are duped since their ItemID disappears once used, it doesn't really help. But thanks for this, helps a little bit, and thanks for sharing what you found. :D

Tyler
09/26/2010 05:54 joeh1cks#25
LOL. Duping is so fun. i love making drama on pservers.
09/26/2010 11:33 SiggyMaker#26
joe; I don't mind dupers on pservers like eternity or on OS but on good pservers, ppl want a good gaming experience and I dupe on pservers with really sucky staff and palyers. Otherwise.... if u dupe on good servers.... ure on my black list xD
09/12/2011 23:55 RaydenRey#27
Yeah dupe blows the good servers. We trying to find a good way to avoid it as well. If we get any new we will give a update here. And ty everybody that shared
09/13/2011 00:47 -III-#28
Quote:
Originally Posted by RaydenRey View Post
Yeah dupe blows the good servers. We trying to find a good way to avoid it as well. If we get any new we will give a update here. And ty everybody that shared
holy friggin NecroPost Batman...
09/13/2011 01:06 Bаne#29
No much of a necro, post WAS on topic.
09/13/2011 04:13 -III-#30
That may be, however, the post had still gone unreplied to in nearly a year; And there are much more updated posts on the matter of avoiding duping with more adequate results as well. Nor did the necro reply offer anything fresh or new to the topic.

The post may have been on topic with what was posted a year ago, but it doesn't change that it has been nearly 365 days since this post was active.

Similarly to receiving an infraction for spam, just for having my own web address in my signature. Not even a link, just the address. However, it apparently was still considered spam.

Likewise, the post may have been on topic, but the post has still be inactive for a year, regardless of the point behind the content.