mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
more small changes
This commit is contained in:
parent
ac552afedc
commit
3f40c4f9be
3 changed files with 9 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
class PlayerInputPacket extends RakNetDataPacket{
|
||||
public $unk1, $unk2, $unk3, $unk4;
|
||||
public $unk1, $unk2, $sneaking, $unk4;
|
||||
public function encode()
|
||||
{
|
||||
|
||||
|
|
@ -15,8 +15,8 @@ class PlayerInputPacket extends RakNetDataPacket{
|
|||
{
|
||||
$this->unk1 = $this->getFloat();
|
||||
$this->unk2 = $this->getFloat();
|
||||
$this->unk3 = $this->getByte();
|
||||
$this->unk4 = $this->getByte();
|
||||
$this->sneaking = bin2hex($this->buffer)[$this->getOffset()] === 4;
|
||||
$this->unk4 = bin2hex($this->buffer)[$this->getOffset()+1] === 4;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,11 @@ abstract class RakNetDataPacket extends stdClass{
|
|||
public function getBuffer(){
|
||||
return $this->buffer;
|
||||
}
|
||||
|
||||
|
||||
public function getOffset(){
|
||||
return $this->offset;
|
||||
}
|
||||
|
||||
public function setBuffer($buffer = ""){
|
||||
$this->buffer = $buffer;
|
||||
$this->offset = 0;
|
||||
|
|
|
|||
|
|
@ -638,6 +638,7 @@ class Utils{
|
|||
}
|
||||
|
||||
public static function readInt($str){
|
||||
if(strlen($str) <= 0) return;
|
||||
if(PHP_INT_SIZE === 8){
|
||||
return @unpack("N", $str)[1] << 32 >> 32;
|
||||
}else{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue