mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-16 10:20:30 +00:00
try to make join.lua more robust against missed callbacks
This commit is contained in:
parent
7e5c599e79
commit
60bb254f69
32
join.lua
32
join.lua
@ -81,23 +81,29 @@ local function plugin()
|
||||
|
||||
context.join({})
|
||||
|
||||
repeat
|
||||
events, context, info = coroutine.yield()
|
||||
if context.join then
|
||||
context.join({})
|
||||
end
|
||||
|
||||
idle_text("in " .. info.name .. " waiting for leader select dialog")
|
||||
until info.name == "Dialog"
|
||||
|
||||
std_print("join: got a leader select dialog...")
|
||||
context.set_result({result = 0})
|
||||
events, context, info = coroutine.yield()
|
||||
|
||||
repeat
|
||||
if context.join then
|
||||
context.join({})
|
||||
else
|
||||
std_print("did not find join...")
|
||||
end
|
||||
|
||||
events, context, info = coroutine.yield()
|
||||
idle_text("in " .. info.name .. " waiting for mp wait")
|
||||
until info.name == "Multiplayer Wait"
|
||||
idle_text("in " .. info.name .. " waiting for leader select dialog")
|
||||
until info.name == "Dialog" or info.name == "Multiplayer Wait"
|
||||
|
||||
if info.name == "Dialog" then
|
||||
std_print("join: got a leader select dialog...")
|
||||
context.set_result({result = 0})
|
||||
events, context, info = coroutine.yield()
|
||||
|
||||
repeat
|
||||
events, context, info = coroutine.yield()
|
||||
idle_text("in " .. info.name .. " waiting for mp wait")
|
||||
until info.name == "Multiplayer Wait"
|
||||
end
|
||||
|
||||
std_print("join: got to multiplayer wait...")
|
||||
context.chat({message = "ready"})
|
||||
|
Loading…
x
Reference in New Issue
Block a user