This commit is contained in:
shoopea 2019-05-06 15:28:34 +08:00
parent 079de7e514
commit 6791dfaad3

View File

@ -77,9 +77,12 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) {
if err == nil {
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Message retrieved (%d)\n%s\n", objId, m.Text)
// War reports
r := regexp.MustCompile(`^(?P<Castle>[.]{1})(?P<Guild>(\[[A-Z]{3}\]){0,1})(?P<User>(\[[A-Za-z0-9 ]*\]){1}) ⚔:(?P<Attack>[0-9]+) ?:(?P<Defense>[0-9]+) Lvl: (?P<Level>[0-9]+)(?s:.*)$`)
// r := regexp.MustCompile(`^(?P<Castle>[.]{1})(?P<Guild>(\[[A-Z]{3}\]){0,1})(?P<User>(\[[A-Za-z0-9 ]*\]){1}) ⚔:(?P<Attack>[0-9]+) ?:(?P<Defense>[0-9]+) Lvl: (?P<Level>[0-9]+)(?s:.*)$`)
r := regexp.MustCompile(`^(?P<Castle>[.]{1})(?s:.*)$`)
if r.FindStringSubmatch(m.Text) != nil {
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : War report identified (%d)\n", objId)
} else {
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Unknown message type (%d)\n", objId)
}
}
}