[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1395278-game_io into lp:widelands

2016-03-04 Thread Klaus Halfmann
Klaus Halfmann has proposed merging 
lp:~widelands-dev/widelands/bug-1395278-game_io into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1395278 in widelands: "Consolidate naming of member variables"
  https://bugs.launchpad.net/widelands/+bug/1395278

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1395278-game_io/+merge/288172

Checked the code and played a game (with some stores and loads)
LGTM
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1395278-game_io into lp:widelands.
=== modified file 'src/game_io/game_loader.cc'
--- src/game_io/game_loader.cc	2016-03-02 16:30:42 +
+++ src/game_io/game_loader.cc	2016-03-04 20:31:45 +
@@ -40,12 +40,16 @@
 namespace Widelands {
 
 GameLoader::GameLoader(const std::string & path, Game & game) :
+<<< TREE
 	m_fs(*g_fs->make_sub_file_system(path)), game_(game)
+===
+	fs_(*g_fs->make_sub_file_system(path)), game_(game)
+>>> MERGE-SOURCE
 {}
 
 
 GameLoader::~GameLoader() {
-	delete _fs;
+	delete _;
 }
 
 /*
@@ -53,7 +57,11 @@
  */
 int32_t GameLoader::preload_game(GamePreloadPacket & mp) {
 	// Load elemental data block
+<<< TREE
 	mp.read(m_fs, game_, nullptr);
+===
+	mp.read(fs_, game_, nullptr);
+>>> MERGE-SOURCE
 
 	return 0;
 }
@@ -65,19 +73,35 @@
 	ScopedTimer timer("GameLoader::load() took %ums");
 
 	log("Game: Reading Preload Data ... ");
+<<< TREE
 	{GamePreloadPacket p; p.read(m_fs, game_);}
+===
+	{GamePreloadPacket p; p.read(fs_, game_);}
+>>> MERGE-SOURCE
 	log("took %ums\n", timer.ms_since_last_query());
 
 	log("Game: Reading Game Class Data ... ");
+<<< TREE
 	{GameClassPacket  p; p.read(m_fs, game_);}
+===
+	{GameClassPacket  p; p.read(fs_, game_);}
+>>> MERGE-SOURCE
 	log("took %ums\n", timer.ms_since_last_query());
 
 	log("Game: Reading Map Data ... ");
+<<< TREE
 	GameMapPacket M;  M.read(m_fs, game_);
+===
+	GameMapPacket M;  M.read(fs_, game_);
+>>> MERGE-SOURCE
 	log("Game: Reading Map Data took %ums\n", timer.ms_since_last_query());
 
 	log("Game: Reading Player Info ... ");
+<<< TREE
 	{GamePlayerInfoPacket p; p.read(m_fs, game_);}
+===
+	{GamePlayerInfoPacket p; p.read(fs_, game_);}
+>>> MERGE-SOURCE
 	log("Game: Reading Player Info took %ums\n", timer.ms_since_last_query());
 
 	log("Game: Calling read_complete()\n");
@@ -87,15 +111,27 @@
 	MapObjectLoader * const mol = M.get_map_object_loader();
 
 	log("Game: Reading Player Economies Info ... ");
+<<< TREE
 	{GamePlayerEconomiesPacketp; p.read(m_fs, game_, mol);}
+===
+	{GamePlayerEconomiesPacketp; p.read(fs_, game_, mol);}
+>>> MERGE-SOURCE
 	log("took %ums\n", timer.ms_since_last_query());
 
 	log("Game: Reading ai persistent data ... ");
+<<< TREE
 	{GamePlayerAiPersistentPacket   p; p.read(m_fs, game_, mol);}
+===
+	{GamePlayerAiPersistentPacket   p; p.read(fs_, game_, mol);}
+>>> MERGE-SOURCE
 	log("took %ums\n", timer.ms_since_last_query());
 
 	log("Game: Reading Command Queue Data ... ");
+<<< TREE
 	{GameCmdQueuePacket   p; p.read(m_fs, game_, mol);}
+===
+	{GameCmdQueuePacket   p; p.read(fs_, game_, mol);}
+>>> MERGE-SOURCE
 	log("took %ums\n", timer.ms_since_last_query());
 
 	//  This must be after the command queue has been read.
@@ -104,14 +140,19 @@
 	iterate_players_existing_const(p, nr_players, game_, player) {
 		const MessageQueue & messages = player->messages();
 		for (std::pair temp_message : messages) {
-			Message* m = temp_message.second;
-			MessageId m_id = temp_message.first;
+			Message* message = temp_message.second;
+			MessageId message_id = temp_message.first;
 
 			// Renew MapObject connections
+<<< TREE
 			if (m->serial() > 0) {
 MapObject* mo = game_.objects().get_object(m->serial());
+===
+			if (message->serial() > 0) {
+MapObject* mo = game_.objects().get_object(message->serial());
+>>> MERGE-SOURCE
 mo->removed.connect
-	(boost::bind(::message_object_removed, player, m_id));
+	(boost::bind(::message_object_removed, player, message_id));
 			}
 		}
 	}
@@ -125,7 +166,11 @@
 	// player.
 	if (!multiplayer) {
 		log("Game: Reading Interactive Player Data ... ");
+<<< TREE
 		{GameInteractivePlayerPacket   p; p.read(m_fs, game_, mol);}
+===
+		{GameInteractivePlayerPacket   p; p.read(fs_, game_, mol);}
+>>> MERGE-SOURCE
 		log("took %ums\n", timer.ms_since_last_query());
 	}
 

=== modified file 'src/game_io/game_loader.h'
--- src/game_io/game_loader.h	2016-03-02 16:30:42 +
+++ src/game_io/game_loader.h	2016-03-04 20:31:45 +
@@ -43,8 +43,13 @@
 	int32_tload_game(bool multiplayer = false);
 

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

2016-03-04 Thread GunChleoc
> The json files are only needed by the website, so why not call
> wl_map_object_info from update_help.py

I am already doing that.


> and storing the files somewhere beneath
> MEDIA_ROOT? Something similar like we have with uploading a map.

That's the plan now :)
-- 
https://code.launchpad.net/~widelands-dev/widelands-website/encyclopedia/+merge/287410
Your team Widelands Developers is subscribed to branch lp:widelands-website.

___
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/new_starting_conditions into lp:widelands

2016-03-04 Thread GunChleoc
> @Gun, I believe that military sites are to be placed sooner (first after
> headquarters) because they immediately conquer new space (unless positioned
> too close to headquarters) and that can be useful for placing other buildings

But they do get positioned right next to the headquarters, so the gain is very 
little - we would need to place a building that has a bigger conquer area than 
the headquarters for it to make any difference - that would be a 
castle/fortress, which needs a big building space. So, we won't gain that much.

I have now tested all official maps with Player 1 and there were no problems 
placing the buildings. So, I think we're in the clear here, and the players can 
profit from the additional territory.


> Also more general question - It is probably not possible to find out from
> within the game, what starting mode are players using... Would be nice...

Something for Build 20 maybe - open a new bug?

When you next have some time, it would be great if you could look at some of 
the merge requests that kaputtnik has already approved - some of them don't 
have much new code in them.

-- 
https://code.launchpad.net/~widelands-dev/widelands/new_starting_conditions/+merge/288059
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/new_starting_conditions 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