Git Product home page Git Product logo

mcdreforged's Introduction

MCDReforged

Python Versions PyPI Version Docker License Documentation Status

MCDR-banner

English | 中文

This is a python based Minecraft server control tool

MCDReforged (abbreviated as MCDR) is a tool which provides the management ability of the Minecraft server using custom plugin system. It doesn't need to modify or mod the original Minecraft server at all

From in-game calculator, player high-light, to manipulate scoreboard, manage structure file and backup / load backup, you can implement these by using MCDR and related plugins

Greatly thanks to chino_desu and his MCDaemon 1.0 for the idea of such a cool Minecraft control tool

Contact me on discord: Fallen_Breath#1215

Advantage

  • It's running above the server. It doesn't need to modify the server at all which keep everything vanilla
  • Hot-reloadable plugin system. You don't need to shut down the server to update the plugins
  • Multi-platform / server compatibility. Supports vanilla, paper, bungeecord etc. on Linux / Windows

How it works?

MCDR uses Popen to start the server as a sub-process, then it has the ability to control the standard input / out stream of the server

Since the console output of a Minecraft server has a stable format and contains a large amount of useful information about the server, e.g. player chat messages, MCDR is able to parse and analyze the server output, abstract them into different events and dispatch them towards plugins for responding

With the help of Minecraft command system, MCDR can send Minecraft commands via the standard input stream to affect the actual Minecraft server

That's it, you can even think of MCDR as a robot that stares at the server console and can quickly respond to server output and input related commands if you like

Plugin

Here is a MCDR plugin collection repository

Document

Check https://docs.mcdreforged.com/ for more details of MCDR

mcdreforged's People

Contributors

401u avatar alex3236 avatar anzhizhang avatar charassss avatar chunkasgore avatar cursor-s avatar dogdie233 avatar fallen-breath avatar him049 avatar huajimur233 avatar lancet-corgi avatar ra1ny-yuki avatar sciroccogti avatar shenjackyuanjie avatar sileence114 avatar woshishabii avatar xiaohuihui233 avatar zyxkad 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

mcdreforged's Issues

关服提示线程相关错误

Fatal Python error: could not acquire lock for <_io.BufferedReader name='<stdin>'> at interpreter shutdown, possibly due to daemon threads
>Python runtime state: finalizing (tstate=01059B00)

Thread 0x00000fbc (most recent call first):
>  File "D:\Program Files\Python38-32\lib\threading.py", line 306 in wait
>  File "D:\Program Files\Python38-32\lib\queue.py", line 179 in get
>  File "D:\Project\Python\MCSManager_8.6.11_Win_x86\server\server_core\DevServer\utils\server.py", line 352 in info_react
>  File "D:\Program Files\Python38-32\lib\threading.py", line 870 in run
>  File "D:\Program Files\Python38-32\lib\threading.py", line 932 in _bootstrap_inner
>  File "D:\Program Files\Python38-32\lib\threading.py", line 890 in _bootstrap

Thread 0x00004bc4 (most recent call first):
>  File "D:\Project\Python\MCSManager_8.6.11_Win_x86\server\server_core\DevServer\utils\server.py", line 321 in console_input
>  File "D:\Program Files\Python38-32\lib\threading.py", line 870 in run
>  File "D:\Program Files\Python38-32\lib\threading.py", line 932 in _bootstrap_inner
>  File "D:\Program Files\Python38-32\lib\threading.py", line 890 in _bootstrap

Thread 0x000049e8 (most recent call first):
>  File "D:\Project\Python\MCSManager_8.6.11_Win_x86\server\server_core\DevServer\utils\update_helper.py", line 23 in check_update_loop
>  File "D:\Program Files\Python38-32\lib\threading.py", line 870 in run
>  File "D:\Program Files\Python38-32\lib\threading.py", line 932 in _bootstrap_inner
>  File "D:\Program Files\Python38-32\lib\threading.py", line 890 in _bootstrap

