mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Updated RakLib dependency
This commit is contained in:
@ -98,7 +98,7 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
|
||||
return $work;
|
||||
}
|
||||
|
||||
public function closeSession($identifier, $reason){
|
||||
public function closeSession(string $identifier, string $reason) : void{
|
||||
if(isset($this->players[$identifier])){
|
||||
$player = $this->players[$identifier];
|
||||
unset($this->identifiers[spl_object_hash($player)]);
|
||||
@ -125,7 +125,7 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
|
||||
$this->interface->emergencyShutdown();
|
||||
}
|
||||
|
||||
public function openSession($identifier, $address, $port, $clientID){
|
||||
public function openSession(string $identifier, string $address, int $port, int $clientID) : void{
|
||||
$ev = new PlayerCreationEvent($this, Player::class, Player::class, $address, $port);
|
||||
$this->server->getPluginManager()->callEvent($ev);
|
||||
$class = $ev->getPlayerClass();
|
||||
@ -137,7 +137,7 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
|
||||
$this->server->addPlayer($identifier, $player);
|
||||
}
|
||||
|
||||
public function handleEncapsulated($identifier, EncapsulatedPacket $packet, $flags){
|
||||
public function handleEncapsulated(string $identifier, EncapsulatedPacket $packet, int $flags) : void{
|
||||
if(isset($this->players[$identifier])){
|
||||
//get this now for blocking in case the player was closed before the exception was raised
|
||||
$address = $this->players[$identifier]->getAddress();
|
||||
@ -164,7 +164,7 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
|
||||
$this->interface->unblockAddress($address);
|
||||
}
|
||||
|
||||
public function handleRaw($address, $port, $payload){
|
||||
public function handleRaw(string $address, int $port, string $payload) : void{
|
||||
$this->server->handlePacket($address, $port, $payload);
|
||||
}
|
||||
|
||||
@ -172,7 +172,7 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
|
||||
$this->interface->sendRaw($address, $port, $payload);
|
||||
}
|
||||
|
||||
public function notifyACK($identifier, $identifierACK){
|
||||
public function notifyACK(string $identifier, int $identifierACK) : void{
|
||||
|
||||
}
|
||||
|
||||
@ -198,8 +198,8 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
|
||||
$this->interface->sendOption("portChecking", (bool) $name);
|
||||
}
|
||||
|
||||
public function handleOption($name, $value){
|
||||
if($name === "bandwidth"){
|
||||
public function handleOption(string $option, string $value) : void{
|
||||
if($option === "bandwidth"){
|
||||
$v = unserialize($value);
|
||||
$this->network->addStatistics($v["up"], $v["down"]);
|
||||
}
|
||||
@ -241,7 +241,7 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
|
||||
return null;
|
||||
}
|
||||
|
||||
public function updatePing(string $identifier, int $pingMS){
|
||||
public function updatePing(string $identifier, int $pingMS) : void{
|
||||
if(isset($this->players[$identifier])){
|
||||
$this->players[$identifier]->updatePing($pingMS);
|
||||
}
|
||||
|
Reference in New Issue
Block a user