Skip to content

Commit

Permalink
Add -setport and -ip debug flags
Browse files Browse the repository at this point in the history
-setport overrides port number
-ip can establish netplay connection for quick vs. Set IP address for peer, leave the argument blank for host
  • Loading branch information
K4thos committed Mar 24, 2022
1 parent 9096978 commit d7aeaa8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions external/script/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ end
if main.flags['-debug'] ~= nil then
toggleDebugDraw()
end
if main.flags['-setport'] ~= nil then
setListenPort(main.flags['-setport'])
end

--motif
main.motifDef = config.Motif
Expand Down Expand Up @@ -1451,7 +1454,25 @@ function main.f_commandLine()
})
end
end
if main.flags['-ip'] ~= nil then
enterNetPlay(main.flags['-ip'])
while not connected() do
if esc() then
exitNetPlay()
os.exit()
end
refresh()
end
refresh()
synchronize()
math.randomseed(sszRandom())
main.f_cmdBufReset()
refresh()
end
loadStart()
while loading() do
--do nothing
end
local winner, t_gameStats = game()
if main.flags['-log'] ~= nil then
main.f_printTable(t_gameStats, main.flags['-log'])
Expand Down

0 comments on commit d7aeaa8

Please sign in to comment.