描述
此插件会在玩家加入或离开游戏时,使用玩家列表更新 MySQL 数据库表。
该插件最初是为 MCAddictGallery 服务器创建的,目的是让我们能够以最少的工作量在网站上实现实时的玩家列表展示。
目前,该插件追踪以下信息:
- 玩家名称
- 上一世界(用于当玩家从一个世界传送至另一个世界时)
- 当前世界(玩家当前所在的世界)
- IP 地址
- 登录时间(存储为自纪元以来的秒数)
- 玩家的权限组
- 标记玩家是否在线的标志。
运行本插件所需的插件
可选插件(提供额外功能)
- 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
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.
评论 0
登录后参与评分
还没有评论,来抢沙发吧