add 双服信息互通 plugin - #196
Open
hunhaa wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
双服信息互通
插件简介
本插件是一款基于ToolDelta和PHP的双服/多服互通插件
它通过一个中心化的PHPapi进行消息中转,实现多个租赁服之间的聊天互通、命令执行和人数查询功能
本插件提供两种部署方案,适配各类服务器和虚拟主机环境
文件说明
__init__.py: ToolDelta插件主程序datas.json: 插件元数据信息api-sql.php: PHPapi数据库版源码api-file.php: PHPapi纯文件版源码database.sql: 数据库建表语句(仅数据库版需要)部署教程
第一步:部署api端
请根据你的服务器环境,从以下两种方案中选择一种进行部署
数据库版(适合有MySQL环境的服务器/面板/虚拟主机)
此方案使用MySQL存储中转数据,性能更好,支持高并发,适合长期稳定运行
database.sql文件,完成数据表创建api-sql.php,修改顶部的数据库配置:$DB_HOST: 数据库地址(通常为 localhost)$DB_NAME: 数据库名$DB_USER: 数据库用户名$DB_PASS: 数据库密码$VALID_KEY: 通信密钥 (请修改为一个复杂的字符串,并牢记)api_sql.php重命名为api.php,并上传至你的网站目录纯文件版 (适合无数据库的环境)
此方案使用本地 JSON 文件存储中转数据,无需配置数据库,内置文件排他锁机制,防止高并发下数据损坏
api_file.php,修改顶部的配置:$VALID_KEY: 通信密钥 (必须与插件端一致)api_file.php重命名为api.php,并上传至你的网站目录cross_server_data.json数据文件第二步:配置插件端
插件配置文件/双服信息互通.json,按照以下说明进行修改:{ "API地址": "https://你的域名或IP/api.php", "通信密钥": "你设置的通信密钥", "本服名称": "A服", "目标服名称": "B服", "轮询间隔_秒": 1.0 }