Thread 0x000045ac (most recent call first):
>  File "D:\Program Files\Python38-32\lib\threading.py", line 306 in wait
>  File "D:\Program Files\Python38-32\lib\queue.py", line 179 in get
>  File "D:\Project\Python\MCSManager_8.6.11_Win_x86\server\server_core\DevServer\utils\plugin_thread.py", line 33 in run
>  File "D:\Program Files\Python38-32\lib\threading.py", line 932 in _bootstrap_inner
>  File "D:\Program Files\Python38-32\lib\threading.py", line 890 in _bootstrap

Thread 0x00004038 (most recent call first):
>  File "D:\Program Files\Python38-32\lib\threading.py", line 306 in wait
>  File "D:\Program Files\Python38-32\lib\queue.py", line 179 in get
>  File "D:\Project\Python\MCSManager_8.6.11_Win_x86\server\server_core\DevServer\utils\plugin_thread.py", line 33 in run
>  File "D:\Program Files\Python38-32\lib\threading.py", line 932 in _bootstrap_inner
>  File "D:\Program Files\Python38-32\lib\threading.py", line 890 in _bootstrap

Thread 0x00003d7c (most recent call first):
>  File "D:\Program Files\Python38-32\lib\threading.py", line 306 in wait
>  File "D:\Program Files\Python38-32\lib\queue.py", line 179 in get
>  File "D:\Project\Python\MCSManager_8.6.11_Win_x86\server\server_core\DevServer\utils\plugin_thread.py", line 33 in run
>  File "D:\Program Files\Python38-32\lib\threading.py", line 932 in _bootstrap_inner
>  File "D:\Program Files\Python38-32\lib\threading.py", line 890 in _bootstrap

Thread 0x000033c4 (most recent call first):
>  File "D:\Program Files\Python38-32\lib\threading.py", line 306 in wait
>  File "D:\Program Files\Python38-32\lib\queue.py", line 179 in get
>  File "D:\Project\Python\MCSManager_8.6.11_Win_x86\server\server_core\DevServer\utils\plugin_thread.py", line 33 in run
>  File "D:\Program Files\Python38-32\lib\threading.py", line 932 in _bootstrap_inner
>  File "D:\Program Files\Python38-32\lib\threading.py", line 890 in _bootstrap

Current thread 0x000036c8 (most recent call first):
<no Python frame>

好几个版本直接就见过了,今天又见到了,似乎是插件线程管理问题 File "D:\Project\Python\MCSManager_8.6.11_Win_x86\server\server_core\DevServer\utils\plugin_thread.py", line 33 in run

服务器cmd输出无颜色 & 配置文件不支持指定java

服务器cmd输出无颜色
[Server] [17:13:11] [Craft Scheduler Thread - 9/INFO]: §6[§bYum§6]§r §6[§bYum §a网络管理§6] §6插件 §bPlaceholderAPI §c尝试访问网络 §4请注意服务器网络安全! [Server] [17:13:11] [Craft Scheduler Thread - 9/INFO]: §6[§bYum§6]§r §6[§bYum §a网络管理§6] §6地址: §chttps://api.spigotmc.org/legacy/update.php?resource=6245 [Server] [17:13:11] [Craft Scheduler Thread - 10/INFO]: §6[§bYum§6]§r §6[§bYum §a网络管理§6] §6插件 §bPlaceholderAPI §c尝试访问网络 §4请注意服务器网络安全! [Server] [17:13:11] [Craft Scheduler Thread - 10/INFO]: §6[§bYum§6]§r §6[§bYum §a网络管理§6] §6地址: §chttp://api.extendedclip.com/v2/ [Server] [17:13:11] [Craft Scheduler Thread - 13/INFO]: §6[§bYum§6]§r §6[§bYum §a网络管理§6] §6插件 §bTrMenu §c尝试访问网络 §4请注意服务器网络安全! [Server] [17:13:11] [Craft Scheduler Thread - 13/INFO]: §6[§bYum§6]§r §6[§bYum §a网络管理§6] §6地址: §chttps://raw.githubusercontent.com/Arasple/TrMenu/master/trmenu.yml

