]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/client.go
Update Docker instructions
[rbdr/mobius] / hotline / client.go
index 33ec511341878cd7d98c97a64567f48c05f40766..24df7c35aa8caddf1c6084d96d2860dc1883bb0e 100644 (file)
@@ -10,7 +10,7 @@ import (
        "github.com/rivo/tview"
        "github.com/stretchr/testify/mock"
        "go.uber.org/zap"
-       "gopkg.in/yaml.v2"
+       "gopkg.in/yaml.v3"
        "math/big"
        "math/rand"
        "net"
@@ -61,7 +61,6 @@ func readConfig(cfgPath string) (*ClientPrefs, error) {
 
        prefs := ClientPrefs{}
        decoder := yaml.NewDecoder(fh)
-       decoder.SetStrict(true)
        if err := decoder.Decode(&prefs); err != nil {
                return nil, err
        }
@@ -336,8 +335,8 @@ func handleGetMsgs(c *Client, t *Transaction) (res []Transaction, err error) {
        newsTextView.SetBorder(true).SetTitle("News")
 
        c.UI.Pages.AddPage("news", newsTextView, true, true)
-       //c.UI.Pages.SwitchToPage("news")
-       //c.UI.App.SetFocus(newsTextView)
+       // c.UI.Pages.SwitchToPage("news")
+       // c.UI.App.SetFocus(newsTextView)
        c.UI.App.Draw()
 
        return res, err
@@ -605,10 +604,10 @@ var ServerHandshake = []byte{
 }
 
 func (c *Client) Handshake() error {
-       //Protocol ID   4       ‘TRTP’      0x54 52 54 50
-       //Sub-protocol ID       4               User defined
-       //Version       2       1       Currently 1
-       //Sub-version   2               User defined
+       // Protocol ID  4       ‘TRTP’      0x54 52 54 50
+       // Sub-protocol ID      4               User defined
+       // Version      2       1       Currently 1
+       // Sub-version  2               User defined
        if _, err := c.Connection.Write(ClientHandshake); err != nil {
                return fmt.Errorf("handshake write err: %s", err)
        }
@@ -644,7 +643,7 @@ func (c *Client) Send(t Transaction) error {
        requestNum := binary.BigEndian.Uint16(t.Type)
        tID := binary.BigEndian.Uint32(t.ID)
 
-       //handler := TransactionHandlers[requestNum]
+       // handler := TransactionHandlers[requestNum]
 
        // if transaction is NOT reply, add it to the list to transactions we're expecting a response for
        if t.IsReply == 0 {