X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/a2ef262a164fc735b9b8471ac0c8001eea2b9bf6..fd740bc499ebc6d3a381479316f74cdc736d02de:/hotline/client.go diff --git a/hotline/client.go b/hotline/client.go index 2389ee5..e300bb8 100644 --- a/hotline/client.go +++ b/hotline/client.go @@ -31,6 +31,7 @@ type Client struct { Pref *ClientPrefs Handlers map[[2]byte]ClientHandler activeTasks map[[4]byte]*Transaction + UserList []User } type ClientHandler func(context.Context, *Client, *Transaction) ([]Transaction, error) @@ -83,8 +84,8 @@ func (c *Client) Connect(address, login, passwd string) (err error) { TranLogin, [2]byte{0, 0}, NewField(FieldUserName, []byte(c.Pref.Username)), NewField(FieldUserIconID, c.Pref.IconBytes()), - NewField(FieldUserLogin, encodeString([]byte(login))), - NewField(FieldUserPassword, encodeString([]byte(passwd))), + NewField(FieldUserLogin, EncodeString([]byte(login))), + NewField(FieldUserPassword, EncodeString([]byte(passwd))), ), ) if err != nil { @@ -119,8 +120,8 @@ var ServerHandshake = []byte{ } func (c *Client) Handshake() error { - // Protocol ID 4 ‘TRTP’ 0x54 52 54 50 - // Sub-protocol ID 4 User defined + // Protocol Type 4 ‘TRTP’ 0x54 52 54 50 + // Sub-protocol Type 4 User defined // Version 2 1 Currently 1 // Sub-version 2 User defined if _, err := c.Connection.Write(ClientHandshake); err != nil { @@ -184,12 +185,6 @@ func (c *Client) HandleTransaction(ctx context.Context, t *Transaction) error { return err } } - } else { - c.Logger.Debug( - "Unimplemented transaction type", - "IsReply", t.IsReply, - "type", t.Type[:], - ) } return nil