Giter Site home page Giter Site 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

pocketvote's People

Contributors

gitter-badger avatar projectinfinity avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pocketvote's Issues

Cant start up PocketVote

I downloaded the plugin from poggit.pmmp.io and once i put in my key and identity, i keep getting this error: [14:57:27] [Server thread/CRITICAL]: ErrorException: "yaml_parse(): parsing error encountered during parsing: did not find expected ',' or ']' (line 17, column 17), context while parsing a flow sequence (line 17, column 12)" (EXCEPTION) in "src/pocketmine/utils/Config" at line 181

Gulist crashing server

PocketMine-MP Crash Dump Thu Sep 5 14:33:42 UTC 2019

Error: Invalid argument supplied for foreach()
File: plugins/PocketVote-PocketMine.phar/src/ProjectInfinity/PocketVote/task/guru/GetLinksTask
Line: 61
Type: ErrorException

THIS CRASH WAS CAUSED BY A PLUGIN
BAD PLUGIN: PocketVote v3.0.1

Full crash report link:
Safari - Sep 5, 2019 at 11:01 AM.pdf

How do players vote?

I have installed everything but how exactly do my players vote for my server?
Is there a command?
I dont even see anything as loaded in my web console..
https://pocketvote.io/#services; says it supports pocketmine 1.2???1.6
Genisys dev416

is this another Nukkit plugin only?

/guadd

Whenever I try to use /guess it said server not found. Does anyone know what this means?

I cant add server

I type in FmFactions as name 127.0.0.1 as ip and 19132 as adress and hit add it doesnt show my server

Vote processed twice

votes are getting processed twice whenever the player is not logged in while voting.

---
dev: false
version: 4
identity: id
secret: sec
lock: true
vote-expiration: 7
multi-server:
  enabled: false
  role: master
  mysql:
    host: 127.0.0.1
    port: 3306
    username: vote
    password: f
    database: Votes
onvote:
  run-cmd: []
  online-cmd:
  - say §2The player §e§l%player§r §2voted with §r§b/vote§r §2and got §612 diamonds,
    10 obsidian and $5.000!
  - givemoney "%player" 5000
  - give "%player" 264 12
  - give "%player" 49 10
  - give "%player" 364 16
  - key common 4 "%player"
  - key uncommon 1 "%player"
votes:

Internal Server Error

I run a leet.cc server and I follow the instructions on the app word for word and as soon as I cast a vote and log back in, I'm constantly getting an internal error preventing me from logging in and making me roll back the server.

/vote top command lists voters in alphabetical order rather than top voters

I would expect the /vote top command to list the top voters e.g.
tom (100)
dick (75)
harry (44)
etc.

But the command returns an alphabetically sorted "top 10" as follows (names truncated for privacy)
vote top�=> 16:06:37 [INFO ] ### Current top 10 voters ###
16:06:37 [INFO ] 1. "App## (5)
16:06:37 [INFO ] 2. “ND m## (6)
16:06:37 [INFO ] 3. aall## (12)
16:06:37 [INFO ] 4. Abid## (6)
16:06:37 [INFO ] 5. AceL## (5)
16:06:37 [INFO ] 6. Adri## (5)
16:06:37 [INFO ] 7. Adva## (10)
16:06:37 [INFO ] 8. Aide## (9)
16:06:37 [INFO ] 9. Aide## (34)
16:06:37 [INFO ] 10. Ajs1## (36)

Server Crash TopVoterTask

Error: Cannot use object of type stdClass as array
File: plugins/PocketVote-PocketMine.phar/src/ProjectInfinity/PocketVote/task/TopVoterTask
Line: 57
Type: Error

THIS CRASH WAS CAUSED BY A PLUGIN
BAD PLUGIN: PocketVote v3.0.1

