Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1751440-smugglers-desync-single-coroutine into lp:widelands

2018-09-28 Thread GunChleoc
Bug filed: https://bugs.launchpad.net/widelands/+bug/1795112
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1751440-smugglers-desync-single-coroutine/+merge/354747
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1751440-smugglers-desync-single-coroutine.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/frisian_balancing_2 into lp:widelands

2018-09-28 Thread GunChleoc
The proposal to merge lp:~widelands-dev/widelands/frisian_balancing_2 into 
lp:widelands has been updated.

Commit message changed to:

Some balancing fixes:

- Fixed the bug that barbarian trading outposts and fortified villages start 
with zero master-miners instead of 4 (like the headquarter does)

- Removed superfluous economy settings of imperial wine

- Fixed the bug that Frisian clay pits ignore economy settings. They do so now 
only if the economy needs fish, because Fish-producing aqua farms can stop 
working if the clay pits do so

- Reduced the problem that Frisian scrap metal tends to pile up: Recycling 
centers will not skipping anymore if the economy doesn't need coal. (If they 
would never skip there would be cases in which they use precious coal which is 
currently needed elsewhere - which could be bad even though recycling saves 
coal after a while)

- Reduced the costs for frisian Helmet to 1 coal and 1 iron. Adopted the scrap 
return as well

- Increased frisian farm workspace to radius 3

- added a master seamstress to each starting condition except for village and 
reduced needles by one in return

- hunter only produces a fur each 5th cycle

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/frisian_balancing_2/+merge/355358
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/frisian_balancing_2 into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/frisian_balancing_2 into lp:widelands

2018-09-28 Thread GunChleoc
Review: Approve

Thanks - let's have it!

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/frisian_balancing_2/+merge/355358
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/frisian_balancing_2.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1751440-smugglers-desync-single-coroutine into lp:widelands

2018-09-28 Thread Klaus Halfmann
Review: Approve compile, review, testplay (osx, win10, linux)

Played this with kapputnik yesterday for about an hour or such.
We both finally got the Idea about the Map and how smuggling works :-)

We had no desnycs whatsover so this can go in.

Gun: Do you want to open Smugglers for all tribes in R20 or defer this?

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1751440-smugglers-desync-single-coroutine/+merge/354747
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1751440-smugglers-desync-single-coroutine.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/fri-01-02-improvements into lp:widelands

2018-09-28 Thread bunnybot
Continuous integration builds have changed state:

Travis build 4068. State: passed. Details: 
https://travis-ci.org/widelands/widelands/builds/434676212.
Appveyor build 3864. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_fri_01_02_improvements-3864.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fri-01-02-improvements/+merge/355843
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fri-01-02-improvements into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1794924-logger-assert into lp:widelands

2018-09-28 Thread bunnybot
Continuous integration builds have changed state:

Travis build 4067. State: passed. Details: 
https://travis-ci.org/widelands/widelands/builds/434562141.
Appveyor build 3863. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1794924_logger_assert-3863.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1794924-logger-assert/+merge/355823
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1794924-logger-assert into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1751440-smugglers-desync-single-coroutine into lp:widelands

2018-09-28 Thread Klaus Halfmann
Played this on OSX/localhost only, stating on the last save, no Issues.

Gun: perhpas we need som real world unreliable network to do more test?

I will try to come online this weekend perhpas we can do some smuggling?
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1751440-smugglers-desync-single-coroutine/+merge/354747
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1751440-smugglers-desync-single-coroutine into 
lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1759857-territorial-lord into lp:widelands

2018-09-28 Thread GunChleoc
The proposal to merge lp:~widelands-dev/widelands/bug-1759857-territorial-lord 
into lp:widelands has been updated.

Commit message changed to:

Pulled out common code for Territorial Lord and Territorial Time. Ensure that 
check_player_defeated is called before points are calculated. New function to 
check whether a field is buildable.

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1759857-territorial-lord/+merge/355860
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1759857-territorial-lord into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1759857-territorial-lord into lp:widelands

2018-09-28 Thread GunChleoc
GunChleoc has proposed merging 
lp:~widelands-dev/widelands/bug-1759857-territorial-lord into lp:widelands.

