This commit is contained in:
shoopea 2019-06-14 12:15:45 +08:00
parent 19df6071e7
commit 0e72a8f118
3 changed files with 29 additions and 2 deletions

View File

@ -9,7 +9,7 @@ ChirpNestBot
- [ ] Transform import/export to jobs, feed msg to identification channel instead of inserting directly - [ ] Transform import/export to jobs, feed msg to identification channel instead of inserting directly
- [ ] Turn on/off queue consumption - [ ] Turn on/off queue consumption
- [ ] Client de-registration announce - [ ] Client de-registration announce
- [ ] Items parsing/identification - [ ] Update items parsing/identification with gear details (atk/def/mana)
- [ ] Auto identificate weight of items - [ ] Auto identificate weight of items
- [ ] Tribute interception - [ ] Tribute interception
- [ ] Withdrawal bot - [ ] Withdrawal bot
@ -25,6 +25,7 @@ ChirpNestBot
- [x] Export/import all messages - [x] Export/import all messages
- [x] Test HTML in message - [x] Test HTML in message
- [x] Update auction from broadcast - [x] Update auction from broadcast
- [x] Items parsing/identification
- Progression : - Progression :
- 0 -> 4 : Forest + Foray ; - 0 -> 4 : Forest + Foray ;
- 5 -> 10 : Forest + Foray + Arena ; - 5 -> 10 : Forest + Foray + Arena ;

26
job.go
View File

@ -160,13 +160,39 @@ func jobRescan(j Job) {
logOnError(err, "jobRescan : Unmarshal payload") logOnError(err, "jobRescan : Unmarshal payload")
start := time.Now() start := time.Now()
milestone := time.Now()
ids := getSQLListID64(r.Query) ids := getSQLListID64(r.Query)
if len(ids) > 1 { if len(ids) > 1 {
txt := fmt.Sprintf("Rescanning %d messages.", len(ids))
m := TGCommand{
Type: commandReplyMsg,
Text: txt,
FromMsgID64: p.MsgID64,
FromChatID64: p.ChatID64,
}
TGCmdQueue <- m
i := 0
for _, id := range ids { for _, id := range ids {
SQLMsgIdentifyQueue <- id SQLMsgIdentifyQueue <- id
i = i + 1
if time.Now().After(milestone.Add(1 * time.Minute)) {
txt := fmt.Sprintf("Rescanned %d/%d messages.", i, len(ids))
m = TGCommand{
Type: commandReplyMsg,
Text: txt,
FromMsgID64: p.MsgID64,
FromChatID64: p.ChatID64,
}
TGCmdQueue <- m
milestone = time.Now()
}
} }
p := JobPayloadSetDone{ p := JobPayloadSetDone{
JobID64: j.ID64, JobID64: j.ID64,
MsgID64: r.MsgID64, MsgID64: r.MsgID64,

2
obj.go
View File

@ -622,7 +622,7 @@ func silentGetObjItemID(code string, name string) int64 {
if ok, _ := regexp.MatchString(`^(a|e)[0-9]+$`, i.Code); !ok { //only gear can be custom named if ok, _ := regexp.MatchString(`^(a|e)[0-9]+$`, i.Code); !ok { //only gear can be custom named
return true return true
} }
s := regexp.QuoteMeta(i.Name) s := strings.ToUpper(regexp.QuoteMeta(i.Name))
m := fmt.Sprintf("^(%s.*|.*%s)$ ", s, s) m := fmt.Sprintf("^(%s.*|.*%s)$ ", s, s)
if ok, _ := regexp.MatchString(m, n2); ok { if ok, _ := regexp.MatchString(m, n2); ok {
return false return false