1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00

chron: 添加下划线,修改文件权限

This commit is contained in:
Lin 2021-10-27 10:03:19 +08:00
parent 4767245285
commit 0f68dadc9a
No known key found for this signature in database
GPG Key ID: 244C608766137C86
4 changed files with 8 additions and 11 deletions

View File

@ -1,6 +1,3 @@
//go:build ignore
// +build ignore
package client
import "github.com/Mrs4s/MiraiGo/client/pb/msg"

View File

@ -8,11 +8,11 @@ import (
const (
UnknownDecoder = iota
sysMsgDecoders
otherDecoders
privateMsgDecoders
nonSvcNotifyTroopSystemMsgDecoders
troopSystemMsgDecoders
sysMsgDecoders
otherDecoders
)
func peekC2CDecoder(msgType int32) (decoder func(*QQClient, *msg.Message, *incomingPacketInfo), decoderType uint8) {

View File

@ -59,7 +59,7 @@ func main() {
var sf switchFile
fset := token.NewFileSet()
astF, err := parser.ParseFile(fset, "c2c_decoders.go", nil, parser.AllErrors|parser.ParseComments)
astF, err := parser.ParseFile(fset, "_c2c_decoders.go", nil, parser.AllErrors|parser.ParseComments)
if err != nil {
panic(err)
}
@ -72,7 +72,7 @@ func main() {
sf.Consts = make([]string, 0, len(astF.Scope.Objects))
for _, obj := range astF.Scope.Objects {
if obj.Kind != ast.Var {
panic(`unknown non-variable in "c2c_decoders.go"`)
panic(`unknown non-variable in "_c2c_decoders.go"`)
}
value := obj.Decl.(*ast.ValueSpec)
sf.Consts = append(sf.Consts, obj.Name)
@ -88,17 +88,17 @@ func main() {
DecoderType: obj.Name,
})
} else {
panic(`unknown key value in ` + obj.Name + ` in "c2c_decoders.go"`)
panic(`unknown key value in ` + obj.Name + ` in "_c2c_decoders.go"`)
}
}
} else {
panic(`unknown non-map value in "c2c_decoders.go"`)
panic(`unknown non-map value in "_c2c_decoders.go"`)
}
}
}
sort.Sort(sf.Decoders)
f, _ := os.OpenFile("c2c_switch.go", os.O_WRONLY|os.O_CREATE|os.O_SYNC|os.O_TRUNC, 0o755)
f, _ := os.OpenFile("c2c_switch.go", os.O_WRONLY|os.O_CREATE|os.O_SYNC|os.O_TRUNC, 0o644)
tmpl, err := template.New("template").Parse(codeTemplate)
if err != nil {
panic(err)

View File

@ -396,7 +396,7 @@ func decodeSvcNotify(c *QQClient, _ *incomingPacketInfo, payload []byte) (interf
notify := &jce.RequestPushNotify{}
notify.ReadFrom(jce.NewJceReader(data.Map["req_PushNotify"]["PushNotifyPack.RequestPushNotify"][1:]))
if decoder, typ := peekC2CDecoder(notify.MsgType); decoder != nil {
// notify.MsgType != 85 && notify.MsgType != 36 moves to c2c_decoders.go [nonSvcNotifyTroopSystemMsgDecoders]
// notify.MsgType != 85 && notify.MsgType != 36 moves to _c2c_decoders.go [nonSvcNotifyTroopSystemMsgDecoders]
if typ == troopSystemMsgDecoders {
c.exceptAndDispatchGroupSysMsg()
return nil, nil