Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[OdinMS] [php] fix character (disappeared items and skills) | *NEW: v2*

Status
Not open for further replies.
Elite Diviner
Joined
Jul 13, 2008
Messages
419
Reaction score
217
v2
Ok, this is very better than v1!
What this do? It runs every 5 seconds a mysql query which deletes the bugged pet equips (1812000 - 1812007 (meso magnet & co.)). That means everytime when a person with this bug relogs it, I'm sure that this takes more than 5 seconds, it already deleted it and the character is unbugged. If you don't like to keep this opened all the time, then use the noobish v1...

Code:
<?php
$ml_host = "localhost"; //host
$ml_user = "root"; //user
$ml_password = ""; //password
$ml_database = "odinms"; //database

mysql_connect("$ml_host","$ml_user","$ml_password"); //connect
mysql_select_db("$ml_database"); //select database

$fix_character = "DELETE FROM inventoryitems WHERE itemid >= '1812000' AND itemid <= '1812007'";
mysql_query("$fix_character") or DIE(mysql_error());

echo"
<meta http-equiv='refresh' content='5;url=$PHP_SELF'>
"
?>
Put this code into a php file, put it in your "www" folder, open it via localhost and keep it opened, don't close it!



v1
This is a php script for odinms which fixes the disappeared items and skills of a character after the player bought fucked up pet equips. I made this because MikeyPwnz' fix for this bug needs the administrator to run a mysql query, this would take too much time. This allows the user to fix it on his own. What this does is very easy, it deletes all the user's pet equips. The user has to be logged off if he/she/it wants to use it.
I hope this helps, have fun with it!
(This is not tested but it should work, if you find any bugs tell me please!)


