File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717use pmmp \encoding \ByteBufferReader ;
1818use pmmp \encoding \ByteBufferWriter ;
1919use pmmp \encoding \LE ;
20+ use pmmp \encoding \VarInt ;
2021use pocketmine \network \mcpe \protocol \types \MemoryCategoryCounter ;
2122use function count ;
2223
@@ -105,7 +106,7 @@ protected function decodePayload(ByteBufferReader $in) : void{
105106 $ this ->avgUnaccountedTimePercent = LE ::readFloat ($ in );
106107
107108 $ this ->memoryCategoryValues = [];
108- for ($ i = 0 , $ count = LE ::readUnsignedInt ($ in ); $ i < $ count ; $ i ++){
109+ for ($ i = 0 , $ count = VarInt ::readUnsignedInt ($ in ); $ i < $ count ; $ i ++){
109110 $ this ->memoryCategoryValues [] = MemoryCategoryCounter::read ($ in );
110111 }
111112 }
@@ -121,7 +122,7 @@ protected function encodePayload(ByteBufferWriter $out) : void{
121122 LE ::writeFloat ($ out , $ this ->avgRemainderTimePercent );
122123 LE ::writeFloat ($ out , $ this ->avgUnaccountedTimePercent );
123124
124- LE ::writeUnsignedInt ($ out , count ($ this ->memoryCategoryValues ));
125+ VarInt ::writeUnsignedInt ($ out , count ($ this ->memoryCategoryValues ));
125126 foreach ($ this ->memoryCategoryValues as $ value ){
126127 $ value ->write ($ out );
127128 }
You can’t perform that action at this time.
0 commit comments