mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Fixed #281 client crashes due to packet recovery
This commit is contained in:
parent
e34b407538
commit
221da1685e
2 changed files with 27 additions and 26 deletions
|
|
@ -98,31 +98,27 @@ class Packet{
|
|||
break;
|
||||
case "customData":
|
||||
$this->addRaw(chr($this->data[1]));
|
||||
switch($this->data[1]){
|
||||
case 0x40:
|
||||
$reply = new CustomPacketHandler($this->data[2]["id"], "", $this->data[2], true);
|
||||
$this->addRaw(Utils::writeShort((strlen($reply->raw) + 1) << 3));
|
||||
$this->addRaw(strrev(Utils::writeTriad($this->data[2]["count"])));
|
||||
$this->addRaw(chr($this->data[2]["id"]));
|
||||
$this->addRaw($reply->raw);
|
||||
break;
|
||||
case 0x00:
|
||||
if($this->data[2]["id"] !== false){
|
||||
if($this->data[2]["id"] === false){
|
||||
$this->addRaw($this->data[2]["raw"]);
|
||||
}else{
|
||||
switch($this->data[1]){
|
||||
case 0x40:
|
||||
$reply = new CustomPacketHandler($this->data[2]["id"], "", $this->data[2], true);
|
||||
$this->addRaw(Utils::writeShort((strlen($reply->raw) + 1) << 3));
|
||||
$this->addRaw(strrev(Utils::writeTriad($this->data[2]["count"])));
|
||||
$this->addRaw(chr($this->data[2]["id"]));
|
||||
$this->addRaw($reply->raw);
|
||||
break;
|
||||
case 0x00:
|
||||
$raw = new CustomPacketHandler($this->data[2]["id"], "", $this->data[2], true);
|
||||
$raw = $raw->raw;
|
||||
$this->addRaw(Utils::writeShort((strlen($raw) + 1) << 3));
|
||||
$this->addRaw(chr($this->data[2]["id"]));
|
||||
$this->addRaw($raw);
|
||||
}else{
|
||||
$this->addRaw($this->data[2]["raw"]);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if($this->data[2]["id"] === false){
|
||||
$this->addRaw($this->data[2]["raw"]);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case "magic":
|
||||
$this->addRaw(RAKNET_MAGIC);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue