
插件的新更新
在接下来的一天里,我将添加一项功能,允许玩家通过输入 /vote 在游戏中投票。投票将被发送回该服务器所在列表网站的投票页面,然后记录投票。插件将生成一个“密钥”,用于验证投票。
更多详情稍后公布。
全新且大幅改进的 Votifier!RPGVotifier 或 Votifier2 开放测试
我已经发布了两个版本的插件……这些是 BETA 版本!
一个适用于 1.6.4-1.7.2,另一个适用于 1.2.5(Tekkit)
请报告任何困难。
现在将重新开始!!!!
如果你有一个列表引擎并希望集成此插件:
给我发消息,我很乐意帮助你搭建投票页面。
为什么这样做
众所周知,Votifier 已经过时且不再活跃……它不稳定且不可靠。最近有人联系我,要么修复旧版,要么制作新版。我选择制作一个新版本,它更易于使用、更详细且非常容易实现。
关于安全的说明
有些人对不使用 AES 加密而仅使用密码表示担忧。如果你也有同样的疑问,请问自己这种加密究竟在保护什么。答案是什么都不重要。除了加密无意义的数据外,旧版 Votifier 中的 AES 加密实际上充当了投票的一种身份验证系统。
对于这两个角色来说,这都是过度设计且毫无意义的,但对于旧版本而言却是必要的,因为旧版本无法保护自己免受虚假投票的影响。事实上,如果玩家设法获取了公钥,他们就可以随意进行无限投票。
因此,在本插件中,简单的密码所做的只是尽可能验证真实投票,说实话,这真的不是必需的。本插件通过身份验证系统和基于时间的投票规则来保护自己,你可以在下面阅读相关内容。
还有人告诉我这个程序可能是恶意投票或投票泛滥的一个漏洞。对于那些这么想的人,让我向你保证:任何带有监听器的公共 IP,只要暴露在云端,都可能成为目标,就像游戏服务器/端口一样。
本插件不会接受未玩过游戏的玩家的投票,所以试图用假名淹没它是行不通的。
当防护开启时,它将拒绝所有未等待新投票所需小时数的投票,它们也会被简单拒绝。
换句话说,这个 IP/端口会被攻击吗……是的,就像任何其他公共 IP/端口一样。它的脆弱性并不比其他任何地方更高或更低。
加密是毫无意义的……你想隐藏什么?用户名吗?
总之,目前就这些,如果你有更多问题,随时私信我或在下面的评论中发帖。
主要功能
- 不再有公钥加密,那是毫无意义且愚蠢的。相反,我们将只使用密码。
- 这个 Votifier 完全基于线程,它在自己的线程中启动套接字监听器,当收到投票时,处理程序也在单独的线程上启动。
- 它实现了一个哨兵线程,“监视”监听器线程,并在其丢失、死亡或不稳定时重新启动它。
- 它保存投票,所以如果玩家离线并是服务器上的玩家,它会记住他们,这样当他们下次登录时可以领取奖励。
- 不再有监听器!作为多线程应用程序,RPGVotifier 还根据简单的配置文件处理玩家奖励。
- 奖励还会进行库存检查。在向玩家发放奖励之前,会检查他们的库存是否有空间。如果没有足够的空间,会要求玩家清空库存并重试。
- 添加了带权限节点的斜杠命令,以允许用户查看是否有待领取的奖励并领取它们。OP 也可以通过斜杠命令添加或移除投票。
- RPGVotifier 实施了一个基于玩家名称的保护系统,以防止滥用。这是一个你可以设置的选项,允许在一定时间后投票(0-???)。将此设置为 0 会关闭该功能。如果收到投票且此功能开启,它将检查确保玩家名称在设定时间内没有投票过。
我还实现了一个详细的响应系统,以便列表网站可以获得有关投票的详细信息以及发送投票的模式。
投票模式
- normal: 正常奖励,如果玩家不在线,奖励将被保存,可以在玩家返回时领取。
- test: 返回连接和密码的验证
投票数据包
[面向列表网站所有者]
数据包结构 [mode:vote_site:player_name:password] 作为字符串。
你从字符串构建数据包。没有固定长度,但所有四个部分都必须存在,并用冒号(:)分隔。
示例投票数据包
"normal:pixelmonservers.info:boduzapho:MyStr0ngpa55w0rd"
投票响应消息
- 无效数据包
- 无效密码
- 无效投票模式
- 测试成功
- 无此玩家
- 用户已投票
- 投票处理成功
其他
还有更多内容,我会在稍后添加。插件几乎完成测试,当我发布时,我将提供以下语言的代码示例以供使用(比旧版 Votifier 脚本更简单、代码更少):
- .Net C#
- .Net VB
- PHP
- Python
此外,数据库集成也非常简单。
目前就这些,我稍后会添加更多内容。
如何发送投票
* 我正在寻找一位 PHP 开发人员将此代码转换为 PHP
如果您愿意通过将我提供的以下代码转换为 PHP 来帮助社区,那将非常有帮助!同时,转换为任何其他相关语言也同样非常有益。
在这些示例中,`IP.Text` 和 `IPPort.Text` 是代表要发送投票的 IP/端口的变量。您可以轻松地将它们作为参数传递给这些函数,或者使用公共变量来代替它们。
这些示例是直接转换的结果!
您显然需要修改下面的一些代码,这里提供的是供您入门的参考!
C# 示例
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);
<span>try</span>
<span>{</span>
<span>sender</span><span>.</span><span>Connect</span><span>(</span><span>remoteEP</span><span>);</span>
<span>byte</span><span>[]</span> <span>msg</span> <span>=</span> <span>Encoding</span><span>.</span><span>ASCII</span><span>.</span><span>GetBytes</span><span>(</span><span>IPsend</span><span>.</span><span>Text</span><span>.</span><span>Trim</span> <span>+</span> <span>Environment</span><span>.</span><span>NewLine</span><span>);</span>
<span>int</span> <span>bytesSent</span> <span>=</span> <span>sender</span><span>.</span><span>Send</span><span>(</span><span>msg</span><span>);</span>
<span>int</span> <span>bytesRec</span> <span>=</span> <span>sender</span><span>.</span><span>Receive</span><span>(</span><span>bytes</span><span>);</span>
<span>Session</span><span>(</span><span>"RES"</span><span>)</span> <span>=</span> <span>Encoding</span><span>.</span><span>ASCII</span><span>.</span><span>GetString</span><span>(</span><span>bytes</span><span>,</span> <span>0</span><span>,</span> <span>bytesRec</span><span>);</span>
<span>sender</span><span>.</span><span>Shutdown</span><span>(</span><span>SocketShutdown</span><span>.</span><span>Both</span><span>);</span>
<span>sender</span><span>.</span><span>Close</span><span>();</span>
<span>}</span>
<span>catch</span> <span>(</span><span>Exception</span> <span>ex</span><span>)</span>
<span>{</span>
<span>Session</span><span>(</span><span>"RES"</span><span>)</span> <span>=</span> <span>"连接失败,请检查 IP 和端口设置。"</span><span>;</span>
<span>}</span>
<span>}</span>
Java 示例
private Vote.Click += SendVote;
public final void SendVotesender, EventArgs e
{
<span>byte</span><span>[]</span> <span>bytes</span> <span>=</span> <span>new</span> <span>byte</span><span>[</span><span>1025</span><span>];</span>
<span>IPAddress</span> <span>ipAddress</span> <span>=</span> <span>ipAddress</span><span>.</span><span>Parse</span><span>(</span><span>IP</span><span>.</span><span>Text</span><span>);</span>
<span>IPEndPoint</span> <span>remoteEP</span> <span>=</span> <span>new</span> <span>IPEndPoint</span><span>(</span><span>ipAddress</span><span>,</span> <span>IPPort</span><span>.</span><span>Text</span><span>);</span>
<span>Socket</span> <span>sender</span> <span>=</span> <span>new</span> <span>Socket</span><span>(</span><span>AddressFamily</span><span>.</span><span>InterNetwork</span><span>,</span> <span>SocketType</span><span>.</span><span>Stream</span><span>,</span> <span>ProtocolType</span><span>.</span><span>Tcp</span><span>);</span>
<span>try</span>
<span>{</span>
<span>sender</span><span>.</span><span>Connect</span><span>(</span><span>remoteEP</span><span>);</span>
<span>byte</span><span>[]</span> <span>msg</span> <span>=</span> <span>Encoding</span><span>.</span><span>ASCII</span><span>.</span><span>GetBytes</span><span>(</span><span>IPsend</span><span>.</span><span>Text</span><span>.</span><span>Trim</span> <span>+</span> <span>Environment</span><span>.</span><span>NewLine</span><span>);</span>
<span>int</span> <span>bytesSent</span> <span>=</span> <span>sender</span><span>.</span><span>Send</span><span>(</span><span>msg</span><span>);</span>
<span>int</span> <span>bytesRec</span> <span>=</span> <span>sender</span><span>.</span><span>Receive</span><span>(</span><span>bytes</span><span>);</span>
<span>Session</span><span>(</span><span>"RES"</span><span>)</span> <span>=</span> <span>Encoding</span><span>.</span><span>ASCII</span><span>.</span><span>GetString</span><span>(</span><span>bytes</span><span>,</span> <span>0</span><span>,</span> <span>bytesRec</span><span>);</span>
<span>sender</span><span>.</span><span>Shutdown</span><span>(</span><span>SocketShutdown</span><span>.</span><span>Both</span><span>);</span>
<span>sender</span><span>.</span><span>Close</span><span>();</span>
<span>}</span>
<span>catch</span> <span>(</span><span>RuntimeException</span> <span>ex</span><span>)</span>
<span>{</span>
<span>Session</span><span>(</span><span>"RES"</span><span>)</span> <span>=</span> <span>"连接失败,请检查 IP 和端口设置。"</span><span>;</span>
<span>}</span>
}
VB.net 示例
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)
<span>Try</span>
<span>sender</span><span>.</span><span>Connect</span><span>(</span><span>remoteEP</span><span>)</span>
<span>Dim</span> <span>msg</span> <span>As</span> <span>Byte</span><span>()</span> <span>=</span> <span>Encoding</span><span>.</span><span>ASCII</span><span>.</span><span>GetBytes</span><span>(</span><span>IPsend</span><span>.</span><span>Text</span><span>.</span><span>Trim</span> <span>&</span> <span>vbNewLine</span><span>)</span>
<span>Dim</span> <span>bytesSent</span> <span>As</span> <span>Integer</span> <span>=</span> <span>sender</span><span>.</span><span>Send</span><span>(</span><span>msg</span><span>)</span>
<span>Dim</span> <span>bytesRec</span> <span>As</span> <span>Integer</span> <span>=</span> <span>sender</span><span>.</span><span>Receive</span><span>(</span><span>bytes</span><span>)</span>
<span>Session</span><span>(</span><span>"RES"</span><span>)</span> <span>=</span> <span>Encoding</span><span>.</span><span>ASCII</span><span>.</span><span>GetString</span><span>(</span><span>bytes</span><span>,</span> <span>0</span><span>,</span> <span>bytesRec</span><span>)</span>
<span>sender</span><span>.</span><span>Shutdown</span><span>(</span><span>SocketShutdown</span><span>.</span><span>Both</span><span>)</span>
<span>sender</span><span>.</span><span>Close</span><span>()</span>
<span>Catch</span> <span>ex</span> <span>As</span> <span>Exception</span>
<span>Session</span><span>(</span><span>"RES"</span><span>)</span> <span>=</span> <span>连接失败,请检查 IP 和端口设置。</span>
<span>End</span> <span>Try</span>
<span>End</span> <span>Sub</span>
BETA 版本已提交审核
如果您希望参与 Beta 测试,您需要一个 Bukkit 1.6.2-1.6.4 的 Bukkit 服务器,或者一个兼容的 Forge 或 MCPC+ 服务器。
发送投票有两种方式。
1. 使用上述代码构建一个投票页面
2. 访问 并使用公共测试表单。
投票数据包示例
普通投票: "normal:Pixelmonservers.info:boduzapho:w3s0m3pa55w0rd"
测试投票 "test:Pixelmonservers.info:boduzapho:w3s0m3pa55w0rd"
这是插件期望的格式。没有长度要求,但语法非常重要!!
它由冒号{:}分隔的四个字符串组成:
mode:server:name:password
确保您发送的密码与配置文件中的密码匹配。
安装方法
- 停止您的服务器
- 将 jar 文件放入 plugins 文件夹。
- 启动您的服务器
- 等待服务器完全启动
- 停止服务器
- 导航至 plugins/votifier2
- 修改配置文件
配置文件示例
ip: 192.168.1.33
port: '8192'
password: w3s0m3pa55w0rd
protect: 1
debug: true
Sentury: 60
- 端口应更改为不会与其他插件(如 votifier)冲突的端口。
- 密码是一个字符串,您可以随意设置。(真的,越复杂对您越好)。
- Protect 是一个整数或数字,表示用户再次投票前需要等待的小时数。0 = 无限制
- Debug 是一个布尔值(true 或 false),开启时将在控制台窗口中显示详细消息。
- Sentury 是一个整数,表示保存线程运行并保存所需数据文件的频率(以秒为单位)。
execute.ini 示例
只需添加控制台命令,每行一条,并在玩家名字的位置使用 <NAME>。
say <NAME> thanks for your vote!
give <NAME> 264 2
eco give <NAME> 100
您将需要使用测试站点发送投票或自行构建。
投票测试页面

