XServer
我已完全停止在 BukkitDev 上更新 XServer。请前往 spigotmc.org 获取更新。
SpigotMC 上的插件地址 ->
已发布快照版本 2.0.1。
将包名从 "com.mickare..." 重命名为 "de.mickare..."
您当前的插件可能无法与新版本兼容!抱歉各位!
在 SpigotMC 更改关于 BungeeCord(一种 Minecraft 代理)等项目辅助插件的指导方针之前,我不会再向 Bukkit Dev 上传 XServer 的任何更新。
警告!Bukkit Dev 团队警告外部下载站点,但我仍在此提供 Maven 仓库的链接。
当前版本可从 Maven 仓库自行下载,风险自负。
描述
XServer 是其他插件的辅助工具。它填补了服务器之间的通信空白。
通过此插件,可以简单地向其他服务器发送字节数组并接收它们。
如果您在多个服务器上使用的插件希望通过套接字进行通信,这将非常有用。
作为开发者,您不再需要思考如何创建套接字并保持连接打开。
XServer 处理所有复杂的工作,并提供了一种发送消息的良好解决方案。
它会自动对出站消息进行排队,并使用独立的 EventHandler 处理传入消息。
您的服务器通过密码进行保护,并通过 MySql 进行管理。
目前 XServer 有两个版本:一个用于 Bukkit,另一个用于 BungeeCord。
XServer 拥有核心模块和 API,因此未来这些部分也将独立发布,使得 XServer 不仅可以在 Bukkit 和 BungeeCord 上运行。
设置 - 准备 / 配置
在您的 MySql 服务器上创建一个新表,使用以下语句:
CREATE TABLE IF NOT EXISTS `xserver` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`NAME` varchar(64) COLLATE utf8_bin NOT NULL,
`ADRESS` varchar(128) COLLATE utf8_bin NOT NULL,
`PW` varchar(20) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`ID`),
UNIQUE KEY `ID` (`ID`),
UNIQUE KEY `ADRESS` (`ADRESS`),
KEY `ID_2` (`ID`)
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
然后将您的服务器添加到表中。
“NAME” 是您的服务器名称,该名称用于标识您的服务器且必须唯一!
请注意 “ADRESS” 格式为 “主机: 端口”(例如 “localhost:19999” 或 “127.0.0.1:19999”)。
PW 是您希望设置的密码,其他服务器需要使用此密码连接到此服务器。
设置 - Bukkit
- 将 “XServer-Bukkit.jar” 复制到您的插件文件夹中。
- 启动服务器一次。
- 进入 xserver 插件文件夹。
- 打开并编辑 “config.yml”。
-> 此处开始配置文件代码段,但 dev.bukkit.org 已损坏。如果换行等显示不正常,请见谅。
<<code>>
useMotdForServername: false
servername: theNameYouCalledThisServer
mysql:
User: myUser
Pass: myPassword
Data: myDatabase
Host: myHost
<</code>>
-> 配置文件代码段结束。
设置 - BungeeCord
BungeeCord 代理服务器上的设置与 Bukkit 服务器相同。
如何使用 XServer
参见:Your First Plugin]]
命令
目前仅在 Bukkit 版本中提供命令。
/xserver <子命令>
子命令如下:
- package [Servername] : 显示到所有服务器的数据包速度,或仅显示给定的服务器。
- ping [Servername] : Ping 所有服务器,或仅 Ping 给定的服务器。
- reconnect [ s] : 重新连接所有服务器。它接受一个标志 (s) 以仅软重启那些未连接的服务器。
- reload:重新加载服务器列表并重新连接。
- status:显示与服务器的连接状态。
- stresstest [times = 10] [targets = all] [async = false]:对 XServer 进行压力测试。目标可以是:(all|以“;”分隔的服务器名称)
命令权限为 "xserver"。
速度
为了将 XServer 逼入绝境,我在一个运行着全部 XServer 的由 43 个 Bukkit 和 2 个 BungeeCord 组成的服务器集群中,使用因子 1000 执行了 stresstest 命令,平均响应时间仍保持在 80-90 毫秒。(这些服务器分布在 4 台根服务器上)
这涉及发送并返回 45,000 条长度为 32 字节的字符串消息。
这意味着在该特定的 Bukkit 服务器上,产生了超过 64MBit/s 的入站和出站流量。
更新日志
快照版本 2.0.1
- 将软件包从 "com.mickare..." 重命名为 "de.mickare..."
版本 2.0.0
- 完全重构!!!
- 新的 EventBus(事件总线)
- 使用 Java 的套接字双工功能(单一连接,无需重建套接字连接)
- 更快的数据包发送
- Ping(心跳检测)
- 数据包统计与压力测试
- 完全且仅支持 MySQL 配置
- 核心模块与 API 从 Bukkit/Bungeecord 代码中分离,因此 Core-Modul 可以在独立的 Java 应用程序中使用。
版本 1.0.3
- 修复了在配置失败时多次禁用插件的消息问题...
版本 1.0.2
版本 1.0.1
- 优化 EventHandler(事件处理器)。
版本 1.0.0
Maven
许可证
[spoiler]MIT 许可证 (MIT)
版权所有 (c) 2013 mickare
特此免费授予任何获得本软件及其相关文档文件(以下简称“本软件”)副本的人,有权在不限制的情况下使用、复制、修改、合并、发布、分发、再许可和/或出售本软件的副本,并允许提供
本软件,并允许获得本软件副本的人如此操作,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
特定目的和不侵权。在任何情况下,作者或版权持有者均不承担责任
版权持有人不对任何索赔、损害或其他责任负责,无论基于
在合同之诉、侵权之诉或其他诉讼中,因……引起或与之相关的
与软件的连接或使用,或在软件中进行的其他许可。
[/spoiler]
XServer
I have completely stopped updating XServer here on BukkitDev. Please go to spigotmc.org for updates.
Plugin at spigotmc ->
Snapshot 2.0.1 released.
Renaming packages from "com.mickare..." to "de.mickare..."
Your current plugins may not work with the new Version! Sry guys!
I won't upload any updates for XServer to Bukkit Dev until they change their guidelines regarding project-helper-plugins for e.g. BungeeCord (a minecraft proxy).
Warning! Bukkit Dev Team warns of external download sites, but I'll still give a link here to the Maven Repository.
Current versions can be downloaded from the Maven Repository on your own risk.
Description
XServer is a helper for other plugins. It closes the communication gap between servers.
With this plugin it's simple to send byte arrays to other servers and receive them.
It's usefull if you use plugins on multiple servers that you want to communicate via sockets.
You, the developer, no more have to think about creating sockets and keeping the connection open.
XServer handles all complicated stuff and offers a nice solution to send messages.
It automatically queues outgoing messages and handles incoming messages with an own EventHandler.
Your servers are protected via passwords and are managed via MySql.
There are currently 2 Versions of XServer: one for Bukkit and one for BungeeCord.
XServer has a Core-Module and a API, so these are released in the future, so not only on Bukkit and on BungeeCord can be run XServer.
Setup - Preparation / Configuration
On your MySql-Server create a new Table with:
CREATE TABLE IF NOT EXISTS `xserver` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`NAME` varchar(64) COLLATE utf8_bin NOT NULL,
`ADRESS` varchar(128) COLLATE utf8_bin NOT NULL,
`PW` varchar(20) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`ID`),
UNIQUE KEY `ID` (`ID`),
UNIQUE KEY `ADRESS` (`ADRESS`),
KEY `ID_2` (`ID`)
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
Then add your servers to the table.
"NAME" is your servers name, this name identifies your server and has to be unique!
Remember "ADRESS" is like "host: port" (e.g. "localhost:19999", or "127.0.0.1:19999").
PW is the password you want, that other servers need to connect to this server.
Setup - Bukkit
- Copy "XServer-Bukkit.jar" to your plugin folder.
- Run once the server.
- Goto the xserver plugin folder.
- Open and edit "config.yml".
-> Here starts the config code section, but dev.bukkit.org is broken. So bear with me if there is no line breaking, etc.
<<code>>
useMotdForServername: false
servername: theNameYouCalledThisServer
mysql:
User: myUser
Pass: myPassword
Data: myDatabase
Host: myHost
<</code>>
-> Here stops the config code section.
Setup - BungeeCord
The setup on a BungeeCord Proxy Server is the same as the Bukkit Server.
How to use XServer
See: Your First Plugin]]
Commands
The commands are currently only available in the Bukkit Version.
/xserver <subcommand>
The subcommands are:
- package [Servername] : Shows package speed to all servers, or the one as given.
- ping [Servername] : Ping all servers, or the one as given.
- reconnect [ s] : Reconnects all servers. It accepts one flag (s) for softly reconnect only those not connected servers.
- reload : Reloads the server list and reconnects.
- status : Shows the connection status to the servers.
- stresstest [times = 10] [targets = all] [async = false] : Stress test for XServer. Targets can be: (all|servernames splitted by ";")
Commands permission is "xserver".
Speed
Trying to force XServer to its knees, i fired on one of 43 Bukkit and 2 BungeeCord Servers running all XServer, the stresstest command with the factor 1000 and still got an average response time of 80-90ms. (The servers are distributed on 4 Root-Servers)
These are 45000 Messages of Strings with a lenght of 32, that are sended and then returned.
Meaning an Incoming and Outgoing traffic of > 64MBit/s on this particular Bukkit server.
Changelog
Snapshot 2.0.1
- Renaming packages from "com.mickare..." to "de.mickare..."
Version 2.0.0
- Complete Rework!!!
- New EventBus
- Usage of java's socket duplex functionality (single connections, no rebuilding of socket connections)
- Faster package sending
- Ping
- Package statistics and stresstest
- Fully and only MySQL configuration
- Core and API divided from Bukkit/Bungeecord Code, so Core-Modul can be used in an own java application.
Version 1.0.3
- Multiple Disabling Message Fix... when having failed in config.
Version 1.0.2
- Bug Fix in Disabling Plugin
- Fix Exception Output to Console.
Version 1.0.1
- EventHandler optimization.
Version 1.0.0
Maven
Licence
[spoiler]The MIT License (MIT)
Copyright (c) 2013 mickare
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[/spoiler]
评论 0
登录后参与评分
还没有评论,来抢沙发吧