diff --git a/workers.go b/workers.go index f523085..50e8207 100644 --- a/workers.go +++ b/workers.go @@ -77,14 +77,8 @@ 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[.]{1})(?P(\[[A-Z]{3}\]){0,1})(?P([A-Za-z0-9 ]*)) ⚔:(?P[0-9]+) ?:(?P[0-9]+) Lvl: (?P[0-9]+)(?s:.*)$`) - // r := regexp.MustCompile(`^(?s:.*)$`) - // r := regexp.MustCompile(`^(?P.)(?P(\[[A-Z]{3}\]){0,1})(?P([A-Za-z0-9 ]*))(?s:.*)$`) - // r := regexp.MustCompile(`^(?P.)(?P(\[[A-Z]{3}\]){0,1})(?P([A-Za-z0-9 ]*)) ⚔:(?P[0-9]+)(?s:.*)$`) - // r := regexp.MustCompile(`^(?P.)(?P(\[[A-Z]{3}\]){0,1})(?P([A-Za-z0-9 ]*)) ⚔:(?P[0-9]+) .:(?P[0-9]+)(?s:.*)$`) // FIXME defense character ! - // r := regexp.MustCompile(`^(?P.)(?P(\[[A-Z]{3}\]){0,1})(?P([A-Za-z0-9 ]*)) ⚔:(?P[0-9]+) .:(?P[0-9]+) Lvl: (?P[0-9]+)(?s:.*)$`) // FIXME defense character ! - // r := regexp.MustCompile(`^(?P.)(?P(\[[A-Z]{3}\]){0,1})(?P([A-Za-z0-9 ]*)) ⚔:(?P[0-9]+) .:(?P[0-9]+) Lvl: (?P[0-9]+)\nYour result on the battlefield:\n.Exp: (?P[0-9]+)\n(?s:.*)$`) // FIXME defense/exp/gold/stock characters ! - r := regexp.MustCompile(`^(?P.)(?P(\[[A-Z]{3}\]){0,1})(?P([A-Za-z0-9 ]*)) ⚔:(?P[0-9]+) .:(?P[0-9]+) Lvl: (?P[0-9]+)\nYour result on the battlefield:\n.Exp: (?P[0-9]+)\n.Gold: (?P[0-9]+)\n.Stock: (?P[0-9]+)\n(?s:.*)$`) // FIXME defense/exp/gold/stock characters ! + // r := regexp.MustCompile(`^(?P.)(?P(\[[A-Z]{3}\]){0,1})(?P([A-Za-z0-9 ]*)) ⚔:(?P[0-9]+) .:(?P[0-9]+) Lvl: (?P[0-9]+)\nYour result on the battlefield:\n.Exp: (?P[0-9]+)\n.Gold: (?P[0-9]+)\n.Stock: (?P[0-9]+)\n(?s:.*)$`) // FIXME defense/exp/gold/stock characters ! + r := regexp.MustCompile(`^(?P.)(?P(\[[A-Z]{3}\]){0,1})(?P([A-Za-z0-9 ]*)) ⚔:(?P[0-9]+) .:(?P[0-9]+) Lvl: (?P[0-9]+)\nYour result on the battlefield:\n.Exp: (?P[0-9]+)\n.Gold: (?P[0-9]+)\n.Stock: (?P[0-9]+)\n(?s:.*)(?P(.Stamina restored)){0,1}(\n)*(?P(.Critical strike)){0,1}(\n)*$`) // FIXME defense/exp/gold/stock characters ! 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) @@ -96,6 +90,8 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) { log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Exp : %s (%d)\n", r.ReplaceAllString(m.Text, "${Exp}"), objId) log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Gold : %s (%d)\n", r.ReplaceAllString(m.Text, "${Gold}"), objId) log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Stock : %s (%d)\n", r.ReplaceAllString(m.Text, "${Stock}"), objId) + log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Stamina : %s (%d)\n", r.ReplaceAllString(m.Text, "${Stamina}"), objId) + log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Crit : %s (%d)\n", r.ReplaceAllString(m.Text, "${Crit}"), objId) } else { log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Unknown message type (%d)\n", objId) }