PrismarineJS / node-minecraft-protocol

Parse and serialize minecraft packets, plus authentication and encryption.
https://prismarinejs.github.io/node-minecraft-protocol/
BSD 3-Clause "New" or "Revised" License
1.22k stars 240 forks source link

server_custom_channel example doesn't work #872

Open GroobleDierne opened 3 years ago

GroobleDierne commented 3 years ago

Versions

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

grovel commented 3 years ago

I have the same issue

soldtm commented 2 years ago

same issue

rom1504 commented 2 years ago

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