Re: [Freecol-developers] emails from patches

2017-02-21 Thread Enrico Weigelt, metux IT consult
On 14.02.2017 16:15, Michael Berger wrote: Hi, > First, my concern about the volume of email. I wasn't aware of the > feature in git to apply patches. Oh, you've missed one of the most important features. Being able to easily handle large patch queues and patch mails was one Linus's primary

Re: [Freecol-developers] emails from patches

2017-02-21 Thread Enrico Weigelt, metux IT consult
On 14.02.2017 11:37, Michael T. Pope wrote: Hi, > For the record I have no objection to patches being sent as emails to this > list. The number of them is however unprecedented for FreeCol, which I > would ask you to bear in mind. Okay, there was just an misunderstand here. My impression that

Re: [Freecol-developers] emails from patches

2017-02-13 Thread Enrico Weigelt, metux IT consult
On 13.02.2017 15:06, win...@genial.ms wrote: > Hello, > > you know how that answer feels? Like talking to an old kernel hacker, who's used to cope with many and large patch queues and therefore tries to get around w/ minimal bureaucracy ? :o Having to create tickets and copy-paste patches on

[Freecol-developers] fcgo serialization and sorting

2017-02-13 Thread Enrico Weigelt, metux IT consult
Hi folks, I've seen lots of places where child lists (eg. Colony's WorkLocation's) are sorted before serialization. Is this really required ? --mtx -- Check out the vibrant tech community on one of the world's most

Re: [Freecol-developers] emails from patches

2017-02-13 Thread Enrico Weigelt, metux IT consult
On 13.02.2017 13:25, Fenyo wrote: > Hi, > > *> I don't remember ever getting so many emails from people submitting >> patches. Is there something Enrico is doing differently? > > *I was just gonna say that. > > Is it possible that Enrico should post his patches at this page?: >

[Freecol-developers] [PATCH] common: networking: ChangeSet: fix missing typecast

2017-02-13 Thread Enrico Weigelt, metux IT consult
--- src/net/sf/freecol/common/networking/ChangeSet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/sf/freecol/common/networking/ChangeSet.java b/src/net/sf/freecol/common/networking/ChangeSet.java index 14d93a39cd7..85e82347e78 100644 ---

[Freecol-developers] [PATCH] common: model: Specification: fix type mismatch

2017-02-13 Thread Enrico Weigelt, metux IT consult
compile: [javac] Compiling 374 source files to /home/nekrad/src/packaging/pkg/freecol.git/build [javac] /home/nekrad/src/packaging/pkg/freecol.git/src/net/sf/freecol/common/model/Specification.java:2013: error: incompatible types [javac] Collection allG = new

Re: [Freecol-developers] [PATCH] common: util: CollectionUtils: optimize variants of first()

