Implement publishing and joining worlds#258
Conversation
… disable batching packets
…ants for value present in packet
…inviting a user, and joining a world.
|
The changes in pull request and other packages, which have been split into separate modules, has been fully documented. |
| // Credentials blocks until [nethernet.Credentials] are received from the server or the [context.Context] | ||
| // is done. It returns a [nethernet.Credentials] or an error if the Conn is closed or the [context.Context] | ||
| // is canceled or exceeded a deadline. | ||
| func (c *Conn) Credentials(ctx context.Context) (*nethernet.Credentials, error) { |
There was a problem hiding this comment.
the comment says this method is blocking but the select has a default case
| ConnectionType uint32 `json:"ConnectionType"` | ||
| HostIPAddress string `json:"HostIpAddress"` | ||
| HostPort uint16 `json:"HostPort"` | ||
| NetherNetID uint64 `json:"NetherNetId"` |
There was a problem hiding this comment.
dont forget to change this to a string
There was a problem hiding this comment.
actually its sent as either a string UUID or a uint64, not a string-based uint64 so this needs a custom type which supports string | uint64 decoding
| } | ||
| } | ||
|
|
||
| func NetherNetID(status Status) (uint64, bool) { |
There was a problem hiding this comment.
would change this to func (status Status) NetherNetID()
| r.mu.Lock() | ||
| defer r.mu.Unlock() | ||
|
|
||
| if r.t == nil || !r.t.Valid() || r.x == nil { |
There was a problem hiding this comment.
this should check x.Valid() but the whole function can be improved like this
func (r *refreshTokenSource) Token() (_ xsapi.Token, err error) {
r.mu.Lock()
defer r.mu.Unlock()
// Return the cached XBL token if it is valid.
if r.x != nil && r.x.Valid() {
return r.x, nil
}
// Request a new underlying token if it is not valid.
if r.t == nil || !r.t.Valid() {
r.t, err = r.underlying.Token()
if err != nil {
return nil, fmt.Errorf("request underlying token: %w", err)
}
}
// Request a new XBL token using the underlying token.
r.x, err = auth.RequestXBLToken(r.ctx, r.t, r.relyingParty)
if err != nil {
return nil, fmt.Errorf("request xbox live token: %w", err)
}
return r.x, nil
}|
What needs to be done to get this updated to use the new auth that was merged? |
|
First, we need an implementation for connecting to the signaling service provided by Minecraft. At the moment, Minecraft uses two different signaling methods:
On top of that, we need support for announcing, discovering, and joining worlds via Xbox Live, with compatibility for both signaling methods mentioned above. Finally, on the protocol, we need:
|
|
I’m currently rewriting During this work, I found that the relying party for XBL tokens can be determined automatically based on the request URL, so my fork includes support for that as well. I’m planning to submit a PR to |
Adds a support for publishing and joining worlds displayed in the friend list. Closes #219.
WIP. I might separate these packages into a different module to reduce usage of huge dependencies added for WebRTC.
Task Lists: