test
This commit is contained in:
parent
187d7ca41f
commit
0d29bee4c1
4
obj.go
4
obj.go
@ -657,6 +657,7 @@ func silentGetObjItemID(code string, name string) int64 {
|
|||||||
item := ChatWarsItem{
|
item := ChatWarsItem{
|
||||||
ObjID64: 0,
|
ObjID64: 0,
|
||||||
}
|
}
|
||||||
|
match := false
|
||||||
cacheObjItem.Range(func(k, v interface{}) bool {
|
cacheObjItem.Range(func(k, v interface{}) bool {
|
||||||
item = v.(ChatWarsItem)
|
item = v.(ChatWarsItem)
|
||||||
if ok, _ := regexp.MatchString(`^(a|e|w)[0-9]+$`, item.Code); !ok { //only gear can be custom named
|
if ok, _ := regexp.MatchString(`^(a|e|w)[0-9]+$`, item.Code); !ok { //only gear can be custom named
|
||||||
@ -665,6 +666,7 @@ func silentGetObjItemID(code string, name string) int64 {
|
|||||||
m := fmt.Sprintf("^((%s.*)|(.*%s))$", regexp.QuoteMeta(item.Name), regexp.QuoteMeta(item.Name))
|
m := fmt.Sprintf("^((%s.*)|(.*%s))$", regexp.QuoteMeta(item.Name), regexp.QuoteMeta(item.Name))
|
||||||
if ok, _ := regexp.MatchString(m, basename); ok {
|
if ok, _ := regexp.MatchString(m, basename); ok {
|
||||||
log.Printf("LOOP : Matching item modified basename %s with %s (%d).\n", basename, item.Name, item.ObjID64)
|
log.Printf("LOOP : Matching item modified basename %s with %s (%d).\n", basename, item.Name, item.ObjID64)
|
||||||
|
match = true
|
||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
log.Printf("Not matching item modified basename %s with %s (%d).\n", basename, item.Name, item.ObjID64)
|
log.Printf("Not matching item modified basename %s with %s (%d).\n", basename, item.Name, item.ObjID64)
|
||||||
@ -675,7 +677,7 @@ func silentGetObjItemID(code string, name string) int64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
if item.ObjID64 != 0 {
|
if item.ObjID64 != 0 && match {
|
||||||
log.Printf("RETURN : Matching item modified basename %s with %s (%d).\n", basename, item.Name, item.ObjID64)
|
log.Printf("RETURN : Matching item modified basename %s with %s (%d).\n", basename, item.Name, item.ObjID64)
|
||||||
return item.ObjID64
|
return item.ObjID64
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user