This commit is contained in:
shoopea 2020-01-12 20:10:30 +08:00
parent ff29f889dc
commit ebece6e98f
3 changed files with 6 additions and 6 deletions

View File

@ -2,7 +2,7 @@ package main
import () 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 var objID64 int64
objID64 = getSilentObjItemID(code, ``) objID64 = getSilentObjItemID(code, ``)
if objID64 == 0 { if objID64 == 0 {
@ -17,7 +17,7 @@ func reloadObjItem(code string, name string, itemTypeID64 int64, weight int64, e
c.ObjID64 = objID64 c.ObjID64 = objID64
c.ItemTypeID = itemTypeID64 c.ItemTypeID = itemTypeID64
c.Code = code c.Code = code
c.Name = append(c.Name, name) c.Names = append(c.Names, name)
c.Weight = weight c.Weight = weight
c.Exchange = exchange c.Exchange = exchange
c.Auction = auction c.Auction = auction

6
job.go
View File

@ -921,7 +921,7 @@ func jobGStock(j Job) {
} else { } else {
w := TGCommand{ w := TGCommand{
Type: commandSendMsg, 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, ToUserID64: cfg.Bot.Admin,
} }
TGCmdQueue <- w TGCmdQueue <- w
@ -1291,7 +1291,7 @@ func jobVaultUserStatus(j Job) {
for i, itemId := range itemList { for i, itemId := range itemList {
item, err := getObjItem(itemId) item, err := getObjItem(itemId)
logOnError(err, "jobVaultUserStatus : getObjItem") 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</code>", out) out = fmt.Sprintf("%s</code>", out)
@ -1319,7 +1319,7 @@ func jobVaultUserStatus(j Job) {
for i, itemId := range itemList { for i, itemId := range itemList {
item, err := getObjItem(itemId) item, err := getObjItem(itemId)
logOnError(err, "jobVaultUserStatus : getObjItem") 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</code>", out) out = fmt.Sprintf("%s</code>", out)

2
obj.go
View File

@ -836,7 +836,7 @@ func addObjItem(code string, name string, itemTypeID64 int64, weight int64, exch
c.ObjID64 = objId c.ObjID64 = objId
c.ItemTypeID = itemTypeID64 c.ItemTypeID = itemTypeID64
c.Code = code c.Code = code
n := new([]string) n := make([]string, 1)
n = append(n, name) n = append(n, name)
c.Names = n c.Names = n
c.Weight = weight c.Weight = weight