Votifier plugin zelf gebruiken
Ik heb een Bukkit minecraft server die gebruik maakt van de plugin Votifier,
http://dev.bukkit.org/server-mods/votifier/
Kort uitgelegd word er informatie naar de server gestuurd, en die reageert daar vervolgens weer op met listeners.
mijn vraag is, hoe zend ik iets naar mijn eigen server toe? een vote request met een username. Inplaats van het gebruiken van een externe site zoals minestatus zou ik dit zelf willen doen. Ik heb het gevraagd aan de auteur van de plugin maar ik snap zijn antwoord niet helemaal, kunnen jullie me hierbij helpen? hieronder staat een documentatie, en wat de auteur tegen mij zij.
Dit is de documentatie:
Quote:
This documentation is for server lists that wish to add Votifier support.
A connection is made to the Votifier server by the server list, and immediately Votifier will send its version in the following packet:
"VOTIFIER <version>"
Votifier then expects a 256 byte RSA encrypted block (the public key should be obtained by the Votifier user), with the following format:
Type Value
string VOTE
string serviceName
string username
string address
string timeStamp
byte[] empty
The first string of value "VOTE" is an opcode check to ensure that RSA was encoded and decoded properly, if this value is wrong then Votifier assumes that there was a problem with encryption and drops the connection. serviceName is the name of the top list service, username is the username (entered by the voter) of the person who voted, address is the IP address of the voter, and timeStamp is the time stamp of the vote. Each string is delimited by the newline character \n (byte value 10). The space block is the empty space that is left over, the block must be exactly 256 bytes regardless of how much information it holds.
A connection is made to the Votifier server by the server list, and immediately Votifier will send its version in the following packet:
"VOTIFIER <version>"
Votifier then expects a 256 byte RSA encrypted block (the public key should be obtained by the Votifier user), with the following format:
Type Value
string VOTE
string serviceName
string username
string address
string timeStamp
byte[] empty
The first string of value "VOTE" is an opcode check to ensure that RSA was encoded and decoded properly, if this value is wrong then Votifier assumes that there was a problem with encryption and drops the connection. serviceName is the name of the top list service, username is the username (entered by the voter) of the person who voted, address is the IP address of the voter, and timeStamp is the time stamp of the vote. Each string is delimited by the newline character \n (byte value 10). The space block is the empty space that is left over, the block must be exactly 256 bytes regardless of how much information it holds.
en dit zij de auteur tegen mij in reacties:
Quote:
The protocol documentation is just a general page that describes how to communicate with Votifier. It's not meant to provide implementation examples for using RSA and TCP sockets in a programming language such as PHP.
To inference with the documentation is saying, you would have a string for example:
VOTE\n
My Server List\n
PlayerName\n
123.123.123.123\n
2012-07-11 17:41:56 -0700\n
The timestamp can be in any format, it's your choice.
The last byte[] block is for the padding needed to have the entire string be 256 bytes filled with \x00. You may or may not have to do this depending on your RSA library.
Then, encrypt that string with the server's Votifier public key. Finally, open a TCP socket to the server's Votifier instance and write the encrypted block to send the notification.
To inference with the documentation is saying, you would have a string for example:
VOTE\n
My Server List\n
PlayerName\n
123.123.123.123\n
2012-07-11 17:41:56 -0700\n
The timestamp can be in any format, it's your choice.
The last byte[] block is for the padding needed to have the entire string be 256 bytes filled with \x00. You may or may not have to do this depending on your RSA library.
Then, encrypt that string with the server's Votifier public key. Finally, open a TCP socket to the server's Votifier instance and write the encrypted block to send the notification.
Zo lang bericht, maar ik weet nu niet waar ik moet beginnen, moet ik alles in een form zetten en dan encrypten? ik moet iets doen met een public key. (die heb ik). Votifier gebruikt een bepaalde poort. dus als ik doe 192.168.2.150:8192 dan staat er in de console van de minecraft server:
Quote:
2012-07-13 19:11:16 [WARNING] [Votifier] Unable to decrypt vote record. Make sure that that your public key
2012-07-13 19:11:16 [WARNING] [Votifier] matches the one you gave the server list.
javax.crypto.BadPaddingException: Data must start with zero
at sun.security.rsa.RSAPadding.unpadV15(Unknown Source)
at sun.security.rsa.RSAPadding.unpad(Unknown Source)
at com.sun.crypto.provider.RSACipher.doFinal(RSACipher.java:356)
at com.sun.crypto.provider.RSACipher.engineDoFinal(RSACipher.java:382)
at javax.crypto.Cipher.doFinal(Cipher.java:2087)
at com.vexsoftware.votifier.crypto.RSA.decrypt(RSA.java:65)
at com.vexsoftware.votifier.net.VoteReceiver.run(VoteReceiver.java:130)
2012-07-13 19:11:16 [WARNING] [Votifier] matches the one you gave the server list.
javax.crypto.BadPaddingException: Data must start with zero
at sun.security.rsa.RSAPadding.unpadV15(Unknown Source)
at sun.security.rsa.RSAPadding.unpad(Unknown Source)
at com.sun.crypto.provider.RSACipher.doFinal(RSACipher.java:356)
at com.sun.crypto.provider.RSACipher.engineDoFinal(RSACipher.java:382)
at javax.crypto.Cipher.doFinal(Cipher.java:2087)
at com.vexsoftware.votifier.crypto.RSA.decrypt(RSA.java:65)
at com.vexsoftware.votifier.net.VoteReceiver.run(VoteReceiver.java:130)
Graag zou ik wat hulp hebben in deze massa :O
Er zijn nog geen reacties op dit bericht.