mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
feat: SetOnlineStatus.
This commit is contained in:
parent
5d971cfb11
commit
dd7898c204
@ -111,6 +111,8 @@ type (
|
||||
IsSetStatus byte `jceId:"34"`
|
||||
ServerBuf []byte `jceId:"35"`
|
||||
SetMute byte `jceId:"36"`
|
||||
ExtOnlineStatus int64 `jceId:"38"`
|
||||
BatteryStatus int32 `jceId:"39"`
|
||||
}
|
||||
|
||||
SvcRespRegister struct {
|
||||
|
@ -448,6 +448,44 @@ func (c *QQClient) buildClientRegisterPacket() (uint16, []byte) {
|
||||
return seq, packet
|
||||
}
|
||||
|
||||
func (c *QQClient) buildStatusSetPacket(status, extStatus int32) (uint16, []byte) {
|
||||
seq := c.nextSeq()
|
||||
svc := &jce.SvcReqRegister{
|
||||
ConnType: 0,
|
||||
Uin: c.Uin,
|
||||
Bid: 7,
|
||||
Status: status,
|
||||
KickPC: 0,
|
||||
KickWeak: 0,
|
||||
Timestamp: time.Now().Unix(),
|
||||
IOSVersion: int64(SystemDeviceInfo.Version.Sdk),
|
||||
NetType: 1,
|
||||
RegType: 0,
|
||||
Guid: SystemDeviceInfo.Guid,
|
||||
IsSetStatus: 1,
|
||||
LocaleId: 2052,
|
||||
DevName: string(SystemDeviceInfo.Model),
|
||||
DevType: string(SystemDeviceInfo.Model),
|
||||
OSVer: string(SystemDeviceInfo.Version.Release),
|
||||
OpenPush: 1,
|
||||
LargeSeq: 1551,
|
||||
ExtOnlineStatus: int64(extStatus),
|
||||
}
|
||||
buf := &jce.RequestDataVersion3{
|
||||
Map: map[string][]byte{"SvcReqRegister": packUniRequestData(svc.ToBytes())},
|
||||
}
|
||||
pkt := &jce.RequestPacket{
|
||||
IVersion: 3,
|
||||
SServantName: "PushService",
|
||||
SFuncName: "SvcReqRegister",
|
||||
SBuffer: buf.ToBytes(),
|
||||
Context: make(map[string]string),
|
||||
Status: make(map[string]string),
|
||||
}
|
||||
packet := packets.BuildUniPacket(c.Uin, seq, "StatSvc.SetStatusFromClient", 1, c.OutGoingPacketSessionId, []byte{}, c.sigInfo.d2Key, pkt.ToBytes())
|
||||
return seq, packet
|
||||
}
|
||||
|
||||
// ConfigPushSvc.PushResp
|
||||
func (c *QQClient) buildConfPushRespPacket(t int32, pktSeq int64, jceBuf []byte) (uint16, []byte) {
|
||||
seq := c.nextSeq()
|
||||
|
@ -432,6 +432,14 @@ func (c *QQClient) GenToken() []byte {
|
||||
})
|
||||
}
|
||||
|
||||
func (c *QQClient) SetOnlineStatus(s UserOnlineStatus) {
|
||||
if s < 1000 {
|
||||
_, _ = c.sendAndWait(c.buildStatusSetPacket(int32(s), 0))
|
||||
return
|
||||
}
|
||||
_, _ = c.sendAndWait(c.buildStatusSetPacket(11, int32(s)))
|
||||
}
|
||||
|
||||
func (c *QQClient) GetVipInfo(target int64) (*VipInfo, error) {
|
||||
b, err := utils.HttpGetBytes(fmt.Sprintf("https://h5.vip.qq.com/p/mc/cardv2/other?platform=1&qq=%d&adtag=geren&aid=mvip.pingtai.mobileqq.androidziliaoka.fromqita", target), c.getCookiesWithDomain("h5.vip.qq.com"))
|
||||
if err != nil {
|
||||
|
@ -19,6 +19,8 @@ type (
|
||||
|
||||
MemberPermission int
|
||||
|
||||
UserOnlineStatus int
|
||||
|
||||
ClientProtocol int
|
||||
|
||||
LoginResponse struct {
|
||||
@ -295,9 +297,34 @@ const (
|
||||
QRCodeConfirmed QRCodeLoginState = 5
|
||||
QRCodeCanceled QRCodeLoginState = 6
|
||||
|
||||
Owner MemberPermission = iota
|
||||
Administrator
|
||||
Member
|
||||
StatusOnline UserOnlineStatus = 11 // 在线
|
||||
StatusOffline UserOnlineStatus = 21 // 离线
|
||||
StatusAway UserOnlineStatus = 31 // 离开
|
||||
StatusInvisible UserOnlineStatus = 41 // 隐身
|
||||
StatusBusy UserOnlineStatus = 50 // 忙
|
||||
StatusBattery UserOnlineStatus = 1000 // 当前电量
|
||||
StatusListening UserOnlineStatus = 1028 // 听歌中
|
||||
StatusConstellation UserOnlineStatus = 1040 // 星座运势
|
||||
StatusWeather UserOnlineStatus = 1030 // 今日天气
|
||||
StatusMeetSpring UserOnlineStatus = 1069 // 遇见春天
|
||||
StatusTimi UserOnlineStatus = 1027 // Timi中
|
||||
StatusEatChicken UserOnlineStatus = 1064 // 吃鸡中
|
||||
StatusLoving UserOnlineStatus = 1051 // 恋爱中
|
||||
StatusWangWang UserOnlineStatus = 1053 // 汪汪汪
|
||||
StatusCookedRice UserOnlineStatus = 1019 // 干饭中
|
||||
StatusStudy UserOnlineStatus = 1018 // 学习中
|
||||
StatusStayUp UserOnlineStatus = 1032 // 熬夜中
|
||||
StatusPlayBall UserOnlineStatus = 1050 // 打球中
|
||||
StatusSignal UserOnlineStatus = 1011 // 信号弱
|
||||
StatusStudyOnline UserOnlineStatus = 1024 // 在线学习
|
||||
StatusGaming UserOnlineStatus = 1017 // 游戏中
|
||||
StatusVacationing UserOnlineStatus = 1022 // 度假中
|
||||
StatusWatchingTV UserOnlineStatus = 1021 // 追剧中
|
||||
StatusFitness UserOnlineStatus = 1020 // 健身中
|
||||
|
||||
Owner MemberPermission = 1
|
||||
Administrator MemberPermission = 2
|
||||
Member MemberPermission = 3
|
||||
|
||||
AndroidPhone ClientProtocol = 1
|
||||
IPad ClientProtocol = 2
|
||||
|
Loading…
x
Reference in New Issue
Block a user