Commit message:
Pulled out common code for Territorial Lord and Territorial Time. Ensure that 
check_player_defeated is called before points are calculated.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1759857 in widelands: ""Lua Coroutine Failed" as Inbox Message"
  https://bugs.launchpad.net/widelands/+bug/1759857

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1759857-territorial-lord/+merge/355860

Since Territorial Lord and Territorial Time are almost the same win condition, 
I pulled out common code while I was touching them anyway.

Needs thorough testing to make sure that the crash is indeed gone. I left some 
NOCOM logging in there to help with debugging, and that needs to be removed 
before this branch gets merged.
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1759857-territorial-lord into lp:widelands.
=== added file 'data/scripting/win_conditions/territorial_functions.lua'
--- data/scripting/win_conditions/territorial_functions.lua	1970-01-01 00:00:00 +
+++ data/scripting/win_conditions/territorial_functions.lua	2018-09-28 18:09:51 +
@@ -0,0 +1,298 @@
+-- RST
+-- territorial_functions.lua
+-- ---
+--
+-- This file contains common code for the "Territorial Lord" and "Territorial Time" win conditions.
+
+set_textdomain("win_conditions")
+
+include "scripting/richtext.lua"
+include "scripting/win_conditions/win_condition_texts.lua"
+
+local team_str = _"Team %i"
+local wc_has_territory = _"%1$s has %2$3.0f%% of the land (%3$i of %4$i)."
+local wc_had_territory = _"%1$s had %2$3.0f%% of the land (%3$i of %4$i)."
+
+-- RST
+-- .. function:: get_buildable_fields()
+--
+--Collects all fields that are buildable
+--
+--:returns: a table with the map's buildable fields
+--
+function get_buildable_fields()
+   local fields = {}
+   local map = wl.Game().map
+   for x=0, map.width-1 do
+  for y=0, map.height-1 do
+ local f = map:get_field(x,y)
+ if f.is_buildable then
+table.insert(fields, f)
+ end
+  end
+   end
+   print("NOCOM Found " .. #fields .. " buildable fields")
+   return fields
+end
+
+-- RST
+-- .. function:: count_owned_fields_for_all_players(fields, players)
+--
+--Counts all owned fields for each player.
+--
+--:arg fields: Table of all buildable fields
+--:arg players: Table of all players
+--
+--:returns: a table with ``playernumber = count_of_owned_fields``  entries
+--
+local function count_owned_fields_for_all_players(fields, players)
+   local owned_fields = {}
+   -- init the landsizes for each player
+   for idx,plr in ipairs(players) do
+  owned_fields[plr.number] = 0
+   end
+
+   for idx,f in ipairs(fields) do
+  -- check if field is owned by a player
+  local owner = f.owner
+  if owner then
+ local owner_number = owner.number
+ if owned_fields[owner_number] == nil then
+-- In case player was defeated and lost all their warehouses, make sure they don't count
+owned_fields[owner_number] = -1
+ elseif owned_fields[owner_number] >= 0 then
+owned_fields[owner_number] = owned_fields[owner_number] + 1
+ end
+  end
+   end
+   return owned_fields
+end
+
+
+-- Used by calculate_territory_points keep track of when the winner changes
+local winning_players = {}
+local winning_teams = {}
+
+
+-- RST
+-- .. data:: territory_points
+--
+--This table contains information about the current points and winning status for all
+--players and teams:
+--
+--.. code-block:: lua
+--
+--   territory_points = {
+--  -- The currently winning team, if any. -1 means that no team is currently winning.
+--  last_winning_team = -1,
+--  -- The currently winning player, if any. -1 means that no player is currently winning.
+--  last_winning_player = -1,
+--  -- Remaining time in secs for victory by > 50% territory. Default value is also used to calculate whether to send a report to players.
+--  remaining_time = 10,
+--  -- Points by player
+--  all_player_points = {},
+--  -- Points by rank, used to generate messages to the players
+--  points = {}
+--   }
+--
+territory_points = {
+   -- TODO(GunChleoc): We want to be able to list multiple winners in case of a draw.
+   last_winning_team = -1,
+   last_winning_player = -1,
+   remaining_time = 10,
+   all_player_points = {},
+   points = {}
+}
+
+-- RST
+-- .. function:: calculate_territory_points(fields, players, wc_descname, wc_version)
+--
+--First checks if a player was defeated, then fills the ``territory_points`` table
+--with current data.
+--
+--:arg fields: Table of all buildable fields
+--:arg players: Table of 

[Widelands-dev] [Merge] lp:~widelands-dev/widelands/fri-01-02-improvements into lp:widelands

2018-09-28 Thread Benedikt Straub
Benedikt Straub has proposed merging 
lp:~widelands-dev/widelands/fri-01-02-improvements into lp:widelands.

Commit message:
Various improvements to both frisian scenarios

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1792478 in widelands: "Frisians 2: No victory declared"
  https://bugs.launchpad.net/widelands/+bug/1792478

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/fri-01-02-improvements/+merge/355843

fri01: The player can take some soldiers with him when he escapes from the 
flood.
fri02:
· 10 of the initial soldiers are chosen from the ones the player took with him
· During the expansion ban, the player can send a scout to spy on Murilius. The 
scout will discover a helpful hint. Two objectives remind the player of that.
· A number of other small tweaks
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fri-01-02-improvements into lp:widelands.
=== modified file 'data/campaigns/fri01.wmf/scripting/mission_thread.lua'
--- data/campaigns/fri01.wmf/scripting/mission_thread.lua	2018-07-24 11:09:41 +
+++ data/campaigns/fri01.wmf/scripting/mission_thread.lua	2018-09-28 14:41:56 +
@@ -422,6 +422,9 @@
p1:allow_buildings {"frisians_port", "frisians_weaving_mill", "frisians_shipyard"}
o = add_campaign_objective(obj_escape)
 
+   sleep(3)
+   campaign_message_box(rising_water_5)
+
-- Wait until an expedition ship is ready
local expedition_ready = false
while not expedition_ready do
@@ -435,8 +438,22 @@
end
 
-- We escaped!
-   scroll_to_field(p1:get_buildings("frisians_port")[1].fields[1])
+   local port = p1:get_buildings("frisians_port")[1]
+   scroll_to_field(port.fields[1])
sleep(1000)
+   local persist = {}
+   for descr,n in pairs(port:get_soldiers("all")) do
+  persist[descr[1] .. descr[2] .. descr[3]] = n
+   end
+   -- We save a table of all soldiers we can take with us:
+   -- {
+   --"262" = 5,
+   --"120" = 2,
+   --...
+   -- }
+   -- means 5 soldiers with training levels health-2/attack-6/defense-2 and
+   -- 2 soldiers with health-1/attack-2/defense-0.
+   wl.Game():save_campaign_data("frisians", "fri01", persist)
campaign_message_box(victory_1)
p1:reveal_scenario("frisians01")
-- END OF MISSION 1

=== modified file 'data/campaigns/fri01.wmf/scripting/texts.lua'
--- data/campaigns/fri01.wmf/scripting/texts.lua	2018-07-24 11:09:41 +
+++ data/campaigns/fri01.wmf/scripting/texts.lua	2018-09-28 14:41:56 +
@@ -129,8 +129,8 @@
   -- TRANSLATORS: Reebaud – Introduction 1
   _([[Welcome to the beautiful isle of Langeness! I am Reebaud, the chieftain of this pristine island.]])
   .. paragraphdivider() ..
-  -- TRANSLATORS: Reebaud – Introduction 1
-  _([[My tribe and I have just arrived from the mainland. There were fights with the Danes in the North, the Vikings in the East… So, I decided to lead my tribe away to start a quiet, peaceful life on this untouched island.]])),
+  -- TRANSLATORS: Reebaud – Introduction 1. The "Schauenburger" and "Holsteiner" are dukedoms.
+  _([[My tribe and I have just arrived from the mainland. There were fights with the Danes in the North, the Schauenburgians and Holsteiners in the East and South… So I decided to lead my tribe away to start a quiet, peaceful life on this untouched island.]])),
 }
 intro_2 = {
title =_ "Introduction",
@@ -139,13 +139,13 @@
   _([[This is as good a place as any to start building our new home. First of all, we must ensure a stable supply of basic building materials.]])
   .. paragraphdivider() ..
   -- TRANSLATORS: Reebaud – Introduction 2
-  _([[I have asked Hauke, one of my advisors to oversee the construction of our settlement.]])),
+  _([[I have asked Hauke, one of my advisors, to oversee the construction of our settlement.]])),
 }
 intro_3 = {
title =_ "Introduction",
body=hauke(_"The first buildings",
-  -- TRANSLATORS: Hauke – Introduction 3
-  _([[Greetings, Chieftain Reebaud! I will start with the colonization of the island straight away.]])
+  -- TRANSLATORS: Hauke – Introduction 3. "Peace" is the traditional frisian greeting
+  _([[Peace, Chieftain Reebaud! I will start with the colonization of the island straight away.]])
   .. paragraphdivider() ..
   -- TRANSLATORS: Hauke – Introduction 3
   _([[Like all Frisians, we build our houses mainly with bricks. We improve them by adding some logs and granite. The roofs are thatched with reed, naturally. Nothing is better suited to keep the rain out.]])
@@ -405,6 +405,12 @@
   _([[The storm flood seems to be coming from the west. If we hurry, we will just make it! We only need to build a port and a shipyard – oh, and a weaving mill to weave the durable cloth, which is made from reed and fur, for the sails. Then we can launch an expedition from the port. Pray to the gods and make haste!]]))
   

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/detect_revision_update into lp:widelands

2018-09-28 Thread Tino
Review: Approve

Ok, currently at least on travis (MacOS and Linux) and on Travis (Windows) 
CMake + DetectRevision.py can determine the git version.
On my local machine (windows) both git and bzr work.

So this can go in from my side.
-- 
https://code.launchpad.net/~widelands-dev/widelands/detect_revision_update/+merge/355590
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/detect_revision_update.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1751440-smugglers-desync-single-coroutine into lp:widelands

2018-09-28 Thread Klaus Halfmann
OK after cleaning my confusion about the two builds I will try a 2xWIN/ 2xOSX 
Smugglers game. 
... some hours later ...
Did so and it was quite ok until I ran into #1794965 I think this is unrelated. 
But I may not be 
able to continue testing. I will try other variants, later
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1751440-smugglers-desync-single-coroutine/+merge/354747
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1751440-smugglers-desync-single-coroutine into 
lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1794924-logger-assert into lp:widelands

2018-09-28 Thread GunChleoc
GunChleoc has proposed merging 
lp:~widelands-dev/widelands/bug-1794924-logger-assert into lp:widelands.

Commit message:
Use std::cout for logging when calling terminate on shutdown, because the 
logger might not exist any more.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1794924 in widelands: "Assertion "logger != nullptr failed on shutdown"
  https://bugs.launchpad.net/widelands/+bug/1794924

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1794924-logger-assert/+merge/355823
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1794924-logger-assert into lp:widelands.
=== modified file 'src/wlapplication.cc'
--- src/wlapplication.cc	2018-09-24 08:35:06 +
+++ src/wlapplication.cc	2018-09-28 09:31:40 +
@@ -103,8 +103,9 @@
  */
 #ifndef _WIN32
 void terminate(int) {
-	log("Waited 5 seconds to close audio. There are some problems here, so killing Widelands."
-	" Update your sound driver and/or SDL to fix this problem\n");
+	// The logger can already be shut down, so we use cout
+	std::cout << "Waited 5 seconds to close audio. There are some problems here, so killing Widelands."
+	" Update your sound driver and/or SDL to fix this problem\n";
 	raise(SIGKILL);
 }
 #endif

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1751440-smugglers-desync-single-coroutine into lp:widelands

2018-09-28 Thread Klaus Halfmann
When trying to Debug WIndows I gita Problem with system.out, as described in: 
#1398536

I will try to debug this anyway 
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1751440-smugglers-desync-single-coroutine/+merge/354747
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1751440-smugglers-desync-single-coroutine into 
lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp