lrocher / CodeConnectFix

Allow use 'Code Connection for Minecraft' v1.50 with Minecraft Bedrock v1.19.x
MIT License
25 stars 3 forks source link

Cannot use CondeConnectFix for Minecraft Eduction #3

Closed himemleung closed 1 week ago

himemleung commented 1 year ago

Hi,

My kid is using Minecraft education to join competition and we use Code connection as webserver before to integrate with mobile phone to control MC agent thru API but now it is not working.The code Connection not working for 1.18/1.19 for over half an year.

I am very excited in seeing CodeConnectFix but seems only suitable for bedrock? I try it for education but the fix crashed with following error. May I seek your help to fix/guide me to fix?

C:\snapshot\CodeConnectFix\mcpews\lib\server.js:253 handleProtocols: (protocols) => protocols.find((protocol) => protocol === implementName) ^

TypeError: protocols.find is not a function at Object.handleProtocols (C:\snapshot\CodeConnectFix\mcpews\lib\server.js:253:55) at WSServer.completeUpgrade (C:\snapshot\CodeConnectFix\node_modules\ws\lib\websocket-server.js:389:24) at WSServer.completeUpgrade (C:\snapshot\CodeConnectFix\mcpews\lib\server.js:274:15) at WSServer.handleUpgrade (C:\snapshot\CodeConnectFix\node_modules\ws\lib\websocket-server.js:339:10) at WSServer.handleUpgrade (C:\snapshot\CodeConnectFix\mcpews\lib\server.js:269:15) at Server.upgrade (C:\snapshot\CodeConnectFix\node_modules\ws\lib\websocket-server.js:114:16) at Server.emit (node:events:527:28) at onParserExecuteCommon (node:_http_server:732:14) at onParserExecute (node:_http_server:646:3)

lrocher commented 1 year ago

Hi,

I haven't test it with Minecraft Education. I have develop this tools with Minecraft Bedrock in mine.

However, i have push a correction from mcpews mainline related to this issue. You can try with v1.1.2 if it work better.

Regards

himemleung commented 1 year ago

Hi Irocher,

My thanks for your prompt feedback and action. I tried, no crash anymore but still can't connect with following error . I have tried to figure it out but I am not familiar with websocket so no luck recently..

Enter '/connect 192.168.2.153:19135' to establish a connection. If connection established, CodeConnectFix will connect to localhost:19131 and forward messages <- [1] connected -> [1] command: 530a6643-652b-417d-bbc3-321dd31866ab geteduclientinfo -> [1] version: 1 node:events:505 throw er; // Unhandled 'error' event ^

RangeError: Invalid WebSocket frame: invalid status code 59907 at Receiver.controlMessage (C:\snapshot\CodeConnectFix\node_modules\ws\lib\receiver.js:566:18) at Receiver.getData (C:\snapshot\CodeConnectFix\node_modules\ws\lib\receiver.js:442:42) at Receiver.startLoop (C:\snapshot\CodeConnectFix\node_modules\ws\lib\receiver.js:158:22) at Receiver._write (C:\snapshot\CodeConnectFix\node_modules\ws\lib\receiver.js:84:10) at writeOrBuffer (node:internal/streams/writable:389:12) at _write (node:internal/streams/writable:330:10) at Receiver.Writable.write (node:internal/streams/writable:334:10) at Socket.socketOnData (C:\snapshot\CodeConnectFix\node_modules\ws\lib\websocket.js:1278:35) at Socket.emit (node:events:527:28) at addChunk (node:internal/streams/readable:315:12) Emitted 'error' event on WebSocket instance at: at Receiver.receiverOnError (C:\snapshot\CodeConnectFix\node_modules\ws\lib\websocket.js:1164:13) at Receiver.emit (node:events:527:28) at emitErrorNT (node:internal/streams/destroy:157:8) at emitErrorCloseNT (node:internal/streams/destroy:122:3) at processTicksAndRejections (node:internal/process/task_queues:83:21) { code: 'WS_ERR_INVALID_CLOSE_CODE',

}

lrocher commented 1 year ago

As I said the tool was developed to connect to the Bedrock version. I think the Education version uses a specific protocol or only manage the integrated block editor.

himemleung commented 1 year ago

Yes, Irocher, my same guess it uses a specific protocol. Although the Code connection can be used with Eduction v1.7 before, I believe Microsoft's direction is to obsolete the Code connection and only manage the integrated block editor.

By the way, thanks for your effort!