On Tue, 18 Sep 2012 06:59:48 AM Michael Vehrs wrote:
> I'll have a look at this. Strangely enough, I don't think we touched
> equipment in any way. 

Agreed.  It is however a bit of a surprise that a routine called 
readAttributes() is where we are clearing the equipment container in advance 
of reading its items.  Alas, I see no good alternative ATM.

> The code snippet is not indicative of a problem,
> in my opinion. It just so happens that Unit is one of the very few
> FreeColGameObjects that still gets initialized from an Element.

OK.  I checked and this happens once as a debug hack, and in some corner cases 
where the client needs to interact with a unit it can not normally see, such 
as diplomacy with scout on a ship and animations where the unit is in a 
settlement, so the c-s routines supply the unit tacked onto the end of a 
normal message.

Stepping back and rethinking, that is a bit of a hack.  If I had thought about 
it a bit more at the time, I probably could have organized a suitable 
location-level update to make these units visible (OK, with some awkwardness, 
as animations sort ahead of ordinary updates ATM), thereby putting the 
complexity back into the server where it belongs.  My only defence for the 
existing code is that `it was like that when I got here':-).

[Next message arrives]
> Well, I should probably have said the decreasing number of 
> FreeColGameObjects that are still initialized from an Element

They need to decrease further.  DOM-removal remains on the agenda.
I have added a note to the todo list on what to do to get rid of these Unit 
cases.  Other Element initializations are probably harder (e.g. Goods).

> . And while the addition of the code was not a problem, the devil was in
> the details, as ever. I think I have fixed the problem.

I kicked off another round of tests, three 1700-games have completed without 
further serialization problems.  The AI OTOH...

Cheers,
Mike Pope

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Freecol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freecol-developers

Reply via email to