-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 获取剩余@全员次数 & fix #126
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package oidb | ||
|
||
import "github.com/LagrangeDev/LagrangeGo/client/packets/pb/service/oidb" | ||
|
||
// ref https://github.com/Mrs4s/MiraiGo/blob/54bdd873e3fed9fe1c944918924674dacec5ac76/client/group_msg.go#L213 | ||
func BuildAtAllRemainRequest(uin, gin uint32) (*Packet, error) { | ||
body := &oidb.OidbSvcTrpcTcp0X8A7_0_ReqBody{ | ||
SubCmd: 1, | ||
LimitIntervalTypeForUin: 2, | ||
LimitIntervalTypeForGroup: 1, | ||
Uin: uint64(uin), | ||
GroupUin: uint64(gin), | ||
} | ||
return BuildOidbPacket(0x8A7, 0, body, false, true) | ||
} | ||
|
||
type AtAllRemainInfo struct { | ||
CanAtAll bool | ||
CountForGroup uint32 // 当前群默认可用次数 | ||
CountForUin uint32 // 当前QQ剩余次数 | ||
} | ||
|
||
// ref https://github.com/Mrs4s/MiraiGo/blob/54bdd873e3fed9fe1c944918924674dacec5ac76/client/group_msg.go#L326 | ||
func ParseAtAllRemainResponse(data []byte) (*AtAllRemainInfo, error) { | ||
var rsp oidb.OidbSvcTrpcTcp0X8A7_0_RspBody | ||
_, err := ParseOidbPacket(data, &rsp) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &AtAllRemainInfo{ | ||
CanAtAll: rsp.CanAtAll, | ||
CountForGroup: rsp.CountForGroup, | ||
CountForUin: rsp.CountForUin, | ||
}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
client/packets/pb/service/oidb/OidbSvcTrpcTcp0x8A7_0.pb.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
client/packets/pb/service/oidb/OidbSvcTrpcTcp0x8A7_0.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
syntax = "proto3"; | ||
|
||
// ref https://github.com/Mrs4s/MiraiGo/blob/master/client/pb/oidb/oidb0x8a7.proto | ||
|
||
option go_package = "github.com/LagrangeDev/LagrangeGo/client/packets/pb/service/oidb"; | ||
|
||
message OidbSvcTrpcTcp0x8A7_0_ReqBody { | ||
uint32 subCmd = 1; | ||
uint32 limitIntervalTypeForUin = 2; | ||
uint32 limitIntervalTypeForGroup = 3; | ||
uint64 uin = 4; | ||
uint64 groupUin = 5; | ||
} | ||
|
||
message OidbSvcTrpcTcp0x8A7_0_RspBody { | ||
bool canAtAll = 1; | ||
uint32 countForUin = 2; | ||
uint32 countForGroup = 3; | ||
//optional bytes promptMsg1 = 4; | ||
//optional bytes promptMsg2 = 5; | ||
} |
68 changes: 36 additions & 32 deletions
68
client/packets/pb/service/oidb/OidbSvcTrpcTcp0xBCB_0.pb.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
解释一下为什么这么改
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
miraigo就是这么写的 Mrs4s: MiraiGo/client/pb/oidb/oidb0xbcb.proto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你应该问为什么之前不是这么写的😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有区别吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
再有这种无意义的提交,我不介意把你block掉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有时间格式化,不如去加个ci配置,让他自动化
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ide 自动 关我什么事
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改错代码 (误删optional) 回滚一下 可 ?