Skip to content

Commit

Permalink
#15: Display the switch's location on startup.
Browse files Browse the repository at this point in the history
  • Loading branch information
danports committed May 17, 2020
1 parent 1f1c914 commit 3251eba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/railswitch/.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
{name = "serializer"},
{name = "wire"},
{name = "minecartevents"},
{name = "railnetwork"},
{name = "autostartup"},
{name = "amber-autoupdater"}
}
Expand Down
4 changes: 3 additions & 1 deletion src/railswitch/startup
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ os.loadAPI("apis/net")
os.loadAPI("apis/serializer")
os.loadAPI("apis/wire")
os.loadAPI("apis/minecartevents")
os.loadAPI("apis/railnetwork")
os.loadAPI("apis/autostartup")
os.loadAPI("apis/autoupdater")

Expand Down Expand Up @@ -48,7 +49,8 @@ function onStartup()
autoupdater.initialize()

dofile("config")
print(string.format("RailSwitchOS: Switch %i listening on %s...", config.switchId, net.openModem(config.modem)))
print(string.format("RailSwitchOS: Switch %i (%s) listening on %s...",
config.switchId, railnetwork.formatLocation(config.location), net.openModem(config.modem)))

state = serializer.readFromFile("state")
if state.switch == nil then
Expand Down

0 comments on commit 3251eba

Please sign in to comment.