- LegionPE Zekkou Cake new plugin
- After finishing this, I will start on a public API for all servers free to use (with credit). This API allows plugins to register subclasses of
Minigame
's as minigames and co-work with each other. - xEcon
- Factions
- PocketRealisticMulti
<?php | |
$web = 'index.php'; | |
if (in_array('phar', stream_get_wrappers()) && class_exists('Phar', 0)) { | |
Phar::interceptFileFuncs(); | |
set_include_path('phar://' . __FILE__ . PATH_SEPARATOR . get_include_path()); | |
Phar::webPhar(null, $web); | |
include 'phar://' . __FILE__ . '/' . Extract_Phar::START; | |
return; |
<?php | |
class HubPlugin extends PluginBase{ | |
public function onChat(PlayerChatEvent $event){ // if session is not self::HUB, monitor it. if session is self::HUB, prevent typing password here | |
$p = $event->getPlayer(); | |
if(($s = $this->sessions[$p->getID()]) < self::HUB or $s >= self::LOGIN){ // if not authed | |
$event->setCancelled(true); | |
} | |
elseif($this->getDb($p)->get("pw-hash") === $this->hash($event->getMessage())){ // if authed but is telling password | |
$event->setCancelled(true); | |
$p->sendMessage("Never talk loudly to others your password!"); |
The date MCPE 0.9.0 is released on iOS and Android is in July I think. PocketMine-MP Alpha_1.4 (Zekkou Cake) will be released not long (probably one or two days) after the release of 0.9.0
. Since 0.9.0
can only be connected with servers hosted with Zekkou Cake, we have to update our plugins to support Zekkou Cake. Our promise is at most one week after the release of Zekkou Cake, but as you know, bugs are never predictable and we may come into bugs that take days to solve.
Currently (14/6/2014), the basic structure of the new API plugin is finished and debugged except chat control, which hopefully will only take 3 to 4 hours to debug. Parkour is fully finished and believed to be stable and hopefully will take no more than 15 minutes to debug. Spleef is finished, but it is based on a proof of concept of spleef arena objects by @PEMapModder, so it may take one or two days to finish debugging, and in worst ccircumstances it may need to be rewrited, which
<?php | |
require_once(dirname(__FILE__)."/Table.php"); | |
$table = new \legendofmcpe\statscore\Table(dirname(__FILE__)."/table.txt"); | |
$table->set("test1", 0, "row one"); | |
$table->set("test2", 0, "row two"); | |
$table->set("test1", 1, true); | |
$table->set("test2", 1, "true"); | |
$table->save(); |
var others = [ | |
"sheep", | |
"pig", | |
"cow", | |
"chicken", | |
"zombie", | |
"skeleton", | |
"spider", | |
"creeper", | |
"zombie pigman", |
<?php | |
class BSFReader extends StringReader{ | |
public function readItem(){ | |
$data = unpack("nid/Cdamage/Ccount/Imetadata", $this->read()); | |
$count = $data["metadata"]; | |
$data["metadata"] = []; | |
for($i = 0; $i < $count; $i++){ | |
$key = $this->readString(2); | |
$data["metadata"][$key] = $this->readString(2); |
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( |
How to implement plugin permisisons (for all servers written in OOP languages with PocketMine-style API: commands, events, schedules) in code for access to API functions
The principle of this system is to make use of the characteristic of executing code on one thread - code flows single-direction - to identify what context (server or what plugin or what) the code is flowing to currently and decide whether the current context has permission to do something.
First, the server has to declare a class that extends a class called Context
and instantiate an object that has any permissions. The object serves as a lock and shall not be accessible by plugins. Every object that represents a plugin (but these objects must not be declared by the plugin) should have a context too. This is an example for the Context
class in Java:
import java.util.List;
public class Context{
- Basic KitPvP things
- Friends
-
W.I.P.
Shops, hopefully done at the end of January 2015 - Spleef, hopefully done in Feburary
- Infected; not sure when I will get it done, or when the map is ready
- KitPvP teams; we may as well extend this to Spleef and Infected too
- Parkour; no offense whoever created it but it didn't look promising to me. Anyway when I have enough time I will work on it if I have enough resources.