Created
May 16, 2012 18:50
-
-
Save vertrigo/2712966 to your computer and use it in GitHub Desktop.
transfer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <meta http-equiv = "Content-Type" content = "charset=utf-8" /> | |
| <?php | |
| include_once("t_dbfunctions.php"); | |
| include_once("t_functions.php"); | |
| include_once("t_config.php"); | |
| if (isset($_POST['Account']) && !empty($_POST['Account']) && isset($_POST['Password']) && !empty($_POST['Password']) | |
| && isset($_POST['ServerUrl']) && !empty($_POST['ServerUrl']) && isset($_POST['RealmlistList']) && !empty($_POST['RealmlistList'])) { | |
| $o_Account = trim($_POST['Account']); | |
| $o_Password = trim($_POST['Password']); | |
| $o_URL = CLEAN($_POST['ServerUrl']); | |
| move_uploaded_file($_FILES['file']['tmp_name'], "./storage/". $_FILES['file']['name']); | |
| $file = "./storage/chardump.lua"; | |
| $fileopen = fopen($file, 'r') or die("<b><font color=\"red\">Unable to open file or your fire not right!</font></b>"); | |
| $buffer = ''; | |
| $realson = ''; | |
| while (!feof($fileopen)) { | |
| $buffer2 = fgets($fileopen); | |
| $buffer .= $buffer2; | |
| } | |
| fclose($fileopen); | |
| unlink($file); | |
| $part = explode('"', $buffer); | |
| if (isset($part[1])) { | |
| $DUMP = $part[1]; | |
| $REALM_NAME = $_POST['RealmlistList']; | |
| $DECODED_DUMP = DECRYPT($DUMP); | |
| $CHAR_REALM = GetRealmID($AccountDBHost, $DBUser, $DBPassword, $AccountDB, $REALM_NAME); | |
| $CHAR_ACCOUNT_ID = GetCharacterAccountID(); | |
| $GM_ACCOUNT_ID = CanOrNoTransferServer($AccountDBHost, $DBUser, $DBPassword, $AccountDB, $CHAR_REALM, $GMLevel); | |
| $json = json_decode(stripslashes($DECODED_DUMP), true); | |
| if(CheckGameBuild($json['ginf']['clientbuild'], $GAMEBUILD)) | |
| $realson = $write[50] ." ". $GAMEBUILD; | |
| $CHAR_NAME = mb_convert_case(mb_strtolower($json['uinf']['name'], 'UTF-8'), MB_CASE_TITLE, 'UTF-8'); | |
| $O_REALMLIST = $json['ginf']['realmlist']; | |
| $O_REALM = $json['ginf']['realm']; | |
| $RaceID = GetRaceID(strtoupper($json['uinf']["race"])); | |
| $ClassID = GetClassID(strtoupper($json['uinf']["class"])); | |
| if(_CheckBlackList($AccountDBHost, $DBUser, $DBPassword, $AccountDB, $o_URL) || | |
| _CheckBlackList($AccountDBHost, $DBUser, $DBPassword, $AccountDB, $O_REALM) || | |
| _CheckBlackList($AccountDBHost, $DBUser, $DBPassword, $AccountDB, $O_REALMLIST)) { | |
| $realson = $write[57]; | |
| } else if (CanOrNoTransferPlayer(_HostDBSwitch($CHAR_REALM), $DBUser, $DBPassword, _CharacterDBSwitch($CHAR_REALM), $CHAR_ACCOUNT_ID)) { | |
| $realson = $write[52] . $REALM_NAME . $write[53]; | |
| } else if ($GM_ACCOUNT_ID < 0) { | |
| $realson = $write[54] . $REALM_NAME . $write[55]; | |
| } else if ($CHAR_ACCOUNT_ID < 0) { | |
| $realson = $write[56]; | |
| } else if (strlen($o_Account) > 32) | |
| $realson = $write[99]; | |
| $GUID = CheckCharacterGuid($AccountDBHost, $DBUser, $DBPassword, $AccountDB, $CHAR_REALM, GetCharacterGuid(_HostDBSwitch($CHAR_REALM), $DBUser, $DBPassword, _CharacterDBSwitch($CHAR_REALM))); | |
| if (empty($realson)) { | |
| $ID = 0; | |
| $ID = | |
| WriteDumpFromFileInDB($AccountDBHost, $DBUser, $DBPassword, $AccountDB, | |
| $DUMP, $CHAR_NAME, $CHAR_ACCOUNT_ID, $CHAR_REALM, | |
| $o_Account, $o_Password, $O_REALMLIST, $O_REALM, $o_URL, $ID, $GUID, $GM_ACCOUNT_ID, $realson, $write[20]); | |
| } | |
| } else if (!isset($part[1])) | |
| $realson = $write[51]; | |
| if (!empty($realson)) { | |
| echo $realson ." | |
| <div align=right style=\"width: 100%; padding-right: 2px;font-family: 'Tahoma'; color:#505070; font-size:10px; border:1px dotted #8080A0\"> $write[70] </div> | |
| <form action=\"". $_SERVER['PHP_SELF'] ."\" method=\"post\" enctype=\"multipart/form-data\"> | |
| <table width=\"350px\"> | |
| <tr><td><div align=right style=\"width: 100%; padding-right: 2px;font-family: 'Tahoma'; color:#505070; font-size:10px; border:1px dotted #8080A0\"> $write[71] </div></td></tr> | |
| <tr><td><b>Account: </b><input name=\"Account\" type=\"text\" size=\"30\" style=\"float: right;\"></td></tr> | |
| <tr><td><div align=right style=\"width: 100%; padding-right: 2px;font-family: 'Tahoma'; color:#505070; font-size:10px; border:1px dotted #8080A0\"> $write[72] </div></td></tr> | |
| <tr><td><b>Password: </b><input name=\"Password\" type=\"password\" size=\"30\" style=\"float: right;\"></tr> | |
| <tr><td> </td></tr> | |
| <tr><td><div align=right style=\"width: 100%; padding-right: 2px;font-family: 'Tahoma'; color:#505070; font-size:10px; border:1px dotted #8080A0\"> $write[79] </div></td></tr> | |
| <tr><td><b>I want transfer to Realm: </b><select name=\"RealmlistList\">"; | |
| $connection = mysql_connect($AccountDBHost, $DBUser, $DBPassword); | |
| _SelectDB($AccountDB, $connection); | |
| $result = mysql_query("SELECT * FROM `realmlist` WHERE `TransferAvailable` = 1;"); | |
| mysql_close($connection); | |
| while ($row = mysql_fetch_array($result)) | |
| echo"<option name=\"".$row['id']."\">". $row['name'] ."</option>"; | |
| echo "</select><tr><td> | |
| <tr><td><div align=right style=\"width: 100%; padding-right: 2px;font-family: 'Tahoma'; color:#505070; font-size:10px; border:1px dotted #8080A0\"> $write[74] </div></td></tr> | |
| <tr><td><b>Server URL: </b><input name=\"ServerUrl\" type=\"text\" size=\"30\" style=\"float: right;\"></td></tr> | |
| <tr><td><div align=right style=\"width: 100%; padding-right: 2px;font-family: 'Tahoma'; color:#505070; font-size:10px; border:1px dotted #8080A0\"> $write[76] </div></td></tr> | |
| </table> | |
| <div style=\"white-space: nowrap; margin-bottom:20px\"> | |
| <h8 style=\"font-size:14px\">$write[63]</h8> | |
| <input type=\"file\" name=\"file\" id=\"file\" /> | |
| <input type=\"submit\" name=\"load\" value=\"$write[77]\" /> | |
| </div> | |
| </form>"; | |
| } else { | |
| $char_money = _MaxValue($json['uinf']["money"], $MaxMoney); | |
| $char_speccount = $json['uinf']["specs"]; | |
| $char_gender = $json['uinf']["gender"] - 2 == 1 ? 1 : 0; | |
| $char_totalkills = $json['uinf']["kills"]; | |
| $char_arenapoints = _MaxValue($json['uinf']["arenapoints"], $MaxAP); | |
| $char_honorpoints = _MaxValue($json['uinf']["honor"], $MaxHP); | |
| $char_level = _MaxValue($json['uinf']["level"], $MaxCL); | |
| $INVrow = ""; | |
| $GEMrow = ""; | |
| $CURrow = ""; | |
| $row = ""; | |
| $connection = mysql_connect(_HostDBSwitch($CHAR_REALM), $DBUser, $DBPassword); | |
| _SelectDB(_CharacterDBSwitch($CHAR_REALM), $connection); | |
| mysql_query(" | |
| INSERT INTO `characters` (`guid`,`name`,`level`,`gender`,`totalHonorPoints`,`arenaPoints`,`totalKills`,`money`,`class`,`race`,`at_login`,`account`,`taximask`,`specco unt`,`online`) VALUES ( | |
| ". $GUID .",\"". $CHAR_NAME ."\",". $char_level .",". $char_gender .",". $char_honorpoints .",". $char_arenapoints .", | |
| ". $char_totalkills .",". $char_money .",". $ClassID .",". $RaceID .", 0x08, 1, \"0 0 0 0 0 0 0 0 0 0 0 0 0 0\",". $char_speccount .", 0);", $connection) or die(mysql_error()); | |
| mysql_query("INSERT INTO `character_transfer` VALUES (". $GUID .",". $CHAR_ACCOUNT_ID .",". $GM_ACCOUNT_ID .",". $ID .");", $connection) or die(mysql_error()); | |
| mysql_query(" | |
| UPDATE `characters` SET | |
| `position_x` = 5741.36, | |
| `position_y` = 626.982, | |
| `position_z` = 648.354, | |
| `map` = 571, | |
| `zone` = 4395, | |
| `cinematic` = 1 WHERE `guid` = ". $GUID .";", $connection) or die(mysql_error()); | |
| if ($char_speccount == 2) { | |
| LearnSeparateSpell(63644, $GUID, $connection); | |
| LearnSeparateSpell(63645, $GUID, $connection); | |
| } | |
| if ($ClassID == 6) { | |
| DeathKnightTransfer($GUID, $connection); | |
| } | |
| foreach( $json['glyphs'] as $key => $value ) { | |
| error_reporting(0); | |
| $GlyphID1 = GetGlyphID($value[0][0]); | |
| $GlyphID2 = GetGlyphID($value[0][1]); | |
| $GlyphID3 = GetGlyphID($value[0][2]); | |
| $GlyphID4 = GetGlyphID($value[1][0]); | |
| $GlyphID5 = GetGlyphID($value[1][1]); | |
| $GlyphID6 = GetGlyphID($value[1][2]); | |
| error_reporting(E_ALL); | |
| mysql_query("INSERT IGNORE INTO `character_glyphs` VALUES (". $GUID .", ". $key .", ". $GlyphID1 .",". $GlyphID4 .", ". $GlyphID5 .",". $GlyphID2 .", ". $GlyphID6 .",". $GlyphID3 .");", $connection) or die(mysql_error()); | |
| } | |
| foreach( $json['achiev'] as $key => $value ) { | |
| $achievement = $value['I']; | |
| $date = $value['D']; | |
| mysql_query("INSERT IGNORE INTO `character_achievement` VALUES (". $GUID .", ". $achievement .", ". $date .");", $connection) or die(mysql_error()); | |
| } | |
| $locale = trim(strtoupper($json['ginf']['locale'])); | |
| foreach( $json['rep'] as $key => $value ) { | |
| $reputation = $value['V']; | |
| $faction = GetFactionID(mb_strtoupper($value['N'], 'UTF-8' ), $locale); | |
| if ($faction < 1 || $reputation < 1) | |
| continue; | |
| $flag = $value['F'] + 1; | |
| if ($faction == 1119 && $reputation > 1) | |
| SonsOfHordirTransfer($GUID, $connection); | |
| mysql_query("INSERT IGNORE INTO `character_reputation` VALUES (". $GUID .", ". $faction .", ". $reputation .",". $flag .");", $connection) or die(mysql_error()); | |
| } | |
| foreach( $json['skills'] as $key => $value ) { | |
| $SkillName = mb_strtoupper($value['N'], 'UTF-8' ); | |
| if (CheckRiding($locale, $SkillName)) { | |
| LearnRiding($value['C'], $connection, $GUID, $char_level); | |
| continue; | |
| }; | |
| $skill = GetSkillID($SkillName, $locale); | |
| if($skill < 1) | |
| continue; | |
| $max = _MaxValue(RemoveRaceBonus($RaceID, $skill, $value['M']), 450); | |
| $cur = _MaxValue(RemoveRaceBonus($RaceID, $skill, $value['C']), 450); | |
| $spell = GetSpellIDForSkill($skill, $max); | |
| if (CheckExtraSpell($skill)) | |
| LearnSeparateSpell(GetExtraSpellForSkill($skill, $cur, $GUID, $connection), $GUID, $connection); | |
| //echo "/* SKILL: */ INSERT INTO `character_skills` VALUES (". $GUID .", ". $skill .",". $cur .",". $max ."<br>"; | |
| mysql_query("/* SKILL: */ INSERT INTO `character_skills` VALUES (". $GUID .", ". $skill .",". $cur .",". $max .");", $connection) or die(mysql_error()); | |
| if($spell < 3) | |
| continue; | |
| //echo "/* SPELL: */ INSERT INTO `character_spell` VALUES (". $GUID .", ". $spell .", 1, 0);"; | |
| mysql_query("/* SPELL: */ INSERT INTO `character_spell` VALUES (". $GUID .", ". $spell .", 1, 0);", $connection) or die(mysql_error()); | |
| } | |
| foreach( $json['spells'] as $key => $value ) { | |
| $SpellID = $key; | |
| if (isProfessionSpell($SpellID) || isSpellValid($SpellID, $RaceID, $ClassID)) | |
| mysql_query("INSERT IGNORE INTO `character_spell` VALUES (". $GUID .", ". $SpellID .", 1, 0);", $connection) or die(mysql_error()); | |
| } | |
| foreach( $json['creature'] as $key => $value ) { | |
| mysql_query("INSERT IGNORE INTO `character_spell` VALUES (". $GUID .", ". $value .", 1, 0);", $connection) or die(mysql_error()); | |
| } | |
| mysql_close($connection); | |
| include("t_itemcheck.php"); | |
| foreach( $json['inventory'] as $key => $value ) { | |
| $item = GetChangedItem($value['I']); | |
| if( !isItemValid($item, $CONFIG) || $item < 1 ) | |
| continue; | |
| $count = CheckItemCount($value['C']); | |
| $INVrow .= $item .":". $count ." "; | |
| $GEM1 = GetGemID($value['G1']); | |
| $GEM2 = GetGemID($value['G2']); | |
| $GEM3 = GetGemID($value['G3']); | |
| if($GEM1 > 1) | |
| $GEMrow .= $GEM1 .":1 "; | |
| if($GEM2 > 1) | |
| $GEMrow .= $GEM2 .":1 "; | |
| if($GEM3 > 1) | |
| $GEMrow .= $GEM3 .":1 "; | |
| } | |
| foreach( $json['currency'] as $key => $value ) { | |
| $CurrencyID = $value['I']; | |
| $COUNT = $value['C']; | |
| if ($COUNT < 1) | |
| continue; | |
| if (CheckCurrency($CurrencyID)) | |
| $CURrow .= $CurrencyID.":".$COUNT." "; | |
| } | |
| $row = trim($INVrow . $GEMrow . $CURrow); | |
| UpdateDumpITEMROW($AccountDBHost, $DBUser, $DBPassword, $AccountDB, $ID, $row); | |
| if (_CheckCharacterName(_HostDBSwitch($CHAR_REALM), $DBUser, $DBPassword, _CharacterDBSwitch($CHAR_REALM), $CHAR_NAME)) { | |
| $_SESSION['guid'] = $GUID; | |
| $_SESSION['realm'] = $CHAR_REALM; | |
| $_SESSION['dumpID'] = $ID; | |
| include("step2.php"); | |
| } else { | |
| UpdateDumpStatus($AccountDBHost, $DBUser, $DBPassword, $AccountDB, $ID, 0); | |
| PreparateMails($row, $CHAR_NAME, $TransferLetterTitle, $TransferLetterMessage, $SOAPUser, $SOAPPassword, _SOAPPSwitch($CHAR_REALM), _SOAPHSwitch($CHAR_REALM)); | |
| TalentsReset(_HostDBSwitch($CHAR_REALM), $DBUser, $DBPassword, _CharacterDBSwitch($CHAR_REALM), $GUID); | |
| MoveToGMAccount(_HostDBSwitch($CHAR_REALM), $DBUser, $DBPassword, _CharacterDBSwitch($CHAR_REALM), $GUID); | |
| echo $write[91]; | |
| } | |
| } | |
| } else { | |
| echo "<div align=right style=\"width: 100%; padding-right: 2px;font-family: 'Tahoma'; color:#505070; font-size:10px; border:1px dotted #8080A0\"> $write[70] </div> | |
| <form action=\"". $_SERVER['PHP_SELF'] ."\" method=\"post\" enctype=\"multipart/form-data\"> | |
| <table width=\"350px\"> | |
| <tr><td><div align=right style=\"width: 100%; padding-right: 2px;font-family: 'Tahoma'; color:#505070; font-size:10px; border:1px dotted #8080A0\"> $write[71] </div></td></tr> | |
| <tr><td><b>Account: </b><input name=\"Account\" type=\"text\" size=\"30\" style=\"float: right;\"></td></tr> | |
| <tr><td><div align=right style=\"width: 100%; padding-right: 2px;font-family: 'Tahoma'; color:#505070; font-size:10px; border:1px dotted #8080A0\"> $write[72] </div></td></tr> | |
| <tr><td><b>Password: </b><input name=\"Password\" type=\"password\" size=\"30\" style=\"float: right;\"></tr> | |
| <tr><td> </td></tr> | |
| <tr><td><div align=right style=\"width: 100%; padding-right: 2px;font-family: 'Tahoma'; color:#505070; font-size:10px; border:1px dotted #8080A0\"> $write[79] </div></td></tr> | |
| <tr><td><b>I want transfer to Realm: </b><select name=\"RealmlistList\">"; | |
| $connection = mysql_connect($AccountDBHost, $DBUser, $DBPassword); | |
| _SelectDB($AccountDB, $connection); | |
| $result = mysql_query("SELECT * FROM `realmlist` WHERE `TransferAvailable` = 1;"); | |
| mysql_close($connection); | |
| while ($row = mysql_fetch_array($result)) | |
| echo "<option name=\"".$row['id']."\">". $row['name'] ."</option>"; | |
| echo "</select><tr><td> | |
| <tr><td><div align=right style=\"width: 100%; padding-right: 2px;font-family: 'Tahoma'; color:#505070; font-size:10px; border:1px dotted #8080A0\"> $write[74] </div></td></tr> | |
| <tr><td><b>Server URL: </b><input name=\"ServerUrl\" type=\"text\" size=\"30\" style=\"float: right;\"></td></tr> | |
| <tr><td><div align=right style=\"width: 100%; padding-right: 2px;font-family: 'Tahoma'; color:#505070; font-size:10px; border:1px dotted #8080A0\"> $write[76] </div></td></tr> | |
| </table> | |
| <div style=\"white-space: nowrap; margin-bottom:20px\"> | |
| <h8 style=\"font-size:14px\">$write[63]</h8> | |
| <input type=\"file\" name=\"file\" id=\"file\" /> | |
| <input type=\"submit\" name=\"load\" value=\"$write[77]\" /> | |
| </div> | |
| </form>"; | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment