mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Added some missing typehints
This commit is contained in:
@ -70,7 +70,7 @@ class QueryHandler{
|
||||
$this->token = random_bytes(16);
|
||||
}
|
||||
|
||||
public static function getTokenString($token, $salt){
|
||||
public static function getTokenString(string $token, string $salt) : int{
|
||||
return Binary::readInt(substr(hash("sha512", $salt . ":" . $token, true), 7, 4));
|
||||
}
|
||||
|
||||
|
@ -71,15 +71,15 @@ class RCONInstance extends Thread{
|
||||
$this->start(PTHREADS_INHERIT_NONE);
|
||||
}
|
||||
|
||||
private function writePacket($client, $requestID, $packetType, $payload){
|
||||
$pk = Binary::writeLInt((int) $requestID)
|
||||
. Binary::writeLInt((int) $packetType)
|
||||
private function writePacket($client, int $requestID, int $packetType, string $payload){
|
||||
$pk = Binary::writeLInt($requestID)
|
||||
. Binary::writeLInt($packetType)
|
||||
. $payload
|
||||
. "\x00\x00"; //Terminate payload and packet
|
||||
return socket_write($client, Binary::writeLInt(strlen($pk)) . $pk);
|
||||
}
|
||||
|
||||
private function readPacket($client, &$requestID, &$packetType, &$payload){
|
||||
private function readPacket($client, ?int &$requestID, ?int &$packetType, ?string &$payload){
|
||||
$d = socket_read($client, 4);
|
||||
if($this->stop){
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user