This commit is contained in:
shoopea 2020-01-27 13:22:13 +08:00
parent 0f3b39295d
commit 9b43ca47bb

21
job.go
View File

@ -1862,6 +1862,27 @@ func jobCraftItem(j Job) {
/* we can finish the job */
out := fmt.Sprintf("Summary for <b>%s</b>\n", item.Name[0])
out = fmt.Sprint("%s<code> Mana : %d</code>\n", out, totalMana)
out = fmt.Sprint("%s<pre> Items :</pre>\n", out)
for k, v := range requiredItems {
obj, _ := getObjItem(getObjItemId(k))
ava, _ := availableItems[k]
out = fmt.Sprintf("%s<code> [%s] %s : %d (%d)</code>\n", out, obj.Code, obj.Name[0], v, ava)
}
out = fmt.Sprint("%s<pre> Missing :</pre>\n", out)
for k, v := range missingItems {
obj, _ := getObjItem(getObjItemId(k))
out = fmt.Sprintf("%s<code> [%s] %s : %d</code>\n", out, obj.Code, obj.Name[0], v)
}
out = fmt.Sprint("%s<pre> To craft :</pre>\n", out)
for k, v := range craftItems {
obj, _ := getObjItem(getObjItemId(k))
out = fmt.Sprintf("%s<code> [%s] %s : %d</code>\n", out, obj.Code, obj.Name[0], v)
}
log.Printf("jobCraftItem[%s] : Output :\n%s\n", item.Code, out)
err = setJobDone(j.ID64)
logOnError(err, "jobCraftItem : setJobDone")