upgrade bot configuration protocol

This commit is contained in:
Tnze
2024-06-15 23:59:23 +08:00
parent 8be84104f1
commit ee23172e0a
3 changed files with 176 additions and 19 deletions

View File

@ -18,15 +18,18 @@ type Client struct {
Auth Auth
// These are filled when login process
Name string
UUID uuid.UUID
ConfigData
// Ingame packet handlers
Events Events
// Login plugins
LoginPlugin map[string]func(data []byte) ([]byte, error)
// Configuration handler
ConfigHandler
}
func (c *Client) Close() error {
@ -44,6 +47,7 @@ func NewClient() *Client {
return &Client{
Auth: Auth{Name: "Steve"},
Events: Events{handlers: make([][]PacketHandler, packetid.ClientboundPacketIDGuard)},
ConfigHandler: NewDefaultConfigHandler(),
}
}