描述
此插件会在玩家加入或离开游戏时,使用玩家列表更新 MySQL 数据库表。
该插件最初是为 MCAddictGallery 服务器创建的,目的是让我们能够以最少的工作量在网站上实现实时的玩家列表展示。
目前,该插件追踪以下信息:
- 玩家名称
- 上一世界(用于当玩家从一个世界传送至另一个世界时)
- 当前世界(玩家当前所在的世界)
- IP 地址
- 登录时间(存储为自纪元以来的秒数)
- 玩家的权限组
- 标记玩家是否在线的标志。
运行本插件所需的插件
- Vault
可选插件(提供额外功能)
- SimplyVanish - 非必需,但如果你希望玩家列表中不显示隐身状态的玩家,则可能需要安装此插件。
配置
config.yml
MySQLServer: localhost MySQLPort: '3306' MySQLUsername: <数据库用户名> MySQLPassword: <数据库密码> MySQLDatabase: <要使用的数据库> MySQLTable: <要使用的数据表> showDebug: true|false op_only_resync: true|false
例如:
MySQLServer: localhost MySQLPort: '3306' MySQLUsername: player_tracker MySQLPassword: fred123 MySQLDatabase: player_tracker MySQLTable: online_players showDebug: false op_only_resync: false
此插件将检查 'MySQLDatabase' 中是否存在必要的表;如果不存在,它将自动创建该表。
设置 showDebug 为 true 后,控制台会输出调试信息,让你能够跟踪插件在玩家连接/断开连接时的操作过程。
op_only_resync 决定是否仅允许管理员(ops)使用 '/onl resync' 命令。
示例 PHP 文件可在此处找到:
它应该能正常工作,但你需要根据你的 MySQL 登录信息更改相应的值。
关于所用每个函数的详细信息,自然可以在 php.net 网站上找到。
Description
This plugin will update a MySQL database table with a list of players as the join and disconnect from your game.
Originally created for the MCAddictGallery server, it was created so that we could have a live player listing on our website with minimal of fuss.
Currently the plugin tracks the following information:
- Player Name
- Previous World (used for when a player warps from one world to another)
- Current World (the current world the player is in)
- IP Address
- Logon Time (stored as seconds since epoch)
- Players permission group
- Flag to say whether the player is online or not.
Required Plugins to use this one
- Vault
Optional Plugins that provide extra features
- SimplyVanish - Not required, but if you want the players list to not show vanished players, then you will likely want this.
Configuration
config.yml
MySQLServer: localhost MySQLPort: '3306' MySQLUsername: <username for db> MySQLPassword: <password for db> MySQLDatabase: <database to use> MySQLTable: <table to use> showDebug: true|false op_only_resync: true|false
eg.
MySQLServer: localhost MySQLPort: '3306' MySQLUsername: player_tracker MySQLPassword: fred123 MySQLDatabase: player_tracker MySQLTable: online_players showDebug: false op_only_resync: false
This plugin will check to see if the necessary table exists in 'MySQLDatabase' and if it doesn't, it will create it.
showDebug will put debug information in the console allowing you to follow along what the plugin does when a player connects/disconnects.
op_only_resync determins if only ops can use '/onl resync' or not.
An example php file can be found here:
It should work just fine, though you will need to change values where necessary for your mysql logon information.
Information about each function used can naturally be found at the php.net website.
下载 OnlinePlayersSQL
下载 OnlinePlayersSQL
下载 OnlinePlayersSQL
下载 OnlinePlayersSQL
下载 OnlinePlayersSQL
下载 OnlinePlayersSQL
下载 OnlinePlayersSQL
下载 OnlinePlayersSQL
下载 OnlinePlayersSQL
下载 OnlinePlayersSQL
v1.9.6
hopefully 修复了权限组问题。
v1.9.5
我将能找到的其余日志输出都包裹在 showDebug 检查条件中。希望现在控制台窗口不会再被 SQL 更新/查询信息刷屏。
v1.9.4
时隔已久,我已将该插件使用的所有 SQL 查询切换为使用预处理语句(preparedstatements),这基本上消除了用户报告的所有 SQL 错误。
v1.9.3
修复了 updatePlayerRecord() 方法中的一些 SQL 查询问题,包括多余的逗号(仅在 Windows 上存在问题)和缺失的引号(据称也仅在 Windows 上存在问题)。
v1.9.2
修复了玩家死亡事件,希望能与 Citizens 更好地兼容。
v1.9.1
修复了插件 onEnable 方法中的 SQL 更新查询问题。
v1.9.0
已更新至 Craftbukkit v. 1.7.2-R0.2(最新发布的 beta 版本)。
标记为 beta 是因为尚未进行 100% 的测试。它应该能正常运行,但请遵循常规操作:备份 SQL 数据、备份你当前使用的插件版本,然后尝试新版本,查看是否正常工作等等……
接下来将修复 Citizens 的 bug 问题。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
插件
ExyliaPlugins 的库。
插件
通过对话框或铁砧界面帮助你的 Anthme
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
插件
用于绘制游戏内地图或在浏览器中随探索实时进行地图绘制的实时地图。
评论 0
登录后参与评分
还没有评论,来抢沙发吧