/
code_builder.go
33 lines (28 loc) · 913 Bytes
/
code_builder.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package packet
import (
"github.com/sandertv/gophertunnel/minecraft/protocol"
)
// CodeBuilder is an Education Edition packet sent by the server to the client to open the URL to a Code
// Builder (websocket) server.
type CodeBuilder struct {
// URL is the url to the Code Builder (websocket) server.
URL string
// ShouldOpenCodeBuilder specifies if the client should automatically open the Code Builder app. If set to
// true, the client will attempt to use the Code Builder app to connect to and interface with the server
// running at the URL above.
ShouldOpenCodeBuilder bool
}
// ID ...
func (*CodeBuilder) ID() uint32 {
return IDCodeBuilder
}
// Marshal ...
func (pk *CodeBuilder) Marshal(w *protocol.Writer) {
w.String(&pk.URL)
w.Bool(&pk.ShouldOpenCodeBuilder)
}
// Unmarshal ...
func (pk *CodeBuilder) Unmarshal(r *protocol.Reader) {
r.String(&pk.URL)
r.Bool(&pk.ShouldOpenCodeBuilder)
}