Skip to content

Commit

Permalink
Fix 0xB9 packet and add createCharacter70160 function, but not finished
Browse files Browse the repository at this point in the history
  • Loading branch information
mbnunes authored and Mauricio Nunes committed Apr 5, 2017
1 parent 0766df9 commit 9d3f2cd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
30 changes: 26 additions & 4 deletions core/account.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -292,7 +310,7 @@ public function loginCharacter($info = array()) {
} else {
$this->disconnect(4);
}
}
}

/**
* Send the connection confirmation of selected server
Expand Down Expand Up @@ -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
}
}
2 changes: 1 addition & 1 deletion core/defs/expansions.def.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions core/player.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -727,5 +727,6 @@ public function updateCurrentStamina($runInLot = false) {

Sockets::out($this->client, $packet, $runInLot);
}


}

0 comments on commit 9d3f2cd

Please sign in to comment.