fix delay

This commit is contained in:
shoopea 2019-08-24 13:36:45 +08:00
parent 0d50ea9ed4
commit 2471348dff

22
job.go
View File

@ -761,7 +761,7 @@ func jobGDeposit(j Job) {
}
}
log.Printf("jobGDeposit : Sending messages.\n")
var delay int64 = 0
var delay time.Duration = 10 * time.Second
var b []byte
if res || alch || misc || craft || equip {
p.Status = 1
@ -770,37 +770,37 @@ func jobGDeposit(j Job) {
if res {
log.Printf("jobGDeposit : Sending res.\n")
clientSendCWMsgDelay(p.ChatID64, `📦Resources`, delay)
err = createJobCallback(objSubTypeJobGDeposit, j.UserID64, objSubTypeMessageOrderbookAck, b, (10+delay)*time.Second)
err = createJobCallback(objSubTypeJobGDeposit, j.UserID64, objSubTypeMessageOrderbookAck, b, delay)
logOnError(err, "jobGDeposit : createJobCallback")
delay = delay + 2
delay = delay + 2*time.Second
}
if alch {
log.Printf("jobGDeposit : Sending alch.\n")
clientSendCWMsgDelay(p.ChatID64, `Alchemy`, delay)
err = createJobCallback(objSubTypeJobGDeposit, j.UserID64, objSubTypeMessageOrderbookAck, b, (10+delay)*time.Second)
err = createJobCallback(objSubTypeJobGDeposit, j.UserID64, objSubTypeMessageOrderbookAck, b, delay)
logOnError(err, "jobGDeposit : createJobCallback")
delay = delay + 2
delay = delay + 2*time.Second
}
if misc {
log.Printf("jobGDeposit : Sending misc.\n")
clientSendCWMsgDelay(p.ChatID64, `🗃Misc`, delay)
err = createJobCallback(objSubTypeJobGDeposit, j.UserID64, objSubTypeMessageOrderbookAck, b, (10+delay)*time.Second)
err = createJobCallback(objSubTypeJobGDeposit, j.UserID64, objSubTypeMessageOrderbookAck, b, delay)
logOnError(err, "jobGDeposit : createJobCallback")
delay = delay + 2
delay = delay + 2*time.Second
}
if craft {
log.Printf("jobGDeposit : Sending craft.\n")
clientSendCWMsgDelay(p.ChatID64, `⚒Crafting`, delay)
err = createJobCallback(objSubTypeJobGDeposit, j.UserID64, objSubTypeMessageOrderbookAck, b, (10+delay)*time.Second)
err = createJobCallback(objSubTypeJobGDeposit, j.UserID64, objSubTypeMessageOrderbookAck, b, delay)
logOnError(err, "jobGDeposit : createJobCallback")
delay = delay + 2
delay = delay + 2*time.Second
}
if equip {
log.Printf("jobGDeposit : Sending equip.\n")
clientSendCWMsgDelay(p.ChatID64, `🏷Equipment`, delay)
err = createJobCallback(objSubTypeJobGDeposit, j.UserID64, objSubTypeMessageOrderbookAck, b, (10+delay)*time.Second)
err = createJobCallback(objSubTypeJobGDeposit, j.UserID64, objSubTypeMessageOrderbookAck, b, delay)
logOnError(err, "jobGDeposit : createJobCallback")
delay = delay + 2
delay = delay + 2*time.Second
}
return