mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
chron: 添加下划线,修改文件权限
This commit is contained in:
parent
4767245285
commit
0f68dadc9a
@ -1,6 +1,3 @@
|
|||||||
//go:build ignore
|
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import "github.com/Mrs4s/MiraiGo/client/pb/msg"
|
import "github.com/Mrs4s/MiraiGo/client/pb/msg"
|
@ -8,11 +8,11 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
UnknownDecoder = iota
|
UnknownDecoder = iota
|
||||||
sysMsgDecoders
|
|
||||||
otherDecoders
|
|
||||||
privateMsgDecoders
|
privateMsgDecoders
|
||||||
nonSvcNotifyTroopSystemMsgDecoders
|
nonSvcNotifyTroopSystemMsgDecoders
|
||||||
troopSystemMsgDecoders
|
troopSystemMsgDecoders
|
||||||
|
sysMsgDecoders
|
||||||
|
otherDecoders
|
||||||
)
|
)
|
||||||
|
|
||||||
func peekC2CDecoder(msgType int32) (decoder func(*QQClient, *msg.Message, *incomingPacketInfo), decoderType uint8) {
|
func peekC2CDecoder(msgType int32) (decoder func(*QQClient, *msg.Message, *incomingPacketInfo), decoderType uint8) {
|
||||||
|
@ -59,7 +59,7 @@ func main() {
|
|||||||
var sf switchFile
|
var sf switchFile
|
||||||
|
|
||||||
fset := token.NewFileSet()
|
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 {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
@ -72,7 +72,7 @@ func main() {
|
|||||||
sf.Consts = make([]string, 0, len(astF.Scope.Objects))
|
sf.Consts = make([]string, 0, len(astF.Scope.Objects))
|
||||||
for _, obj := range astF.Scope.Objects {
|
for _, obj := range astF.Scope.Objects {
|
||||||
if obj.Kind != ast.Var {
|
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)
|
value := obj.Decl.(*ast.ValueSpec)
|
||||||
sf.Consts = append(sf.Consts, obj.Name)
|
sf.Consts = append(sf.Consts, obj.Name)
|
||||||
@ -88,17 +88,17 @@ func main() {
|
|||||||
DecoderType: obj.Name,
|
DecoderType: obj.Name,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
panic(`unknown key value in ` + obj.Name + ` in "c2c_decoders.go"`)
|
panic(`unknown key value in ` + obj.Name + ` in "_c2c_decoders.go"`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
panic(`unknown non-map value in "c2c_decoders.go"`)
|
panic(`unknown non-map value in "_c2c_decoders.go"`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sort.Sort(sf.Decoders)
|
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)
|
tmpl, err := template.New("template").Parse(codeTemplate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
@ -396,7 +396,7 @@ func decodeSvcNotify(c *QQClient, _ *incomingPacketInfo, payload []byte) (interf
|
|||||||
notify := &jce.RequestPushNotify{}
|
notify := &jce.RequestPushNotify{}
|
||||||
notify.ReadFrom(jce.NewJceReader(data.Map["req_PushNotify"]["PushNotifyPack.RequestPushNotify"][1:]))
|
notify.ReadFrom(jce.NewJceReader(data.Map["req_PushNotify"]["PushNotifyPack.RequestPushNotify"][1:]))
|
||||||
if decoder, typ := peekC2CDecoder(notify.MsgType); decoder != nil {
|
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 {
|
if typ == troopSystemMsgDecoders {
|
||||||
c.exceptAndDispatchGroupSysMsg()
|
c.exceptAndDispatchGroupSysMsg()
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user