|
Phpcraft
|


Public Member Functions | |
| __construct ($stream, int $protocol_version) | |
| sendHandshake (string $server_name, int $server_port, int $next_state, array $join_specs=[]) | |
| login (Account $account) | |
| startPacket ($packet) | |
| getName () | |
| sendMessage ($message) | |
| sendAdminBroadcast ($message, string $permission="everything") | |
| hasPermission (string $permission) | |
| hasPosition () | |
| getPosition () | |
| hasServer () | |
| getServer () | |
Public Member Functions inherited from Phpcraft\Connection | |
| __construct (int $protocol_version=-1, $stream=null) | |
| isOpen () | |
| setReadBuffer (string $buffer) | |
| getRemainingData () | |
| writeChat (ChatComponent $value) | |
| writeString (string $value) | |
| writeRaw (string $value) | |
| writeFloat (float $value) | |
| writePosition (Point3D $pos) | |
| writeGMP ($value, int $bytes, int $bits, bool $signed, int $gmp_export_options=GMP_MSW_FIRST|GMP_BIG_ENDIAN) | |
| writeLong ($value) | |
| writePrecisePosition (Point3D $pos) | |
| writeDouble (float $value) | |
| writeFixedPointPosition (Point3D $pos) | |
| writeInt ($value) | |
| writeSlot (Slot $slot) | |
| writeBoolean (bool $value) | |
| writeShort ($value) | |
| writeVarInt ($value) | |
| writeByte (int $value) | |
| writeUnsignedShort ($value) | |
| writeUnsignedByte (int $value) | |
| writeAngle (float $value) | |
| writeUUID (UUID $uuid) | |
| send (bool $raw=false) | |
| close () | |
| readRawPacket (float $timeout=3.000, int $bytes=0) | |
| getRemoteAddress () | |
| readPacket (float $timeout=3.000) | |
| readVarInt () | |
| readUnsignedByte () | |
| readAngle () | |
| readByte () | |
| readChat () | |
| readString (int $maxLength=32767, int $minLength=-1) | |
| readPosition () | |
| readGMP (int $bytes, int $bits, bool $signed, int $gmp_import_options=GMP_MSW_FIRST|GMP_BIG_ENDIAN) | |
| readPrecisePosition () | |
| readDouble () | |
| readFixedPointPosition () | |
| readInt () | |
| readUUID () | |
| readSlot (bool $additional_processing=true) | |
| readBoolean () | |
| readShort () | |
| readNBT (int $type=0) | |
| readRaw (int $bytes) | |
| readLong () | |
| readFloat () | |
| readUnsignedShort () | |
| ignoreBytes (int $bytes) | |
Public Attributes | |
| $username | |
| $uuid | |
| $pos | |
Public Attributes inherited from Phpcraft\Connection | |
| const | STATE_HANDSHAKE = 0 |
| const | STATE_STATUS = 1 |
| const | STATE_LOGIN = 2 |
| const | STATE_PLAY = 3 |
| const | LENIENCY_LENIENT = 1 |
| const | LENIENCY_VANILLA = 0 |
| const | LENIENCY_STRICT = -1 |
| $protocol_version | |
| $stream | |
| $compression_threshold = -1 | |
| $state | |
| $write_buffer = "" | |
| $lenient = false | |
| $leniency = self::LENIENCY_VANILLA | |
| $read_buffer = "" | |
| $read_buffer_offset = 0 | |
Additional Inherited Members | |
Static Public Member Functions inherited from Phpcraft\Connection | |
| static | varInt ($value) |
Static Public Attributes inherited from Phpcraft\Connection | |
| static | $zero |
| static | $pow2 = [] |
A client-to-server connection.
| Phpcraft\ServerConnection::__construct | ( | $stream, | |
| int | $protocol_version | ||
| ) |
| resource | $stream | A stream created by fsockopen. |
| int | $protocol_version |
| Phpcraft\ServerConnection::getName | ( | ) |
Implements Phpcraft\Command\CommandSender.
| Phpcraft\ServerConnection::getPosition | ( | ) |
Implements Phpcraft\Command\CommandSender.
| Phpcraft\ServerConnection::getServer | ( | ) |
Available in accordance with the CommandSender interface.
Implements Phpcraft\Command\CommandSender.
| Phpcraft\ServerConnection::hasPermission | ( | string | $permission | ) |
| Phpcraft\ServerConnection::hasPosition | ( | ) |
Implements Phpcraft\Command\CommandSender.
| Phpcraft\ServerConnection::hasServer | ( | ) |
Available in accordance with the CommandSender interface.
Implements Phpcraft\Command\CommandSender.
| Phpcraft\ServerConnection::login | ( | Account | $account | ) |
Logs in to the server using the given account. This has to be called even when joining an offline mode server.
| Account | $account |
| IOException |
| Phpcraft\ServerConnection::sendAdminBroadcast | ( | $message, | |
| string | $permission = "everything" |
||
| ) |
Prints a message to the console. Available in accordance with the CommandSender interface.
| array | string | null | ChatComponent | $message | |
| string | $permission |
Implements Phpcraft\Command\CommandSender.
| Phpcraft\ServerConnection::sendHandshake | ( | string | $server_name, |
| int | $server_port, | ||
| int | $next_state, | ||
| array | $join_specs = [] |
||
| ) |
Sends a handshake to the server. If $next_state is 2, you should call ServerConnection::login() after this, even when joining an offline mode server.
| string | $server_name | |
| int | $server_port | |
| int | $next_state | May be Connection::STATE_STATUS (1) for list ping or Connection::STATE_LOGIN (2) for login to play. |
| array<string> | $join_specs Additional data to provide, e.g. "FML" is in this array for Forge clients. |
| IOException |
| Phpcraft\ServerConnection::sendMessage | ( | $message | ) |
Prints a message to the console. Available in accordance with the CommandSender interface.
| array | string | null | ChatComponent | $message |
Implements Phpcraft\Command\CommandSender.
| Phpcraft\ServerConnection::startPacket | ( | $packet | ) |
Clears the write buffer and starts a new packet.
| string | integer | $packet | The name or ID of the new packet. |
Reimplemented from Phpcraft\Connection.
| Point3D Phpcraft\ServerConnection::$pos |
Our position on the server.
| string null Phpcraft\ServerConnection::$username |
The username assigned to us by the server after login. Null before that.
| UUID null Phpcraft\ServerConnection::$uuid |
The UUID assigned to us by the server after login. Null before that.
1.8.17