This commit is contained in:
shoopea 2020-01-26 21:55:43 +08:00
parent 88a069af26
commit 43b2c785b2

21
job.go
View File

@ -1908,25 +1908,20 @@ func jobGetVault(j Job) {
p JobPayloadGetVault p JobPayloadGetVault
reqTab map[int64]int64 reqTab map[int64]int64
doneTab map[int64]int64 doneTab map[int64]int64
items []string = {`item_res`, `item_alch`, `item_misc`, `item_recipe`, `item_part`, `item_other`}
) )
log.Printf("jobGetVault[%d] : Starting.\n", j.ID64) log.Printf("jobGetVault[%d] : Starting.\n", j.ID64)
reqTab = make(map[int64]int64) reqTab = make(map[int64]int64)
reqTab[cacheObjSubType[`item_res`]] = 1 << 0 for k, v := range items {
reqTab[cacheObjSubType[`item_alch`]] = 1 << 1 reqTab[cacheObjSubType[v]] = 1 << k
reqTab[cacheObjSubType[`item_misc`]] = 1 << 2 }
reqTab[cacheObjSubType[`item_recipe`]] = 1 << 3
reqTab[cacheObjSubType[`item_part`]] = 1 << 4
reqTab[cacheObjSubType[`item_other`]] = 1 << 5
doneTab = make(map[int64]int64) doneTab = make(map[int64]int64)
doneTab[cacheObjSubType[`item_res`]] = 1 << 10 for k, v := range items {
doneTab[cacheObjSubType[`item_alch`]] = 1 << 11 doneTab[cacheObjSubType[v]] = 1 << (10 + k)
doneTab[cacheObjSubType[`item_misc`]] = 1 << 12 }
doneTab[cacheObjSubType[`item_recipe`]] = 1 << 13
doneTab[cacheObjSubType[`item_part`]] = 1 << 14
doneTab[cacheObjSubType[`item_other`]] = 1 << 15
err := setJobStart(j.ID64) err := setJobStart(j.ID64)
logOnError(err, "jobGetVault : setJobStart") logOnError(err, "jobGetVault : setJobStart")
@ -1938,7 +1933,7 @@ func jobGetVault(j Job) {
for _, typeID64 := range p.ItemTypeList { for _, typeID64 := range p.ItemTypeList {
p.Status = p.Status | reqTab[typeID64] p.Status = p.Status | reqTab[typeID64]
} }
for _, v := range {`item_res`, `item_alch`, `item_misc`, `item_recipe`, `item_part`, `item_other`} { for _, v := range items {
if (p.Status & reqTab[cacheObjSubType[v]]) == 0 { if (p.Status & reqTab[cacheObjSubType[v]]) == 0 {
p.Status = p.Status | doneTab[cacheObjSubType[v]] p.Status = p.Status | doneTab[cacheObjSubType[v]]
} }