fix_character.php
Code:
Here you can fix your character after you bought fucked up pet equips.
<br>
(This will delete all your pet equips!)
<br>
(You have to be logged out if you want to do this or it won't work!)
<br>
<br>
<form method="post" action="fix_character_2.php">
<table>
<tr>
<td>
<b>login id:</b> 
</td>
<td>
<input type="text" name="login_id">
</td>
</tr>
<tr>
<td>
<b>password:</b> 
</td>
<td>
<input type="password" name="password" maxlength="12">
</td>
</tr>
<tr>
<td>
<b>character:</b> 
</td>
<td>
<input type="text" name="character" maxlength="12">
</td>
</tr>
<tr>
<td>
</td>
<td>
<input type="submit" value="Fix Character">
</td>
</tr>
</table>
</form>

fix_character_2.php
Code:
<?php
$ml_host = "localhost"; //host
$ml_user = "root"; //user
$ml_password = ""; //password
$ml_database = "odinms"; //database

mysql_connect("$ml_host","$ml_user","$ml_password"); //connect
mysql_select_db("$ml_database"); //select database


$login_id = $_POST["login_id"];
$password = $_POST["password"];
$character = $_POST["character"];

$resultsalt = mysql_query("SELECT salt FROM accounts WHERE name = '$login_id'");

if ($row = mysql_fetch_array($resultsalt)) {
	do {
		$salt = $row["salt"];
	}
	while ($row = mysql_fetch_array($resultsalt));
}

if ($salt == "") {
	$password_sha = hash("sha1",$password);
} else {
	$password_sha = hash("sha512",$password . $salt);
}

$check_login_id = mysql_query("SELECT * FROM accounts WHERE name = '$login_id'");
$check_login_id_2 = mysql_num_rows($check_login_id);

$check_password = mysql_query("SELECT * FROM accounts WHERE name = '$login_id' AND password = '$password_sha'");
$check_password_2 = mysql_num_rows($check_password);

$check_character = mysql_query("SELECT * FROM characters WHERE name = '$character'");
$check_character_2 = mysql_num_rows($check_character);

if ($login_id == "") {
	echo "
	Please enter your login ID.
	<br>
	<a href='javascript:history.back()'>Back</a>
	";
} elseif ($password == "") {
	echo "
	Please enter your password.
	<br>
	<a href='javascript:history.back()'>Back</a>
	";
} elseif ($character == "") {
	echo "
	Please enter your character.
	<br>
	<a href='javascript:history.back()'>Back</a>
	";
} elseif ($check_login_id_2 < 1) {
	echo "
	This login ID does not exist.
	<br>
	<a href='javascript:history.back()'>Back</a>
	";
} else {
	if ($check_password_2 < 1) {
		echo "
		The password is not correct.
		<br>
		<a href='javascript:history.back()'>Back</a>
		";
	} else {
		if ($check_character_2 < 1) {
			echo "
			This character does not exist.
			<br>
			<a href='javascript:history.back()'>Back</a>
			";
		}
		else {
			while ($account = mysql_fetch_assoc($check_login_id)) {
				while ($character_2 = mysql_fetch_assoc($check_character)) {
					if ($account["id"] == $character_2["accountid"]) {
						$fix_character = "DELETE FROM inventoryitems WHERE itemid >= '1812000' AND itemid <= '1812007' AND characterid = $character_2[id]";
						mysql_query("$fix_character") or DIE(mysql_error());
						echo "
						Your character has been fixed.
						<br>
						<a href='javascript:history.back()'>Back</a>
						";
					} else {
						echo "
						This character is not yours.
						<br>
						<a href='javascript:history.back()'>Back</a>
						";				
					}
				}
			}
		}
	}
}
?>
 
Last edited:
Newbie Spellweaver
Joined
Apr 27, 2008
Messages
23
Reaction score
0
Re: [Release] [OdinMS] [php] fix character (disappeared items and skills)

Thnx need this XD First Post
 
Elite Diviner
Joined
Jul 13, 2008
Messages
419
Reaction score
217
Re: [Release] [OdinMS] [php] fix character (disappeared items and skills)

Sorry, there was a little bug... If it doesn't work try again, I updated the script of fix_character_2.php!
 
Experienced Elementalist
Joined
Jun 8, 2008
Messages
240
Reaction score
1
Re: [Release] [OdinMS] [php] fix character (disappeared items and skills)

FAIL...nice try tho
 
Banned
Banned
Joined
Apr 17, 2008
Messages
125
Reaction score
0
Re: [Release] [OdinMS] [php] fix character (disappeared items and skills)

what is it? info?
 
Newbie Spellweaver
Joined
Jun 9, 2008
Messages
15
Reaction score
0
Re: [Release] [OdinMS] [php] fix character (disappeared items and skills)

@iMikeez It's supposed to fix the disappearing items and skills glitch when you purchase certain pet items like magic scales.

It's really close but the second script needs to be edited more...
You can fix some errors by adding include('config.php'); under <?php in the second script...
 
Experienced Elementalist
Joined
Jul 10, 2008
Messages
299
Reaction score
3
Re: [Release] [OdinMS] [php] fix character (disappeared items and skills)

@iMikeez It's supposed to fix the disappearing items and skills glitch when you purchase certain pet items like magic scales.

It's really close but the second script needs to be edited more...
You can fix some errors by adding include('config.php'); under <?php in the second script...

I was going to say that. But htat wont fix all the errors since his query is all wrong..:
Code:
DELETE FROM 'inventoryitems' WHERE 'itemid' >= 1812000 AND 'itemid' <= 1812007 AND name = '$login_id

There is no such thing as name in inventoryitems... take that out and it should work. Why would you try to delete only that person's items anyways if everyone's should be deleted. Anyways just replace that with this oh yeah and make sure to remove the name = $login_id from the queries.

Code:
DELETE FROM 'inventoryitems' WHERE 'itemid' >= 1812000 AND 'itemid' <= 1812007
 
Elite Diviner
Joined
Jul 13, 2008
Messages
419
Reaction score
217
Re: [Release] [OdinMS] [php] fix character (disappeared items and skills)

FAIL...nice try tho

Forget something, will add...
Don't forget to include connection file!


@iMikeez It's supposed to fix the disappearing items and skills glitch when you purchase certain pet items like magic scales.

It's really close but the second script needs to be edited more...
You can fix some errors by adding include('config.php'); under <?php in the second script...

Yea, that's for sure... So I didn't add this, I will update because some people have not enough knowledge! <.<
 
Newbie Spellweaver
Joined
Jun 21, 2008
Messages
26
Reaction score
0
Re: [Release] [OdinMS] [php] fix character (disappeared items and skills)

Lol Nice !!
 
Elite Diviner
Joined
Jul 13, 2008
Messages
419
Reaction score
217
Re: [Release] [OdinMS] [php] fix character (disappeared items and skills)

I was going to say that. But htat wont fix all the errors since his query is all wrong..:
Code:
DELETE FROM 'inventoryitems' WHERE 'itemid' >= 1812000 AND 'itemid' <= 1812007 AND name = '$login_id

There is no such thing as name in inventoryitems... take that out and it should work. Why would you try to delete only that person's items anyways if everyone's should be deleted. Anyways just replace that with this oh yeah and make sure to remove the name = $login_id from the queries.

Code:
DELETE FROM 'inventoryitems' WHERE 'itemid' >= 1812000 AND 'itemid' <= 1812007

AND name = '$login_id' should be AND 'characterid' = $character_2[id]"
fixed, thanks for reporting that bug :p

Everyone who tried this, try again now! Should work now...
 
Junior Spellweaver
Joined
Jun 26, 2008
Messages
145
Reaction score
0
Re: [Release] [OdinMS] [php] fix character (disappeared items and skills)

"inventoryitems' WHERE 'itemid' >=1812000 AND 'itemid' <=1812007 AND 'characte' at line one
 
Experienced Elementalist
Joined
Jul 10, 2008
Messages
299
Reaction score
3
Re: [Release] [OdinMS] [php] fix character (disappeared items and skills)

AND name = '$login_id' should be AND 'characterid' = $character_2[id]"
fixed, thanks for reporting that bug :p

Everyone who tried this, try again now! Should work now...

If im not mistaken $character_2 checks for account id not character id.
 
Elite Diviner
Joined
Jul 13, 2008
Messages
419
Reaction score
217
Re: [Release] [OdinMS] [php] fix character (disappeared items and skills)

"inventoryitems' WHERE 'itemid' >=1812000 AND 'itemid' <=1812007 AND 'characte' at line one

Try this
Code:
						$fix_character = "DELETE FROM inventoryitems WHERE itemid >= '1812000' AND itemid <= '1812007' AND characterid = $character_2[id]";
						mysql_query("$fix_character") or DIE(mysql_error());
						$fix_character_2 = "DELETE FROM inventoryitems WHERE itemid >= '1802000' AND itemid <= '1802054' AND characterid = $character_2[id]";
						mysql_query("$fix_character_2") or DIE(mysql_error());
Here I removed the '...


If im not mistaken $character_2 checks for account id not character id.

No, that's correct... It checks the id from the character...



PS: Fixed last error reported by andrew667, this time I tested it and it works! 100% sure! :/
 
Junior Spellweaver
Joined
Jun 26, 2008
Messages
145
Reaction score
0
Re: [Release] [OdinMS] [php] fix character (disappeared items and skills)

k, thanks
 
Junior Spellweaver
Joined
Jun 26, 2008
Messages
145
Reaction score
0
Re: [Release] [OdinMS] [php] fix character (disappeared items and skills)

it works~
 
Junior Spellweaver
Joined
Jun 26, 2008
Messages
145
Reaction score
0
Re: [Release] [OdinMS] [php] fix character (disappeared items and skills)

Code:
<?php
$ml_host = "localhost"; //host
$ml_user = "root"; //user
$ml_password = "root"; //password
$ml_database = "odinms"; //database

mysql_connect("$ml_host","$ml_user","$ml_password"); //connect
mysql_select_db("$ml_database"); //select database


$login_id = $_POST["login_id"];
$password = $_POST["password"];
$character = $_POST["character"];

$resultsalt = mysql_query("SELECT salt FROM accounts WHERE name = '$login_id'");

if ($row = mysql_fetch_array($resultsalt)) {
	do {
		$salt = $row["salt"];
	}
	while ($row = mysql_fetch_array($resultsalt));
}

if ($salt == "") {
	$password_sha = hash("sha1",$password);
} else {
	$password_sha = hash("sha512",$password . $salt);
}

$check_login_id = mysql_query("SELECT * FROM accounts WHERE name = '$login_id'");
$check_login_id_2 = mysql_num_rows($check_login_id);

$check_password = mysql_query("SELECT * FROM accounts WHERE name = '$login_id' AND password = '$password_sha'");
$check_password_2 = mysql_num_rows($check_password);

$check_character = mysql_query("SELECT * FROM characters WHERE name = '$character'");
$check_character_2 = mysql_num_rows($check_character);

if ($login_id == "") {
	echo "
	Please enter your login ID.
	<br>
	<a href='javascript:history.back()'>Back</a>
	";
} elseif ($password == "") {
	echo "
	Please enter your password.
	<br>
	<a href='javascript:history.back()'>Back</a>
	";
} elseif ($character == "") {
	echo "
	Please enter your character.
	<br>
	<a href='javascript:history.back()'>Back</a>
	";
} elseif ($check_login_id_2 < 1) {
	echo "
	This login ID does not exist.
	<br>
	<a href='javascript:history.back()'>Back</a>
	";
} else {
	if ($check_password_2 < 1) {
		echo "
		The password is not correct.
		<br>
		<a href='javascript:history.back()'>Back</a>
		";
	} else {
		if ($check_character_2 < 1) {
			echo "
			This character does not exist.
			<br>
			<a href='javascript:history.back()'>Back</a>
			";
		}
		else {
			while ($account = mysql_fetch_assoc($check_login_id)) {
				while ($character_2 = mysql_fetch_assoc($check_character)) {
					if ($account["id"] == $character_2["accountid"]) {
						$fix_character = "DELETE FROM inventoryitems WHERE itemid >= '1812000' AND itemid <= '1812007' AND characterid = $character_2[id]";
						mysql_query("$fix_character") or DIE(mysql_error());
						$fix_character_2 = "DELETE FROM inventoryitems WHERE itemid >= '1802000' AND itemid <= '1802054' AND characterid = $character_2[id]";
						mysql_query("$fix_character_2") or DIE(mysql_error());
						echo "
						Your character has been fixed.
						<br>
						<a href='javascript:history.back()'>Back</a>
						";
					} else {
						echo "
						This character is not yours.
						<br>
						<a href='javascript:history.back()'>Back</a>
						";				
					}
				}
			}
		}
	}
}
?>
 
Elite Diviner
Joined
Jul 13, 2008
Messages
419
Reaction score
217
Re: [Release] [OdinMS] [php] fix character (disappeared items and skills)

Update
Added v2! :D

Removed items 1802000 - 1802054 because I'm sure that they are not bugged... Otherwise re-add them, to do this add this lines
Code:
$fix_character_2 = "DELETE FROM inventoryitems WHERE itemid >= '1802000' AND itemid <= '1802054";
mysql_query("$fix_character_2") or DIE(mysql_error());
below this lines
Code:
$fix_character = "DELETE FROM inventoryitems WHERE itemid >= '1812000' AND itemid <= '1812007'";
mysql_query("$fix_character") or DIE(mysql_error());
 
Newbie Spellweaver
Joined
Jun 9, 2008
Messages
15
Reaction score
0
Re: [Release] [OdinMS] [php] fix character (disappeared items and skills) | *NEW: v2*

nice release and good job fixing it =D
 
Newbie Spellweaver
Joined
Jun 17, 2008
Messages
46
Reaction score
0
Re: [Release] [OdinMS] [php] fix character (disappeared items and skills) | *NEW: v2*

Why dont you just disable them in Cash shop so ppl cant buy them?
 
Experienced Elementalist
Joined
Jul 8, 2008
Messages
246
Reaction score
0
Re: [Release] [OdinMS] [php] fix character (disappeared items and skills) | *NEW: v2*

Or you could just run this in your SQL...

DELETE FROM `inventoryitems` WHERE `itemid` >= 5000000 AND `itemid` <= 5000045
Makes sure server is off / bugged acc's are logged off
 
Status
Not open for further replies.
Back
Top