Pref *ClientPrefs
Handlers map[[2]byte]ClientHandler
activeTasks map[[4]byte]*Transaction
+ UserList []User
}
type ClientHandler func(context.Context, *Client, *Transaction) ([]Transaction, 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 {
}
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 {
return err
}
}
- } else {
- c.Logger.Debug(
- "Unimplemented transaction type",
- "IsReply", t.IsReply,
- "type", t.Type[:],
- )
}
return nil