Git Product home page Git Product logo

mcdreforgedplugins's Introduction

Hello! I'm Andy Zhang

Blog Email bilibili RSS

I am a student studying Computer Science.

I am actively seeking a PhD position, with a particular interest in programs at UC Berkeley, Stanford, MIT, CMU, and others.

My GitHub Stats

Andy Zhang's Github Stats Most Used Languages

My Skills

Programming Languages

Skills Languages

Softwares & Tools

Skills Softwares Skills Online Skills Tools

Frameworks

Skills Frameworks

Others

Skills OS Skills Databases

Top Repositories

CurseForgeModpackDownloader MCDReforgedPlugins ChatHub

mcdreforgedplugins's People

Contributors

aimerny avatar alex3236 avatar anzhizhang avatar aurorataro avatar easonsyc avatar github-actions[bot] avatar linwendong83 avatar zhuruoling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mcdreforgedplugins's Issues

QQChat 相关功能无法正常使用

系统环境

操作系统

Windows Server 2019 Datacenter

网络情况

5700、5701 和 10676 端口均打开,且未被其他应用占用。
Minecraft 服务端占用 3500 端口。

Python 版本

3.8.6rc1 (64-bit)

Java 运行环境

Minecraft 服务端:

OpenJDK Runtime Environment (Alibaba Dragonwell 8.3.3) (build 1.8.0_242-b98)
OpenJDK 64-Bit Server VM (Alibaba Dragonwell 8.3.3) (build 25.242-b98, mixed mode)

Mirai 机器人:

OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_265-b01)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.265-b01, mixed mode)

机器人信息

MiraiOK 版本:MiraiOK 20200915.071520 windows-amd64
Mirai-console 版本:

Starting mirai-console...
2020-09-20 17:47:25 I/main: Backend: version 1.0-M4, built on 2020-09-13 02:19:35.
2020-09-20 17:47:25 I/main: Frontend Pure: version 1.0-M4, provided by Mamoe Technologies

CQHTTP-Mirai 插件信息:

2020-09-20 17:47:27 I/CQHTTP-Mirai: Plugin loaded! 0.2.4-SNAPSHOT-1.0-M4-dev
2020-09-20 17:47:27 I/CQHTTP-Mirai: 插件当前Commit 版本: c2c8ae6

CQHTTP-Mirai 插件配置:
<miraiok安装目录>\config\CQHTTP-Mirai\tech.mihoyo.mirai.Settings.yml

MCDR 信息

MCDR 版本:0.9.6
MCDR 插件列表:

[MCDR] [19:25:43] [InfoReactor/INFO]: 8x 已加载插件
[MCDR] [19:25:43] [InfoReactor/INFO]: - CoolQAPI-MCDR.py
[MCDR] [19:25:43] [InfoReactor/INFO]: - daycount.py
[MCDR] [19:25:43] [InfoReactor/INFO]: - Here.py
[MCDR] [19:25:43] [InfoReactor/INFO]: - joinMOTD.py
[MCDR] [19:25:43] [InfoReactor/INFO]: - OnlinePlayerAPI.py
[MCDR] [19:25:43] [InfoReactor/INFO]: - QQChat.py
[MCDR] [19:25:43] [InfoReactor/INFO]: - QuickBackupM.py
[MCDR] [19:25:43] [InfoReactor/INFO]: - tps.py
[MCDR] [19:25:43] [InfoReactor/INFO]: 0x 已禁用插件
[MCDR] [19:25:43] [InfoReactor/INFO]: 0x 未加载插件

以上插件在运行过程中均未产生任何报错。

问题描述

产生问题的步骤

  1. 登录 QQChat.py 中已经配置好的三个 admin_id 中的其中一个管理员 QQ 号。
  2. 启动 Mirai 程序,登录机器人 QQ 号,见上面附带的 CQHTTP-Mirai 配置文件第三行。
  3. Mirai 成功登录 QQ 号后,用 !!MCDR reload all 命令重载 MCDR。
    直接重启 MCDR 也尝试过,仍然有同样问题。
  4. 通过管理员 QQ 号,先后向机器人 QQ 号私聊发送 /bound/whitelist 命令。
  5. 从 Mirai 控制台可以看到机器人收到了私聊消息,但 MCDR 控制台中无任何反应。
  6. 通过已经配置在 QQChat.py 中 group_id 的 QQ 群,向机器人发送同样的消息。
  7. 从 Mirai 控制台可以看到机器人收到了群聊消息,但 MCDR 控制台中无任何反应。

由于我无法使用随 CoolQAPI 插件分发的 Mirai 包,我使用了其他渠道获取的 MiraiOK 包,
并对照随 CoolQAPI 分发的 CQHTTP-Mirai 配置文件 settings.yml,
修改了我手头 Mirai 包中的 CQHTTP-Mirai 插件配置文件,已经附在上文中。
但我并不能确定是否是我的配置有误导致了机器人与 MCDR 没能共同工作。

