This commit is contained in:
shoopea 2019-05-06 15:38:28 +08:00
parent 7f7fccfe26
commit 50822a9f09

View File

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