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

Method webSsoRequest

client/base.go:222–245  ·  view source on GitHub ↗
(host, webCmd, data string)

Source from the content-addressed store, hash-verified

220}
221
222func (c *QQClient) webSsoRequest(host, webCmd, data string) (string, error) {
223 s := strings.Split(host, `.`)
224 sub := ""
225 for i := len(s) - 1; i >= 0; i-- {
226 sub += s[i]
227 if i != 0 {
228 sub += "_"
229 }
230 }
231 cmd := "MQUpdateSvc_" + sub + ".web." + webCmd
232 req, _ := proto.Marshal(&service.WebSsoRequestBody{
233 Type: proto.Uint32(0),
234 Data: proto.Some(data),
235 })
236 rspData, err := c.sendUniPacketAndWait(cmd, req)
237 if err != nil {
238 return "", errors.Wrap(err, "send web sso request error")
239 }
240 rsp := &service.WebSsoResponseBody{}
241 if err = proto.Unmarshal(rspData, rsp); err != nil {
242 return "", errors.Wrap(err, "unmarshal response error")
243 }
244 return rsp.Data.Unwrap(), nil
245}
246
247func (c *QQClient) doHeartbeat() {
248 for c.Online.Load() {

Callers 2

Calls 5

sendUniPacketAndWaitMethod · 0.95
MarshalFunction · 0.92
Uint32Function · 0.92
SomeFunction · 0.92
UnmarshalFunction · 0.92

Tested by

no test coverage detected