希望可以得到您的帮助,非常感谢!

[Plugin name]: Title

OnlinePlayerAPI.py

加载失败

报错:
[MCDR] [08:08:47] [MainThread/ERROR]: 插件 OnlinePlayerAPI.py 加载失败
Traceback (most recent call last):
File "D:\我的世界服务器研究\MCFab1164\utils\plugin_manager.py", line 63, in load_plugin
plugin.load()
File "D:\我的世界服务器研究\MCFab1164\utils\plugin.py", line 82, in load
self.module = tool.load_source(self.file_path)
File "D:\我的世界服务器研究\MCFab1164\utils\tool.py", line 25, in load_source
spec.loader.exec_module(module)
File "", line 779, in exec_module
File "", line 916, in get_code
File "", line 846, in source_to_code
File "", line 219, in _call_with_frames_removed
File "plugins\OnlinePlayerAPI.py", line 7

^
SyntaxError: invalid syntax

QQChat 插件运行中报错:json.decoder.JSONDecodeError

服务端环境

MCDR 版本:0.9.6
Minecraft 服务端核心:Fabric
所有安装的 MCDR 插件:

!!MCDR plugin list
[MCDR] [16:37:35] [InfoReactor/INFO]: 8x 已加载插件
[MCDR] [16:37:35] [InfoReactor/INFO]: - CoolQAPI-MCDR.py
[MCDR] [16:37:35] [InfoReactor/INFO]: - daycount.py
[MCDR] [16:37:35] [InfoReactor/INFO]: - Here.py
[MCDR] [16:37:35] [InfoReactor/INFO]: - joinMOTD.py
[MCDR] [16:37:35] [InfoReactor/INFO]: - OnlinePlayerAPI.py
[MCDR] [16:37:35] [InfoReactor/INFO]: - QuickBackupM.py
[MCDR] [16:37:35] [InfoReactor/INFO]: - tps.py
[MCDR] [16:37:35] [InfoReactor/INFO]: - QQChat.py
[MCDR] [16:37:35] [InfoReactor/INFO]: 0x 已禁用插件
[MCDR] [16:37:35] [InfoReactor/INFO]: 0x 未加载插件

问题描述

用 MCDR 启动了上述服务端后,控制台反复跳出如下报错:

[MCDR] [16:31:23] [PT2-on_info@QQChat/ERROR]: Error calling on_info in plugin QQChat
Traceback (most recent call last):
  File "C:\MARYT-Servers\MCDReforged-0.9.6\utils\plugin_thread.py", line 41, in run
    task_data.func(*task_data.args)
  File "plugins\QQChat.py", line 263, in on_info
    forward_list = get_forward()
  File "plugins\QQChat.py", line 306, in get_forward
    return json.load(f)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\json\__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

因为与 MCDR 及其 QQ 相关插件衔接的 QQ 机器人尚未配置完毕,
所以我并不能确定这个报错是否影响到插件的正常功能使用;
但是报错非常频繁,以至于出现了 log spam 的情况,严重干扰到正常的控制台管理。

想问一下这个情况与哪些可能的原因有关?需要我做哪些操作予以解决?
非常感谢。

[Advanced Calculator]: Some Bugs

一些小问题

(1) 运算 -> 复杂运算,如=2**2**2**2**2**2**2**2**2**2 or !!calc 2**2**2**2**2**2**2**2**2**2 的指令大量执行会阻塞线程

(2) 合法性校验 ->非无符号整型,如!!calc item -1 or !!calc item 3.3

(3) 异常抛出 ->TypeError,如!!calc item [] or !!calc item chr(32)

[Gamemode]: 重载/重启服务器后会使玩家保存的状态失效

Describe

可以使玩家在某些条件下完成远距离传送

Details

玩家使用!!spec指令后,若重载插件后,玩家再次!!spec会使玩家再一次进入到观察者,并刷新观察上线位置。在此之前移动到想要的位置并输入两次!!spec就可以传送到该位置

Expected behavior

在重载插件后保留玩家的旁观、位置数据

在MCDR1.5.1加载StartStopHelperR失败

!!MCDR plugin load StartStopHelperR.py
[MCDR] [13:16:34] [TaskExecutor/INFO]: 正在从 plugins\StartStopHelperR.py 加载插件
[MCDR] [13:16:34] [TaskExecutor/ERROR]: 插件 RegularPlugin[file=StartStopHelperR.py,path=plugins\StartStopHelperR.py,state=0] 加载失败
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\mcdreforged\plugin\plugin_manager.py", line 170, in __load_plugin
plugin.load()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\mcdreforged\plugin\regular_plugin.py", line 87, in load
self.__load_instance()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\mcdreforged\plugin\regular_plugin.py", line 67, in __load_instance
self.module_instance = misc_util.load_source(self.file_path)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\mcdreforged\utils\misc_util.py", line 31, in load_source
spec.loader.exec_module(module)
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "plugins\StartStopHelperR.py", line 4, in
from mcdreforged.plugin.server_interface import PluginServerInterface
ImportError: cannot import name 'PluginServerInterface' from 'mcdreforged.plugin.server_interface' (C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\mcdreforged\plugin\server_interface.py)
[MCDR] [13:16:34] [TaskExecutor/INFO]: 插件 "StartStopHelperR.py" 加载失败

