-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nethernet support for joining worlds #533
base: master
Are you sure you want to change the base?
Conversation
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/[email protected] |
Thanks for working on this, please advise when it's ready for review |
Most the work is done apart from some bits but would probably be good to start moving parts of this out of here into other areas. Mainly moving the contents of ./nethernet, I'd think it'd make sense to have this in a prismarine-nethernet repo maybe? Same with the Xbox Session API, I think we could get away with putting this in pauth unless you think we should separate an Xbox API to another repo? |
const PORT = 7551 | ||
const BROADCAST_ADDRESS = getBroadcastAddress() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are these constants coming from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Port 7551 is used for Nethernet LAN discovery and a network discovery request is sent to the broadcast address
|
||
client.conLog?.(`Connecting to ${client.options.host}:${client.options.port} ${ad.motd} (${ad.levelName}), version ${ad.version} ${client.options.version !== ad.version ? ` (as ${client.options.version})` : ''}`) | ||
} else if (client.options.transport === 'nethernet') { | ||
client.conLog?.(`Connecting to ${client.options.networkId} ${ad.motd} (${ad.levelName})`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we know what version to connect as here if the user does not specify/can't get via ping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user doesn't specify it defaults to the current version and the version isn't included in the Nethernet ping response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, what is advertisement.version
then? We may have to figure out the version after connecting to the server then like nmp can do. It should be sent in login/network_settings packet otherwise. The current code should also be matching version by protocol version num over strings but that should be fixed outside this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely sure but I assume it's the version of NetherNet protocol being used as it's just a uint8. From my testing it's always been set to 3 over multiple version updates.
if (client.session) client.session.end() | ||
if (client.signalling) client.signalling.destroy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is client.session not something already auth related?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it is, I took note of that a while back to amend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting all the nethernet properties under .nethernet.* may be a good idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node-fetch can be removed in favor of native fetch now that it's also removed from prismarine-auth
if (client.session) client.session.end() | ||
if (client.signalling) client.signalling.destroy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting all the nethernet properties under .nethernet.* may be a good idea
Majority work for Nethernet support. Supports listening and joining over LAN, signalling via the franchise WebSocket and creating/joining an Xbox session.
To do
Closes #473