From af3ef63e49f46595589cee1f36f4fb42608f95c6 Mon Sep 17 00:00:00 2001 From: shoopea Date: Thu, 6 Jun 2019 15:54:29 +0800 Subject: [PATCH] test --- obj.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/obj.go b/obj.go index 313d59f..e398276 100644 --- a/obj.go +++ b/obj.go @@ -4,6 +4,7 @@ import ( "fmt" "regexp" "strconv" + "strings" "sync" "time" ) @@ -492,7 +493,7 @@ func addObjItem(code string, name string, itemTypeID64 int64, weight int) (int64 c := new(ChatWarsItem) c.ObjID64 = objId c.Code = code - c.Name = name + c.Name = strings.ToUpper(name) c.Weight = weight cacheObjItem.Store(code, *c) cacheObjItem.Store(name, *c) @@ -513,7 +514,9 @@ func getObjItemID(c string, n string) int64 { return i } -func silentGetObjItemID(c string, n string) int64 { +func silentGetObjItemID(code string, name string) int64 { + c := string.ToLower(code) + n := string.ToUpper(name) if v, ok := cacheObjItem.Load(c); ok { i := v.(ChatWarsItem) return i.ObjID64 @@ -576,7 +579,7 @@ func loadObjItem() error { c := new(ChatWarsItem) c.ObjID64 = id c.Code = intl_id - c.Name = name + c.Name = strings.ToUpper(name) c.Weight = weight cacheObjItem.Store(intl_id, *c) cacheObjItem.Store(name, *c)