Skip to content

Instantly share code, notes, and snippets.

@shoghicp
shoghicp / threads.md
Last active August 29, 2015 14:02
PocketMine-MP Alpha_1.4 Threads

PocketMine-MP Alpha_1.4 Threads

default RCONInstance threads: 1

default AsyncTask Workers: 3

  • (0) Main thread
  • (1) MainLogger [sleeping]
  • (2) CommandReader [sleeping]
  • (3) RakLib networking
@shoghicp
shoghicp / improvements.md
Last active August 16, 2020 19:11
Improvements to External Server adding on Minecraft: PE

As the MCPE team said, they don't want young people find External servers easily. They are a non-controlled area for parents, and would increase the rating of the app (meaning... not recommended for young people). So, there is no problem in making it easier to join servers to the people that want to, while other people will just play the same, right?

Adding Direct Connect, without the list

One way to do so is improving the "Add External Server" screen. Lots of people don't want to have a big list. This can be solved adding a Connect button just below the Add Server button.

Removing defaults

When you add the server details, you have to delete the 127.0.0.1 default value for the Address. The Port one is filled too, but that is mostly unchanged. Just leaving Address empty makes it easier.

URL Protocol

@shoghicp
shoghicp / list.md
Last active August 29, 2015 14:00
Tech things done by Mojang for Minecraft: Pocket Edition

These are a few things requested to Mojang, or the developer themselves, or we were told that they added this.

Done / Confirmed

Thing done Version Notes
Play -> Edit -> External menu 0.7.4
Fix protocol inconsistencies MCPE-6865 0.9.0
@shoghicp
shoghicp / 0.9.0_stream.md
Last active March 15, 2017 04:36
Minecraft Pocket Edition 21 million Panel
#!/bin/sh
POCKETMINE_PATH="/home/user"
START_OPTS="--start --background --exec /bin/bash '$POCKETMINE_PATH/start.sh'"
STOP_OPTS="--stop"
test -x $DAEMON || exit 0
set -e
<?php
class PocketMineInstance extends Thread{
public $cwd;
public $args;
public function __construct($workingDirectory, $args){
$this->cwd = realpath($workingDirectory) . "/";
$this->args = $args;
$this->start(PTHREADS_INHERIT_NONE);
@shoghicp
shoghicp / namespacer.php
Last active August 29, 2015 13:57
Tool used on PocketMine-MP to autogenerate Namespace use importing, with automatic collision detection. Abuses PCRE
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*

This test shows the difference of sending 16x16 full chunks on the server when using no compression, or using different deflate levels.

Settings:

  • enable-advanced-cache=off
  • max-chunks-per-second=7

The max sending speed is bound by the max-chunks-per-second setting. This test doesn't measures the time used to decompress and parse the chunks by the client. The send time measures the time taken to send all the chunks (send packets, receive ACK, resend lost packets).

| DEFLATE level | UP kB/s | CPU usage | send time |

@shoghicp
shoghicp / seeds.php
Last active March 7, 2017 18:55
Seed guesser, generator, unwrapper and compressor for Minecraft - idea by jocopa3, rewrote by shoghicp
<?php
//Seed guesser for Minecraft - idea by jocopa3, rewrote by shoghicp
//Implements modified binary search
//Unwrapping only works for targets of 7 characters
define("RANGE_MIN", 0x21);
define("RANGE_MAX", 0x7e);
define("MAX_LENGTH", 6);
@shoghicp
shoghicp / Explode.php
Last active December 22, 2015 12:49
Explode Plugin. Usage: /explode [power]
<?php
/*
__PocketMine Plugin__
name=Explode
description=Create an explosion
version=0.2
author=shoghicp
class=ExplodePlugin
apiversion=10