Git Product home page Git Product logo

pocketvote's Introduction

PocketVote

Get help or talk to developers on Discord!

PocketVote is a middleman service for both Minecraft Server Lists and Minecraft Server Owners. It aims to drastically better how voting is done on MCPE. Gone is the days of old.

PocketVote is completely free to use, however any donations to cover the operational costs of PocketVote is gladly accepted.

You can send Bitcoin (BTC) to the following address to support PocketVote: 3QC8XUfjXQSMg4CKvvQdscMPQts5wxM9su

How it works, the easy version.

I am a server owner:

  1. Register at PocketVote.io/register.

  2. Add a server at PocketVote.io/servers by clicking the add server button.

  3. Click Show Secrets and copy your secret.

  4. Go to one of the supported sites

  5. When prompted for your secret, provide the secret you got at PocketVote.io.

  6. Download one of the official plugins at PocketVote.io.

  7. Use the identity generated at PocketVote.io/dashboard/servers and follow the plugin instructions on how to utilize the identity.

Instructions for PocketMine available here.

Please ensure that you only give your secret to sites you trust. If you for some reason need to reset your secret you can do so in the same place that you can view your secret.

I am a server list operator:

  1. Register at PocketVote.io/register and select “Server List Site” under I have a.

  2. Add a site at PocketVote.io/dashboard/sites/create.

  3. Go to PocketVote.io/dashboard/sites.

  4. Click Show Secrets.

  5. Take note of the JWT secret and Identity header.

  6. Look at How it works, the developer version.

How it works, the developer version.

Server list operators:

Make yourself familiar with JWT.io as you will need to understand it. It supports most languages available, so don’t feel required to write your POST in one specific language.

In this example I will be using node-jsonwebtoken. You can install it by typing

npm install jsonwebtoken

For use with PocketVote we will be utilizing standard HMAC SHA256 so you can do the following:

var jwt = require('jsonwebtoken');
var token = jwt.sign({ player: 'Steve', ip: '127.0.0.1', server: SECRET_YOU_GOT_FROM_SERVER_OWNER}, JWT_SECRET_YOU_GOT_FROM_POCKETVOTE);

Your token is now ready to be sent. Make sure you send the token parameter with the name token.

When sending a request to PocketVote, you need to make sure that the target address is https://api.pocketvote.io/vote failure to do so will reject your request. The method also has to be POST.

In order to identify you, you’ve been given a UUID by PocketVote.io, please add this to your HTTP headers with the key Identity

Do note that if your JWT library does not automatically insert a timestamp (iat) then you must do this yourself.

If you see “success”, you’re all golden.

 

Plugin developers:

To run your code when a vote is registered simply listen to the VoteEvent. You can get the IP, player name or site name through the event object.

Supported Sites

If you own a server listing that supports PocketVote, open a Github Issue and we’ll get you added to the list.

Support on Beerpay

Hey dude! Help me out for a couple of 🍻!

Beerpay Beerpay

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.