mirror of
https://github.com/Luzifer/sii.git
synced 2024-12-21 00:21:15 +00:00
Increase expiry time to suite long routes
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
c294ea1308
commit
c43d142d3e
1 changed files with 5 additions and 2 deletions
|
@ -7,10 +7,13 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Luzifer/sii"
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
|
"github.com/Luzifer/sii"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const jobExpiryPerSegment = 4 * 24 * 60 // 4d * 24h * 60m
|
||||||
|
|
||||||
const (
|
const (
|
||||||
fixAll = "all"
|
fixAll = "all"
|
||||||
fixCargoOnly = "cargo"
|
fixCargoOnly = "cargo"
|
||||||
|
@ -194,7 +197,7 @@ func addJobToGame(game *sii.Unit, job commSaveJob, routePartID int) error {
|
||||||
strconv.FormatInt(time.Now().Unix(), 16),
|
strconv.FormatInt(time.Now().Unix(), 16),
|
||||||
strconv.FormatInt(int64(routePartID), 16),
|
strconv.FormatInt(int64(routePartID), 16),
|
||||||
}, ".")
|
}, ".")
|
||||||
exTime := game.BlocksByClass("economy")[0].(*sii.Economy).GameTime + 300 // 300min = 5h
|
exTime := game.BlocksByClass("economy")[0].(*sii.Economy).GameTime + jobExpiryPerSegment*int64(routePartID+1)
|
||||||
j := &sii.JobOfferData{
|
j := &sii.JobOfferData{
|
||||||
// User requested job data
|
// User requested job data
|
||||||
Target: strings.TrimPrefix(job.TargetReference, "company.volatile."),
|
Target: strings.TrimPrefix(job.TargetReference, "company.volatile."),
|
||||||
|
|
Loading…
Reference in a new issue