Code:
[48]
[49] public function onCompletion(Server $server): void {
[50] if(!$this->hasResult()) {
[51] $server->getLogger()->error('[PocketVote] TopVoterTask - Failed to retrieve top voters. Try again later.');
[52] return;
[53] }
[54]
[55] $result = $this->getResult();
[56]
[57] if(!$result['success'] && isset($result['error'])) {
[58] $server->getLogger()->error('[PocketVote] TopVoterTask - An error occurred while contacting the PocketVote servers, please try again later.');
[59] $server->getLogger()->error('[PocketVote] curl error occurred during TopVoterTask: '.$result['error']);
[60] return;
[61] }
[62]
[63] if(!$result['success']) {
[64] $server->getLogger()->error('[PocketVote] TopVoterTask - An error occurred while contacting the PocketVote servers, please try again later.');
[65] return;
[66] }
[67]

Backtrace:
#0 src/pocketmine/scheduler/AsyncPool(304): ProjectInfinity\PocketVote\task\TopVoterTask->onCompletion(object pocketmine\Server)
#1 src/pocketmine/Server(2384): pocketmine\scheduler\AsyncPool->collectTasks()
#2 src/pocketmine/Server(2143): pocketmine\Server->tick()
#3 src/pocketmine/Server(1990): pocketmine\Server->tickProcessor()
#4 src/pocketmine/Server(1584): pocketmine\Server->start()
#5 src/pocketmine/PocketMine(273): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[20] /root/PocketMine-MP/, string[28] /root/PocketMine-MP/plugins/)
#6 src/pocketmine/PocketMine(296): pocketmine\server()
#7 (11): require(string[75] phar:///root/PocketMine-MP/PocketMine-MP.phar/src/pocketmine/PocketMine.php)

PocketMine-MP version: 3.12.0 [Protocol 390]
Git commit: 77d45bf11674a1360f58e32a14a3b09f423d860c
uname -a: Linux localhost 5.3.0-40-generic #32-Ubuntu SMP Fri Jan 31 20:24:34 UTC 2020 x86_64
PHP Version: 7.3.14
Zend version: 3.3.14
OS : Linux, linux

how to use

i read the instructions and registed my server on https://minecraftpocket-servers.com/ and there was no where to put the secret that pocketvote provided. also, is there /vote command in game to confirm the vote? for identifier, do i put that in identity: ''? for secret: '', do i put the secret that the web gave me? The Copy and paste this secret into server lists:

After doing /guadd and i add the link it dosn't work

When I do /guadd to add the link from the server list it doesn't work. It says that the API says its an invalid link. I tried countless times to do this with different links and varients but it doesn't work. Please help me.

Error

[16:08:19] [Server thread/CRITICAL]: Could not execute task ProjectInfinity\PocketVote\task\SchedulerTask: Undefined property: ProjectInfinity\PocketVote\PocketVote::$identity

[16:08:19] [Server thread/CRITICAL]: ErrorException: "Undefined property: ProjectInfinity\PocketVote\PocketVote::$identity" (EXCEPTION) in "PocketVote-PocketMine.phar/src/ProjectInfinity/PocketVote/task/SchedulerTask" at line 20

Add API for overall votes

It would really be great for this feature to be added. Apart from showing the top voters, you also get to know how many votes the server has.

Issue with link

Hi, whenever someone types /vote and goes to the guru link, it just forwards them to the pocketvote homepage. Please Help

Server Crash

PocketMine-MP Crash Dump Wed Feb 5 11:04:44 CET 2020

Error: Cannot use object of type stdClass as array
File: plugins/PocketVote-PocketMine.phar/src/ProjectInfinity/PocketVote/task/TopVoterTask
Line: 57
Type: Error

THIS CRASH WAS CAUSED BY A PLUGIN
BAD PLUGIN: PocketVote v3.0.1

Code:
[48]
[49] public function onCompletion(Server $server): void {
[50] if(!$this->hasResult()) {
[51] $server->getLogger()->error('[PocketVote] TopVoterTask - Failed to retrieve top voters. Try again later.');
[52] return;
[53] }
[54]
[55] $result = $this->getResult();
[56]
[57] if(!$result['success'] && isset($result['error'])) {
[58] $server->getLogger()->error('[PocketVote] TopVoterTask - An error occurred while contacting the PocketVote servers, please try again later.');
[59] $server->getLogger()->error('[PocketVote] curl error occurred during TopVoterTask: '.$result['error']);
[60] return;
[61] }
[62]
[63] if(!$result['success']) {
[64] $server->getLogger()->error('[PocketVote] TopVoterTask - An error occurred while contacting the PocketVote servers, please try again later.');
[65] return;
[66] }
[67]

Backtrace:
#0 src/pocketmine/scheduler/AsyncPool(304): ProjectInfinity\PocketVote\task\TopVoterTask->onCompletion(object pocketmine\Server)
#1 src/pocketmine/Server(2383): pocketmine\scheduler\AsyncPool->collectTasks()
#2 src/pocketmine/Server(2142): pocketmine\Server->tick()
#3 src/pocketmine/Server(1989): pocketmine\Server->tickProcessor()
#4 src/pocketmine/Server(1583): pocketmine\Server->start()
#5 src/pocketmine/PocketMine(274): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[16] /home/minecraft/, string[24] /home/minecraft/plugins/)
#6 src/pocketmine/PocketMine(297): pocketmine\server()
#7 (11): require(string[68] phar:///home/minecraft/pocketmine.phar/src/pocketmine/PocketMine.php)

PocketMine-MP version: 3.11.5 [Protocol 389]
Git commit: 13e4772f98fe665cc60ad2a2d2cde0eaaf1321b4-dirty
uname -a: Linux 879747f4f51b 4.19.0-0.bpo.6-amd64 #1 SMP Debian 4.19.67-2+deb10u1~bpo9+1 (2019-09-30) x86_64
PHP Version: 7.3.6
Zend version: 3.3.6
OS : Linux, linux

Crashes the server when someone votes

When I vote for my server it crashes the server when i log back in and after i relog it says you need to vote, please help me I want my server to be cool

Detail API Document

Hi, I'm developer of ElementZero (third-party server based on official bedrock dedicated server), and I want to develop a PocketVote mod for it, but I cannot found detail API document for that -- like api.pocketvote.io/v2/check etc..
So are there any existing documents and instructions now? I think that studying the existing PMMP and nukkit plugins is not a good idea, I may miss some important information from the source code

Warning console & Mysql (NULL) values

Hi, i've juste installed PocketVote v2.0.2 on PocketMin-MP (1.7dev API 3.0.0-ALPHA7) and i have some warning in console :

Warning: Attempt to modify property 'player' of non-object in phar:///home/root/mcpe/plugins/PocketVote-PocketMine_2.0.2.phar/src/ProjectInfinity/PocketVote/task/VoteCheckTask.php on line 98

Warning: Attempt to modify property 'ip' of non-object in phar:///home/root/mcpe/plugins/PocketVote-PocketMine_2.0.2.phar/src/ProjectInfinity/PocketVote/task/VoteCheckTask.php on line 98

Warning: Attempt to modify property 'site' of non-object in phar:///home/root/mcpe/plugins/PocketVote-PocketMine_2.0.2.phar/src/ProjectInfinity/PocketVote/task/VoteCheckTask.php on line 98

I juste check my database and in "pocketvote_table", i have an weird row :

    id  player  ip      site     timestamp  
------  ------  ------  ------  ------------
     1  (NULL)  (NULL)  (NULL)    1505138922

I think i've configured all things good, Is it normal?

Votes not working

The votes for my server on minecraftpocket-servers.com isnt going through to my games vote rewards. Ive put the secret and the id in the correct places on both the vote website and in my plugin-date, so im confused to why its not working.

Freezes server startup on Genisys

I added the plugin and updated the config with the secret and key when I start the server on Genisys it just hangs on this.

[12:56:40] [Server thread/INFO]: Enabling PeacefulSpawn v2.4
[12:56:40] [Server thread/INFO]: Enabling PocketVote v1.1.3

Won't go any further I waited for 5 minutes..

Login is broken

I created a new account, because I couldn't login to my old account. I logged out, and when I tryed to log in:

Error
Invalid credentials. Please check your email and password.

I'm login in with the exact same passwort and email, with wich I created the account. Why is this happening?

Vote System does not work.

I connected my PocketVote secret with minecraft-servers and I added the secret, identity, link ingame. So I tested it by voting, I waited for a while and nothing showed.
ip: orescapemc.ddns.net

Feature Request!

Could we please have a feature that would allow server owners to specify a TIME in which the VOTES would expire so that when someone connects after DAYS of not being online they will NOT be flooded with rewards.

I reckon a VALUE of DAYS should suffice for this as then we could expire the votes after 1,7,14 days

New Supported voting site

Hello, we have been talking on gitter. You said to open an issue :). My site is MinecraftPE-Servers.com

Regards,
Austin

My Servers Website

Wanted to report that the My servers section of the PocketVote Website isn't working.

Doesn't work with pmmp 3.8.4

[21:17:37] [Server thread/CRITICAL]: TypeError: "Return value of ProjectInfinity\PocketVote\PocketVote::getPlugin() must be an instance of ProjectInfinity\PocketVote\PocketVote, null returned" (EXCEPTION) in "plugins/PocketVote-PocketMine.phar/src/ProjectInfinity/PocketVote/PocketVote" at line 167
[21:17:37] [Server thread/DEBUG]: #0 plugins/PocketVote-PocketMine.phar/src/ProjectInfinity/PocketVote/task/VoteLinkTask(92): ProjectInfinity\PocketVote\PocketVote::getPlugin()
[21:17:37] [Server thread/DEBUG]: #1 src/pocketmine/scheduler/AsyncPool(319): ProjectInfinity\PocketVote\task\VoteLinkTask->onCompletion(object pocketmine\Server)
[21:17:37] [Server thread/DEBUG]: #2 src/pocketmine/scheduler/AsyncPool(353): pocketmine\scheduler\AsyncPool->collectTasks()
[21:17:37] [Server thread/DEBUG]: #3 src/pocketmine/Server(2118): pocketmine\scheduler\AsyncPool->shutdown()
[21:17:37] [Server thread/DEBUG]: #4 src/pocketmine/Server(2310): pocketmine\Server->forceShutdown()
[21:17:37] [Server thread/DEBUG]: #5 src/pocketmine/Server(2238): pocketmine\Server->crashDump()
[21:17:37] [Server thread/DEBUG]: #6 src/pocketmine/Server(1776): pocketmine\Server->exceptionHandler(object Exception)
[21:17:37] [Server thread/DEBUG]: #7 src/pocketmine/PocketMine(266): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[16] /root/Minigames/, string[24] /root/Minigames/plugins/)
[21:17:37] [Server thread/DEBUG]: #8 (1): require(string[71] phar:///root/Minigames/PocketMine-MP.phar/src/pocketmine/PocketMine.php)
[21:17:37] [Server thread/EMERGENCY]: Crashed while crashing, killing process
Killed

Unknown SSL protocol error

I receive this error on my PocketMine server every so often.

Unknown SSL protocol error in connection to api.pocketvote.io:443
35

Help!

I can't login, because the passwort reset button doesn't work!

Password Help

For some reason My account doesn't get saved. When I try to login to my account ut says wrong credentials but I'm 100% sure my password was right so what do I do?

Help

Hello, when I go on mcpe.guru/(name of my server) I can not vote. There is no button. how should I do it ?

[Server thread/ ERROR]

Keep getting the serverthread/error for pocketvote saying "Votechecktask: Missing indentity"

What is it that i'm doing wrong?
Each identity is set for each server.

Spams my console with this

[21:53:18] [RakLibServer thread/NOTICE]: Blocked 45.79.134.18 for 5 seconds
[21:53:39] [RakLibServer thread/DEBUG]: Received garbage message from 45.79.134.18 45076 (Packet magic is invalid): 010000000100ffff00fefefefefdfdfdfd12345678
[21:53:39] [RakLibServer thread/DEBUG]: #0 /vendor/pocketmine/raklib/server/SessionManager(135): raklib\server\SessionManager->receivePacket()
[21:53:39] [RakLibServer thread/DEBUG]: #1 /vendor/pocketmine/raklib/server/SessionManager(127): raklib\server\SessionManager->tickProcessor()
[21:53:39] [RakLibServer thread/DEBUG]: #2 /vendor/pocketmine/raklib/server/SessionManager(103): raklib\server\SessionManager->run()
[21:53:39] [RakLibServer thread/DEBUG]: #3 /vendor/pocketmine/raklib/server/RakLibServer(220): raklib\server\SessionManager->__construct(raklib\server\RakLibServer object, raklib\server\UDPServerSocket object, integer 1492)
[21:53:39] [RakLibServer thread/DEBUG]: #4 (): raklib\server\RakLibServer->run()

Unable to view more then 3 gu.

When you use the command guadd to add your vote sites, if you have more than 3 sites added to your list you are unable to view with gulist.

Clarification, If you you have 4 in the list, you can only view the first 3 but not the fourth.
If the case is you have more than 3 then you can not view the ID for the 4th to delete or edit, so you have to delete number 3 to make number 4->3 to see the id.

Not necessarily a game changing bug, just a bit of an annoyance.

/pocketvote diagnose crashes server

The previous closed issue I didn't include the right log.

I added a link "PocketVote" Pocket.io which does populate Pocketvote.io when used in a browser but I'm still crashing with every "pocketvote diagnose"


27.07 15:35:02 [Server] Startup Done (0.336s)! For help, type "help" or "?"
27.07 15:35:03 [Server] Server thread/INFO [PocketVote] Voting link set to mcpe.guru/mineyourcraft
27.07 15:35:23 [Server] Server thread/INFO Scheduling a diagnosis...
27.07 15:35:23 [Server] Server thread/INFO ✔ Found server
27.07 15:35:23 [Server] Server thread/INFO ✖ Has votes (trivial)
27.07 15:35:23 [Server] Server thread/INFO ✔ Decode sample vote
27.07 15:35:23 [Server] Server thread/INFO A test vote will be dispatched momentarily. If more than a couple of minutes passes the dispatch has failed.
27.07 15:35:43 [Server] Server thread/CRITICAL ErrorException: "Undefined index: player-online" (EXCEPTION) in "plugins/PocketVote-PocketMine.phar/src/ProjectInfinity/PocketVote/VoteListener" at line 36
Sat_Jul_27-15.35.43-PDT_2019.log


pocketvote plugin wont work?

when im trying to get this plugin to work, it wont. There is no identity/identifier, and it isnt detecting the secret key even when i enter it in via console.
p4
p1
p2
p3

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.