2017-02-13 Thread Enrico Weigelt, metux IT consult
On 13.02.2017 11:55, Enrico Weigelt, metux IT consult wrote: > +public static T first(List l) { > +return (l == null || list.isEmpty()) ? null : l.get(0); ups, there's a typo in here ... will repost fixed patched.

[Freecol-developers] [PATCH] common: util: CollectionUtils: optimized variants of find()

2017-02-13 Thread Enrico Weigelt, metux IT consult
--- .../sf/freecol/common/util/CollectionUtils.java| 39 ++ 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/src/net/sf/freecol/common/util/CollectionUtils.java b/src/net/sf/freecol/common/util/CollectionUtils.java index 841cf3dad2f..058835714a1 100644 ---

[Freecol-developers] [PATCH] common: util: CollectionUtils: optimize variants of first()

2017-02-13 Thread Enrico Weigelt, metux IT consult
--- .../sf/freecol/common/util/CollectionUtils.java| 31 +++--- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/net/sf/freecol/common/util/CollectionUtils.java b/src/net/sf/freecol/common/util/CollectionUtils.java index 058835714a1..4e25f7d599e 100644 ---

[Freecol-developers] [PATCH] common: util: CollectionUtils: optimized any(), all(), none() variants

2017-02-12 Thread Enrico Weigelt, metux IT consult
--- .../sf/freecol/common/util/CollectionUtils.java| 79 -- 1 file changed, 29 insertions(+), 50 deletions(-) diff --git a/src/net/sf/freecol/common/util/CollectionUtils.java b/src/net/sf/freecol/common/util/CollectionUtils.java index bb76838eb58..841cf3dad2f 100644 ---

[Freecol-developers] whole world map

2017-02-11 Thread Enrico Weigelt, metux IT consult
Hi folks, did anyone already create a map of the whole world, including europe (and the other continents) ? sounds like an interesting game to play. --mtx -- Check out the vibrant tech community on one of the world's

[Freecol-developers] [PATCH] common: model: Player: remove unnecessary check that's always true

2017-02-11 Thread Enrico Weigelt, metux IT consult
productionType::getOutputs() never returns null --- src/net/sf/freecol/common/model/Player.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/net/sf/freecol/common/model/Player.java b/src/net/sf/freecol/common/model/Player.java index 1d884626f72..3974bdc3d8a 100644 ---

[Freecol-developers] [PATCH] common: model: WorkLocation: dont use unncessary getter for internal fields

2017-02-11 Thread Enrico Weigelt, metux IT consult
--- src/net/sf/freecol/common/model/WorkLocation.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net/sf/freecol/common/model/WorkLocation.java b/src/net/sf/freecol/common/model/WorkLocation.java index 504e41d46d7..086689197b2 100644 ---

[Freecol-developers] [PATCH] common: model: WorkLocation: drop unused hasInputs()

2017-02-11 Thread Enrico Weigelt, metux IT consult
--- src/net/sf/freecol/common/model/WorkLocation.java | 9 - 1 file changed, 9 deletions(-) diff --git a/src/net/sf/freecol/common/model/WorkLocation.java b/src/net/sf/freecol/common/model/WorkLocation.java index 108f95c97b8..504e41d46d7 100644 ---

[Freecol-developers] [PATCH] fix unmappable character errors

2017-02-11 Thread Enrico Weigelt, metux IT consult
--- src/net/sf/freecol/client/gui/dialog/ConfirmDeclarationDialog.java | 2 +- src/net/sf/freecol/common/model/Map.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/net/sf/freecol/client/gui/dialog/ConfirmDeclarationDialog.java

[Freecol-developers] RFE: automatic trade with natives

2017-02-04 Thread Enrico Weigelt, metux IT consult
Hi folks, trading w/ natives tends to be a pretty time consuming job, you'll have to check which settlements want which goods (and pay enough), load up the cargo and instruct the units. That's some I'd really like to be done automatically. My idea for that goes like this: #1: set up a trade

[Freecol-developers] trade routes and unload problem

2017-02-04 Thread Enrico Weigelt, metux IT consult
Hi folks, I've observed that wagons on trade routes, that cannot unload all their cargo just wait in the city until they, some day, have been unloaded. (already observed that in older versions). It that the desired behaviour ? --mtx

[Freecol-developers] automatic goods routing

2017-02-03 Thread Enrico Weigelt, metux IT consult
Hi folks, I'm looking for a way to let the computer do the routing of goods between supplier and consumer colonies. Maintaining trade routes manually is a quite time consuming task, that doesn't actually contribute to the fun level. Is there already somthing we could reuse ? How does the AI

Re: [Freecol-developers] Git ignore fixes from Enrico Weigelt

2017-02-03 Thread Enrico Weigelt, metux IT consult
On 02.02.2017 22:14, Fenyo wrote: Hi, > I think we should either join the contents of the doc\.gitignore to > \.gitignore (and delete doc\.gitignore) > just like in the case of many other subfolders, > or we should specify this new file in the build.xml to avoid cleaning it. IMHO, we should

Re: [Freecol-developers] [PATCH] client: gui: panel: harmonize close behavior of panels - enable ESC for all

2017-02-03 Thread Enrico Weigelt, metux IT consult
On 02.02.2017 22:05, win...@genial.ms wrote: > I wanted to try it out to possibly apply it, but when I > copied the patch into a file and used git apply, I got: > "error: corrupt patch at line 11" although it did > not look corrupted to me? Looks like it something broke the mail path or copying

[Freecol-developers] [PATCH] client: gui: panel: harmonize close behavior of panels - enable ESC for all

2017-02-02 Thread Enrico Weigelt, metux IT consult
--- src/net/sf/freecol/client/gui/panel/ColonyPanel.java | 8 src/net/sf/freecol/client/gui/panel/FreeColPanel.java | 12 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/net/sf/freecol/client/gui/panel/ColonyPanel.java

[Freecol-developers] populationQueue

2017-02-01 Thread Enrico Weigelt, metux IT consult
Hi folks, I somehow accidentially messed up my popuplationQueue in some of my savegames, and after some digging, I wonder whether we really need need to save it, instead of just always creating it from the spec. It's initially filled in one of the ServerColony constructors (IMHO: the one for

[Freecol-developers] strange modifiers in TilePanel ?

2017-01-31 Thread Enrico Weigelt, metux IT consult
Hi folks, just stubled across some lines in TilePanel constructor, that look a bit strange to me: 150> final UnitType expert = spec.getExpertForProducing(gt); 151> if (expert != null) { 152> expertPotential = (int)expert.applyModifiers(amount, 153> getGame().getTurn(), gt.getId());

[Freecol-developers] [PATCH] common: model: encapsulate checks for ability to build

2017-01-31 Thread Enrico Weigelt, metux IT consult
BuildableType's and Colony's are often checked for whether they are able to build certain BuildableType in general (different from whether a Colony can do it right now, eg. required resources available). Instead of directly going to the low-level ability test, introduce an semantic interface, se

[Freecol-developers] [PATCH 0/4] network request handler cleanups

2017-01-31 Thread Enrico Weigelt, metux IT consult
easier and cheaper. Enrico Weigelt, metux IT consult (4): server: control: ServerInputHandler: drop unused unregister() client: control: ClientInputHandler: drop unused unregister() server: control: simplify message element handlers w/o expensive callback objects client: control

[Freecol-developers] [PATCH 4/4] client: control: simplify message element handlers w/o expensive callback objects

2017-01-31 Thread Enrico Weigelt, metux IT consult
--- .../freecol/client/control/ClientInputHandler.java | 68 +++ .../freecol/client/control/InGameInputHandler.java | 220 ++--- .../client/control/PreGameInputHandler.java| 94 ++--- 3 files changed, 246 insertions(+), 136 deletions(-) diff --git

[Freecol-developers] [PATCH 1/4] server: control: ServerInputHandler: drop unused unregister()

2017-01-31 Thread Enrico Weigelt, metux IT consult
--- src/net/sf/freecol/server/control/ServerInputHandler.java | 11 --- 1 file changed, 11 deletions(-) diff --git a/src/net/sf/freecol/server/control/ServerInputHandler.java b/src/net/sf/freecol/server/control/ServerInputHandler.java index 31e57c2f1de..1dab9bb0694 100644 ---

Re: [Freecol-developers] Modifiers - lists vs sets

2017-01-31 Thread Enrico Weigelt, metux IT consult
On 31.01.2017 10:03, Michael T. Pope wrote: >> Ok. Seems that Set is used more often (especially in FeatureContainer), >> therefore duplicate modifiers (incl. all attributes eg. source) are >> not allowed. > > I can not think of a case where exactly equal Modifiers can coexist. Okay, then most

Re: [Freecol-developers] [PATCH] client: control: ConnectController: clean out dead code

2017-01-25 Thread Enrico Weigelt, metux IT consult
On 25.01.2017 10:52, Michael T. Pope wrote: > No. Please, enough of these. The code below is commented out > temporarily to make it easier to test multiplayer while I extract more DOM > from the login code. Why not just keeping such things in a separate patch queue, that can be applied when

[Freecol-developers] [PATCH] common: model: FeatureContainer: boost up heavily used ability handling

2017-01-25 Thread Enrico Weigelt, metux IT consult
These ability checks are called very often (eg. cursor paint cycles). Instead of creating lists of applying abilities first (getAbilities() call) out of the internal sets and then check for false candidates, we do that along with the set scan and bail out as soon as possible, thus saving a lot

[Freecol-developers] [PATCH] common: model: Turn: optimize-away class instances for just an int

2017-01-25 Thread Enrico Weigelt, metux IT consult
--- .../freecol/client/control/InGameController.java | 36 --- .../freecol/client/control/PreGameController.java | 3 +- src/net/sf/freecol/client/gui/GrayLayer.java | 4 +- src/net/sf/freecol/client/gui/ModifierFormat.java | 3 +-

[Freecol-developers] [PATCH] common: model: FreeColObject: drop unused containsAbilityKey()

2017-01-25 Thread Enrico Weigelt, metux IT consult
--- src/net/sf/freecol/common/model/FreeColObject.java | 10 -- 1 file changed, 10 deletions(-) diff --git a/src/net/sf/freecol/common/model/FreeColObject.java b/src/net/sf/freecol/common/model/FreeColObject.java index 0fc661b1fc0..72af78d16f8 100644 ---

[Freecol-developers] [PATCH] common: networking: ChangeSet: fix missing type conversion regression

2017-01-25 Thread Enrico Weigelt, metux IT consult
Broken-By: f47e5985fed3bb2fb4cad9d4b13318049a634354 compile: [javac] Compiling 459 source files to /home/nekrad/src/packaging/pkg/freecol.git/build [javac] /home/nekrad/src/packaging/pkg/freecol.git/src/net/sf/freecol/common/networking/ChangeSet.java:807: error: no suitable constructor

[Freecol-developers] Panels as own windows

2017-01-24 Thread Enrico Weigelt, metux IT consult
Hi folks, I'd like to have the various panels (eg. colony view) as separate windows (instead of frames within the main window) for better usability (eg. keeping some panels open on a separate workspace, and keep the map view visible, etc) It seems that swing only supports that for JDialog - and

Re: [Freecol-developers] FeatureContainer

2017-01-24 Thread Enrico Weigelt, metux IT consult
On 24.01.2017 12:12, Michael T. Pope wrote: > Always the performance... for the nth time, show me that it is a problem! Well, eg. up to several seconds delay on map move, etc actually is a problem - at least for me ... >> I've seen that abilities are checked a lot, and >> the current

Re: [Freecol-developers] FeatureContainer

2017-01-24 Thread Enrico Weigelt, metux IT consult
On 24.01.2017 05:16, Michael T. Pope wrote: Hi, >> Should we perhaps consolidate all the ability handling inside >> FeatureContainer and let FreeColObject just call it ? > > I am not sure what you intend here that is different from the current > implementation. Better performance. I've seen

Re: [Freecol-developers] possible bug in Settlement::exciseSettlement() ?

2016-12-28 Thread Enrico Weigelt, metux IT consult
On 27.12.2016 23:37, Michael T. Pope wrote: Hi, > Yes, or at least harmless. The routine does what it says --- "removes > the settlement from the map". It does not remove all reference to the map > from the settlement, that is something else. Okay. OTOH, we could use that as an indication

[Freecol-developers] possible bug in Settlement::exciseSettlement() ?

2016-12-27 Thread Enrico Weigelt, metux IT consult
Hi folks, just had a look at Settlement::exciseSettlement(), which removes a settlement from the map, so eg. removing tile ownerships, etc But it doesn't seem to clear the tile reference (this.tile). Is that really correct ? By the way: how are tiles identified in client-server communication?

[Freecol-developers] angry natives and weapons sales

2016-12-25 Thread Enrico Weigelt, metux IT consult
Hi folks, is it correct that offering weapens to angry natives reduces their anger ? --mtx -- Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With

[Freecol-developers] getGame() + getSpecification() calls

2016-12-25 Thread Enrico Weigelt, metux IT consult
Hi folks, we've got *a lot* of objects holding a reference to Game objects and lots of places retrieving it via getGame() calls, or getting specification object Game::getSpecification(). Is there any usecase for having multiple Game objects within one process ? Otherwise we could make it a

Re: [Freecol-developers] lifetime of Map object

2016-12-09 Thread Enrico Weigelt, metux IT consult
On 09.12.2016 09:43, Michael T. Pope wrote: > Actually I did not think the map display was calling canSee(), but it > does, albeit only per Unit, not per Tile. hmm, what is that flag actually used for ? all the tiles a player can see (IOW: has been explored) or just changes in these tiles (eg.

Re: [Freecol-developers] path finding and carrier

2016-12-09 Thread Enrico Weigelt, metux IT consult
On 09.12.2016 09:00, Michael T. Pope wrote: >> Does that mean, that land units can automatically can employ a ship >> when ordered across the sea ? > > Yes. This was implemented and indeed used in the AI. Can we use that also for human players ? >> If so, does that also work w/ wagons >> on a

[Freecol-developers] path finding and carrier

2016-12-08 Thread Enrico Weigelt, metux IT consult
Hi folks, just looking at Unit::search() - the documentation states that there can be given an optonal carrier which is the unit can use. Does that mean, that land units can automatically can employ a ship when ordered across the sea ? If so, does that also work w/ wagons on a trade route ?

Re: [Freecol-developers] lifetime of Map object

2016-12-08 Thread Enrico Weigelt, metux IT consult
On 09.12.2016 06:24, Michael T. Pope wrote: Hi, > (c) is obviously a win in terms of making things easier to read. The other > two are nice, but I doubt the existing locking is a serious problem, not sure whether it's actually problem (IOW: notable slowdown), but we for now require a lock on

[Freecol-developers] killing players and tile ownership

2016-12-08 Thread Enrico Weigelt, metux IT consult
Hi folks, I'm just having a look at ServerPlayer::csKill(). IIRC it sends out CS'es for all the individual changes caused by killing a player, eg. removing it's settlements, diplomatic relationships, etc. Do we really need that traffic at all ? Why not just sending a kill player notification

[Freecol-developers] lifetime of Map object

2016-12-08 Thread Enrico Weigelt, metux IT consult
Hi folks, I'm currently reworking the (per-player) visibility map, by a) doing it (mostly) lockless b) using BitSet instead of the huge boolean array c) encapsulating the whole logic into an own class As it obviously needs the map dimensions (coming from the Map object), I'm wondering whether

Re: [Freecol-developers] internal getters vs performance

2016-12-08 Thread Enrico Weigelt, metux IT consult
On 08.12.2016 22:02, Michael T. Pope wrote: >> Should we instead make them final or use the underlying fields >> directly ? > > We could. Patches welcome. This is low priority stuff though. Okay, I'll do that when touching these places for other reasons. --mtx

[Freecol-developers] internal getters vs performance

2016-12-08 Thread Enrico Weigelt, metux IT consult
Hi folks, we've got a lot of trivila getters that are heavily used within their classes. As they're public and not final, the compiler can't inline them (it must assume that they might be overwritten by derived classes), which of course introduces a performance penalty. Should we instead make

[Freecol-developers] GoodsType, AbstractGoods, etc

2016-12-03 Thread Enrico Weigelt, metux IT consult
Hi folks, could anyone please give me some insight, how GoodsType, AbstractGoods and Lists of AbstractGoods play together ? I guess, GoodsType describes the existing types of goods, while AbstractGoods represents a storage slot (eg. in city or on a ship). What puzzles me most: why are List at