From ebece6e98fd8bfb80e86e23c3317b42810702f97 Mon Sep 17 00:00:00 2001 From: shoopea Date: Sun, 12 Jan 2020 20:10:30 +0800 Subject: [PATCH] test --- items.go | 4 ++-- job.go | 6 +++--- obj.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/items.go b/items.go index 34b9c28..39883df 100644 --- a/items.go +++ b/items.go @@ -2,7 +2,7 @@ package main import () -func reloadObjItem(code string, name string, itemTypeID64 int64, weight int64, exchange bool, auction bool) { +func reloadObjItem(code string, name string, itemTypeID64 int64, weight int64, exchange string, auction bool) { var objID64 int64 objID64 = getSilentObjItemID(code, ``) if objID64 == 0 { @@ -17,7 +17,7 @@ func reloadObjItem(code string, name string, itemTypeID64 int64, weight int64, e c.ObjID64 = objID64 c.ItemTypeID = itemTypeID64 c.Code = code - c.Name = append(c.Name, name) + c.Names = append(c.Names, name) c.Weight = weight c.Exchange = exchange c.Auction = auction diff --git a/job.go b/job.go index a9f7e63..f98bf89 100644 --- a/job.go +++ b/job.go @@ -921,7 +921,7 @@ func jobGStock(j Job) { } else { w := TGCommand{ Type: commandSendMsg, - Text: fmt.Sprintf("Unknown weight for item : %s - %s\n", item.Code, item.Name), + Text: fmt.Sprintf("Unknown weight for item : %s - %s\n", item.Code, item.Names[0]), ToUserID64: cfg.Bot.Admin, } TGCmdQueue <- w @@ -1291,7 +1291,7 @@ func jobVaultUserStatus(j Job) { for i, itemId := range itemList { item, err := getObjItem(itemId) logOnError(err, "jobVaultUserStatus : getObjItem") - out = fmt.Sprintf("%s%-32s |%6d |%6d |%6d\n", out, item.Name, depositList[i], withdrawList[i], depositList[i]-withdrawList[i]) + out = fmt.Sprintf("%s%-32s |%6d |%6d |%6d\n", out, item.Names[0], depositList[i], withdrawList[i], depositList[i]-withdrawList[i]) } out = fmt.Sprintf("%s", out) @@ -1319,7 +1319,7 @@ func jobVaultUserStatus(j Job) { for i, itemId := range itemList { item, err := getObjItem(itemId) logOnError(err, "jobVaultUserStatus : getObjItem") - out = fmt.Sprintf("%s%-32s |%6d |%6d |%6d\n", out, item.Name, depositList[i], withdrawList[i], depositList[i]-withdrawList[i]) + out = fmt.Sprintf("%s%-32s |%6d |%6d |%6d\n", out, item.Names[0], depositList[i], withdrawList[i], depositList[i]-withdrawList[i]) } out = fmt.Sprintf("%s", out) diff --git a/obj.go b/obj.go index 613743e..d783213 100644 --- a/obj.go +++ b/obj.go @@ -836,7 +836,7 @@ func addObjItem(code string, name string, itemTypeID64 int64, weight int64, exch c.ObjID64 = objId c.ItemTypeID = itemTypeID64 c.Code = code - n := new([]string) + n := make([]string, 1) n = append(n, name) c.Names = n c.Weight = weight