Coder Social home page Coder Social logo

cikeyqi / mc-plugin Goto Github PK

View Code? Open in Web Editor NEW
25.0 3.0 4.0 7.17 MB

基于 Yunzai 的 Minecraft 消息互通插件

Home Page: https://docs.yunzai.art

License: GNU Affero General Public License v3.0

JavaScript 76.48% Less 16.78% HTML 6.74%
minecraft plugin rcon websocket yunzai yunzai-bot

mc-plugin's Introduction

header

✨ Ciallo ~(∠・ω< )⌒☆
🔭 I am a high school student.
😽 Turned 17 / Neko / Draw / Play stupid.
🌱 I’m currently learning Kotlin, Python, JavaScript, Docker.
📫 How to reach me: 🌟QQ Group / E-mail / QQ / Telegram.
Anurag's github stats

📚Maybe I can use these Languages

Kotlin JavaScript Python HTML5 Shell

🔧Maybe I can use these Tools

Visual Studio Code WebStorm PyCharm Android Studio Docker

📖Maybe I can use these Frameworks

Node.js Flask Ktor Vue.js

📊 This Week I Spent My Time On

🕑︎ Time Zone: Asia/Shanghai

💬 Programming Languages: 
Other                    26 hrs 31 mins      █████████████████░░░░░░░░   68.37 % 
JavaScript               9 hrs 23 mins       ██████░░░░░░░░░░░░░░░░░░░   24.20 % 
YAML                     1 hr 43 mins        █░░░░░░░░░░░░░░░░░░░░░░░░   04.43 % 
Markdown                 31 mins             ░░░░░░░░░░░░░░░░░░░░░░░░░   01.35 % 
Python                   30 mins             ░░░░░░░░░░░░░░░░░░░░░░░░░   01.31 % 

🔥 Editors: 
Edge                     26 hrs 26 mins      █████████████████░░░░░░░░   68.17 % 
VS Code                  12 hrs 18 mins      ████████░░░░░░░░░░░░░░░░░   31.73 % 
PyCharm                  2 mins              ░░░░░░░░░░░░░░░░░░░░░░░░░   00.10 % 

I Mostly Code in JavaScript

JavaScript               13 repos            ███████████████░░░░░░░░░░   61.90 % 
Shell                    3 repos             ████░░░░░░░░░░░░░░░░░░░░░   14.29 % 
Python                   1 repo              █░░░░░░░░░░░░░░░░░░░░░░░░   04.76 % 
C#                       1 repo              █░░░░░░░░░░░░░░░░░░░░░░░░   04.76 % 
Java                     1 repo              █░░░░░░░░░░░░░░░░░░░░░░░░   04.76 % 

Last Updated on 08/05/2024 15:06:43 UTC

mc-plugin's People

Contributors

17theword avatar aliorpse avatar cikeyqi avatar erzaozi avatar ifeif 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

Watchers

 avatar  avatar  avatar

mc-plugin's Issues

非插件端只能单向推送信息

QQ群→MC服务器成功
MC服务器→QQ群 失败

MC服务器日志

[MC_QQ]丨已成功连接 WebSocket 服务器。
[MC_QQ]丨Lemon_ZSH说:娉ョ尨
[MC_QQ]丨Lemon_ZSH说:娴嬬爜
[MC_QQ]丨Shirasu_Azusa09说:绌哄惂鍝�
[MC_QQ] 日志路径错误,无法读取。
java.lang.NullPointerException: Cannot invoke "java.util.regex.Matcher.group(int)" because "serverLog" is null
        at com.scareye.mcqq.Utils.processMessageToJson(Utils.java:132)
        at com.scareye.mcqq.FileWatcher.lambda$watcherLog$4(FileWatcher.java:100)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
        at com.scareye.mcqq.FileWatcher.watcherLog(FileWatcher.java:83)
        at com.scareye.mcqq.FileWatcher.lambda$FileListen$1(FileWatcher.java:37)
        at java.base/java.lang.Thread.run(Thread.java:833)

只能传递这一条消息,而且读取到的中文是乱码,后面还有报错
7G Z8CSYJ`I7E91PR62CX23

MC服务器配置文件

enable_mc_qq: true
websocket_url: "ws://云崽服务器IP:9090/yz/v3/mcqq"
say_way: "说:"
death_message: true
join_quit: true
server_name: "Server"
display_groupname: false
log_local: "./logs/"
log_name: "latest.log"

云崽配置文件

mc_qq_ws_url: /yz/v3/mcqq
mc_qq_ws_port: 9090
mc_qq_send_group_name: false
rcon_enable: true
rcon_host: MC服务器地址
rcon_port: 25575
rcon_password: "12300"
group_list:
  - 群号

有概率获取群对象失败

获取群对象失败:找不到群 ————
file:///D:/Yunzai/plugins/mc-plugin/components/WebSocket.js:92
Bot.pickGroup(config.group_list[i]).sendMsg(msg);
^

TypeError: Cannot read properties of undefined (reading 'sendMsg')
at WebSocket.sendMsg (file:///D:/Yunzai/plugins/mc-plugin/components/WebSocket.js:92:44)
at WebSocketServer. (file:///D:/Yunzai/plugins/mc-plugin/components/WebSocket.js:36:16)
at WebSocketServer.emit (node:events:514:28)
at WebSocketServer.completeUpgrade (D:\Yunzai\node_modules.pnpm\[email protected]\node_modules\ws\lib\websocket-server.js:427:5)
at WebSocketServer.handleUpgrade (D:\Yunzai\node_modules.pnpm\[email protected]\node_modules\ws\lib\websocket-server.js:336:10)
at Server.upgrade (D:\Yunzai\node_modules.pnpm\[email protected]\node_modules\ws\lib\websocket-server.js:112:16)
at Server.emit (node:events:514:28)
at onParserExecuteCommon (node:_http_server:942:14)
at onParserExecute (node:_http_server:836:3)

但是多登几次就好了..

添加特定屏蔽词功能

如题
比如:blacklist:§;1;2,这如果有此类文字便略过发送
实际情况:plugins(xx):§xxxx
看一眼plugins简直等于是要自己的命

QQ群的信息无法同步到游戏服务器内

服务端 1.20.4 leaves
rcon没问题 因为可以在Q群发送指令
后来查看日志发现
tellraw @A {"text":"","extra":[{"text":"Q群信息","color":"white","bold":"false"}]}
这串指令根本无法在mc服务端运行
后来发现问题出现在"bold":"false"中
将false的引号去掉后就可以执行了

查询离线服务器时报错,且没有信息返回

[MiaoYz][18:09:45.623][ERRO] [Minecraft Server Status][status]
[MiaoYz][18:09:45.625][ERRO] TypeError: Cannot read properties of undefined (reading 'html')
at Status.createListImage (file:///C:/Users/lulu/Desktop/robot/Miao-Yunzai/plugins/mc-plugin/apps/Status.js:174:32)
at Status.status (file:///C:/Users/lulu/Desktop/robot/Miao-Yunzai/plugins/mc-plugin/apps/Status.js:41:29)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async PluginsLoader.deal (file:///C:/Users/lulu/Desktop/robot/Miao-Yunzai/lib/plugins/loader.js:293:54)

bot端启动失败

[MiaoYz][14:06:56.678][INFO] 【Minecraft-Plugin v1.0.1】 [MC_QQ]丨WebSocket 服务器已启动,等待连接
[MiaoYz][14:06:56.679][INFO] ---------------
[MiaoYz][14:06:56.680][MARK] Minecraft WebSocket 地址:ws://127.0.0.1:9090/yz/v3/mcqq
[MiaoYz][14:06:56.681][INFO] ---------------
node:buffer:787
throw new ERR_INVALID_ARG_TYPE(
^

TypeError [ERR_INVALID_ARG_TYPE]: The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received type number (114514)
at new NodeError (node:internal/errors:405:5)
at Function.byteLength (node:buffer:787:11)
at Rcon.send (C:\Users\Administrator\Desktop\QQG\Miao-Yunzai\node_modules.pnpm\[email protected]\node_modules\rcon\node-rcon.js:51:25)
at Rcon.socketOnConnect (C:\Users\Administrator\Desktop\QQG\Miao-Yunzai\node_modules.pnpm\[email protected]\node_modules\rcon\node-rcon.js:196:10)
at Socket. (C:\Users\Administrator\Desktop\QQG\Miao-Yunzai\node_modules.pnpm\[email protected]\node_modules\rcon\node-rcon.js:88:53)
at Socket.emit (node:events:526:35)
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1480:10) {
code: 'ERR_INVALID_ARG_TYPE'
}

Node.js v18.17.1

群聊消息始终无法传到服务器

使用插件端:
【MCserver的配置】:
enable_mc_qq: true
........

【server properties配置】:
rcon.port=25575
rcon.password=***
enable-rcon=true

【mc-plugin配置】:
mc_qq_ws_url: /yz/v3/mcqq
mc_qq_ws_port: 9090
mc_qq_send_group_name: false
rcon_enable: true
rcon_host: (服务器公网ip)
rcon_port: 10005(内网25575映射到公网端口)
group_list:


rcon_password: ***
command_header: /

【群聊响应】:
可以正常的收到服务器的信息并发送到qq群

【服务器响应】:
无响应

【TRSS报错日志】:
[TRSSYz][21:30:02.930][ERRO] 【Minecraft-Plugin v1.0.1】 Error: read ECONNRESET
at TCP.onStreamRead (node:internal/stream_base_commons:217:20) {
errno: -4077,
code: 'ECONNRESET',
syscall: 'read'
}

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.