← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/bug-1811583-desync-with-territorial into lp:widelands

 

I don't think we can fix wait_for_roadbuilding(). What we could do is either remove it from send_message() so that it looks like this:


function send_message(player, title, body, parameters)
   player:send_message(title, body, parameters)
end

Or, every send_message() call needs to be called from within a coroutine:

function broadcast(plrs, header, msg, goptions)
   local options = goptions or {}
   for idx, p in ipairs(plrs) do
      run(function()
         send_message(p, header, msg, options)
      end)
   end
end

The problem here is that the send_time will differ. E.g. the message is scheduled for 30 minutes. The message would be: "Game ends in 3 hours 30 minutes" and send_time would  be 30 minutes. If the User has the road building menu open, this message would be delayed until the menu is closed. Let's say the user closes the menu at the 40 minutes mark (I know, nobody would let the road building menu open for 10 minutes) the content of the message would be wrong, because the remaining time after 40 minutes is 3 hours 20 minutes.

The 3rd option is what we do right now. 
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1811583-desync-with-territorial/+merge/362272
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1811583-desync-with-territorial.


References