test
This commit is contained in:
parent
afdf512fc6
commit
d0a5fc5129
5
def.go
5
def.go
@ -1,5 +1,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
)
|
||||
|
||||
type ChatWarsMessage struct {
|
||||
UserID64 int64 `json:"user_id"`
|
||||
SenderUserID64 int64 `json:"sender_user_id"`
|
||||
@ -15,6 +19,7 @@ type MessageParsingRule struct {
|
||||
Description string
|
||||
Rule string
|
||||
MsgTypeID int32
|
||||
re *regexp.Regexp
|
||||
}
|
||||
|
||||
const (
|
||||
|
@ -3,7 +3,6 @@ package main
|
||||
import (
|
||||
"encoding/json"
|
||||
"log"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
@ -78,8 +77,6 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) {
|
||||
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Retrieving message.")
|
||||
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>.)(?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]+)\nYour result on the battlefield:\n.Exp: (?P<Exp>[0-9]+)\n.Gold: (?P<Gold>[0-9]+)\n.Stock: (?P<Stock>[0-9]+)\n(?s:.*)$`) // FIXME defense/exp/gold/stock characters !
|
||||
for i = 0; i < len(msgParsingRules) && msgParsingRules[i].re.FindStringSubmatch(m.Text) != nil; i++ {
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user