mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 06:55:29 +00:00
network: added some missing native closure return types
This commit is contained in:
parent
85fdb7ec05
commit
ded0f5c80e
@ -92,7 +92,7 @@ class ChunkCache implements ChunkListener{
|
|||||||
$chunkZ,
|
$chunkZ,
|
||||||
$this->world->getChunk($chunkX, $chunkZ),
|
$this->world->getChunk($chunkX, $chunkZ),
|
||||||
$this->caches[$chunkHash],
|
$this->caches[$chunkHash],
|
||||||
function() use ($chunkX, $chunkZ){
|
function() use ($chunkX, $chunkZ) : void{
|
||||||
$this->world->getLogger()->error("Failed preparing chunk $chunkX $chunkZ, retrying");
|
$this->world->getLogger()->error("Failed preparing chunk $chunkX $chunkZ, retrying");
|
||||||
|
|
||||||
$this->restartPendingRequest($chunkX, $chunkZ);
|
$this->restartPendingRequest($chunkX, $chunkZ);
|
||||||
|
@ -448,7 +448,7 @@ class NetworkSession{
|
|||||||
* Disconnects the session, destroying the associated player (if it exists).
|
* Disconnects the session, destroying the associated player (if it exists).
|
||||||
*/
|
*/
|
||||||
public function disconnect(string $reason, bool $notify = true) : void{
|
public function disconnect(string $reason, bool $notify = true) : void{
|
||||||
$this->tryDisconnect(function() use ($reason, $notify){
|
$this->tryDisconnect(function() use ($reason, $notify) : void{
|
||||||
if($this->player !== null){
|
if($this->player !== null){
|
||||||
$this->player->disconnect($reason, null, $notify);
|
$this->player->disconnect($reason, null, $notify);
|
||||||
}
|
}
|
||||||
@ -462,7 +462,7 @@ class NetworkSession{
|
|||||||
* @throws \UnsupportedOperationException
|
* @throws \UnsupportedOperationException
|
||||||
*/
|
*/
|
||||||
public function transfer(string $ip, int $port, string $reason = "transfer") : void{
|
public function transfer(string $ip, int $port, string $reason = "transfer") : void{
|
||||||
$this->tryDisconnect(function() use ($ip, $port, $reason){
|
$this->tryDisconnect(function() use ($ip, $port, $reason) : void{
|
||||||
$this->sendDataPacket(TransferPacket::create($ip, $port), true);
|
$this->sendDataPacket(TransferPacket::create($ip, $port), true);
|
||||||
$this->disconnect($reason, false);
|
$this->disconnect($reason, false);
|
||||||
if($this->player !== null){
|
if($this->player !== null){
|
||||||
@ -476,7 +476,7 @@ class NetworkSession{
|
|||||||
* Called by the Player when it is closed (for example due to getting kicked).
|
* Called by the Player when it is closed (for example due to getting kicked).
|
||||||
*/
|
*/
|
||||||
public function onPlayerDestroyed(string $reason, bool $notify = true) : void{
|
public function onPlayerDestroyed(string $reason, bool $notify = true) : void{
|
||||||
$this->tryDisconnect(function() use ($reason, $notify){
|
$this->tryDisconnect(function() use ($reason, $notify) : void{
|
||||||
$this->doServerDisconnect($reason, $notify);
|
$this->doServerDisconnect($reason, $notify);
|
||||||
}, $reason);
|
}, $reason);
|
||||||
}
|
}
|
||||||
@ -497,7 +497,7 @@ class NetworkSession{
|
|||||||
* example in a timeout condition or voluntary client disconnect.
|
* example in a timeout condition or voluntary client disconnect.
|
||||||
*/
|
*/
|
||||||
public function onClientDisconnect(string $reason) : void{
|
public function onClientDisconnect(string $reason) : void{
|
||||||
$this->tryDisconnect(function() use ($reason){
|
$this->tryDisconnect(function() use ($reason) : void{
|
||||||
if($this->player !== null){
|
if($this->player !== null){
|
||||||
$this->player->disconnect($reason, null, false);
|
$this->player->disconnect($reason, null, false);
|
||||||
}
|
}
|
||||||
@ -740,7 +740,7 @@ class NetworkSession{
|
|||||||
ChunkCache::getInstance($world)->request($chunkX, $chunkZ)->onResolve(
|
ChunkCache::getInstance($world)->request($chunkX, $chunkZ)->onResolve(
|
||||||
|
|
||||||
//this callback may be called synchronously or asynchronously, depending on whether the promise is resolved yet
|
//this callback may be called synchronously or asynchronously, depending on whether the promise is resolved yet
|
||||||
function(CompressBatchPromise $promise) use ($world, $chunkX, $chunkZ, $onCompletion){
|
function(CompressBatchPromise $promise) use ($world, $chunkX, $chunkZ, $onCompletion) : void{
|
||||||
if(!$this->isConnected()){
|
if(!$this->isConnected()){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user