[Bot] 其它假人插件数据迁移脚本

CarpetBotManager

import json

with open('config.json', encoding='utf-8') as f:
    bots = json.load(f)['bots']

for name, bot in bots.items():
    # Location
    print('!!bot save {} {} {} {}'.format(
        name,
        ' '.join(map(str, bot['pos'])),
        ' '.join(map(str, bot['rotation'])),
        bot['dim']
    ))

    # Comment
    if bot['desc'] != 'Nothing here.':
        print(f'!!bot config {name} comment {bot["desc"]}')

    # Actions
    for action in bot['actions']:
        print(f'!!bot config {name} actions append {action}')

[advanced_calculator]: Security problem

Describe

Using eval() is unsafe.

Details

The plugin uses the eval() function to evaluate expressions,but the eval() function has security holes.It allows players to execute remote commands through shell.

Example

We can upload the files to the remote server.
tt

[MinedRanking]: 插件加载失败

MCDR v2.3.2
Python v3.9.2
OS: Debian (Linux) 11

[MCDR] [2022-03-23 19:56:06] [TaskExecutor/ERROR]: 插件 SoloPlugin[file=MinedRanking.py,path=plugins/MinedRanking.py,state=PluginState.LOADING] 加载失败
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/mcdreforged/plugin/plugin_manager.py", line 168, in __load_plugin
    plugin.load()
  File "/usr/local/lib/python3.9/dist-packages/mcdreforged/plugin/type/regular_plugin.py", line 93, in load
    self._on_load()
  File "/usr/local/lib/python3.9/dist-packages/mcdreforged/plugin/type/solo_plugin.py", line 47, in _on_load
    self._load_entry_instance()
  File "/usr/local/lib/python3.9/dist-packages/mcdreforged/plugin/type/regular_plugin.py", line 65, in _load_entry_instance
    self.entry_module_instance = self._get_module_instance()
  File "/usr/local/lib/python3.9/dist-packages/mcdreforged/plugin/type/solo_plugin.py", line 39, in _get_module_instance
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "plugins/MinedRanking.py", line 34, in <module>
    class MinedRanking(Thread):
  File "plugins/MinedRanking.py", line 35, in MinedRanking
    def __init__(self, server: ServerInterface, config):
NameError: name 'ServerInterface' is not defined

[QQChat | Bug] 配置项server_name疑似无效

在QQChat插件中,其配置文件config.json中默认没有server_name配置项。根据说明,或许是能添加server_name配置项,但是添加之后启动服务器会直接直接重置config.json文件。导致需要重新配置插件。以下是详细信息。
修改config为以下格式:

