This commit is contained in:
shoopea 2019-12-29 16:44:23 +08:00
parent 01508d0207
commit 89ebfb6358

14
sql.go
View File

@ -744,11 +744,11 @@ func insertMsgPillageInc(m *ChatWarsMessagePillageInc) error {
func loadMsgParsingRules() (m map[int]MessageParsingRule, err error) { func loadMsgParsingRules() (m map[int]MessageParsingRule, err error) {
var ( var (
id int32 id int32
priority int32 priority int32
descn string descn string
rule string rule string
msgTypeID int64 msgTypeID64 int64
) )
log.Println("Loading message parsing rules...") log.Println("Loading message parsing rules...")
@ -769,7 +769,7 @@ func loadMsgParsingRules() (m map[int]MessageParsingRule, err error) {
defer rules.Close() defer rules.Close()
for rules.Next() { for rules.Next() {
err = rules.Scan(&id, &priority, &descn, &rule, &msgTypeID) err = rules.Scan(&id, &priority, &descn, &rule, &msgTypeID64)
if err != nil { if err != nil {
return m, err return m, err
} }
@ -778,7 +778,7 @@ func loadMsgParsingRules() (m map[int]MessageParsingRule, err error) {
i.Priority = priority i.Priority = priority
i.Description = descn i.Description = descn
i.Rule = rule i.Rule = rule
i.MsgTypeID = msgTypeID i.MsgTypeID64 = msgTypeID64
i.re = regexp.MustCompile(rule) i.re = regexp.MustCompile(rule)
m[count] = *i m[count] = *i
// log.Printf("New rule : %s\n", rule) // log.Printf("New rule : %s\n", rule)