← Back to team overview

widelands-dev team mailing list archive

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

 

Toni Förster has proposed merging lp:~widelands-dev/widelands/bug-1811583-desync-with-territorial into lp:widelands.

Commit message:
- fix broadcast()
- use broadcast() in _send_state() instead of send_message()

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1721126 in widelands: "crashes/desyncs in multiplayer"
  https://bugs.launchpad.net/widelands/+bug/1721126
  Bug #1811583 in widelands: "Desync on bzr8954[trunk] with territorial lord"
  https://bugs.launchpad.net/widelands/+bug/1811583

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1811583-desync-with-territorial/+merge/362272

The win conditions territorial, woodgnome and collectors should not desync anymore.
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1811583-desync-with-territorial into lp:widelands.
=== modified file 'data/scripting/win_conditions/collectors.lua'
--- data/scripting/win_conditions/collectors.lua	2018-10-13 08:51:51 +0000
+++ data/scripting/win_conditions/collectors.lua	2019-01-26 15:44:39 +0000
@@ -191,9 +191,7 @@
          msg = msg .. vspace(8) .. message
       end
 
-      for idx, plr in ipairs(plrs) do
-         send_message(plr, game_status.title, msg, {popup = true})
-      end
+      broadcast(plrs, game_status.title, msg, {popup = true})
    end
 
    local function _game_over(plrs)

=== modified file 'data/scripting/win_conditions/territorial_lord.lua'
--- data/scripting/win_conditions/territorial_lord.lua	2018-12-03 20:30:01 +0000
+++ data/scripting/win_conditions/territorial_lord.lua	2019-01-26 15:44:39 +0000
@@ -50,7 +50,7 @@
                msg = msg .. losing_status_header(plrs) .. vspace(8)
             end
             msg = msg .. vspace(8) .. game_status.body .. territory_status(fields, "has")
-         send_message(player, game_status.title, msg, {popup = true})
+            broadcast(plrs, game_status.title, msg, {popup = true})
          end
       end
 

=== modified file 'data/scripting/win_conditions/territorial_time.lua'
--- data/scripting/win_conditions/territorial_time.lua	2018-12-03 20:30:01 +0000
+++ data/scripting/win_conditions/territorial_time.lua	2019-01-26 15:44:39 +0000
@@ -68,7 +68,7 @@
                   :format(remaining_max_minutes))
             end
             msg = msg .. vspace(8) .. game_status.body .. territory_status(fields, "has")
-            send_message(player, game_status.title, msg, {popup = true})
+            broadcast(plrs, game_status.title, msg, {popup = true})
          end
       end
 

=== modified file 'data/scripting/win_conditions/win_condition_functions.lua'
--- data/scripting/win_conditions/win_condition_functions.lua	2018-09-28 17:20:32 +0000
+++ data/scripting/win_conditions/win_condition_functions.lua	2019-01-26 15:44:39 +0000
@@ -108,7 +108,7 @@
 function broadcast(plrs, header, msg, goptions)
    local options = goptions or {}
    for idx, p in ipairs(plrs) do
-      send_message(p, header, msg, options)
+      p:send_message(header, msg, options)
    end
 end
 


Follow ups