File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,44 @@ Usage of ./minetest_client:
4343 The username (default "test")
4444```
4545
46+ # Api
47+
48+ ``` golang
49+ package main
50+
51+ import (
52+ " github.com/minetest-go/minetest_client/commandclient"
53+ )
54+
55+ func main () {
56+ host := " 127.0.0.1"
57+ port := 30000
58+ username := " test"
59+ password := " test"
60+
61+ client := commandclient.NewCommandClient (host, port)
62+ err := client.Connect ()
63+ if err != nil {
64+ panic (err)
65+ }
66+
67+ err = commandclient.Init (client, username)
68+ if err != nil {
69+ panic (err)
70+ }
71+
72+ err = commandclient.Login (client, username, password)
73+ if err != nil {
74+ panic (err)
75+ }
76+
77+ err = commandclient.ClientReady (client)
78+ if err != nil {
79+ panic (err)
80+ }
81+ }
82+ ```
83+
4684# License
4785
4886MIT
You can’t perform that action at this time.
0 commit comments