update protocol packet definitions: replace value receivers with pointer receivers in PacketID methods, expand FixedBitSet size from 8 to 256 bits, and remove outdated documentation files
This commit is contained in:
37
cmd/template/main.go
Normal file
37
cmd/template/main.go
Normal file
@ -0,0 +1,37 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"git.konjactw.dev/patyhank/minego/pkg/auth"
|
||||
"git.konjactw.dev/patyhank/minego/pkg/bot"
|
||||
"git.konjactw.dev/patyhank/minego/pkg/client"
|
||||
"git.konjactw.dev/patyhank/minego/pkg/game/player"
|
||||
)
|
||||
|
||||
func main() {
|
||||
userCode := "powru"
|
||||
c := client.NewClient(&bot.ClientOptions{AuthProvider: &auth.KonjacAuth{
|
||||
UserCode: userCode,
|
||||
}})
|
||||
|
||||
ctx, cancelFunc := context.WithCancel(context.Background())
|
||||
defer cancelFunc()
|
||||
|
||||
err := c.Connect(ctx, "mc.konjactw.dev", nil)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
bot.SubscribeEvent(c, func(e player.MessageEvent) error {
|
||||
fmt.Println(e.Message.String())
|
||||
return nil
|
||||
})
|
||||
|
||||
err = c.HandleGame(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user