From 9d3f2cd982ac14addbe8b0d04182a9037631a52a Mon Sep 17 00:00:00 2001 From: Mauricio Nunes Date: Wed, 5 Apr 2017 12:27:32 -0300 Subject: [PATCH] Fix 0xB9 packet and add createCharacter70160 function, but not finished --- core/account.class.php | 30 ++++++++++++++++++++++++++---- core/defs/expansions.def.php | 2 +- core/player.class.php | 1 + 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/core/account.class.php b/core/account.class.php index 0221bb76..d2211c2d 100644 --- a/core/account.class.php +++ b/core/account.class.php @@ -144,7 +144,24 @@ public function sendServerList($runInLot = false) { * Enable locked client features */ public function enableLockedFeatures($runInLot = false) { - $packet = "B9000C829F"; + $tmpPacket = ""; + $expansion = dechex(expansionDefs::EXPANSION_TOL); + + // IF the client is the Old Version change 8 to 4 + for($i = 0;$i <8-strlen($expansion);++$i) + { + $tmpPacket .= "0"; + } + + $tmpPacket .= $expansion; + // if (versaoAntiga){ + //Versao antiga o pacote é 3 bytes + //}else{ + //Versao nova o pacote tem 5 bytes + //} + + $packet = "B9"; + $packet .= $tmpPacket; Sockets::out($this->client, $packet, $runInLot); } @@ -198,8 +215,9 @@ public function sendCharacterList($runInLot = false) { $tmpPacket .= str_pad(Functions::strToHex($location['area']), 62, "0", STR_PAD_RIGHT); }*/ } - $tmpPacket .= str_pad("01A8", 8, "0", STR_PAD_LEFT); - $tmpPacket .= "0000"; + + $tmpPacket .= str_pad("11E8", 8, "0", STR_PAD_LEFT); + $tmpPacket .= "FFFF"; $packet = "A9"; $packet .= str_pad(dechex(ceil(strlen($tmpPacket) / 2) + 4), 4, "0", STR_PAD_LEFT); @@ -292,7 +310,7 @@ public function loginCharacter($info = array()) { } else { $this->disconnect(4); } - } + } /** * Send the connection confirmation of selected server @@ -341,4 +359,8 @@ public function disconnect($reason = 4) { public function sendClientVersionRequest($runInLot = false) { Sockets::out($this->client, "BD0003", $runInLot); } + + public function createCharacter70160($runInLot = false, $charName, $flags, $loginCount, $profession, $genderRace, $str, $dex, $int, $skillid1,$skillvalue1, $skillid2, $skillvalue2, $skillid3, $skillvalue3, $skillid4, $skillvalue4 , $skinColor, $hairStyle, $beardStyle, $beardColor, $shardIndex, $startCity, $charSlot, $shirtColor, $pantsColor){ + //Ainda nao fiz + } } \ No newline at end of file diff --git a/core/defs/expansions.def.php b/core/defs/expansions.def.php index a1ca52b8..63659b02 100644 --- a/core/defs/expansions.def.php +++ b/core/defs/expansions.def.php @@ -7,7 +7,7 @@ abstract class expansionDefs { const EXPANSION_NONE = clientDefs::CLIENT_NONE; const EXPANSION_T2A = clientDefs::CLIENT_T2A; - const EXPANSION_UOR = self::EXPANSION_T2A | clientDefs::CLIENT_UOR; + const EXPANSION_UOR = self::EXPANSION_T2A | clientDefs::CLIENT_UOR; const EXPANSION_UOTD = self::EXPANSION_UOR | clientDefs::CLIENT_UOTD; const EXPANSION_LBR = self::EXPANSION_UOTD | clientDefs::CLIENT_LBR; const EXPANSION_AOS = self::EXPANSION_LBR | clientDefs::CLIENT_AOS | clientDefs::CLIENT_LIVEACCOUNT; diff --git a/core/player.class.php b/core/player.class.php index d9eddd86..87353b2b 100644 --- a/core/player.class.php +++ b/core/player.class.php @@ -727,5 +727,6 @@ public function updateCurrentStamina($runInLot = false) { Sockets::out($this->client, $packet, $runInLot); } + }