{
"main_group": [
XXXXXXX
],
"manage_groups": [
],
"message_sync_groups": [
],
"server_name": 'someServerName', //此行 为手动添加项
"admins": [
XXXXXXX
],
......

保存退出并重载服务器(完全重启)后,config.json重置变回默认格式。
抱歉,我不是很懂插件的运作方式,如有勘误请指教。(っ◞‸◟c)

[Gamemode]: 能给gamemode插件加个权限控制吗

Describe

Details

Some details for your issue.

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

[QQChat] 消息转发相关功能无法正常工作

          ### http连接时,go-cqhttp后台反复刷屏"上报Event数据到 '反向http post地址'  失败"

抱歉,我遇到上述问题。根据文档的配置,http通信地址对应了'api_host',而反向http post地址对应了'post_host'。配合QQChat插件,qq机器人能一定程度和mc通信(help和绑定白名单指令能正常工作,能从MC发消息到QQ,而QQ不能发消息到MC)。
但是go-cqhttp的控制台一直反复报错:
dss (2)

抱歉,我不是很理解插件和go-cqhttp的工作原理,实在不清楚报错原因。网上案例好像很少,没有找到解决方案。

下面是服务端信息:

  • MCDR版本: 2.9.0
  • QQAPI版本:1.2.1
  • QQChat版本:2.0.0
  • mc服务端:1.20 Fabric
  • go-cqhttp版本:1.0.0
  • go-cqhttp选择的连接方式 http

go-cqhttp / config.yml :

  • http: # HTTP 通信设置
    address: 0.0.0.0:5700 # HTTP监听地址
    version: 11 # OneBot协议版本, 支持 11/12
    timeout: 5 # 反向 HTTP 超时时间, 单位秒,<5 时将被忽略
    long-polling: # 长轮询拓展
    enabled: false # 是否开启
    max-queue-size: 2000 # 消息队列大小,0 表示不限制队列大小,谨慎使用
    middlewares:
    <<: *default # 引用默认中间件
    post: # 反向HTTP POST地址列表

qq_api / config.json :
{
"api_host": "127.0.0.1",
"api_port": 5700,
"post_host": "127.0.0.1",
"post_port": 5701
}

go-cqhttp控制台警告消息刷屏 :
[WARNING] : 上报 Event 数据到 http://127.0.0.1:5701 失败:Post "http://127.0.0.1:5701": EOF 将进行第 1 次重试
[WARNING] : 上报 Event 数据到 http://127.0.0.1:5701 失败:Post "http://127.0.0.1:5701": EOF 将进行第 1 次重试
....

[Gamemode]: 如何解决玩家名称前缀问题

发现过程

不久前,我对我的服务器引进了称号系统(用原版的Team实现,格式是 [称号]名称 ),在加上前缀后,我发现Gamemode就不好使了。输入!!spec没反应,啥事没有
后来我了解到这似乎是因为MCDR只会接收玩家“显示的名称”,于是我翻看MCDR帮助文档中服务端处理器部分并成功把其中展示的处理器示例实装到服务器上,但后面还是出了问题,就来这发issue了

问题

实装处理器后的服务端能够接到并处理带有前缀玩家发送的!!MCDR命令、其他插件的命令,但Gamemode插件失效了,实装处理器后使用!!spec时会提示已切换至旁观模式,但就是无法成功切换,仍然停留在生存
搭载服务端的系统:Centos 7.3
Python 3.9.5
Java:
openjdk version "16.0.1" 2021-04-20
OpenJDK Runtime Environment 21.3 (build 16.0.1+9)
OpenJDK 64-Bit Server VM 21.3 (build 16.0.1+9, mixed mode, sharing)
游戏版本1.17
加载的所有插件:

[MCDR] [10:49:07] [TaskExecutor/INFO]: 26x 已加载插件
[MCDR] [10:49:07] [TaskExecutor/INFO]: - beep ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - BiliWiki ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - calculator ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - ConfigAPI ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - CoolQAPI ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - daycount ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - Daytime ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - Gamemode ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - Here ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - JsonDataAPI ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - Markit ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - Task ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - MCDReforged ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - Minecraft Data API ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - OnlinePlayerAPI ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - pget_pure ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - QQChat ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - Quick Backup Multi ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - seed ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - Start Stop Helper ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - stext ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - test ([email protected])  <-这个是我自己写的TPA插件
[MCDR] [10:49:07] [TaskExecutor/INFO]: - Timed QBM ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: - tpa ([email protected])
[MCDR] [10:49:07] [TaskExecutor/INFO]: 0x 已禁用插件
[MCDR] [10:49:07] [TaskExecutor/INFO]: 0x 未加载插件

游戏内信息:
B %(N9_6_GMEG7E7 J @B49
控制台报错:

[Server] [10:39:29] [Server thread/INFO]: <[赞助者]boring_314> !!spec
[Server] [10:39:29] [Server thread/INFO]: [赞助者]boring_314 has the following entity data: "minecraft:overworld"
[MCDR] [10:39:34] [Gamemode switch mode/WARNING]: [Minecraft Data API] Query for player boring_314 at path  Dimension timeout
Exception in thread Gamemode switch mode:
Traceback (most recent call last):
  File "/usr/local/python3/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/usr/local/python3/lib/python3.9/threading.py", line 892, in run
    self._target(*self._args, **self._kwargs)
  File "/root/MCDReforged/plugins/Gamemode.py", line 67, in change_mode
    sur_to_spec(server, player)
  File "/root/MCDReforged/plugins/Gamemode.py", line 155, in sur_to_spec
    dim = DIMENSIONS[api.get_player_info(player, 'Dimension')]
KeyError: None

这是为什么,我该如何解决这个问题?

[bot] 保存假人报错

使用!!bot save 1 时报错,报错内容如下
Error when executing command "!!bot save 1" with command source "Player Doubted2
Traceback (most recent call last):
File "C:\Users\vdyik\AppData\Local\Programs\Python\Python310\lib\site-packages\mcdreforged\command\command_manager.pye
node.execute(source, command)
File "C:\Users\vdyik\AppData\Local\Programs\Python\Python310\lib\site-packages\mcdreforged\command\builder\nodes\basie
self._execute_command(CommandContext(source, command))
File "C:\Users\vdyik\AppData\Local\Programs\Python\Python310\lib\site-packages\mcdreforged\command\builder\nodes\basid
child_literal._execute_command(context)
File "C:\Users\vdyik\AppData\Local\Programs\Python\Python310\lib\site-packages\mcdreforged\command\builder\nodes\basid
if not self.__smart_callback(self._requirement, context.source, context):
File "C:\Users\vdyik\AppData\Local\Programs\Python\Python310\lib\site-packages\mcdreforged\command\builder\nodes\basik
return callback(*args[:spec_args_len])
File "plugins\Bot-v1.0.2.mcdr\bot\command_handler.py", line 87, in
lambda src: src.has_permission(permissions['save'])
KeyError: 'save'

MCDR 插件对外接口 API

为方便其他服务通过接口与 MCDR 插件交互,计划发布一个 API 插件,提供 HTTP 的接口能力,其它插件可以注册对外提供的接口。

在某技术大佬的敦促下,决定框架选型 fastapi

现在下方征求该插件命名

Originally posted by @AnzhiZhang in #145 (comment)

[QQChat]群聊内命令/list返回信息有误

在群聊内使用/list时,返回的玩家名单是开服以来登录过的玩家的名单而非实际在线名单。如图所示:
-42ff2d79c011dc93
插件和依赖都是最新版,服务端是Paper系。

[bot]: index 的页码列表在哪,没找到,假人动作用不了

Describe

A clear and concise description of your issue.

Details

Some details for your issue.

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

[Advanced Calculator]: Security

#48 中的问题并未完全解决

在命令!!calc item中,eval()的执行未经过滤。但由于参数分割及if len(ctx) == 1:的限制,使得形如!!calc item __import__("os").system("echo Hello!")含有空格的指令无法被eval()执行。但仍可通过字符拼接的方式成功执行:!!calc item __import__("os").system("echo+chr(32)+Hello!")

`

[QQChat]: 无法加载插件

Error invoking listener EventListener[[email protected],priority=1000,callback=<function on_load at 0x00000210DE1AAC20>]
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\mcdreforged\plugin\plugin_manager.py", line 474, in trigger_listener
listener.execute(listener.plugin.server_interface, *args)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\mcdreforged\plugin\plugin_event.py", line 79, in execute
return self.callback(*args, **kwargs)
File "F:\rb\mcdr\plugins\QQChat.py", line 62, in on_load
from ConfigAPI.py import Config
ModuleNotFoundError: No module named 'ConfigAPI'

[Bot]: Feature:自动更新

Description丨描述

假人下线时自动更新位置维度等信息,这样上线时可以按照下线的位置,同时模拟原版行为,用于世吞等需要假人移动的机器。现在计划把这个功能做一个设置,可以选择每个假人是否自动更新。
征求两个意见:
1.这个功能默认开启还是关闭?还是在配置文件中设置这个设置的默认值?
2.这个功能应该做 True/False 设置还是 list 设置,即全部更新或更新部分内容(位置、方向、维度)
28%$F%OQ0(12` GVPJY X63

[qqchat]:mc的消息无法同步到qq群

系统环境

debain9
python 3.8.3
mcdr 1.3

插件版本

qqchat 0.0.1
coolapi 0.0.10
onlineplayerapi
0.0.1configapi 0.0.1
jsondataapi 0.0.1

bot使用go-cqhttp

问题描述:根据教程配置文件安装,安装成功后,qq可以发送消息到mc,但是mc不能向qq发送消息,机器人后台也收到任何消息。我处理你配置文件如下!
coolqapi配置文件
a2

qqchat配置文件
a1

go-cqhttp配置文件
a

发送!!qq 后台 无反应
a3

Suggestion: Why not use a faster third-party json library like ujson for implementation?

As we all know, the python standard json library has been criticized for its inefficient implementation. So since this project provides a convenient Json package, why not use some more efficient and easy-to-use third-party json library by the way. Like ujson, it has the same usage as the standard json library, except that it needs to be installed as a third-party library. This seems to reduce the experience a little bit, but compared to the efficiency improvement it brings, that is worthful.

There is no doubt about the efficiency improvement from these third-party json libraries. There are some evaluations about it:

Benchmark of Python JSON libraries
Benchmark on home page of ujson library

And some of my light experience tells me that ujson is more than an order of magnitude faster than json. So why not use it?

[MinedRanking]: 能整个实时更新吗?

Describe

A clear and concise description of your issue.

Details

Some details for your issue.

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

个别玩家!!spec失效

情景:我使用!!spec后因聊天验证被t出服务器,再次进入发现自己模式变成了冒险,我又再次输入!!spec又因同样原因被踢出,可这次进入模式并没有改为生存,还是冒险模式。之后我大退(重启游戏)没有出现聊天框一打字就被t出的情况,但是却发现!!spec对我无效了,我不管怎么使用都无法切换模式
5941e66f430b4b4c7ac009a8bd4fc9a4
其他人可以正常使用,就我无法正常使用,服务器后台输出如下:
image
以下是服务器其他玩家正常使用图片及服务器后台输出
image
image
最后我还把出现问题的日志也要来了
日志.zip

[QQChat]: 未来更新计划一览

  • 代码重构,拆分文件
  • 语言国际化,将硬编码的回复转移到语言文件
  • 用户个性化,用户可以使用配置文件覆盖语言文件
  • /list /mc /bound 等命令在多服情况下支持统一回复
  • 玩家上下线信息发送到 sync 群

suggestion info: More functions and bug

希望能够加入tps和mstp功能,和更多关于Minecraft 服务器本身的信息,例如server占用内存,在线人数,服务端版本信息和离线在线等

[QQAPI&QQchat]: 插件报错

[MCDR] [12:04:46] [TaskExecutor/ERROR]: Error invoking listener EventListener[[email protected],priority=1000,callback=<function on_load at 0x00000217BFE2A790>]
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\mcdreforged\plugin\plugin_manager.py", line 589, in trigger_listener
listener.execute(listener.plugin.server_interface, *args)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\mcdreforged\plugin\plugin_event.py", line 106, in execute
return self.callback(*args, **kwargs)
File "plugins\QQAPI-v1.1.1.mcdr\qq_api_init_.py", line 41, in on_load
_bot = CQHttp(api_root=f"http://{config.api_host}:{config.api_port}")
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\aiocqhttp_init
.py", line 135, in init
self._server_app = Quart(import_name, **(server_app_kwargs or {}))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\quart\app.py", line 308, in init
self.first_request_lock = self.lock_class()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\locks.py", line 81, in init
self.loop = events.get_event_loop()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 642, in get_event_loop
raise RuntimeError('There is no current event loop in thread %r.'
RuntimeError: There is no current event loop in thread 'TaskExecutor'.
[MCDR] [12:04:46] [TaskExecutor/INFO] [qq_chat]: 配置文件已加载
[MCDR] [12:04:46] [TaskExecutor/ERROR]: Error invoking listener EventListener[[email protected],priority=1000,callback=<function on_load at 0x00000217C0844550>]
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\mcdreforged\plugin\plugin_manager.py", line 589, in trigger_listener
listener.execute(listener.plugin.server_interface, *args)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\mcdreforged\plugin\plugin_event.py", line 106, in execute
return self.callback(*args, **kwargs)
File "plugins\QQChat-v1.0.0.mcdr\qq_chat_init
.py", line 68, in on_load
final_bot = server.get_plugin_instance('qq_api').get_bot()
File "plugins\QQAPI-v1.1.1.mcdr\qq_api_init
.py", line 106, in get_bot
return __bot
NameError: name 'bot' is not defined
[MCDR] [12:05:03] [TaskExecutor/ERROR]: Error invoking listener EventListener[[email protected],priority=1000,callba]
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\mcdreforged\plugin\plugin_managr
listener.execute(listener.plugin.server_interface, *args)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-packages\mcdreforged\plugin\plugin_evente
return self.callback(*args, **kwargs)
File "plugins\QQChat-v1.0.0.mcdr\qq_chat_init
.py", line 88, in on_server_startup
send_msg_to_all_groups('Server is started up')
File "plugins\QQChat-v1.0.0.mcdr\qq_chat_init
.py", line 270, in send_msg_to_all_groups
event_loop.run_until_complete(
NameError: name 'event_loop' is not defined
go-cqhttp也报错
[2023-02-18 12:07:11] [WARNING]: 上报 Event 数据到 http://127.0.0.1:5701/ 失败: Post "http://127.0.0.1:5701/": dial tcp 127.0.0.1:5701: connectex: No connection could be made because the target machine actively refused it. 将进行第 1 次重试
[2023-02-18 12:07:15] [WARNING]: 上报 Event 数据到 http://127.0.0.1:5701/ 失败: Post "http://127.0.0.1:5701/": dial tcp 127.0.0.1:5701: connectex: No connection could be made because the target machine actively refused it. 将进行第 2 次重试
[2023-02-18 12:07:18] [WARNING]: 上报 Event 数据到 http://127.0.0.1:5701/ 失败: Post "http://127.0.0.1:5701/": dial tcp 127.0.0.1:5701: connectex: No connection could be made because the target machine actively refused it. 将进行第 3 次重试
[2023-02-18 12:07:22] [WARNING]: 上报 Event 数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1676693229,"self_id":3537494107,"interval":5000,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":25,"packet_sent":16,"packet_lost":0,"message_received":0,"message_sent":0,"disconnect_times":0,"lost_times":0,"last_message_time":0}}}

QQChat 插件加载失败

系统环境

操作系统:Windows Server 2019 Datacenter
Python 版本:3.8.6-rc1(64bit)

服务端环境

MCDR 版本:0.9.6
Minecraft 服务端核心:Fabric
所有安装的 MCDR 插件:

!!MCDR plugin list
[MCDR] [12:31:52] [InfoReactor/INFO]: 7x 已加载插件
[MCDR] [12:31:52] [InfoReactor/INFO]: - CoolQAPI-MCDR.py
[MCDR] [12:31:52] [InfoReactor/INFO]: - daycount.py
[MCDR] [12:31:52] [InfoReactor/INFO]: - Here.py
[MCDR] [12:31:52] [InfoReactor/INFO]: - joinMOTD.py
[MCDR] [12:31:52] [InfoReactor/INFO]: - OnlinePlayerAPI.py
[MCDR] [12:31:52] [InfoReactor/INFO]: - QuickBackupM.py
[MCDR] [12:31:52] [InfoReactor/INFO]: - tps.py
[MCDR] [12:31:53] [InfoReactor/INFO]: 0x 已禁用插件
[MCDR] [12:31:53] [InfoReactor/INFO]: 1x 未加载插件
[MCDR] [12:31:53] [InfoReactor/INFO]: - QQChat.py

问题描述

已经安装了 requirements.txt 中包含的所有依赖模块。

安装完成后,服务器启动时,和使用
!!MCDR plugin reloadall
重载插件时,MCDR 抛出如下异常:
https://paste.ubuntu.com/p/RQ493Rz7wZ/

[QQChat]: ChatBridge支持?

最近在用ChatBridge
但是里面的QQ客户端有bug不能用
而且QQChat功能更丰富
我的服务器还是群组服(在代理端装MCDR没有什么用(而且MCDR不支持我用的Velocity代理端))
所以想要能支持ChatBridge
谢谢

[OnlinePlayerAPI] 关于统计海尔威的FZ-sDataPack-Plus-Plus数据包创建的假人

大佬您好,目前发现通过FZ-sDataPack-Plus-Plus数据包创建的假人,只能在创建时添加到在线列表,kill时并不会从列表中移除,导致只要假人创建就会一直存在于列表。(这个数据包为了假人不被计分板统计在创建假人时给假人加了分组和tag,并且显示的名字前面会有“假的 ”前缀。)我读了您的源码判断这有可能是MCDR底层的原因,想向大佬求证一下,或者看看大佬有什么可行的解决方案,谢谢啦

QQChat 插件报错:ProxySchemeUnknown: Not supported proxy scheme None

MCDR 版本

0.9.6

所有安装的插件

[MCDR] [15:16:13] [InfoReactor/INFO]: 8x 已加载插件
[MCDR] [15:16:13] [InfoReactor/INFO]: - CoolQAPI-MCDR.py
[MCDR] [15:16:13] [InfoReactor/INFO]: - daycount.py
[MCDR] [15:16:13] [InfoReactor/INFO]: - Here.py
[MCDR] [15:16:13] [InfoReactor/INFO]: - joinMOTD.py
[MCDR] [15:16:13] [InfoReactor/INFO]: - OnlinePlayerAPI.py
[MCDR] [15:16:13] [InfoReactor/INFO]: - QQChat.py
[MCDR] [15:16:13] [InfoReactor/INFO]: - QuickBackupM.py
[MCDR] [15:16:13] [InfoReactor/INFO]: - tps.py
[MCDR] [15:16:13] [InfoReactor/INFO]: 0x 已禁用插件
[MCDR] [15:16:13] [InfoReactor/INFO]: 0x 未加载插件

系统环境

Windows 10 专业工作站版,版本号 20H2
考虑到报错中包含 Proxy,我将“网络和 Internet 设置”中的“手动设置代理”设为“关”,但仍然没有解决问题。
环境变量中有一个http_proxy,值是127.0.0.1:7890,应该是代理软件 ClashForWindows 添加的,不确定有没有影响。

报错内容

[MCDR] [15:10:53] [PT0-on_info@QQChat/ERROR]: Error calling on_info in plugin QQChat
Traceback (most recent call last):
  File "C:\MARYT\MARYT Classic\utils\plugin_thread.py", line 41, in run
    task_data.func(*task_data.args)
  File "plugins\QQChat.py", line 267, in on_info
    send_private_msg(info.raw_content, a)
  File "plugins\QQChat.py", line 296, in send_private_msg
    requests.post(f'http://{host}:{port}/send_private_msg', json=data)
  File "C:\Program Files\Python39\lib\site-packages\requests\api.py", line 119, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "C:\Program Files\Python39\lib\site-packages\requests\api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Program Files\Python39\lib\site-packages\requests\sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Program Files\Python39\lib\site-packages\requests\sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "C:\Program Files\Python39\lib\site-packages\requests\adapters.py", line 412, in send
    conn = self.get_connection(request.url, proxies)
  File "C:\Program Files\Python39\lib\site-packages\requests\adapters.py", line 309, in get_connection
    proxy_manager = self.proxy_manager_for(proxy)
  File "C:\Program Files\Python39\lib\site-packages\requests\adapters.py", line 193, in proxy_manager_for
    manager = self.proxy_manager[proxy] = proxy_from_url(
  File "C:\Program Files\Python39\lib\site-packages\urllib3\poolmanager.py", line 492, in proxy_from_url
    return ProxyManager(proxy_url=url, **kw)
  File "C:\Program Files\Python39\lib\site-packages\urllib3\poolmanager.py", line 429, in __init__
    raise ProxySchemeUnknown(proxy.scheme)
urllib3.exceptions.ProxySchemeUnknown: Not supported proxy scheme None

问题补充

这个问题是我在将 MCDR 连同服务端一起迁移到另一台机器上时出现的。
Minecraft 服务端可以正常工作,但是 QQChat 频繁产生上述报错,影响到了服务端控制台的正常使用。
我不能确定是因为什么原因产生的,希望能得到你的帮助。
非常感谢你的耐心帮助!

[bot]: Feature: tag功能

Description丨描述

添加假人tag功能,服务器假人过多的时候使用tag便于查找,例如!!bot list , 更进一步的话希望能有个tag菜单的功能,列出所有tag,然后自行选择

[Gamemode]: Adding structure support for MCDR 2.x

Describe

In MCDR 2.x, it is impossible to depend on Python .py files other than the file itself same as MCDR 1.x. Therefore, it is strongly recommended to remove these two APIs.

Details

For ConfigAPI, it is possible to use MCDR APIs to get coordinates, which is easy to be changed. For JSONDataAPI, it is possible to use similar methods to some other plugins (e.g. TimedQBM).

[Gamemode]: 玩家加入服务器时加载失败

首次加载插件时和玩家进入服务器时报错,!!spec无反应

(U4DI4G`PEH122{I8VHXHRN

_H{_D46SBSKRJN$EEBGPI

系统:Windows 10.0.22621.1413
服务端:fabric-server-mc.1.18.2-loader.0.14.17-launcher.0.11.2 未添加mod
Python版本:v3.11.1:a7a450f
Java版本:17.0.6 x86_64
MCDR版本:2.7.2
依赖:
image
已加载插件:
@0%RL6{RB@QWG 1EBI7AI2C

[QQAPI | Feature Request]: Websocket mode support

The websocket mode is more stable, at least for go-cqhttp. In HTTP mode, inexplicable problems often occur when the settings are correct. This is not a QQAPI problem, but adding ws mode is good for everyone ;)

[QQChat]: Is QQChat no longer supported?

After you removed QQChat from your repo, I've looked for alternatives for it. However, ChatBridge is to huge for me (both client and server needed) and other plugins that link QQ to the game don't support automatic forwarding (though it isn't difficult to implement).

So is QQChat no longer supported? Or are there any alternatives in development?

对接到gocq后goce一直警告上报数据失败

对接之后BOT是能用的,但是时不时会出现以下警告
[2023-03-01 00:11:50] [WARNING]: 上报 Event 数据到 http://127.0.0.1:5701/ 失败: Post "http://127.0.0.1:5701/": read tcp 127.0.0.1:64460->127.0.0.1:5701: wsarecv: An existing connection was forcibly closed by the remote host. 将进行第 1 次重试
[2023-03-01 00:12:00] [WARNING]: 上报 Event 数据到 http://127.0.0.1:5701/ 失败: Post "http://127.0.0.1:5701/": read tcp 127.0.0.1:64463->127.0.0.1:5701: wsarecv: An existing connection was forcibly closed by the remote host. 将进行第 1 次重试
[2023-03-01 00:12:50] [WARNING]: 上报 Event 数据到 http://127.0.0.1:5701/ 失败: Post "http://127.0.0.1:5701/": read tcp 127.0.0.1:64469->127.0.0.1:5701: wsarecv: An existing connection was forcibly closed by the remote host. 将进行第 1 次重试

[ColoredChat]: Bug Report: ColoredChat can only recognize text starting with &

Describe

When the format control character appears in the middle of a chat text instead of the beginning of the line, the plug-in will not work properly.

Details

Take the following figure as an example:
image
Here, the &a in the line should be parsed, but it doesn't actually happen.

Expected behavior

The expected result is shown in the figure below:
image
However, I did it by adding &f at the beginning of the line.

Additional context

So after a lot of testing, it is found that the entire line will be parsed only when the control character appears at the beginning of the line. This is a functional bug. Read the code and speculate that the match function of the re module may have been misused. This function only provides regular expression matching at the beginning of the string. The search function should be used to achieve in-line matching.

Also see: search-vs-match

To solve this problem, my opinion is as follows:
Change line 28 of the ColoredChat.py file:

        if re.match(r'&[0-9a-z]', info.content):

to

        if re.search(r'&[0-9a-z]', info.content):

[ColoredChat]: 加载失败,没有 mcdreforged.info 这个模块。

[coloredChat]: 加载失败,没有 mcdreforged.info 这个模块。(应该是个简单的问题,但是我不懂python所以没法解决)
image

配置:
centOS8.5 x86_64
python:@3.8.latest
mcdr:@2.3.1
依赖包:
image

mcdr安装方式:
下载: pip install mcdreforged
初始化: python -m mcdreforged init
ps:我记得旧版本有一个 requirements.txt 记录了四个依赖,该版本按照文档使用了python init 的方式,根目录中没有requirements.txt文件了,我自己也没有手动安装过之前依赖了,我想这个过程应该已经被init做过了吧。服务器可以启动,其他插件没有问题

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.