PrismarineJS / bedrock-protocol

Minecraft Bedrock protocol library, with authentication and encryption
https://prismarinejs.github.io/minecraft-data/?v=bedrock_1.17.10&d=protocol
MIT License
291 stars 69 forks source link

Useless variable? #336

Closed MrDiamond64 closed 1 year ago

MrDiamond64 commented 1 year ago

Hi,

I noticed in relay.js:193 it is passing ds onto the onMsaCode function. https://github.com/PrismarineJS/bedrock-protocol/blob/d7345ed7321d802dd9f57ffd95bb8768e5a6e10c/src/relay.js#L193

However on line 191 (where onMsaCode is defined), ds isnt declared anywhere, making it so passing ds is redundant. https://github.com/PrismarineJS/bedrock-protocol/blob/d7345ed7321d802dd9f57ffd95bb8768e5a6e10c/src/relay.js#L191

ds is declared at line 182 so passing it onto onMsaCode isnt needed. https://github.com/PrismarineJS/bedrock-protocol/blob/d7345ed7321d802dd9f57ffd95bb8768e5a6e10c/src/relay.js#L182

I feel like im missing something, but i thought I would bring it up 😅

extremeheat commented 1 year ago

The ds refers to the downstream client. The this.options refers to the options object passed to the Relay class on instantiating. If the onMsaCode is present, it will be called opposed to sending the login prompt to the user in a kick message. For information on API fields refer to the typescript definitions.