mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
made pushing disableable in config, php8.1+particial 8.2 comp(not recommended)
This commit is contained in:
parent
79831c457d
commit
cb6e649081
19 changed files with 55 additions and 40 deletions
|
|
@ -5,7 +5,7 @@ class MinecraftInterface{
|
|||
public $bandwidth;
|
||||
private $socket;
|
||||
private $packets;
|
||||
|
||||
public $start;
|
||||
function __construct($server, $port = 25565, $serverip = "0.0.0.0"){
|
||||
$this->socket = new UDPSocket($server, $port, true, $serverip);
|
||||
if($this->socket->connected === false){
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
class UDPSocket{
|
||||
|
||||
public $connected, $sock, $server;
|
||||
|
||||
public $connected, $sock, $server, $port;
|
||||
|
||||
function __construct($server, $port, $listen = false, $serverip = "0.0.0.0"){
|
||||
$this->server = $server;
|
||||
$this->port = $port;
|
||||
|
|
|
|||
|
|
@ -3,15 +3,15 @@
|
|||
class RakNetCodec{
|
||||
|
||||
public $packet;
|
||||
|
||||
public $buffer;
|
||||
public function __construct(RakNetPacket $packet){
|
||||
$this->packet = $packet;
|
||||
$this->buffer =& $this->packet->buffer;
|
||||
$this->buffer = &$this->packet->buffer;
|
||||
$this->encode();
|
||||
}
|
||||
|
||||
private function encode(){
|
||||
if(strlen($this->packet->buffer) > 0){
|
||||
if($this->packet->buffer != null && strlen($this->packet->buffer) > 0){
|
||||
return;
|
||||
}
|
||||
$this->buffer .= chr($this->packet->pid());
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ abstract class RakNetDataPacket extends stdClass{
|
|||
}
|
||||
|
||||
protected function putByte($v){
|
||||
$this->buffer .= chr($v);
|
||||
$this->buffer .= chr((int)$v);
|
||||
}
|
||||
|
||||
protected function getString(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue