Skip to content

Commit

Permalink
fix: portservice env loading
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcStdt committed Oct 19, 2024
1 parent 31fb688 commit 5c24ebf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@
"--cwd",
"${workspaceFolder}/examples/minecraft",
],
"env": {
"DRUID_PORT_QUERY": "14620",
"DRUID_PORT_MAIN": "7771"
}
},
{
"name": "Debug Daemon coldstart (minecraft2 example)",
Expand Down
11 changes: 3 additions & 8 deletions examples/minecraft/.scroll/scroll.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ ports:
port: 25565
sleep_handler: packet_handler/minecraft.lua
mandatory: true
- name: udptest
- name: query
protocol: udp
port: 2556
sleep_handler: packet_handler/udp.lua
sleep_handler: packet_handler/query.lua
vars:
- name: GameName
value: "ARK: Survival Evolved"
Expand All @@ -20,15 +19,11 @@ ports:
- name: GameSteamId
value: "0"
- name: MapName
value: "TheIsland"
value: TheIsland
- name: ServerListName
value: "Coldstarter is cool (server is idle, join to start)"
- name: ServerPort
value: "7777"
- name: main
protocol: udp
port: 12345
sleep_handler: generic

init: "start"
commands:
Expand Down
2 changes: 1 addition & 1 deletion internal/core/services/port_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (p *PortMonitor) SyncPortEnv(file *domain.File) []*domain.AugmentedPort {

if envPort != "" && port.Port == 0 {
portInt, err := strconv.Atoi(envPort)
if err != nil {
if err == nil {
port.Port = portInt
}
}
Expand Down

0 comments on commit 5c24ebf

Please sign in to comment.