Skip to content

Instantly share code, notes, and snippets.

Basic Authentication (BA)

All requests that require account authorization (i.e. to be "logged in") require a POST/GET field user and hash.

  • user is the username for the account. It is case-insensitive.
  • hash is the hashed form of the account's password. The account password can be calculated using the following algorithm:
CharSequence hash = bin2hex(whirlpool(password + uid) ^ sha512(uid + password))

FAQ for LegionPE Theta

What will be different?

Everything will become different. Our server will be splitted into multiple servers, each being one of the following types:

  • hub
  • classic
  • KitPvP
  • parkour
  • spleef
---
enchants:
- id: 1
name: oh
enchant: point twelve
- id: 2
name: oh point
enchant: thirteen point pi
...
<?php
$statement = false; // false; a lie
if($statement === true){ // if $statement is true
$fact = $statement; // the fact is exactly that statement.
}else{ // else, i.e. $statement is false
$fact = !$statement; // the fact is the opposite (NOT; !) of $statement
}
# Log generated by PacketLogger 1.1.0 in PocketMine-MP 1.5dev-245 for Minecraft: PE v0.11.0 alpha (protocol #27)
Player: pemapmodder, clientId 1697512888 from [/14.199.247.137:51550
Start time: 2015-07-17T07:37:21-04:00
[Server -> Client 0xaa] ContainerSetContentPacket (length 1276)
0000 aa 79 00 fe 00 04 01 00 00 00 62 01 00 00 00 62 .y........b....b
0010 01 00 01 00 62 01 00 02 00 62 01 00 03 00 30 01 ....b....b....0.
0020 00 00 00 05 01 00 00 00 05 01 00 01 00 05 01 00 ................
0030 02 00 05 01 00 03 00 05 01 00 04 00 05 01 00 05 ................
@PEMapModder
PEMapModder / theta ks changes.md
Created July 2, 2015 14:52
LegionPE Theta | Kill streak changes
  • Kill streaks will get saved over sessions, i.e. server restarts and client crashes (only if you don't get killed in the 10-second timeout!) will no longer reset your kill streaks.
  • Kill streaks will be reset if you haven't killed anyone over a certain period of time (period is yet to be confirmed, but probably like 20 seconds)
  • To avoid PvP logging and similar activities, kill streaks are going to be reset, if any of the following happens within 15 seconds after being attacked by a non-teammate and not killing anyone (not necessarily your attacker) before these happen:
    • Getting a teleport request accepted
    • Leaving the game
  • Requesting a transfer to another game
@PEMapModder
PEMapModder / todo-cmds.md
Last active January 25, 2016 13:09
Commands redo list
  • version
  • tell
  • ban // TODO deprecate and replace with backwards compatibility (advanced warnings)
  • pardon // TODO deprecate and replace with backwards compatibility (advanced warnings)
  • say
  • me
  • kick
  • give // TODO permissions
  • effect // TODO permissions
  • particle // TODO permissions
<?php
@define("STDIN", fopen("php://stdin", "rt"));
function query($query){
echo $query;
return trim(fgets($query));
}
function out($message){
echo date("[H:i:s] ") . $message . PHP_EOL;
}
function quit($message, $code = 2){
@PEMapModder
PEMapModder / index.php
Created June 15, 2015 07:47
Legion PE status generator, hosted at http://lgpe.co/status/
<?php
$begin = microtime(true);
const NORM = "/var/www/html/sgn/norm.ttf";
const BOLD = "/var/www/html/sgn/bold.ttf";
const X_INTERVAL = 6;
const LEFT_PADDING = 80;
const RIGHT_PADDING_24 = 325;
const RIGHT_PADDING_SLOTS = 350;
const TOP_PADDING = 100;
const BOTTOM_PADDING_24 = 80;
@PEMapModder
PEMapModder / SpleefArena.php
Created May 25, 2015 15:52
LegionPE plugin source code (spleef part only)
<?php
namespace legionpe\games\spleef;
use legionpe\config\Settings;
use pocketmine\inventory\PlayerInventory;
use pocketmine\item\Item;
use pocketmine\item\Snowball;
class SpleefArena{