All Projects → falkirks → Volt

falkirks / Volt

Licence: MIT license
A painless web server for PocketMine-MP

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to Volt

SAC
An AntiCheat software for PockeMine-MP made to detect unfair gamplay advantages.
Stars: ✭ 52 (+116.67%)
Mutual labels:  pocketmine, mcpe, pocketmine-mp, pocketmine-plugins
CommandShop
Players have to pay items or money to use specific commands! A PocketMine plugin.
Stars: ✭ 32 (+33.33%)
Mutual labels:  pocketmine, mcpe, pocketmine-mp, pocketmine-plugins
MineReset
Powerful mine resetting tool
Stars: ✭ 44 (+83.33%)
Mutual labels:  pocketmine, mcpe, pocketmine-plugins
BlockSniper
An advanced (brush) world editing plugin for PocketMine-MP
Stars: ✭ 77 (+220.83%)
Mutual labels:  pocketmine, pocketmine-mp, pocketmine-plugins
Emotes
This plugin allows players to use their favorite emotes on the server!
Stars: ✭ 15 (-37.5%)
Mutual labels:  pocketmine, mcpe, pocketmine-mp
InvSee
A PocketMine-MP plugin that lets you view and modify offline and online players' inventories in real-time!
Stars: ✭ 19 (-20.83%)
Mutual labels:  pocketmine, mcpe, pocketmine-mp
EggWars
EggWars minigame for PocketMine
Stars: ✭ 32 (+33.33%)
Mutual labels:  pocketmine, pocketmine-mp, pocketmine-plugins
Other-Plugins
A collection of all the plugins which I used to work on but no longer maintain
Stars: ✭ 26 (+8.33%)
Mutual labels:  pocketmine, pocketmine-mp, pocketmine-plugins
BuilderTools
🪓 Powerful World Editor plugin for PocketMine servers
Stars: ✭ 74 (+208.33%)
Mutual labels:  pocketmine, pocketmine-mp, pocketmine-plugins
VirionTools
A handy plugin for developers who wish to compile and inject virions without using Poggit.
Stars: ✭ 17 (-29.17%)
Mutual labels:  pocketmine, pocketmine-mp
Capital
An extensible economy API for PocketMine-MP.
Stars: ✭ 31 (+29.17%)
Mutual labels:  pocketmine, pocketmine-plugins
ProperDuels
A properly made duels plugin
Stars: ✭ 16 (-33.33%)
Mutual labels:  pocketmine, pocketmine-mp
MyPlot
Plot and protection plugin for PocketMine-MP
Stars: ✭ 101 (+320.83%)
Mutual labels:  pocketmine, pocketmine-mp
Pathfinding
A pmmp virion (library) for pathfinding using A*
Stars: ✭ 36 (+50%)
Mutual labels:  pocketmine, pocketmine-mp
MagicSpell
This plugin is remaking.
Stars: ✭ 22 (-8.33%)
Mutual labels:  pocketmine-mp, pocketmine-plugins
AdvanceDeaths
A plugin to customize the death messages!
Stars: ✭ 16 (-33.33%)
Mutual labels:  pocketmine, pocketmine-mp
CosmeticMenu
Fun and Easy-to-Use Pocketmine Cosmetics plugin. (Gadgets, Particles, Trails, etc)
Stars: ✭ 22 (-8.33%)
Mutual labels:  pocketmine, pocketmine-mp
devirion
Plugin used for debugging virions or plugins that use virions.
Stars: ✭ 35 (+45.83%)
Mutual labels:  pocketmine, pocketmine-plugins
PiggyAuth
Safe & feature-rich auth plugin. Project has been discontinued
Stars: ✭ 33 (+37.5%)
Mutual labels:  pocketmine, pocketmine-mp
MysteryBox
Crate implemention for PocketMine-MP (PMMP)
Stars: ✭ 19 (-20.83%)
Mutual labels:  pocketmine, pocketmine-mp

Volt Icon Volt

Formerly HTTPServer

Volt is an hyper-powerful integrated website solution for PocketMine. Driven by Handlebars and pthreads, volt is an extensive webserver. Volt's dependencies are managed using Miner.

What's changing in v3.0.0?

  • Name. HTTPServer is now volt. Why? I thought carefully about this one and I figured that "HTTPServer" did not represent the project correctly.
  • Threading. Volt is now better at threading. Every request is run by a worker in a pool. This allows multiple requests to be processed in parallel.
  • Templating. Now Volt is driven by Handlebars for high speeds and extreme customization.
  • API. The API has been entirely rewritten to be more fun to use. It is much more logical and powerful.

The /volt command

The /volt command allows interaction with the API and the server itself. It doesn't have many features right now, but I am always open to suggestions for new ones.

  • /volt api list - Will list plugins that are using the API
  • /volt api getsub - Will list what subscription every plugin on the server holds in the Volt API

Volt API

The API is still tentative and might undergo some large structural changes before its release, so don't get too attached to it. The API centralizes on WebsiteData objects which are magical objects that allow interaction with the server. These objects mimic arrays by implementing \ArrayAccess, \Countable, and \IteratorAggregate. The API also exposes DynamicPage for registering pages, ServerThread for direct interaction with the server and HandlebarsHelper for injecting code into handlebars.

API Security

API subscription levels

Volt's API will offer features which can cause harm to the PocketMine instance. For example, using a HandlebarsHelper can easily cause a segfault or a memory leak if not used correctly. In order to combat this, Volt provides an API subscription system. There are five subscription levels.

  • micro (Default) - DynamicPage and WebsiteData
  • deci- Not currently used
  • kilo - HandlebarsHelper
  • mega - ServerThread
  • peta - Not currently used

You can specify an API level to consume in the base class of your plugin using a doc comment on the class. You will have access to all lower levels as well. The following comment is used on the Volt main class

    /**
     * Class Volt
     * @package volt
     * @volt-api peta
     */
     class Volt extends PluginBase{

Note If you want to save space you can remove the first two lines of the comment.

Internal method protection

Some methods are protected by Volt for API security. If you attempt to access one of these you will get thrown an InternalMethodException.

API Identification

In an optimal setting you should identify yourself to Volt. This will allow Volt to create logs of your API usage. Identification is recommended for all interactions and is required for all interactions except WebsiteData. There are three options for identification

  • PluginBase (Recommended)
  • Plugin name
  • Auto-detect (Not recommended)
MonitoredWebsiteData
/* Option #1 (Recommended) */
$data = new \volt\api\MonitoredWebsiteData($this); //Called from within a PluginBase
/* Option #2 */
$data = new \volt\api\MonitoredWebsiteData("PluginName"); //Called from anywhere
/* Option #3 (Not recommended) */
$data = new \volt\api\MonitoredWebsiteData(); //Called from within a PluginBase, and requires class name to equal plugin name
DynamicPage
/* Option #1 (Recommended) */
$data = new \volt\api\DynamicPage("/page", $this); //Called from within a PluginBase
/* Option #2 */
$data = new \volt\api\DynamicPage("/page", "PluginName"); //Called from anywhere
/* Option #3 (Not recommended) */
$data = new \volt\api\DynamicPage("/page"); //Called from within a PluginBase, and requires class name to equal plugin name

If an identification request fails a volt\exception\PluginIdentificationException will be thrown.

Setting and getting values with WebsiteData or MonitoredWebsiteData

Once you have a WebsiteData object, you get a link to the global scope of handlebars variables. It is highly recommended to put all your variables in a namespace for your plugin, this helps avoid collisions.

$data = new \volt\WebsiteData(); //We are using anon
$data["foo"] = ["1", "2", "3"]; // not logged
var_dump($data["foo"]); // not logged
$data = new \volt\MonitoredWebsiteData($this); // We are using identified, $this is a \pocketmine\plugin\Plugin
$data["bar"] = ["1", "2", "3"]; // logged
var_dump($data["bar"]); // logged

Dynamic Page Registration with DynamicPage

To ease plugin installation, pages can be dynamically registered into Volt. This feature is still experimental and may be expanded upon in a future release.

$page = new \volt\api\DynamicPage("/hello", $this); // For second param see identified. 
$page("This is the content"); //Page is now available at /hello and will display "This is the content"

Handlebars Helpers with HandlebarsHelper

Helpers allow custom features to be added to the handlebars language. Helpers are callable and should be anonymous functions. Due to the threaded nature of Volt, helpers are unstable and can easily cause issues. In order to use helpers, you will need to set your @volt-api to kilo or higher.

Direct thread access with ServerThread

Sometimes the API doesn't cut it and you might need direct access the the server thread. You can do this using a ServerThread object. These objects will forward all function calls to the volt server. To use ServerThread, you will need to set your @volt-apito mega or higher.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].