Skip to content
This repository was archived by the owner on Mar 24, 2018. It is now read-only.

Commit 7def0c4

Browse files
committed
JumpGate travel capability can now avoid high-sec
- added example request for showcase
1 parent 4d805d7 commit 7def0c4

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

RouteService.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func getTravelCapability(universe universe.Universe, requestedCapabilities *api.
181181
list := make([]travel.TravelCapability, 0)
182182

183183
if requestedCapabilities.JumpGate != nil {
184-
list = append(list, jumpgate.JumpGateTravelCapability(universe))
184+
list = append(list, jumpgate.JumpGateTravelCapability(universe, requestedCapabilities.JumpGate.AvoidHighSec))
185185
}
186186
if requestedCapabilities.JumpDrive != nil {
187187
list = append(list, jumpdrive.JumpDriveTravelCapability(universe, requestedCapabilities.JumpDrive.DistanceLimit))

api/TravelCapabilities.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package api
22

33
type JumpGateTravelCapability struct {
4+
AvoidHighSec bool `json:"avoidHighSec"`
45
}
56

67
type JumpDriveTravelCapability struct {
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"method": "Route.Find",
3+
"params": [{
4+
"route": {
5+
"from": {
6+
"solarSystems": [30002516]
7+
},
8+
"to": {
9+
"solarSystem": 30002515
10+
}
11+
},
12+
"capabilities": {
13+
"jumpGate": {
14+
"avoidHighSec": true
15+
},
16+
"jumpDrive": {
17+
"distanceLimit": 5.0
18+
}
19+
},
20+
"rules": {
21+
"jumpDistance": {
22+
"priority": 0
23+
},
24+
"transitCount": {
25+
"priority": 1
26+
},
27+
"warpDistance": {
28+
"priority": 2
29+
}
30+
}
31+
}],
32+
"id": 1
33+
}

0 commit comments

Comments
 (0)