This commit is contained in:
shoopea 2019-05-25 18:59:27 +08:00
parent 50e7af882e
commit 99b6e7094d
3 changed files with 8 additions and 5 deletions

5
def.go
View File

@ -240,9 +240,8 @@ const (
objSubTypeMessageMiscReq = 347 // /misc (done) objSubTypeMessageMiscReq = 347 // /misc (done)
objSubTypeMEssageMiscAck = 348 // result from /misc (not done) objSubTypeMEssageMiscAck = 348 // result from /misc (not done)
objSubTypeMessageUnionWar = 349 // from Chat Wars Reports (not done) objSubTypeMessageUnionWar = 349 // from Chat Wars Reports (not done)
objSubTypeMessageFairWar = 350 // from Chat Wars Reports (not done) objSubTypeMessageTUReportReq = 350 // /tu_report (not done)
objSubTypeMessageTUReportReq = 351 // /tu_report (not done) objSubTypeMessageTUReportAck = 351 // result from /tu_report (not done)
objSubTypeMessageTUReportAck = 352 // result from /tu_report (not done)
objSubTypeJobPillage = 601 objSubTypeJobPillage = 601
objSubTypeJobTribute = 602 objSubTypeJobTribute = 602
objSubTypeJobStatus = 603 objSubTypeJobStatus = 603

View File

@ -100,7 +100,12 @@ func resetMsgParsingRules() {
,(5000, ` + strconv.Itoa(objSubTypeMessageUnionWar) + `, "Union war report", "^(🏠Trade union news:\\n){0,1}` + ,(5000, ` + strconv.Itoa(objSubTypeMessageUnionWar) + `, "Union war report", "^(🏠Trade union news:\\n){0,1}` +
`(((?P<Union>[A-Z][a-z]+ [A-Z][a-z]+) was (?P<Status>(easily defended|defended successfully|breached.|easily breached.|closely breached.))(Attackers have pillage union for (?<Loot>[0-9]+) stock):\\n` + `(((?P<Union>[A-Z][a-z]+ [A-Z][a-z]+) was (?P<Status>(easily defended|defended successfully|breached.|easily breached.|closely breached.))(Attackers have pillage union for (?<Loot>[0-9]+) stock):\\n` +
`(🎖Attack leaders: (?P<AtkCastle1>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser1>[^,]+)(,(?P<AtkCastle2>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser2>[^,]+)){0,1}(,(?P<AtkCastle3>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser3>[^,]+)){0,1}(,(?P<AtkCastle4>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser4>[^,]+)){0,1}){0,1}(\\n){0,1}` + `(🎖Attack leaders: (?P<AtkCastle1>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser1>[^,]+)(,(?P<AtkCastle2>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser2>[^,]+)){0,1}(,(?P<AtkCastle3>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser3>[^,]+)){0,1}(,(?P<AtkCastle4>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser4>[^,]+)){0,1}){0,1}(\\n){0,1}` +
`(🎖Defense leaders: (?P<DefCastle1>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefUser1>[^,]+)(,(?P<DefCastle2>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser2>[^,]+)){0,1}(,(?P<DefCastle3>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefUser3>[^,]+)){0,1}(,(?P<DefCastle4>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser4>[^,]+)){0,1}){0,1}(\\n){0,1})(\\n)*)+$") `(🎖Defense leaders: (?P<DefCastle1>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefUser1>[^,]+)(,(?P<DefCastle2>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser2>[^,]+)){0,1}(,(?P<DefCastle3>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefUser3>[^,]+)){0,1}(,(?P<DefCastle4>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser4>[^,]+)){0,1}){0,1}(\\n){0,1})(\\n)*)*` +
`(🎪State of exclusive rights:\\n){0,1}` +
`(((?P<Fair>[A-Z][a-z]+ [A-Z][a-z]+) (?P<Status>(was protected|belongs to)( (?P<Attacker>[A-Z][a-z]+ [A-Z][a-z]+):)\\n` +
`(🎖Attack leaders: (?P<AtkCastle1>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser1>[^,]+)(,(?P<AtkCastle2>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser2>[^,]+)){0,1}(,(?P<AtkCastle3>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser3>[^,]+)){0,1}(,(?P<AtkCastle4>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser4>[^,]+)){0,1}){0,1}(\\n){0,1}` +
`(🎖Defense leaders: (?P<DefCastle1>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefUser1>[^,]+)(,(?P<DefCastle2>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser2>[^,]+)){0,1}(,(?P<DefCastle3>[🐉🦅🐺🦈🦌🥔🌑])(?P<DefUser3>[^,]+)){0,1}(,(?P<DefCastle4>[🐉🦅🐺🦈🦌🥔🌑])(?P<AtkUser4>[^,]+)){0,1}){0,1}(\\n){0,1})(\\n)*)*` +
`"$")
;`) ;`)
failOnError(err, "resetMsgParsingRules : populate table msg_rules") failOnError(err, "resetMsgParsingRules : populate table msg_rules")
} }

1
sql.go
View File

@ -364,7 +364,6 @@ func initDB() {
,(` + strconv.Itoa(objSubTypeMEssageMiscAck) + `, "misc_ack", "Misc Ack", ` + strconv.Itoa(objTypeMessage) + `) ,(` + strconv.Itoa(objSubTypeMEssageMiscAck) + `, "misc_ack", "Misc Ack", ` + strconv.Itoa(objTypeMessage) + `)
,(` + strconv.Itoa(objSubTypeMessageTUReportReq) + `, "tureport_req", "Trade Union War Report Req", ` + strconv.Itoa(objTypeMessage) + `) ,(` + strconv.Itoa(objSubTypeMessageTUReportReq) + `, "tureport_req", "Trade Union War Report Req", ` + strconv.Itoa(objTypeMessage) + `)
,(` + strconv.Itoa(objSubTypeMessageTUReportAck) + `, "tureport_ack", "Trade Union War Report Ack", ` + strconv.Itoa(objTypeMessage) + `) ,(` + strconv.Itoa(objSubTypeMessageTUReportAck) + `, "tureport_ack", "Trade Union War Report Ack", ` + strconv.Itoa(objTypeMessage) + `)
,(` + strconv.Itoa(objSubTypeMessageFairWar) + `, "fair_war", "Fair war report", ` + strconv.Itoa(objTypeMessage) + `)
,(` + strconv.Itoa(objSubTypeMessageUnionWar) + `, "union_war", "Union war report", ` + strconv.Itoa(objTypeMessage) + `) ,(` + strconv.Itoa(objSubTypeMessageUnionWar) + `, "union_war", "Union war report", ` + strconv.Itoa(objTypeMessage) + `)
,(` + strconv.Itoa(objSubTypeJobPillage) + `, "job_pillage", "Pillage job", ` + strconv.Itoa(objTypeJob) + `) ,(` + strconv.Itoa(objSubTypeJobPillage) + `, "job_pillage", "Pillage job", ` + strconv.Itoa(objTypeJob) + `)
,(` + strconv.Itoa(objSubTypeJobTribute) + `, "job_tribute", "Tribute job", ` + strconv.Itoa(objTypeJob) + `) ,(` + strconv.Itoa(objSubTypeJobTribute) + `, "job_tribute", "Tribute job", ` + strconv.Itoa(objTypeJob) + `)