> As I mentioned before , I've been looking for the missing player in the
> pilot list and model view.
> If I comment out the 2 lines below "foreach"  , in multiplayer.nas at line
> 374 ...
>
>         foreach (var n; props.globals.getNode("ai/models",
> 1).getChildren("multiplayer")) {
>             #if (!n.getNode("valid", 1).getValue())
>             #   continue;
>
> ... I then get the correct <num-players>  in /ai/models, and I can now step
> through ALL the players in "model view" ,
> and they all appear in the pilot list.
> I don't consider this a fix since I dont know why the above lines would
> cause a problem,but it's a start.
> Cheers
Looks like this is a chicken-egg problem:

The chicken:
The model class in multiplayer.nas listens on the 
property /ai/models/model-added and checks for all models the 
property "valid" to be true.

The egg:
When AIManager attaches a model, it first loads the model by calling 
model->init();
FGAIBase::init() calls FGAIBase::load3DModel() which calls 
FGAIBase::initModel() which sets property /ai/models/model-added. (This 
triggers the chicken, but "valid" is not yet set to true)
_AFTER_ model->init() in AIManager::atach() is finished, the property "valid" 
in the /ai/models/multiplayer[n] is set to true.

This causes new latest addition to the multiplayer list to be ignored.

I think the behaviour of FGAIBase and AIManager is correct to set the "valid" 
property to true after the initialization is complete. 
I also think that the check for "valid" in the model class in multiplayer.nas 
is required to stay there.

I have just commited a patch for multiplayer.nas that ignores the "valid" flag 
for the latest pilot that has joined.

Please check if this solves the problem.

Torsten

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to