
In the next day I am adding a feature that will allow players to vote IN GAME simply by typing /vote. The vote will be sent back to the list site vote page for that server and the vote can then be recorded. A "key" will be generated by the plugin that should be used to authenticate the votes.
More details to follow.
I have released 2 versions of the plugin.. these are BETA releases!
One for 1.6.4-1.7.2 and one for 1.2.5 (Tekkit)
Please report any difficulties.
It will be RE STARTED now!!!!
IF YOU HAVE A LIST ENGINE AND WANT TO IMPLEMENT THIS PLUGIN: Send me a message and I will be happy to help you put the vote page together.
As we all know, Votifier is pretty much outdated and dead.. It is unstable and unreliable. Recently I was contacted to either fix the old one or make a new one. I opted to make a new version, that is easier to use, more verbose and very easy to implement.
A few people have expressed concern about not using AES and only using a password. If you do as well ask yourself what exactly is that encryption is protecting. The answer is nothing important. Aside from encrypting pointless data the AES encryption of the old votifier acted as sort of an authentication system for votes.
For both of those roles it was overkill and pointless, but for the old version it was needed because the old version did not protect itself from false votes, in fact if a player managed to get the public key they could vote as much as they wanted to.
So in this plugin the simple password does nothing more than authenticate an actual vote, as much as it can, and honestly it really is not needed. This plugin protects itself with an authentication system and a time based vote rule, which you can read about below.
I have also been told that this program is a possible exploit for bad voting or vote flooding. To those who think that let me assure you that ANY public IP with a listener of any sort, thats exposed to the cloud is or can be a target, just like the game server/port.
This plugin will NOT accept votes on a server for any player that has not played, so trying to flood it with fake names won't work.
When the protection is on it will reject all votes that have not waited the hours required for a new vote, they are also simply rejected.
In other words can this IP/Port be attacked.. well YES just like any other public IP/Port. It is no more or less vulnerable than any other.
Encryption is POINTLESS.. What are you trying to hide? A username seriously....?
Anyway thats all for now, if you have more question feel free to PM me or post them below in the comments.
I have also implemented a verbose response system so server lists can get detailed information about the vote as well as modes in which to send the vote.
[For listing site owners]
packet structure [mode:vote_site:player_name:password] as string.
You build the packet from strings. There is no set length however all four parts must be present, and separated with a colon(:)
Example Vote Packet
"normal:pixelmonservers.info:boduzapho:MyStr0ngpa55w0rd"
There is much more and I will add to this later. The plugin is almost done testing and when i release it Ill will provide code samples for the following languages to use it (Its less complicated and less code than the old Votifier scripts):
Also Database integration is VERY simple to do.
Thats all for now I will be adding more later.
If you want to help the community by sending me a conversion of the code below to PHP, that would be very helpful! Also conversion to any other relative languages would be very helpful as well.
In these examples, IP.Text and IPPort.Text are variables that represent the IP/Port to send the vote to. You can easily pass them to these functions as parameters or use a Public Variable in their place.
THESE EXAMPLES WERE A DIRECT CONVERSION!
YOU WILL OBVIOUSLY HAVE TO CHANGE SOME OF THE CODE BELOW, IT IS HERE TO GET YOU STARTED!
Vote.Click += SendVote; public void SendVotesender, EventArgs e { byte[] bytes = new byte[1025]; IPAddress ipAddress = ipAddress.Parse(IP.Text); IPEndPoint remoteEP = new IPEndPoint(ipAddress, IPPort.Text); Socket sender = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); try { sender.Connect(remoteEP); byte[] msg = Encoding.ASCII.GetBytes(IPsend.Text.Trim + Environment.NewLine); int bytesSent = sender.Send(msg); int bytesRec = sender.Receive(bytes); Session("RES") = Encoding.ASCII.GetString(bytes, 0, bytesRec); sender.Shutdown(SocketShutdown.Both); sender.Close(); } catch (Exception ex) { Session("RES") = "Failed to connect, Check the settings for IP and Port."; } }
private Vote.Click += SendVote; public final void SendVotesender, EventArgs e { byte[] bytes = new byte[1025]; IPAddress ipAddress = ipAddress.Parse(IP.Text); IPEndPoint remoteEP = new IPEndPoint(ipAddress, IPPort.Text); Socket sender = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); try { sender.Connect(remoteEP); byte[] msg = Encoding.ASCII.GetBytes(IPsend.Text.Trim + Environment.NewLine); int bytesSent = sender.Send(msg); int bytesRec = sender.Receive(bytes); Session("RES") = Encoding.ASCII.GetString(bytes, 0, bytesRec); sender.Shutdown(SocketShutdown.Both); sender.Close(); } catch (RuntimeException ex) { Session("RES") = "Failed to connect, Check the settings for IP and Port."; } }
Public Sub SendVote() Dim bytes(1024) As Byte Dim ipAddress As IPAddress = ipAddress.Parse(IP.Text) Dim remoteEP As New IPEndPoint(ipAddress, IPPort.Text) Dim sender As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) Try sender.Connect(remoteEP) Dim msg As Byte() = Encoding.ASCII.GetBytes(IPsend.Text.Trim & vbNewLine) Dim bytesSent As Integer = sender.Send(msg) Dim bytesRec As Integer = sender.Receive(bytes) Session("RES") = Encoding.ASCII.GetString(bytes, 0, bytesRec) sender.Shutdown(SocketShutdown.Both) sender.Close() Catch ex As Exception Session("RES") = "Failed to connect, Check the settings for IP and Port." End Try End Sub
If you wish to beta test, you will need a Bukkit 1.6.2-1.6.4 Bukkit server or a compatible Forge or MCPC+ server.
For sending a vote you have TWO options.
1. Build a send vote page using the code above
2. Visit http://pixelmonservers.info/V2.aspx and use the public test form.
Normal vote: "normal:Pixelmonservers.info:boduzapho:w3s0m3pa55w0rd"
Test Vote "test:Pixelmonservers.info:boduzapho:w3s0m3pa55w0rd"
These are the format the plugin expects. There is no length requirement, but the syntax IS VERY important!!
It is four strings separated by colons{:} mode:server:name:password
Be sure the password you send matches the config file password.
ip: 192.168.1.33 port: '8192' password: w3s0m3pa55w0rd protect: 1 debug: true Sentury: 60
simply add console commands, one per line and use <NAME> where the players name would be.
say <NAME> thanks for your vote! give <NAME> 264 2 eco give <NAME> 100
You will need to use the test site to send votes or build your own. Vote Test Page