31 lines
746 B
Go
31 lines
746 B
Go
package main
|
|
|
|
import ()
|
|
|
|
func reloadObjItem(code string, name string, itemTypeID64 int64, weight int64, exchange string, auction bool) {
|
|
var objID64 int64
|
|
objID64 = getSilentObjItemID(code, ``)
|
|
if objID64 == 0 {
|
|
id, err := addObjItem(code, name, itemTypeID64, weight, exchange, auction)
|
|
objID64 = id
|
|
logOnError(err, "reloadObjItem : addObjItem")
|
|
}
|
|
if getSilentObjItemID(``, name) == 0 {
|
|
//log.Printf("Adding %s to %d.\n", name, objID64)
|
|
objAddName(objID64, name)
|
|
c := new(ChatWarsItem)
|
|
c.ObjID64 = objID64
|
|
c.ItemTypeID = itemTypeID64
|
|
c.Code = code
|
|
c.Names = append(c.Names, name)
|
|
c.Weight = weight
|
|
c.Exchange = exchange
|
|
c.Auction = auction
|
|
|
|
muxObjItem.Lock()
|
|
cacheObjItem[name] = *c
|
|
muxObjItem.Unlock()
|
|
}
|
|
|
|
}
|