This commit is contained in:
shoopea 2019-06-06 14:42:23 +08:00
parent 9901518a37
commit 3c075df02d

2
obj.go
View File

@ -524,6 +524,7 @@ func silentGetObjItemID(c string, n string) int64 {
}
if ok, _ := regexp.MatchString(`u[0-9]+`, c); ok {
r := regexp.MustCompile(`(?P<Modifier>⚡\+[0-9]+) (?P<BaseName>[a-zA-Z ]+?)( +(?P<Atk>[0-9]+)⚔ +(?P<Def>[0-9]+)🛡){0,1}`)
fmt.Printf("silentGetObjItemID : Looking for `%s` (Atk : %s, Def : %s)\n", r.ReplaceAllString(n, "${BaseName}"), r.ReplaceAllString(n, "${Atk}"), r.ReplaceAllString(n, "${Def}"))
n2 := r.ReplaceAllString(n, "${BaseName}")
if v, ok := cacheObjItem.Load(n2); ok {
i := v.(ChatWarsItem)
@ -532,6 +533,7 @@ func silentGetObjItemID(c string, n string) int64 {
}
if len(c) == 0 {
r := regexp.MustCompile(`(?P<Modifier>⚡\+[0-9]+) (?P<BaseName>[a-zA-Z ]+?)( +(?P<Atk>[0-9]+)⚔ +(?P<Def>[0-9]+)🛡){0,1}`)
fmt.Printf("silentGetObjItemID : Looking for `%s` (Atk : %s, Def : %s)\n", r.ReplaceAllString(n, "${BaseName}"), r.ReplaceAllString(n, "${Atk}"), r.ReplaceAllString(n, "${Def}"))
n2 := r.ReplaceAllString(n, "${BaseName}")
if v, ok := cacheObjItem.Load(n2); ok {
i := v.(ChatWarsItem)