Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

Commit

Permalink
Increase expiry time to suite long routes
Browse files Browse the repository at this point in the history
Signed-off-by: Knut Ahlers <knut@ahlers.me>
  • Loading branch information
Luzifer committed Jan 4, 2020
1 parent c294ea1 commit c43d142
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/sii-editor/saves.go
Expand Up @@ -7,10 +7,13 @@ import (
"strings"
"time"

"github.com/Luzifer/sii"
"github.com/pkg/errors"

"github.com/Luzifer/sii"
)

const jobExpiryPerSegment = 4 * 24 * 60 // 4d * 24h * 60m

const (
fixAll = "all"
fixCargoOnly = "cargo"
Expand Down Expand Up @@ -194,7 +197,7 @@ func addJobToGame(game *sii.Unit, job commSaveJob, routePartID int) error {
strconv.FormatInt(time.Now().Unix(), 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{
// User requested job data
Target: strings.TrimPrefix(job.TargetReference, "company.volatile."),
Expand Down

0 comments on commit c43d142

Please sign in to comment.