This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
if(!defined("STDIN")) define("STDIN", fopen("php://stdin", "R")); | |
$host = "localhost"; | |
$user = "root"; | |
$password = ""; | |
$schema = ""; | |
$opts = getopt("h:u:p:s:"); |
Before reading, please consider I have poor English writing skills. Sorry. :(
'Magenta' is Python script, which are made to crash PocketMine-MP servers, exactly PocketMine-Raklib.
To understand this, you should know how Raklib's session system is working. Raklib creates every session per IP/Port to manage each clients, and these sessions are PHP objects.
They have many properties, such as $messageIndex
, $address
, $port
, etc. What we need to play with is $preJoinQueue[]
array. This contains MCPE DataPackets before a server-client handshake, and all stored packets will be processed after the connection process is completed. (See This)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @name VirtualInventories | |
* @main VirtualInventories\Loader | |
* @version 1.0.0 | |
* @api 1.12.0 | |
* @description Way to open virtual custom inventories | |
* @author iksaku | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This file is an example of a compressed plaintext plugin format for PocketMine | |
* It's aimed towards easy scripting, but not for normal plugin development. | |
* | |
* This kind of plugin won't be able to embed/load resources, | |
* nor have access to some features like fast permission/command integration. | |
* | |
* This first comment is used to define the properties like on plugin.yml, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace shoghicp\MinecraftSimulator\task; | |
use pocketmine\Player; | |
use pocketmine\scheduler\PluginTask; | |
use shoghicp\MinecraftSimulator\Loader; | |
class MarqueeTask extends PluginTask{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* One random row from table "tbl" */ | |
WITH RECURSIVE r AS ( | |
SELECT NULL::int AS id, min(id) AS min_id, max(id) AS max_id, 0 AS cnt | |
FROM tbl | |
UNION ALL | |
SELECT tbl.id, r.min_id, r.max_id, r.cnt + 1 | |
FROM r LEFT JOIN tbl | |
ON tbl.id = (SELECT floor(random() * (r.max_id - r.min_id + 1))::int) | |
WHERE r.id IS NULL | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$world = $this->getServer()->getDefaultLevel(); | |
$radius = 136; | |
$total = (($radius * 2) + 1) ** 2; | |
$count = 0; | |
$bList = clone \pocketmine\block\Block::$list; | |
$search = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dispatcher.registerCommand( | |
literal("scoreboard").then( | |
literal("players").then( | |
literal("reset").then( | |
argument("players", players()).then( | |
optional("objective", objective()) | |
).executes(SOME_COMMAND) | |
) | |
).then( | |
literal("list").then( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
for($K='Key',$_=range($i=$j=0,$n=255);$i<=$n;$j+=$_[$i]+ord($K{$i%strlen($K)}),_($_[$j&=$n],$_[$i++])); | |
for($j=$i=0;++$i;$j+=$_[$i&=$n],_($_[$j&=$n],$_[$i]),printf('%x',$_[($_[$i]+$_[$j])&$n])); | |
function _(&$i,&$j){$i=$j+$i-($j=$i);} |
NewerOlder