test
This commit is contained in:
parent
8838d459c3
commit
a89a6e8511
18
obj.go
18
obj.go
@ -599,12 +599,20 @@ func getObjItemID(c string, n string) int64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func silentGetObjItemID(code string, name string) int64 {
|
func silentGetObjItemID(code string, name string) int64 {
|
||||||
if v, ok := cacheObjItem.Load(code); ok && len(code) > 0 {
|
if len(code) > 0 {
|
||||||
item := v.(ChatWarsItem)
|
if v, ok := cacheObjItem.Load(code); ok {
|
||||||
log.Printf("Matching item code %s with %s.\n", code, item.Code)
|
item := v.(ChatWarsItem)
|
||||||
return item.ObjID64
|
log.Printf("Matching item code %s with %s.\n", code, item.Code)
|
||||||
|
return item.ObjID64
|
||||||
|
}
|
||||||
|
if ok, _ := regexp.MatchString(`^u[0-9]+`, code); !ok {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if v, ok := cacheObjItem.Load(name); ok && len(name) > 0 {
|
if len(name) == 0 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
if v, ok := cacheObjItem.Load(name); ok {
|
||||||
item := v.(ChatWarsItem)
|
item := v.(ChatWarsItem)
|
||||||
log.Printf("Matching item name %s with %s.\n", name, item.Name)
|
log.Printf("Matching item name %s with %s.\n", name, item.Name)
|
||||||
return item.ObjID64
|
return item.ObjID64
|
||||||
|
Loading…
Reference in New Issue
Block a user