Skip to content

Instantly share code, notes, and snippets.

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 / 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
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
<?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 / 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 / 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 / bugs.md
Created August 18, 2014 21:17
Minecraft: PE v0.9.5 possible bugs

MovePlayerPacket sends weird yaw values

  • Step 1: Rotate the head in one direction multiple times
  • Step 2: Get MovePlayerPacket with yaw > 360, example: 6407.0166015625
  • This can cause rounding errors after too many rotations

NULL UpdateBlockPacket is sent by the client randomly

  • Step 1: ??? (happens in vanilla and PocketMine)
  • Step 2: Get an UpdateBlockPacket with x, y, z, blockId, blockData all 0 (null)
  • This packet is not meant to be sent by clients, it's only Server -> Client
@shoghicp
shoghicp / bugs.md
Created August 18, 2014 21:17
Minecraft: PE v0.9.5 possible bugs

MovePlayerPacket sends weird yaw values

  • Step 1: Rotate the head in one direction multiple times
  • Step 2: Get MovePlayerPacket with yaw > 360, example: 6407.0166015625
  • This can cause rounding errors after too many rotations

NULL UpdateBlockPacket is sent by the client randomly

  • Step 1: ??? (happens in vanilla and PocketMine)
  • Step 2: Get an UpdateBlockPacket with x, y, z, blockId, blockData all 0 (null)
  • This packet is not meant to be sent by clients, it's only Server -> Client
@shoghicp
shoghicp / bugs.md
Created August 18, 2014 21:19
Minecraft: PE v0.9.5 possible bugs

MovePlayerPacket sends weird yaw values

  • Step 1: Rotate the head in one direction multiple times
  • Step 2: Get MovePlayerPacket with yaw > 360, example: 6407.0166015625
  • This can cause rounding errors after too many rotations

NULL UpdateBlockPacket is sent by the client randomly

  • Step 1: ??? (happens in vanilla and PocketMine)
  • Step 2: Get an UpdateBlockPacket with x, y, z, blockId, blockData all 0 (null)
  • This packet is not meant to be sent by clients, it's only Server -> Client
@shoghicp
shoghicp / bugs.md
Created August 18, 2014 21:29
Minecraft: PE v0.9.5 possible bugs

MovePlayerPacket sends weird yaw values

  • Step 1: Rotate the head in one direction multiple times
  • Step 2: Get MovePlayerPacket with yaw > 360, example: 6407.0166015625
  • This can cause rounding errors after too many rotations

NULL UpdateBlockPacket is sent by the client randomly

  • Step 1: ??? (happens in vanilla and PocketMine)
  • Step 2: Get an UpdateBlockPacket with x, y, z, blockId, blockData all 0 (null)
  • This packet is not meant to be sent by clients, it's only Server -> Client

Keybase proof

I hereby claim:

  • I am shoghicp on github.
  • I am shoghicp (https://keybase.io/shoghicp) on keybase.
  • I have a public key whose fingerprint is 7E68 21B8 74F3 325D D2CD 2719 BD68 8354 33DA BBE5

To claim this, I am signing this object: