├── POCKETMINE.md └── README.md /POCKETMINE.md: -------------------------------------------------------------------------------- 1 | PocketMine Plugin Documentation 2 | =============================== 3 | 4 | This file is continuously updated. If you feel something is missing or 5 | incorrect, please open an issue. 6 | 7 | Commands 8 | ======== 9 | 10 | | Command | Permission | Description | 11 | |---------------------------------|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| 12 | | /vote | pocketvote.vote | Shows the MCPE.guru voting link associated with the server. | 13 | | /vote top | pocketvote.vote | Shows the top voters the past month. | 14 | | /pocketvote identity [identity] | pocketvote.admin | This sets your plugin’s identity to the one you provided. Get your server’s identity from the server dashboard at pocketvote.io. | 15 | | /pocketvote secret [secret] | pocketvote.admin | This sets your plugin’s secret to the one you provided. Get your server’s secret from the server dashboard at pocketvote.io. | 16 | | /pocketvote cmd list | pocketvote.admin | Lists the commands that will run when a player votes. | 17 | | /pocketvote cmd add [command] | pocketvote.admin | Adds a command that is ran when a player votes. The following variables can be used in the command and will be replaced by the correct data: **%player**, **%ip** and **%site**. *Note that this command runs immediately as a player votes, regardless of whether they are online or not.* | 18 | | /pocketvote cmd remove [id] | pocketvote.admin | Removes the specified command. Use ‘cmd list’ to find the command id. | 19 | | /pocketvote cmdo list | pocketvote.admin | Lists the commands that will run when a player votes and is online. | 20 | | /pocketvote cmdo add [command] | pocketvote.admin | Adds a command that is ran when a player votes and is online. The following variables can be used in the command and will be replaced by the correct data: **%player**, **%ip** and **%site**. *Note that this command runs only when the player is online! If they are not online while voting this command will not run until they log on.* | 21 | | /pocketvote cmdo remove [id] | pocketvote.admin | Removes the specified command. Use ‘cmdo list’ to find the command id. | 22 | | /pocketvote link [name] | pocketvote.admin | Attempts to set your MCPE.guru link to the provided name. Your link will look something like this mcpe.guru/[name]. | 23 | | TODO: MCPE.guru commands! | | | 24 | 25 | Configuration 26 | ============= 27 | 28 | | Key | Description | 29 | |-----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| 30 | | version | Used to track how the configuration should be altered in order to be completely up to date. | 31 | | identity | The identity given to you from [PocketVote.io](https://pocketvote.io) which is used to identify your server. | 32 | | secret | The secret given to you from [PocketVote.io](https://pocketvote.io) which is given to voting sites. | 33 | | lock | If set to true, the commands to alter secret or identity is disabled. | 34 | | vote-expiration | An amount of time to keep votes that have not been redeemed by a player, specified in **days**. | 35 | | multi-server.enabled | If set to true, PocketVote will allow you to sync votes across multiple servers by using MySQL as the backend. | 36 | | multi-server.role | If set to ‘master’ the server will talk to the PocketVote servers and store voting information in the MySQL database. If set to ‘slave’ the server will not talk to the PocketVote servers but instead check the specified MySQL server for pending votes. | 37 | | multi-server.mysql.host | The hostname of your MySQL server. | 38 | | multi-server.mysql.port | The port of your MySQL server. | 39 | | multi-server.mysql.username | The username of your MySQL server. | 40 | | multi-server.mysql.password | The password of your MySQL server. | 41 | | multi-server.mysql.database | The database name of your MySQL server. | 42 | | onvote.run-cmd | A list of commands that are to be ran immediately as a vote is retrieved. The following variables can be used in the commands: %player, %site, %ip. | 43 | | onvote.online-cmd | A list of commands that are to be ran as soon as the target player is online. The following variables can be used in the commands: %player, %site, %ip. | 44 | | votes | A list of votes waiting for players to log on. Please leave this alone. | 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | PocketVote 2 | ========== 3 | 4 | [Get help or talk to developers on Discord!](https://discord.gg/B4WHSSq) 5 | 6 | PocketVote is a middleman service for both Minecraft Server Lists and Minecraft 7 | Server Owners. It aims to drastically better how voting is done on MCPE. Gone is 8 | the days of old. 9 | 10 | PocketVote is completely free to use, however any donations to cover the operational costs of PocketVote is gladly accepted. 11 | 12 | *You can send Bitcoin (BTC) to the following address to support PocketVote: **3QC8XUfjXQSMg4CKvvQdscMPQts5wxM9su*** 13 | 14 | How it works, the easy version. 15 | =============================== 16 | 17 | **I am a server owner:** 18 | 19 | 1. Register at [PocketVote.io/register](https://pocketvote.io/register). 20 | 21 | 2. Add a server at 22 | [PocketVote.io/servers](https://pocketvote.io/servers/create) by clicking the add server button. 23 | 24 | 3. Click *Show Secrets* and copy your secret. 25 | 26 | 4. Go to one of the [supported sites](#supported-sites) 27 | 28 | 5. When prompted for your secret, provide the secret you got at PocketVote.io. 29 | 30 | 6. Download one of the official plugins at 31 | [PocketVote.io](https://pocketvote.io/#services). 32 | 33 | 7. Use the identity generated at 34 | [PocketVote.io/dashboard/servers](https://pocketvote.io/dashboard/servers) 35 | and follow the plugin instructions on how to utilize the identity. 36 | 37 | [Instructions for PocketMine available 38 | here](https://github.com/ProjectInfinity/PocketVote/blob/master/POCKETMINE.md)*.* 39 | 40 | Please ensure that you **only** give your secret to sites you trust. If you for 41 | some reason need to reset your secret you can do so in the same place that you 42 | can view your secret. 43 | 44 | **I am a server list operator:** 45 | 46 | 1. Register at [PocketVote.io/register](https://pocketvote.io/register) and 47 | select “Server List Site” under *I have a*. 48 | 49 | 2. Add a site at 50 | [PocketVote.io/dashboard/sites/create](https://pocketvote.io/dashboard/sites/create). 51 | 52 | 3. Go to 53 | [PocketVote.io/dashboard/sites](https://pocketvote.io/dashboard/sites). 54 | 55 | 4. Click *Show Secrets*. 56 | 57 | 5. Take note of the [JWT](http://jwt.io) secret and Identity header. 58 | 59 | 6. Look at [How it works, the developer 60 | version.](#how-it-works-the-developer-version) 61 | 62 | How it works, the developer version. 63 | ==================================== 64 | 65 | **Server list operators:** 66 | 67 | Make yourself familiar with [JWT.io](https://jwt.io/) as you will need to 68 | understand it. It supports most languages available, so don’t feel required to 69 | write your POST in one specific language. 70 | 71 | In this example I will be using 72 | [node-jsonwebtoken](https://github.com/auth0/node-jsonwebtoken). You can install 73 | it by typing 74 | 75 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 76 | npm install jsonwebtoken 77 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 78 | 79 | For use with PocketVote we will be utilizing standard HMAC SHA256 so you can do 80 | the following: 81 | 82 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 83 | var jwt = require('jsonwebtoken'); 84 | var token = jwt.sign({ player: 'Steve', ip: '127.0.0.1', server: SECRET_YOU_GOT_FROM_SERVER_OWNER}, JWT_SECRET_YOU_GOT_FROM_POCKETVOTE); 85 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 86 | 87 | Your token is now ready to be sent. Make sure you send the token parameter with 88 | the name *token*. 89 | 90 | When sending a request to PocketVote, you need to make sure that the target 91 | address is **https://api.pocketvote.io/vote** failure to do so will reject your 92 | request. The method also has to be **POST**. 93 | 94 | In order to identify you, you’ve been given a UUID by PocketVote.io, please add 95 | this to your HTTP headers with the key **Identity** 96 | 97 | Do note that if your JWT library does not automatically insert a timestamp (iat) 98 | then you **must** do this yourself. 99 | 100 | If you see “success”, you’re all golden. 101 | 102 |   103 | 104 | **Plugin developers:** 105 | 106 | To run your code when a vote is registered simply listen to the **VoteEvent**. 107 | You can get the IP, player name or site name through the event object. 108 | 109 | Supported Sites 110 | =============== 111 | 112 | If you own a server listing that supports PocketVote, open a [Github 113 | Issue](https://github.com/ProjectInfinity/PocketVote/issues/new) and we’ll get 114 | you added to the list. 115 | 116 | - [Minecraftlist.org](https://minecraftlist.org/) 117 | 118 | - [minecraftpocket-servers.com](http://minecraftpocket-servers.com) 119 | 120 | - [Minecraft-PE-Servers.com](https://minecraft-pe-servers.com) 121 | 122 | - [MinecraftPE-Servers.com](https://minecraftpe-servers.com/) 123 | 124 | ## Support on Beerpay 125 | Hey dude! Help me out for a couple of :beers:! 126 | 127 | [![Beerpay](https://beerpay.io/ProjectInfinity/PocketVote/badge.svg?style=beer-square)](https://beerpay.io/ProjectInfinity/PocketVote) [![Beerpay](https://beerpay.io/ProjectInfinity/PocketVote/make-wish.svg?style=flat-square)](https://beerpay.io/ProjectInfinity/PocketVote?focus=wish) --------------------------------------------------------------------------------