PocketMine-MP 5.23.3 git-976fc63567edab7a6fb6aeae739f43cf9fe57de4
Loading...
Searching...
No Matches
pocketmine\console\ConsoleReaderChildProcessUtils Class Reference
+ Collaboration diagram for pocketmine\console\ConsoleReaderChildProcessUtils:

Static Public Member Functions

static createMessage (string $line, int &$counter)
 
static parseMessage (string $message, int &$counter)
 

Public Attributes

const TOKEN_DELIMITER = ":"
 
const TOKEN_HASH_ALGO = "xxh3"
 

Detailed Description

Definition at line 31 of file ConsoleReaderChildProcessUtils.php.

Member Function Documentation

◆ createMessage()

static pocketmine\console\ConsoleReaderChildProcessUtils::createMessage ( string $line,
int & $counter )
static

Creates an IPC message to transmit a user's input command to the parent process.

Unfortunately we can't currently provide IPC pipes other than stdout/stderr to subprocesses on Windows, so this adds a hash of the user input (with a counter as salt) to prevent unintended process output (like error messages) from being treated as user input.

Definition at line 46 of file ConsoleReaderChildProcessUtils.php.

◆ parseMessage()

static pocketmine\console\ConsoleReaderChildProcessUtils::parseMessage ( string $message,
int & $counter )
static

Extracts a command from an IPC message from the console reader subprocess. Returns the user's input command, or null if this isn't a user input.

Definition at line 56 of file ConsoleReaderChildProcessUtils.php.

Member Data Documentation

◆ TOKEN_DELIMITER

const pocketmine\console\ConsoleReaderChildProcessUtils::TOKEN_DELIMITER = ":"

Definition at line 32 of file ConsoleReaderChildProcessUtils.php.

◆ TOKEN_HASH_ALGO

const pocketmine\console\ConsoleReaderChildProcessUtils::TOKEN_HASH_ALGO = "xxh3"

Definition at line 33 of file ConsoleReaderChildProcessUtils.php.


The documentation for this class was generated from the following file: