node-minecraft-protocol icon indicating copy to clipboard operation
node-minecraft-protocol copied to clipboard

server_custom_channel example doesn't work

Open GroobleDierne opened this issue 3 years ago • 3 comments

  • [x] The FAQ doesn't contain a resolution to my issue

Versions

  • minecraft-protocol: 1.25.0
  • server: none
  • node: 14.12.0
  • minecraft version: 1.16.5

Detailed description of a problem

I tried to run the server_custom_channel example and it crashed when I tried to connect, giving this error:

D:\Documents\dev\fabric\proxy>node main.js
D:\Documents\dev\fabric\proxy\node_modules\minecraft-protocol\src\transforms\framing.js:67
          } else { throw e }
                   ^

TypeError: SizeOf error for undefined : value.reduce is not a function
    at ProtoDef.sizeOfDumbArr (D:\Documents\dev\fabric\proxy\node_modules\minecraft-protocol\src\client\pluginChannels.js:96:18)
    at ProtoDef.sizeOf (D:\Documents\dev\fabric\proxy\node_modules\protodef\src\protodef.js:40:67)
    at ProtoDef.sizeOf (D:\Documents\dev\fabric\proxy\node_modules\protodef\src\protodef.js:131:31)
    at e.message (D:\Documents\dev\fabric\proxy\node_modules\protodef\src\protodef.js:138:40)
    at tryCatch (D:\Documents\dev\fabric\proxy\node_modules\protodef\src\utils.js:50:16)
    at ProtoDef.createPacketBuffer (D:\Documents\dev\fabric\proxy\node_modules\protodef\src\protodef.js:138:20)
    at Client.writeChannel (D:\Documents\dev\fabric\proxy\node_modules\minecraft-protocol\src\client\pluginChannels.js:68:19)
    at Client.registerChannel (D:\Documents\dev\fabric\proxy\node_modules\minecraft-protocol\src\client\pluginChannels.js:26:14)
    at Server.<anonymous> (D:\Documents\dev\fabric\proxy\main.js:31:10)
    at Server.emit (events.js:314:20)

Current code

https://github.com/PrismarineJS/node-minecraft-protocol/blob/master/examples/server_custom_channel/server_custom_channel.js

Expected behavior

The example should run smoothly :p

GroobleDierne avatar Jul 04 '21 18:07 GroobleDierne

I have the same issue

grovel avatar Aug 20 '21 20:08 grovel

same issue

soldtm avatar Sep 11 '21 18:09 soldtm

https://github.com/PrismarineJS/node-minecraft-protocol/blob/61789bbea9cbb8a746d0460c176067ff4076cfbb/src/client/pluginChannels.js#L24 might be related with protodef interpreted / compiled

rom1504 avatar Jan 07 '22 18:01 rom1504