配置文件不支持指定java
类似于这样写 "C:\Program Files\Java\jre1.8.0_101\bin\java.exe" -Xmx20G -Xms1G -jar CatServer-20aba10-async.jar

建议添加控制台输出颜色支持

比如
[Server] [19:21:45] [Server thread/INFO]: §6[§bYum§6]§r §6[§bYum §a网络管理§6] §6插件 §bGroupManager §c尝试在主线程访问网络 §4可能会导致服务器卡顿或无响应! [Server] [19:21:45] [Server thread/INFO]: §6[§bYum§6]§r §6[§bYum §a网络管理§6] §c已阻止插件 §bGroupManager §c访问网络! [Server] [19:21:45] [Server thread/INFO]: §6[§bYum§6]§r §6[§bYum §a网络管理§6] §6地址: §chttps://pastebin.com/raw/B6Kxj1hj
希望遇到§可以转义到正确的颜色

[Feature Request] 修改server.reply()使其支持向游戏内和控制台输出不同内容

之前那个表达不太行
重新好好说一遍(


想法来源

MCDR更新0.9.5,我看到MCDR的指令在游戏内显示的 点击用摁钮在控制台不会显示
看了一下MCDR的代码实现方法是每个需要不同显示的地方都加了if判断
就想到可以改进一下 server.reply(),让插件和MCDR都可以使用一行代码对不同目标输出不同内容

改进方式

思路:给server.reply添加第三个可选参数,当判断需要输出到控制台时,如果有第三个参数则使用这个参数来输出
代码:

def server.reply(info, text, console=None, encoding=None):
    if info.is_player:  # 这里的判断没有区别
        server.tell(info.player, text, encoding=encoding, is_plugin_call=False)
    else:
        if console is not None: # 插件传递的控制台消息
            text = console # 如果是控制台就把text变为控制台应当显示的不同信息
        for line in RTextList(text).to_colored_text().splitlines():
            server.logger.info(line)

插件应用示例

代码

def on_info(server, info):
    # 传递了3个参数,最后一个为可选参数,所以不会影响旧插件使用。像encoding一样,不需要强制传递
    server.reply(info, '点击确认' + RText('[✔]').c('run_command', '!!check'), '输入!!check确认操作')

显示效果:

  • 游戏内显示 点击确认[✔],并且点击 [✔] 即可确认
  • 控制台显示 输入!!check确认操作

在控制台输入iOS BUG字符会导致MCDR出错

log如下:

say (iOS BUG字符)
[MCDR] [15:14:18] [MainThread/ERROR]: 解析文本 "b'[15:14:18] [Server thread/INFO]: [Server] \x811\x840\x811\x877\x811\x877\x811\x877\x811\x877\x811\x878\x811\x878\x811\x879\x811\x879\x811\x879\x811\x880\x811\x881\x811\x881\x811\x881\x811\x882\x811\x849\x811\x877\x811\x877\x811\x877\x811\x877\x811\x878\x811\x878\x811\x879\x811\x879\x811\x880\x811\x880\x811\x881\x811\x881\x811\x881\x811\x882\x811\x834\x811\x877\x811\x877\x811\x877\x811\x878\x811\x879\x811\x881 Microbe \x811\x840\x811\x877\x811\x877\x811\x877\x811\x877\x811\x878\x811\x878\x811\x879\x811\x879\x811\x879\x811\x880\x811\x881\x811\x881\x811\x881\x811\x882\x811\x849\x811\x877\x811\x877\x811\x877\x811\x877\x811\x878\x811\x878\x811\x879\x811\x879\x811\x880\x811\x880\x811\x881\x811\x881\x811\x881\x811\x882\x811\x834\x811\x877\x811\x877\x811\x877\x811\x878\x811\x879\x811\x881\r\n'" 出错
[MCDR] [15:14:18] [MainThread/ERROR]: 运行 MCDR 时出错
[MCDR] [15:14:18] [MainThread/ERROR]: Traceback (most recent call last):
  File "I:\Minecraft\ServerFiles\Minecraft_Server-QQ-1.16\utils\server.py", line 276, in run
    self.tick()
  File "I:\Minecraft\ServerFiles\Minecraft_Server-QQ-1.16\utils\server.py", line 244, in tick
    text = self.receive()
  File "I:\Minecraft\ServerFiles\Minecraft_Server-QQ-1.16\utils\server.py", line 222, in receive
    text = text.decode(self.decoding_method)
UnicodeDecodeError: 'gbk' codec can't decode byte 0x81 in position 42: illegal multibyte sequence

[MCDR] [15:14:18] [MainThread/INFO]: 服务端已关闭
[MCDR] [15:14:18] [on_mcdr_stop@sample_plugin/INFO]: See you next time~
[MCDR] [15:14:18] [MainThread/INFO]: bye

字符放图片防止iOS设备炸掉

Snipaste_2020-05-12_15-19-50.png

linux服务器如何后台运行

我在linux系统搭的服务器,python3 MCDReforged.py可以启动服务器。
不过现在想后台运行,如何输入指令呢?

win10使用0.8.0\0.6.0版本在输入python MCDReforged.py启动不了服务端

输入python MCDReforged.py启动服务器不能启动0.8.0\0.6.0测试过

MCDR 0.6.0-alpha starting up
MCDR is open source, u can find it here: https://github.com/Fallen-Breath/MCDReforged
MCDR is still in development, it may not work well
[MCDR] [13:36:18] [MainThread/INFO]: Language has set to en_us
[MCDR] [13:36:18] [MainThread/INFO]: Parser has set to vanilla_parser
[MCDR] [13:36:18] [MainThread/INFO]: Encoding / Decoding method has set to utf-8 / cp936
[MCDR] [13:36:18] [MainThread/INFO]: Loading plugins
[MCDR] [13:36:18] [MainThread/INFO]: No plugin was found
[MCDR] [13:36:18] [MainThread/INFO]: Starting the server
[MCDR] [13:36:18] [MainThread/INFO]: Server is running at PID 868
[MCDR] [13:36:18] [MainThread/INFO]: Console thread starting
[Server] Error: Unable to access jarfile minecraft_server.jar
[MCDR] [13:36:18] [MainThread/INFO]: Waiting for server process to stop
[MCDR] [13:36:18] [MainThread/INFO]: Server process stopped with code 1
[MCDR] [13:36:18] [MainThread/INFO]: Server stopped by itself
[MCDR] [13:36:18] [MainThread/INFO]: Server stopped
[MCDR] [13:36:18] [MainThread/INFO]: bye
求求大神帮帮我

插件开发规范性不佳

MCDR工作目录没有config文件夹,但开发文档告诉我配置文件应该放在config,建议下个版本release加入空的config文件夹,如果每个插件的in_load都判断并且新建config文件夹易出问题
image

另外有些插件需要文件存储数据,比如qb、seen、task、economy,这些插件的数据要么在工作目录建个文件夹,要么就是在plugins建了个文件夹。
我的建议是可以在工作目录放一个data文件夹,或者想个统一的解决方案

[feature request] support JSON-RPC

This is a feature request.

With JSON-RPC, developers can contorl MCDR with JSON api. More convenient!! 😃

这是一项 功能请求
使用 JSON-RPC,开发人员可以使用 JSON API 控制 MCDR。更方便!! 😃

MCDR解析错误

INFO解析错误
可能是由于名字中带有 - 引起的
image
image
另外也无法为这样的玩家创建默认权限,根本没有发现玩家加入了
image
image
permission set 也会报错
image

BUG我找出来了,就是 \w{1,16} 无法匹配 -
image

on_player_joined 似乎不起作用

当玩家加入时 on_player_joined似乎不起作用

[Server] [12:44:32] [User Authenticator #4/INFO]: UUID of player nainiu is 70986197-f128-3860-8459-155dace3cb89 [Server] [12:44:32] [Netty Server IO #0/INFO]: Client protocol version 2 [Server] [12:44:32] [Netty Server IO #0/INFO]: Client attempting to join with 4 mods : [email protected],[email protected],[email protected],[email protected] [Server] [12:44:32] [Server thread/INFO]: [Server thread] Server side modded connection established [Server] [12:44:32] [Server thread/INFO]: nainiu[/127.0.0.1:52084] logged in with entity id 951 at ([world]-46.23715083207496, 78.40427338977307, -230.04551873932988)

服务端还是catserver

parser中新的PLAYER_JOINED_PATTERN和on left判断的矛盾

新的join判断直接排除了carpet工具人的信息,但是on left的时候依旧会对工具人退出有反应,这导致在使用一个结构在on player join时记录线上玩家及其相关数据的情况下,on player left函数会因为找不到工具人玩家名而抛出异常(虽然工具人也没啥用。。但老抛出异常就很难受

提供多语言API

看到 MCDR 内建了一个多语言的轮子,有没有改造一下变成 API 大家都能用的说法

[Feature Request] 修改server.reply()使其支持向游戏内和控制台输出不同内容

看到0.9.5做了控制台不显示游戏内用摁钮,实现方法是这样的
@EI66ARNIKF~PR$JCFM5FX9
是否改一下reply方法,比如

server.reply(info, message, console=None):
    if console is not None and not info.is_player():
        for line in RTextList(text).to_colored_text().splitlines():
            server.logger.info(line)
    else:
        server.tell(info.player, message)

让插件也可以直接向不同来源的消息提供不同的反馈,不再需要在插件内进行判断
应用场景有出现报错的时候控制台可以显示一些信息和反馈方式,这些内容在游戏内是没有意义的
还有就是task插件这类的有一些游戏内点击小图标可以在控制台不显示

服务端PID显示异常

开服时显示的服务端PID和 !!MCDR status 显示的PID都指向一个CMD的pid,并不是服务端真正的java pid
image
image

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=572 -DPSUTIL_LINUX=1 -I/usr/include/python3.8 -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.8/psutil/_psutil_common.o
psutil/_psutil_common.c:9:10: fatal error: Python.h: No such file or directory
 #include <Python.h>
          ^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-pdrg9qal/psutil/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-ds853pew-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-pdrg9qal/psutil/

用nohup后台服务器进程被杀

用的指令是nohup python3 -u MCDReforged.py >test.log 2>&1 &
然后输出是
[MCDR] [12:35:17] [MainThread/INFO]: Language has set to en_us
[MCDR] [12:35:17] [MainThread/INFO]: Parser has set to vanilla_parser
[MCDR] [12:35:17] [MainThread/INFO]: Encoding / Decoding method has set to utf-8 / UTF-8
[MCDR] [12:35:17] [MainThread/INFO]: Loading plugins
[MCDR] [12:35:17] [MainThread/INFO]: Plugin ./plugins/QuickBackupM.py loaded
[MCDR] [12:35:17] [on_load@sample_plugin/INFO]: This is the 1 time to load the plugin
[MCDR] [12:35:17] [MainThread/INFO]: Plugin ./plugins/sample_plugin.py loaded
[MCDR] [12:35:17] [MainThread/INFO]: Loaded: 2 plugins
[MCDR] [12:35:17] [MainThread/INFO]: Starting the server
[MCDR] [12:35:17] [MainThread/INFO]: Server is running at PID 2335
[MCDR] [12:35:17] [Console/INFO]: Process killed
[MCDR] [12:35:17] [MainThread/INFO]: Server process stopped with code -9
[MCDR] [12:35:17] [MainThread/INFO]: Server stopped by itself
[MCDR] [12:35:17] [MainThread/INFO]: MCDR has been interrupted by user
[MCDR] [12:35:17] [MainThread/INFO]: See you next time~
[MCDR] [12:35:17] [MainThread/INFO]: bye
佛冷大大,这是个什么情况,谢谢了

服务器已经启动完毕 但是MCDR显示未启动

[Server] [14:43:43] [Server thread/INFO]: Done (3.959s)! For help, type "help" or "?"
!!MCDR reload plugin
[MCDR] [14:45:13] [Console/INFO]: 加载插件中
[MCDR] [14:45:13] [Console/INFO]: 插件 joinMsg 已重载
[MCDR] [14:45:13] [Console/INFO]: 已重载: 1 个插件
!!MCDR status
[MCDR] [14:45:35] [Console/INFO]: MCDReforged 版本: 0.6.1-alpha
[MCDR] [14:45:35] [Console/INFO]: 服务端状态: 运行中
[MCDR] [14:45:35] [Console/INFO]: 服务端已启动: False
[MCDR] [14:45:35] [Console/INFO]: Rcon: 离线
[MCDR] [14:45:35] [Console/INFO]: 插件数量: 1
[MCDR] [14:45:35] [Console/INFO]: PID: 11984

使用的服务端为CatServer-abc4d59-universal

增加接口过滤控制台输出

实体自动消失时,MC 控制台经常会有类似下面的输出

[Server] [05:12:57] [Server thread/WARN]: Fetching packet for removed entity class_1542['Cobblestone'/1177081, l='ServerLevel[world]', x=1171.49, y=10.27, z=-47.44]

希望能添加一个接口让插件有能力去过滤掉这类输出,单独处理把他存到 log 文件之类的

语言问题

如图,启动时若没有安装插件会显示无插件变更
image
image
这是启动时加载插件,输出无变更是不是不太合适

又挑出一个错别字(

中文插件文档(MCDReforged/doc/plugin_cn.md)源文件67行,
MCDR会自动对齐进行转义
应为
MCDR会自动对其进行转义

如何贡献插件?

希望能提供方便地贡献插件的方式。

此外,也希望能有便捷地下载插件的方式。

感谢

使用MCD插件的时候出现的问题

按照文档我修改了之前的插件,但是在玩家退出的时候会跳出这个错误:
File "./plugins/Here.py", line 79, in on_player_left
onPlayerLeave(server, player)
File "./plugins/Here.py", line 69, in onPlayerLeave
playerlist.remove(player)
ValueError: list.remove(x): x not in list

还有一个小疑惑:使用joinMOTD的时候开服天数怎么改也改不过来,使用!!day是正常的;后来将joinMOTD.py引入getday的部分去掉,自己重新写了一个getday函数 就好了 这是为什么呢?

关于玩家ID

MCDR读取的是玩家在聊天栏显示的ID,而非玩家本身的ID,一旦为玩家加上队伍前缀,MCDR就无法识别该玩家
-7a74a961cc26d76f

关于加入自动赋予用户组权限问题

我用的客户端是原版+forge,但是在有新的人进入Server的时候,MCDR总是会把权限给进来的时间......
而且不知道为什么即使给了权限相应玩家也没法用MCDR......

报错没有依赖模块

使用命令 python MCDReforged.py
提示没有ruamel.yaml模块
已经执行过pip install -r requirement.txt,还是这样
版本python3.9
具体报错:
Traceback (most recent call last):
File "/root/mcd/MCDReforged.py", line 3, in
from utils.server import Server
File "/root/mcd/utils/server.py", line 10, in
from utils import config, constant, logger, tool
File "/root/mcd/utils/config.py", line 4, in
import ruamel.yaml as yaml
ModuleNotFoundError: No module named 'ruamel'

部分自定义插件会被吞文件名,导致server.get_plugin_instance失败

以下内容来自log
[MCDR] [2020-05-08 22:44:57] [Console/INFO]: Plugin CommitSuicide reloaded [MCDR] [2020-05-08 22:44:57] [Console/INFO]: Plugin currenc reloaded [MCDR] [2020-05-08 22:44:57] [Console/INFO]: Plugin Here reloaded [MCDR] [2020-05-08 22:44:57] [Console/INFO]: Plugin petmove reloaded [MCDR] [2020-05-08 22:44:57] [Console/INFO]: Plugin PlayerInfoAPI reloaded [MCDR] [2020-05-08 22:44:57] [Console/INFO]: Plugin sho reloaded [MCDR] [2020-05-08 22:44:57] [Console/INFO]: Plugin SimpleOP reloaded
初步推测是这里吞了文件名导致我的shop.py用server.get_plugin_instance调用currency.py失败的。
我的插件源文件在https://github.com/63815af756f0357940c666d2ae1c801d/currency,运行环境win7 python 3.8.2 64位,mc环境fabric 1.15.2

ImportError

Traceback (most recent call last):
File "MCDReforged.py", line 34, in
from utils.server import Server
File "C:\Users\lpj15\Desktop\PY-server\utils\server.py", line 16, in
from utils.rcon_manager import RconManager
File "C:\Users\lpj15\Desktop\PY-server\utils\rcon_manager.py", line 2, in
from utils.rcon import Rcon
ImportError: cannot import name 'Rcon' from 'utils.rcon' (C:\Users\lpj15\Desktop\PY-server\utils\rcon_init_.py)
Exception occurred, press Enter to exit

Format error if plugin print something to console when on load

Here is the log

[MCDR] [21:44:54] [MainThread/INFO]: Plugin SimpleOP.py loaded
before [MCDR] [21:44:54] [MainThread/0INFO ]: Loaded: 7 plugins; Loaded plugi
n amount: 1007
64
after 1.5625
1 buy config(s) loaded, 1 sell config(s) loaded.[MCDR] [21:44:54] [MainThread
/
INFO]: Starting the server with command "java -Xms1G -Xmx2G -jar fabric-server-l
aunch.jar nogui"

and here is my code

def load_config():
......
print(len(list_buy), ' buy config(s) loaded, ', len(list_sell), ' sell config(s) loaded.')
def on_load(server, old):
load_config()
......

[Server] /bin/sh: ./start.sh: No such file or directory

按照md文件里面配置config.yml的.
在运行时会出现这个错误;
将./start.sh改成绝对路径是可行的.
然后上面working_directory也不行
就算改成绝对路径依然会报错:Unable to access jarfile server.jar
需要在start.sh里添加cd ./server/ && ...才行
这样看上去好像路径出了点问题???但是我不是很懂python
然后还有两个问题:
一是控制台里输入!!MCDR reload xxx没有反应(会有意料之中的unknown command出现),服务器里面尚未测试;
二是md文件里的命令有问题:python MCDRxxx.py 应该改成python3 ...
祝开发顺利

MCDR编码错误

UnicodeDecodeError: 'gbk' codec can't decode byte 0xaa in position 62: illegal multibyte sequence

完整内容
8:14:58] [MainThread/ERROR]: 解析文本 "b'[18:14:58] [main/INFO]: Reloading ResourceManager: Default, \xe8\x87\xaa\xe6\x9d\x80.zip\r\n'" 出错
[MCDR] [18:14:58] [MainThread/CRITICAL]: 运行 MCDR 时出错
Traceback (most recent call last):
File "D:\utils\server.py", line 296, in run
self.tick()
File "D:\utils\server.py", line 253, in tick
text = self.receive()
File "D:\utils\server.py", line 232, in receive
text = text.decode(self.decoding_method)
UnicodeDecodeError: 'gbk' codec can't decode byte 0xaa in position 62: illegal multibyte sequence

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.