MCPcopy Create free account
hub / github.com/LagrangeDev/LagrangeGo / PasswordLogin

Method PasswordLogin

client/client.go:170–204  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

168}
169
170func (c *QQClient) PasswordLogin() (*LoginResponse, error) {
171 if c.Online.Load() {
172 return nil, ErrAlreadyOnline
173 }
174
175 err := c.connect()
176 if err != nil {
177 return nil, err
178 }
179
180 err = c.keyExchange()
181 if err != nil {
182 return nil, err
183 }
184
185 data, err := buildPasswordLoginRequest(c.Uin, c.Version(), c.Device(), &c.transport.Sig, c.PasswordMD5)
186 if err != nil {
187 return nil, err
188 }
189 packet, err := c.sendUniPacketAndWait(
190 "trpc.login.ecdh.EcdhService.SsoNTLoginPasswordLogin",
191 data,
192 )
193 if err != nil {
194 return nil, err
195 }
196 res, err := parseNtloginResponse(packet, &c.transport.Sig)
197 if err != nil {
198 return nil, err
199 }
200 if res.Success {
201 err = c.init()
202 }
203 return &res, err
204}
205
206func (c *QQClient) SubmitCaptcha(ticket, randStr, aid string) (*LoginResponse, error) {
207 c.Sig().CaptchaInfo = [3]string{ticket, randStr, aid}

Callers 1

mainFunction · 0.80

Calls 8

connectMethod · 0.95
keyExchangeMethod · 0.95
VersionMethod · 0.95
DeviceMethod · 0.95
sendUniPacketAndWaitMethod · 0.95
initMethod · 0.95
parseNtloginResponseFunction · 0.85

Tested by

no test coverage detected