Implementing Dyno for PocketMine-MP
Create a Network system for PocketMine easily without AsyncTask and MySQL !
- DynoPM Version: 1.0
- For PocketMine-MP: 3.0.0
- Current Protocol: 1
- Config Version: 1.0
Download latest .phar here: Github Release
DynoPM needs Dyno to work
Download latest .phar and moved it to the PocketMine plugins folder
- DynoMail : Demo plugin for send Mail to player
- DynoNetworkCount : SOON
Documentation Page: Wiki
You can see more example code on the documentation!
public function onEnable()
{
DynoPM::getInstance()->addPluginSyncWithDynoDescription($this, $dynoDesc);
if (($this->dyno = DynoPM::getInstance()->getDynoByDescription($dynoDesc)) === null) {
$this->getServer()->getPluginManager()->disablePlugin($this);
return;
}
$this->getServer()->getLogger()->info("Plugin Started !");
}
$pk = new inputPacket();
$final = new inputPacketLib();
$final = $final
->createBase("Base Test", [
BaseOptionsInterface::ONLY_IF_BASE_NOT_EXIST
])
->createTable("Table Test", [
TableOptionsInterface::ONLY_IF_TABLE_NOT_EXIST
])
->getTable("Table Test")
->putBool("Bool !", true)
->putString("String !", "This is a string")
->finalInput();
$pk->input = $final;
$this->dyno->sendDataPacket($pk);
Configuration in config.yml
enabled: Enable DynoPM plugin or not
dynos:
- enabled: Enabled Dyno Client
ip: IP Dyno
port: Port Dyno
description: Description of your dyno (Allows to identify the DynoPM)
password: Dyno Password
With DynoPM you can create any kind of plugin using MySQL/YML, there is no limitation .
You do not have to use only dyno, you can use Mysql and Dyno. Dyno even has a function that automatically transfers the data sent to Dyno on Mysql and guarantees no lag on your PocketMine server.
This means that you can send multiple Information Packet per second without having to wait more than 2 seconds for an Asynchronous response.
You can look at the source of the example plugins.