-
Notifications
You must be signed in to change notification settings - Fork 6
/
server_settings_response.go
36 lines (31 loc) · 1.25 KB
/
server_settings_response.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
34
35
36
package packet
import (
"dotcs/minecraft/protocol"
)
// ServerSettingsResponse is optionally sent by the server in response to a ServerSettingsRequest from the
// client. It is structured the same as a ModalFormRequest packet, and if filled out correctly, will show
// a specific tab for the server in the settings of the client. A ModalFormResponse packet is sent by the
// client in response to a ServerSettingsResponse, when the client fills out the settings and closes the
// settings again.
type ServerSettingsResponse struct {
// FormID is an ID used to identify the form. The ID is saved by the client and sent back when the player
// submits the form, so that the server can identify which form was submitted.
FormID uint32
// FormData is a JSON encoded object of form data. The content of the object differs, depending on the
// type of the form sent, which is also set in the JSON.
FormData []byte
}
// ID ...
func (*ServerSettingsResponse) ID() uint32 {
return IDServerSettingsResponse
}
// Marshal ...
func (pk *ServerSettingsResponse) Marshal(w *protocol.Writer) {
w.Varuint32(&pk.FormID)
w.ByteSlice(&pk.FormData)
}
// Unmarshal ...
func (pk *ServerSettingsResponse) Unmarshal(r *protocol.Reader) {
r.Varuint32(&pk.FormID)
r.ByteSlice(&pk.FormData)
}