New Update to the plugin
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.
The NEW and Greatly Improved Votifier! RPGVotifier or Votifier2 OPEN BETA TEST
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.
Why this was done
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.
Notes about Security
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.
Key Features
- NO MORE Public Key encryption, it was pointless and stupid. Instead we will just use a password.
- This Votifier is completely thread based it launches the socket listener in its own thread and when a vote comes in the handler is also launched on a separate thread.
- It implements a Sentry thread that "watches" the listener thread and will restart it if it is lost, dead or becomes unstable.
- It saves votes, so if the player votes offline and is a player on the server it will remember them so when they next log in they can collect the rewards.
- No more listeners! As a threaded application RPGVotifier also handles the player rewards as defined by a simple config file.
- Rewards also do an inventory check. Before giving the rewards to a player their inventory is checked for space. If not enough exists the player is asked to clear their inventory and try again.
- Slash commands with perm nodes were added to allow a use to see if they have rewards waiting ad to collect them. Op's can add or remove votes via slash commands as well.
- RPGVotifier implements a protection system, based upon player name to prevent abuse. This is an option you can set to allow voting after so many hours (0-???). Setting this to 0 turns off the feature. If a vote comes in and this is on it will check to be sure the player name has not voted in the set time frame.
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.
Vote Modes
- normal: Normal rewards, if not online the rewards are saved and can be collected when the player returns.
- test: Return validation of connection and password
Vote Packet
[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"
Vote Response Messages
- Bad Packet
- Bad Password
- Bad Vote Mode
- Test success
- No Such Player
- User Already Voted
- Vote processed okay
Misc.
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):
- .Net C#
- .Net VB
- PHP
- Python
Also Database integration is VERY simple to do.
Thats all for now I will be adding more later.
How to send votes
* I am looking for a PHP person to convert this to PHP
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!
C# Example
Vote.Click += SendVote;
public void SendVotesender, EventArgs e
{
<span>byte</span><span>[]</span> <span>bytes</span> <span>=</span> <span>new</span> <span>byte</span><span>[</span><span>1025</span><span>];</span>
<span>IPAddress</span> <span>ipAddress</span> <span>=</span> <span>ipAddress</span><span>.</span><span>Parse</span><span>(</span><span>IP</span><span>.</span><span>Text</span><span>);</span>
<span>IPEndPoint</span> <span>remoteEP</span> <span>=</span> <span>new</span> <span>IPEndPoint</span><span>(</span><span>ipAddress</span><span>,</span> <span>IPPort</span><span>.</span><span>Text</span><span>);</span>
<span>Socket</span> <span>sender</span> <span>=</span> <span>new</span> <span>Socket</span><span>(</span><span>AddressFamily</span><span>.</span><span>InterNetwork</span><span>,</span> <span>SocketType</span><span>.</span><span>Stream</span><span>,</span> <span>ProtocolType</span><span>.</span><span>Tcp</span><span>);</span>
<span>try</span>
<span>{</span>
<span>sender</span><span>.</span><span>Connect</span><span>(</span><span>remoteEP</span><span>);</span>
<span>byte</span><span>[]</span> <span>msg</span> <span>=</span> <span>Encoding</span><span>.</span><span>ASCII</span><span>.</span><span>GetBytes</span><span>(</span><span>IPsend</span><span>.</span><span>Text</span><span>.</span><span>Trim</span> <span>+</span> <span>Environment</span><span>.</span><span>NewLine</span><span>);</span>
<span>int</span> <span>bytesSent</span> <span>=</span> <span>sender</span><span>.</span><span>Send</span><span>(</span><span>msg</span><span>);</span>
<span>int</span> <span>bytesRec</span> <span>=</span> <span>sender</span><span>.</span><span>Receive</span><span>(</span><span>bytes</span><span>);</span>
<span>Session</span><span>(</span><span>"RES"</span><span>)</span> <span>=</span> <span>Encoding</span><span>.</span><span>ASCII</span><span>.</span><span>GetString</span><span>(</span><span>bytes</span><span>,</span> <span>0</span><span>,</span> <span>bytesRec</span><span>);</span>
<span>sender</span><span>.</span><span>Shutdown</span><span>(</span><span>SocketShutdown</span><span>.</span><span>Both</span><span>);</span>
<span>sender</span><span>.</span><span>Close</span><span>();</span>
<span>}</span>
<span>catch</span> <span>(</span><span>Exception</span> <span>ex</span><span>)</span>
<span>{</span>
<span>Session</span><span>(</span><span>"RES"</span><span>)</span> <span>=</span> <span>"Failed to connect, Check the settings for IP and Port."</span><span>;</span>
<span>}</span>
<span>}</span>
Java Example
private Vote.Click += SendVote;
public final void SendVotesender, EventArgs e
{
<span>byte</span><span>[]</span> <span>bytes</span> <span>=</span> <span>new</span> <span>byte</span><span>[</span><span>1025</span><span>];</span>
<span>IPAddress</span> <span>ipAddress</span> <span>=</span> <span>ipAddress</span><span>.</span><span>Parse</span><span>(</span><span>IP</span><span>.</span><span>Text</span><span>);</span>
<span>IPEndPoint</span> <span>remoteEP</span> <span>=</span> <span>new</span> <span>IPEndPoint</span><span>(</span><span>ipAddress</span><span>,</span> <span>IPPort</span><span>.</span><span>Text</span><span>);</span>
<span>Socket</span> <span>sender</span> <span>=</span> <span>new</span> <span>Socket</span><span>(</span><span>AddressFamily</span><span>.</span><span>InterNetwork</span><span>,</span> <span>SocketType</span><span>.</span><span>Stream</span><span>,</span> <span>ProtocolType</span><span>.</span><span>Tcp</span><span>);</span>
<span>try</span>
<span>{</span>
<span>sender</span><span>.</span><span>Connect</span><span>(</span><span>remoteEP</span><span>);</span>
<span>byte</span><span>[]</span> <span>msg</span> <span>=</span> <span>Encoding</span><span>.</span><span>ASCII</span><span>.</span><span>GetBytes</span><span>(</span><span>IPsend</span><span>.</span><span>Text</span><span>.</span><span>Trim</span> <span>+</span> <span>Environment</span><span>.</span><span>NewLine</span><span>);</span>
<span>int</span> <span>bytesSent</span> <span>=</span> <span>sender</span><span>.</span><span>Send</span><span>(</span><span>msg</span><span>);</span>
<span>int</span> <span>bytesRec</span> <span>=</span> <span>sender</span><span>.</span><span>Receive</span><span>(</span><span>bytes</span><span>);</span>
<span>Session</span><span>(</span><span>"RES"</span><span>)</span> <span>=</span> <span>Encoding</span><span>.</span><span>ASCII</span><span>.</span><span>GetString</span><span>(</span><span>bytes</span><span>,</span> <span>0</span><span>,</span> <span>bytesRec</span><span>);</span>
<span>sender</span><span>.</span><span>Shutdown</span><span>(</span><span>SocketShutdown</span><span>.</span><span>Both</span><span>);</span>
<span>sender</span><span>.</span><span>Close</span><span>();</span>
<span>}</span>
<span>catch</span> <span>(</span><span>RuntimeException</span> <span>ex</span><span>)</span>
<span>{</span>
<span>Session</span><span>(</span><span>"RES"</span><span>)</span> <span>=</span> <span>"Failed to connect, Check the settings for IP and Port."</span><span>;</span>
<span>}</span>
}
VB.net Example
Public Sub SendVote()
<span>Dim</span> <span>bytes</span><span>(</span><span>1024</span><span>)</span> <span>As</span> <span>Byte</span>
<span>Dim</span> <span>ipAddress</span> <span>As</span> <span>IPAddress</span> <span>=</span> <span>ipAddress</span><span>.</span><span>Parse</span><span>(</span><span>IP</span><span>.</span><span>Text</span><span>)</span>
<span>Dim</span> <span>remoteEP</span> <span>As</span> <span>New</span> <span>IPEndPoint</span><span>(</span><span>ipAddress</span><span>,</span> <span>IPPort</span><span>.</span><span>Text</span><span>)</span>
<span>Dim</span> <span>sender</span> <span>As</span> <span>New</span> <span>Socket</span><span>(</span><span>AddressFamily</span><span>.</span><span>InterNetwork</span><span>,</span> <span>SocketType</span><span>.</span><span>Stream</span><span>,</span> <span>ProtocolType</span><span>.</span><span>Tcp</span><span>)</span>
<span>Try</span>
<span>sender</span><span>.</span><span>Connect</span><span>(</span><span>remoteEP</span><span>)</span>
<span>Dim</span> <span>msg</span> <span>As</span> <span>Byte</span><span>()</span> <span>=</span> <span>Encoding</span><span>.</span><span>ASCII</span><span>.</span><span>GetBytes</span><span>(</span><span>IPsend</span><span>.</span><span>Text</span><span>.</span><span>Trim</span> <span>&</span> <span>vbNewLine</span><span>)</span>
<span>Dim</span> <span>bytesSent</span> <span>As</span> <span>Integer</span> <span>=</span> <span>sender</span><span>.</span><span>Send</span><span>(</span><span>msg</span><span>)</span>
<span>Dim</span> <span>bytesRec</span> <span>As</span> <span>Integer</span> <span>=</span> <span>sender</span><span>.</span><span>Receive</span><span>(</span><span>bytes</span><span>)</span>
<span>Session</span><span>(</span><span>"RES"</span><span>)</span> <span>=</span> <span>Encoding</span><span>.</span><span>ASCII</span><span>.</span><span>GetString</span><span>(</span><span>bytes</span><span>,</span> <span>0</span><span>,</span> <span>bytesRec</span><span>)</span>
<span>sender</span><span>.</span><span>Shutdown</span><span>(</span><span>SocketShutdown</span><span>.</span><span>Both</span><span>)</span>
<span>sender</span><span>.</span><span>Close</span><span>()</span>
<span>Catch</span> <span>ex</span> <span>As</span> <span>Exception</span>
<span>Session</span><span>(</span><span>"RES"</span><span>)</span> <span>=</span> <span>"Failed to connect, Check the settings for IP and Port."</span>
<span>End</span> <span>Try</span>
<span>End</span> <span>Sub</span>
The BETA has been sent in for Approval
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 and use the public test form.
VOTE PACKET EXAMPLES
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.
How to Install
- Stop your server
- Place the jar file into your plugins folder.
- Start your server
- Wait for the server to completely start
- Stop the server
- Navigate to plugins/votifier2
- Modify the config file
Config File Sample
ip: 192.168.1.33
port: '8192'
password: w3s0m3pa55w0rd
protect: 1
debug: true
Sentury: 60
- The IP that should be the ip of the server you're running it on.
- The port should be changed to one that will not conflict with other plugins, like votifier.
- The password is a string go nuts. (no really the crazier the better for YOU).
- Protect is an integer or number representing how many HOURS a user has to wait before voting again. 0 = no restriction
- Debug is a boolean (true or false) that when on will display verbose messages in the console window.
- Sentury is an integer that represents how often the save thread runs and saves the required data files in SECONDS.
execute.ini sample
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
评论 0
登录后参与评分
还没有评论,来抢沙发吧