This commit is contained in:
shoopea 2019-06-14 14:04:50 +08:00
parent 5a498d1589
commit ce20e31721
2 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,5 @@
ChirpNestBot
- [ ] Check for not launching concurrent msg rescan jobs
- [ ] MQTGCmdWorker[2] : Publishing message.: Exception (504) Reason: "channel/connection is not open" (add check in MQKeepAliveWorker ?)
- [ ] Make sure refresh message receives the message later (jobMsgRefresh)
- [ ] Adjust /time clock for auctions/... (delay between cw and real time ?)

11
obj.go
View File

@ -580,7 +580,7 @@ func addObjItem(code string, name string, itemTypeID64 int64, weight int) (int64
c.Name = name
c.Weight = weight
cacheObjItem.Store(code, *c)
cacheObjItem.Store(strings.ToUpper(name), *c)
cacheObjItem.Store(name, *c)
return objId, nil
}
@ -599,8 +599,8 @@ func getObjItemID(c string, n string) int64 {
}
func silentGetObjItemID(code string, name string) int64 {
c := strings.ToLower(code)
n := strings.ToUpper(name)
c := code
n := name
if v, ok := cacheObjItem.Load(c); ok {
i := v.(ChatWarsItem)
return i.ObjID64
@ -622,8 +622,7 @@ func silentGetObjItemID(code string, name string) int64 {
if ok, _ := regexp.MatchString(`^(a|e|w)[0-9]+$`, i.Code); !ok { //only gear can be custom named
return true
}
s := strings.ToUpper(regexp.QuoteMeta(i.Name))
m := fmt.Sprintf("^(%s.*|.*%s)$", s, s)
m := fmt.Sprintf("^(%s.*|.*%s)$", regexp.QuoteMeta(i.Name), regexp.QuoteMeta(i.Name))
if ok, _ := regexp.MatchString(m, n2); ok {
return false
} else {
@ -676,7 +675,7 @@ func loadObjItem() error {
c.Name = name
c.Weight = weight
cacheObjItem.Store(intl_id, *c)
cacheObjItem.Store(strings.ToUpper(name), *c)
cacheObjItem.Store(name, *c)
}
return nil